Jelajahi Sumber

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 6 bulan lalu
induk
melakukan
a45f0b6bec
21 mengubah file dengan 1028 tambahan dan 10 penghapusan
  1. 1 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/common/CallRecordOrderVo.java
  2. 17 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementAddUp.java
  3. 21 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementDetail.java
  4. 50 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementVo.java
  5. 72 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/MailBoxSendRecordVo.java
  6. 73 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/MailboxSendRecordPolicyVo.java
  7. 23 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyDetail.java
  8. 63 0
      mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyVo.java
  9. 25 0
      mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/PolicyCMapper.java
  10. 1 0
      mall-server-api/src/main/java/com/gree/mall/manager/constant/Constant.java
  11. 92 0
      mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/AgreementController.java
  12. 120 0
      mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/MailboxController.java
  13. 104 0
      mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/PolicyController.java
  14. 159 0
      mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java
  15. 125 0
      mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/PolicyLogic.java
  16. 1 1
      mall-server-api/src/main/java/com/gree/mall/manager/logic/unicom/UnicomLogic.java
  17. 1 0
      mall-server-api/src/main/resources/bootstrap-dev.properties
  18. 3 3
      mall-server-api/src/main/resources/bootstrap-prd.propertiesb
  19. 1 0
      mall-server-api/src/main/resources/bootstrap-test.properties
  20. 7 6
      mall-server-api/src/main/resources/mapper/CommonMapper.xml
  21. 69 0
      mall-server-api/src/main/resources/mapper/PolicyCMapper.xml

+ 1 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/common/CallRecordOrderVo.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.gree.mall.manager.annotation.ZfireField;
 import com.gree.mall.manager.plus.entity.CallRecord;
+import com.gree.mall.manager.plus.entity.CallSendRecord;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 

+ 17 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementAddUp.java

@@ -0,0 +1,17 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.gree.mall.manager.plus.entity.Agreement;
+import com.gree.mall.manager.plus.entity.AgreementPolicy;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@ApiModel
+@Data
+public class AgreementAddUp extends Agreement {
+
+    @ApiModelProperty(value = "绑定政策")
+    private List<AgreementPolicy> agreementPolicies;
+}

+ 21 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementDetail.java

@@ -0,0 +1,21 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.gree.mall.manager.plus.entity.Agreement;
+import com.gree.mall.manager.plus.entity.AgreementPolicy;
+import com.gree.mall.manager.plus.entity.Policy;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@ApiModel
+@Data
+public class AgreementDetail extends Agreement {
+
+    @ApiModelProperty(value = "绑定政策内容")
+    private List<Policy> policy;
+
+    @ApiModelProperty(value = "绑定政策")
+    private List<AgreementPolicy> agreementPolicies;
+}

+ 50 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/AgreementVo.java

@@ -0,0 +1,50 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.material.StateEnum;
+import com.gree.mall.manager.plus.entity.Agreement;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@ApiModel
+@Data
+public class AgreementVo   {
+
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "协议名称")
+    private String agreementName;
+
+    @ApiModelProperty(value = "协议类型")
+    private String agreementType;
+
+    @ApiModelProperty(value = "状态")
+    private StateEnum status;
+
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+}

+ 72 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/MailBoxSendRecordVo.java

@@ -0,0 +1,72 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.plus.entity.MailboxSendRecord;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@ApiModel
+@Data
+public class MailBoxSendRecordVo  {
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "保险类型")
+    private String policyType;
+
+    @ApiModelProperty(value = "发送批次")
+    private String sendBatch;
+
+    @ApiModelProperty(value = "发送邮箱")
+    private String sendMailbox;
+
+    @ApiModelProperty(value = "接收邮箱")
+    private String receiveMailbox;
+
+    @ApiModelProperty(value = "发送状态  OK 成功 NO 失败")
+    private String sendStatus;
+
+    @ApiModelProperty(value = "发送时间")
+    private Date sendTime;
+
+    @ApiModelProperty(value = "回执状态 NO 未收到  YES 收到")
+    private String receiptStatus;
+
+    @ApiModelProperty(value = "回执收到时间")
+    private Date receiptTime;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "商户名")
+    private String companyWechatName;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "商户id")
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+
+}

+ 73 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/MailboxSendRecordPolicyVo.java

@@ -0,0 +1,73 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.plus.entity.MailboxSendRecordPolicy;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@ApiModel
+@Data
+public class MailboxSendRecordPolicyVo   {
+
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "商户名")
+    private String companyWechatName;
+
+    @ApiModelProperty(value = "商户id")
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "保单编号")
+    private String policyNumber;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ApiModelProperty(value = "参保人")
+    private String policyName;
+
+    @ApiModelProperty(value = "参保人身份证")
+    private String policyIdcard;
+
+    @ApiModelProperty(value = "保单操作类型 新增 IN 雇主 替换 RE")
+    private String type;
+
+    @ApiModelProperty(value = "保险类型")
+    private String policyType;
+
+    @ApiModelProperty(value = "替换人")
+    private String replaceName;
+
+    @ApiModelProperty(value = "替换人身份证")
+    private String replaceIdcard;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+}

+ 23 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyDetail.java

@@ -0,0 +1,23 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.gree.mall.manager.plus.entity.Policy;
+import com.gree.mall.manager.plus.entity.PolicyRange;
+import com.gree.mall.manager.plus.entity.PolicyWebsit;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@ApiModel
+@Data
+public class PolicyDetail extends Policy {
+
+
+    @ApiModelProperty(value = "保单范围")
+    private List<PolicyRange> policyRanges;
+
+
+    @ApiModelProperty(value = "网点")
+    private List<PolicyWebsit> policyWebsits;
+}

+ 63 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/policy/PolicyVo.java

@@ -0,0 +1,63 @@
+package com.gree.mall.manager.bean.policy;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.IsYesNoEnum;
+import com.gree.mall.manager.plus.entity.Policy;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel
+@Data
+public class PolicyVo   {
+
+
+    @ZfireField(hide = true)
+    @TableId(value = "id", type = IdType.ID_WORKER_STR)
+    private String id;
+
+    @ApiModelProperty(value = "保单名称")
+    private String policyName;
+
+    @ApiModelProperty(value = "保单编号")
+    private String policyNumber;
+
+    @ApiModelProperty(value = "保费金额")
+    private BigDecimal policyPrice;
+
+    @ApiModelProperty(value = "生效时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束日期")
+    private Date endTime;
+
+    @ApiModelProperty(value = "是否允许购买 YES 是 NO否")
+    private IsYesNoEnum isBuy;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(value = "修改时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改人")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+
+
+
+}

+ 25 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/PolicyCMapper.java

@@ -0,0 +1,25 @@
+package com.gree.mall.manager.commonmapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.policy.AgreementVo;
+import com.gree.mall.manager.bean.policy.MailBoxSendRecordVo;
+import com.gree.mall.manager.bean.policy.MailboxSendRecordPolicyVo;
+import com.gree.mall.manager.bean.policy.PolicyVo;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface PolicyCMapper {
+
+    IPage<PolicyVo> list(Page page, @Param("ex")ZfireParamBean zfireParam,@Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    IPage<AgreementVo> listAgreement(Page page,@Param("ex") ZfireParamBean zfireParam,@Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    IPage<MailBoxSendRecordVo> listMailBoxRecord(Page page, @Param("ex")ZfireParamBean zfireParam, @Param("adminCompanyIds") List<String> adminCompanyIds);
+
+    IPage<MailboxSendRecordPolicyVo> listPolicy(Page page,@Param("ex") ZfireParamBean zfireParam,@Param("adminCompanyIds")  List<String> adminCompanyIds);
+}

+ 1 - 0
mall-server-api/src/main/java/com/gree/mall/manager/constant/Constant.java

@@ -53,6 +53,7 @@ public class Constant {
     public class RedisPrefix {
         public final static String LOCK_LOGIN = "jsm:sxb:login:";
         public final static String TOKEN_UNICOME_YUNH = "jsm:sxb:UNICOME:";
+        public final static String TOKEN_UNICOME_YUNH_PRD = "jsm:sxb:UNICOME:PRD";
         public final static String WORK_MINI_ACCESS_TOKEN = "jsm:sxb:work:mini:access:token";
         public final static String TOKEN_WX = "jsm:sxb:token:wx";
         public final static String TOKEN_MP_WX = "mp:token:wx";

+ 92 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/AgreementController.java

@@ -0,0 +1,92 @@
+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.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 = "/agreement", produces = "application/json; charset=utf-8")
+public class AgreementController {
+
+    @Autowired
+    private AgreementLogic agreementLogic;
+
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "保险协议配置列表")
+    public ResponseHelper<IPage<AgreementVo>> list(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        IPage<AgreementVo> increVOIPage = agreementLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        return ResponseHelper.success(increVOIPage, new TypeReference<AgreementVo>() {});
+    }
+
+    @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<AgreementVo> increVOIPage = agreementLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        //3.导出
+        FieldUtils.exportData(increVOIPage.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+    @PostMapping("/detail")
+    @ApiOperation("保险协议配置详情")
+    public ResponseHelper<AgreementDetail> detail(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        AgreementDetail agreementDetail = agreementLogic.detail(id);
+        return ResponseHelper.success(agreementDetail);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation("添加保险协议配置")
+    public ResponseHelper add(
+            @RequestBody AgreementAddUp agreementAddUp,
+            HttpServletRequest request
+    ) throws ParseException {
+        agreementLogic.add(agreementAddUp);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation("修改保险协议配置")
+    public ResponseHelper update(
+            @RequestBody AgreementAddUp agreementAddUp,
+            HttpServletRequest request
+    ) throws ParseException {
+        agreementLogic.update(agreementAddUp);
+        return ResponseHelper.success();
+    }
+
+
+
+}

+ 120 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/MailboxController.java

@@ -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);
+    }
+
+}

+ 104 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/PolicyController.java

@@ -0,0 +1,104 @@
+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.PolicyDetail;
+import com.gree.mall.manager.bean.policy.PolicyVo;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.policy.PolicyLogic;
+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 = "/policyManager", produces = "application/json; charset=utf-8")
+public class PolicyController {
+
+    @Autowired
+    private PolicyLogic policyLogic;
+
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "保险方案管理列表")
+    public ResponseHelper<IPage<PolicyVo>> list(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        IPage<PolicyVo> increVOIPage = policyLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        return ResponseHelper.success(increVOIPage, new TypeReference<PolicyVo>() {});
+    }
+
+    @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<PolicyVo> increVOIPage = policyLogic.list(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
+        //3.导出
+        FieldUtils.exportData(increVOIPage.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+    @PostMapping("/detail")
+    @ApiOperation("保险方案管理详情")
+    public ResponseHelper<PolicyDetail> detail(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        PolicyDetail policyDetail = policyLogic.detail(id);
+        return ResponseHelper.success(policyDetail);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation("添加保险方案管理")
+    public ResponseHelper add(
+            @RequestBody PolicyDetail policyDetail,
+            HttpServletRequest request
+    ) throws ParseException {
+        policyLogic.add(policyDetail);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation("修改保险方案管理")
+    public ResponseHelper update(
+            @RequestBody PolicyDetail policyDetail,
+            HttpServletRequest request
+    ) throws ParseException {
+        policyLogic.update(policyDetail);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/del")
+    @ApiOperation("删除")
+    public ResponseHelper del(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        policyLogic.del(id);
+        return ResponseHelper.success();
+    }
+
+
+
+}

+ 159 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/AgreementLogic.java

@@ -0,0 +1,159 @@
+package com.gree.mall.manager.logic.policy;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.policy.*;
+import com.gree.mall.manager.commonmapper.PolicyCMapper;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.*;
+import com.gree.mall.manager.plus.service.*;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class AgreementLogic {
+
+    @Autowired
+    PolicyCMapper policyCMapper;
+
+
+    @Autowired
+    CommonLogic commonLogic;
+
+    @Autowired
+    AgreementService agreementService;
+
+    @Autowired
+    AgreementPolicyService agreementPolicyService;
+
+    @Autowired
+    PolicyService policyService;
+
+    @Autowired
+    MailboxService mailboxService;
+
+    @Autowired
+    MailboxSendRecordService mailboxSendRecordService;
+
+
+
+    public IPage<AgreementVo> list(Page page, ZfireParamBean zfireParam) {
+
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, PolicyVo.class);
+
+        IPage<AgreementVo> agreementVoIPage = policyCMapper.listAgreement(page, zfireParam,adminCompanyIds);
+        return agreementVoIPage;
+    }
+
+    public AgreementDetail detail(String id) {
+
+        Agreement agreement = agreementService.getById(id);
+
+        AgreementDetail agreementDetail = BeanUtil.toBean(agreement, AgreementDetail.class);
+
+        List<AgreementPolicy> agreementPolicies = agreementPolicyService.lambdaQuery().eq(AgreementPolicy::getAgreementId, agreement.getId()).list();
+
+
+        List<String> aggre = agreementPolicies.stream().map(AgreementPolicy::getAgreementId).collect(Collectors.toList());
+
+
+        List<Policy> policyList = policyService.lambdaQuery().in(Policy::getId, aggre).list();
+
+        agreementDetail.setAgreementPolicies(agreementPolicies);
+        agreementDetail.setPolicy(policyList);
+
+        return agreementDetail;
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void add(AgreementAddUp agreementAddUp) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        agreementAddUp.setCompanyWechatId(adminUser.getCompanyWechatId());
+        agreementAddUp.setCompanyWechatName(adminUser.getCompanyName());
+        agreementAddUp.insert();
+
+        for (AgreementPolicy agreementPolicy : agreementAddUp.getAgreementPolicies()) {
+            agreementPolicy.setAgreementId(agreementAddUp.getId());
+        }
+        agreementPolicyService.saveBatch(agreementAddUp.getAgreementPolicies());
+    }
+
+
+    @Transactional(rollbackFor = Exception.class)
+    public void update(AgreementAddUp agreementAddUp) {
+
+
+        agreementAddUp.updateById();
+
+        agreementPolicyService.lambdaUpdate().eq(AgreementPolicy::getAgreementId,agreementAddUp.getId()).remove();
+
+        for (AgreementPolicy agreementPolicy : agreementAddUp.getAgreementPolicies()) {
+            agreementPolicy.setAgreementId(agreementAddUp.getId());
+        }
+        agreementPolicyService.saveBatch(agreementAddUp.getAgreementPolicies());
+    }
+
+    public Mailbox detailMailbox() {
+
+        if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1)
+            return new Mailbox();
+
+
+        return mailboxService.getById("1");
+
+    }
+
+    public void addDetail(Mailbox mailbox) {
+        if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1){
+            mailbox.setId("1");
+            mailbox.insert();
+            return;
+        }
+        mailbox.setId("1");
+        mailbox.updateById();
+
+    }
+
+    public IPage<MailBoxSendRecordVo> listMailBoxRecord(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, MailBoxSendRecordVo.class);
+
+        IPage<MailBoxSendRecordVo> policyVoIPage = policyCMapper.listMailBoxRecord(page, zfireParam,adminCompanyIds);
+        return policyVoIPage;
+    }
+
+    public MailboxSendRecord detailRecord(String id) {
+        MailboxSendRecord mailboxSendRecord = mailboxSendRecordService.getById(id);
+        return mailboxSendRecord;
+    }
+
+    public IPage<MailboxSendRecordPolicyVo> listPolicy(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, MailboxSendRecordPolicyVo.class);
+
+        IPage<MailboxSendRecordPolicyVo> policyVoIPage = policyCMapper.listPolicy(page, zfireParam,adminCompanyIds);
+        return policyVoIPage;
+    }
+}

+ 125 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/PolicyLogic.java

@@ -0,0 +1,125 @@
+package com.gree.mall.manager.logic.policy;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.policy.PolicyDetail;
+import com.gree.mall.manager.bean.policy.PolicyVo;
+import com.gree.mall.manager.commonmapper.PolicyCMapper;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.Policy;
+import com.gree.mall.manager.plus.entity.PolicyRange;
+import com.gree.mall.manager.plus.entity.PolicyWebsit;
+import com.gree.mall.manager.plus.service.PolicyRangeService;
+import com.gree.mall.manager.plus.service.PolicyService;
+import com.gree.mall.manager.plus.service.PolicyWebsitService;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+public class PolicyLogic {
+
+    @Autowired
+    PolicyCMapper policyCMapper;
+
+    @Autowired
+    CommonLogic commonLogic;
+
+    @Autowired
+    PolicyService policyService;
+
+    @Autowired
+    PolicyRangeService policyRangeService;
+
+    @Autowired
+    PolicyWebsitService policyWebsitService;
+
+
+
+    public IPage<PolicyVo> list(Page page, ZfireParamBean zfireParam) {
+        //获取当前登录企业id
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        List<String> adminCompanyIds = adminUser.getCompanyWechatIds();
+        //1.组装查询条件
+        zfireParam = FieldUtils.supplyParam(zfireParam, PolicyVo.class);
+
+        IPage<PolicyVo> policyVoIPage = policyCMapper.list(page, zfireParam,adminCompanyIds);
+        return policyVoIPage;
+    }
+
+    public PolicyDetail detail(String id) {
+
+        Policy policy = policyService.getById(id);
+
+        PolicyDetail policyDetail = BeanUtil.toBean(policy, PolicyDetail.class);
+
+        List<PolicyRange> policyRanges = policyRangeService.lambdaQuery().eq(PolicyRange::getPolicyId, policyDetail.getId()).list();
+        List<PolicyWebsit> policyWebsits = policyWebsitService.lambdaQuery().eq(PolicyWebsit::getPolicyId, policyDetail.getId()).list();
+
+
+        policyDetail.setPolicyRanges(policyRanges);
+        policyDetail.setPolicyWebsits(policyWebsits);
+
+        return policyDetail;
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void add(PolicyDetail policyDetail) {
+
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        policyDetail.setCompanyWechatId(adminUser.getCompanyWechatId());
+        policyDetail.setCompanyWechatName(adminUser.getCompanyName());
+
+        policyDetail.insert();
+
+        for (PolicyRange policyRange : policyDetail.getPolicyRanges()) {
+            policyRange.setPolicyId(policyDetail.getId());
+        }
+
+        for (PolicyWebsit policyWebsit : policyDetail.getPolicyWebsits()) {
+            policyWebsit.setPolicyId(policyDetail.getId());
+        }
+
+
+        policyRangeService.saveBatch(policyDetail.getPolicyRanges());
+        policyWebsitService.saveBatch(policyDetail.getPolicyWebsits());
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void update(PolicyDetail policyDetail) {
+
+        policyDetail.updateById();
+
+        policyRangeService.lambdaUpdate().eq(PolicyRange::getPolicyId,policyDetail.getId()).remove();
+        policyWebsitService.lambdaUpdate().eq(PolicyWebsit::getPolicyId,policyDetail.getId()).remove();
+
+        for (PolicyRange policyRange : policyDetail.getPolicyRanges()) {
+            policyRange.setPolicyId(policyDetail.getId());
+        }
+
+        for (PolicyWebsit policyWebsit : policyDetail.getPolicyWebsits()) {
+            policyWebsit.setPolicyId(policyDetail.getId());
+        }
+
+
+        policyRangeService.saveBatch(policyDetail.getPolicyRanges());
+        policyWebsitService.saveBatch(policyDetail.getPolicyWebsits());
+    }
+
+    public void del(String id) {
+
+        policyService.removeById(id);
+
+        policyRangeService.lambdaUpdate().eq(PolicyRange::getPolicyId,id).remove();
+        policyWebsitService.lambdaUpdate().eq(PolicyWebsit::getPolicyId,id).remove();
+    }
+}

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/unicom/UnicomLogic.java

@@ -103,7 +103,7 @@ public class UnicomLogic {
         String s = HttpUtil.get(baseUrl + "/accessToken?account=" + ACCOUNT + "&appid=" + APPID + "&secret=" + SECRET);
         String accessToken = JSONObject.parseObject(s).getString("accessToken");
         log.info("【获取联通云呼token】:{}",accessToken);
-        redisUtil.set(tokenKey,accessToken,2 * 60 * 60);
+        redisUtil.set(tokenKey,accessToken,9 * 60);
         return accessToken;
     }
 

+ 1 - 0
mall-server-api/src/main/resources/bootstrap-dev.properties

@@ -110,6 +110,7 @@ unicome.yunh.account=N000000015221
 unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
 unicome.yunh.appid=69jpgmwqxyhtcsor
 
+
 #法大大
 fadada.app.id=401793
 fadada.app.secret=eB8mlIWs7ayFihEzWbNfMjrL

+ 3 - 3
mall-server-api/src/main/resources/bootstrap-prd.propertiesb

@@ -88,9 +88,9 @@ management.health.elasticsearch.enabled=false
 
 #联通云呼配置
 unicome.yunh.baseurl=https://a5.7x24cc.com
-unicome.yunh.account=N000000015221
-unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
-unicome.yunh.appid=69jpgmwqxyhtcsor
+unicome.yunh.account=N000000014414
+unicome.yunh.secret=c33fe780-fd69-11ea-8033-ff87e22c5f18
+unicome.yunh.appid=a6s2zu00twewmi
 
 #法大大
 fadada.app.id=401793

+ 1 - 0
mall-server-api/src/main/resources/bootstrap-test.properties

@@ -99,6 +99,7 @@ unicome.yunh.account=N000000015221
 unicome.yunh.secret=fe443fc0264411ec80212baafe602ea7
 unicome.yunh.appid=69jpgmwqxyhtcsor
 
+
 #法大大
 fadada.app.id=401793
 fadada.app.secret=eB8mlIWs7ayFihEzWbNfMjrL

+ 7 - 6
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1340,16 +1340,17 @@
         FROM
         call_send_record  a
         ${ex.query}
+
+        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
+            AND a.websit_number IN
+            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="ex.orderBy == null or ex.orderBy ==''">
             ORDER BY a.create_time, a.id DESC
         </if>
 
-    <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
-        AND a.websit_number IN
-        <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
-            #{item}
-        </foreach>
-    </if>
         ${ex.orderBy}
     </select>
 

+ 69 - 0
mall-server-api/src/main/resources/mapper/PolicyCMapper.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gree.mall.manager.commonmapper.PolicyCMapper">
+
+    <select id="list" resultType="com.gree.mall.manager.bean.policy.PolicyVo">
+        SELECT
+        ${ex.selected}
+        FROM policy a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+    <select id="listAgreement" resultType="com.gree.mall.manager.bean.policy.AgreementVo">
+        SELECT
+        ${ex.selected}
+        FROM agreement a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+    <select id="listMailBoxRecord" resultType="com.gree.mall.manager.bean.policy.MailBoxSendRecordVo">
+        SELECT
+        ${ex.selected}
+        FROM mailbox_send_record a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+    <select id="listPolicy" resultType="com.gree.mall.manager.bean.policy.MailboxSendRecordPolicyVo">
+        SELECT
+        ${ex.selected}
+        FROM mailbox_send_record_policy a
+        ${ex.query}
+        <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+</mapper>