|
@@ -0,0 +1,120 @@
|
|
|
+package com.gree.mall.manager.controller.policy;
|
|
|
+
|
|
|
+import cn.hutool.core.lang.TypeReference;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.gree.mall.manager.annotation.ZfireList;
|
|
|
+import com.gree.mall.manager.bean.policy.*;
|
|
|
+import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
+import com.gree.mall.manager.helper.ResponseHelper;
|
|
|
+import com.gree.mall.manager.logic.policy.AgreementLogic;
|
|
|
+import com.gree.mall.manager.plus.entity.Mailbox;
|
|
|
+import com.gree.mall.manager.plus.entity.MailboxSendRecord;
|
|
|
+import com.gree.mall.manager.plus.entity.MailboxSendRecordPolicy;
|
|
|
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
+import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.text.ParseException;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@Api(value = "邮箱配置和邮箱记录", tags = {"邮箱配置和邮箱记录"})
|
|
|
+@RequestMapping(value = "/mailbox", produces = "application/json; charset=utf-8")
|
|
|
+public class MailboxController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AgreementLogic agreementLogic;
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/detail")
|
|
|
+ @ApiOperation("邮箱配置详情")
|
|
|
+ public ResponseHelper<Mailbox> detail(
|
|
|
+ HttpServletRequest request
|
|
|
+ ) throws ParseException {
|
|
|
+ Mailbox mailbox = agreementLogic.detailMailbox();
|
|
|
+ return ResponseHelper.success(mailbox);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/add")
|
|
|
+ @ApiOperation("邮箱配置修改")
|
|
|
+ public ResponseHelper add(
|
|
|
+ @RequestBody Mailbox mailbox,
|
|
|
+ HttpServletRequest request
|
|
|
+ ) throws ParseException {
|
|
|
+ agreementLogic.addDetail(mailbox);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ZfireList
|
|
|
+ @PostMapping("/list")
|
|
|
+ @ApiOperation(value = "已发邮箱记录列表")
|
|
|
+ public ResponseHelper<IPage<MailBoxSendRecordVo>> list(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean
|
|
|
+ ) throws RemoteServiceException {
|
|
|
+ ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
|
|
|
+ IPage<MailBoxSendRecordVo> increVOIPage = agreementLogic.listMailBoxRecord(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
|
|
|
+ return ResponseHelper.success(increVOIPage, new TypeReference<MailBoxSendRecordVo>() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/list/export")
|
|
|
+ @ApiOperation(value = "已发邮箱记录列表导出")
|
|
|
+ public void listExport(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean,
|
|
|
+ HttpServletRequest request,
|
|
|
+ HttpServletResponse response
|
|
|
+ ) throws Exception {
|
|
|
+ //1.组装查询条件
|
|
|
+ ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
|
|
|
+ //2.查询要导出的内容
|
|
|
+ IPage<MailBoxSendRecordVo> increVOIPage = agreementLogic.listMailBoxRecord(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
|
|
|
+ //3.导出
|
|
|
+ FieldUtils.exportData(increVOIPage.getRecords(), zfireParam.getExportFields(), request, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/detailRecord")
|
|
|
+ @ApiOperation("保险方案管理详情")
|
|
|
+ public ResponseHelper<MailboxSendRecord> detail(
|
|
|
+ @ApiParam(value = "id", required = true) @RequestParam String id,
|
|
|
+ HttpServletRequest request
|
|
|
+ ) throws ParseException {
|
|
|
+ MailboxSendRecord mailboxSendRecord = agreementLogic.detailRecord(id);
|
|
|
+ return ResponseHelper.success(mailboxSendRecord);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ZfireList
|
|
|
+ @PostMapping("/listPolicy")
|
|
|
+ @ApiOperation(value = "保单信息列表")
|
|
|
+ public ResponseHelper<IPage<MailboxSendRecordPolicyVo>> listPolicy(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean
|
|
|
+ ) throws RemoteServiceException {
|
|
|
+ ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
|
|
|
+ IPage<MailboxSendRecordPolicyVo> increVOIPage = agreementLogic.listPolicy(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
|
|
|
+ return ResponseHelper.success(increVOIPage, new TypeReference<MailboxSendRecordPolicyVo>() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/listPolicy/export")
|
|
|
+ @ApiOperation(value = "保单信息列表导出")
|
|
|
+ public void listPolicyExport(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean,
|
|
|
+ HttpServletRequest request,
|
|
|
+ HttpServletResponse response
|
|
|
+ ) throws Exception {
|
|
|
+ //1.组装查询条件
|
|
|
+ ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
|
|
|
+ //2.查询要导出的内容
|
|
|
+ IPage<MailboxSendRecordPolicyVo> increVOIPage = agreementLogic.listPolicy(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
|
|
|
+ //3.导出
|
|
|
+ FieldUtils.exportData(increVOIPage.getRecords(), zfireParam.getExportFields(), request, response);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|