Browse Source

添加续保报价信息

wks 2 năm trước cách đây
mục cha
commit
1c1bc7c289

+ 33 - 0
src/main/java/com/ydtech/constants/enums/dict/insurance/Renewal.java

@@ -0,0 +1,33 @@
+package com.ydtech.constants.enums.dict.insurance;
+
+
+import com.ydtech.aop.request.DictEnum;
+import com.ydtech.constants.enums.dict.IBaseEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+/**
+ * @description: 是否续保
+ * @author: wenks
+ * @date: 2024/5/13 15:53
+ **/
+@AllArgsConstructor
+@Getter
+@DictEnum(key = "renewal", desc = "是否续保")
+public enum Renewal implements IBaseEnum {
+
+    R_0("0", "转保", 0, 0),
+    R_1("1", "续保", 1, 0),
+    R_2("2", "新保", 2, 0);
+
+    // 编号
+    private final String code;
+    // 说明
+    private final String desc;
+    // 排序
+    private final Integer sort;
+    // 状态  0 启用  1 不启用
+    private final Integer status;
+
+}

+ 6 - 0
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -153,6 +153,12 @@ public class QuoteRespVo {
     @ApiModelProperty("总计出口费用")
     private BigDecimal sumExportFee;
 
+    @ApiModelProperty("交强续保")
+    private String jqRenewal;
+
+    @ApiModelProperty("商业续保")
+    private String syRenewal;
+
 
     public List<AccidentResponseVo> getAccidentInfo() {
         return accident == null ? Collections.emptyList() : accident;

+ 26 - 6
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -14,6 +14,7 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.idgen.IdGenerate;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -382,31 +383,31 @@ public class InsAreaCompany implements Serializable {
     private String isDjq;
 
     /**
-     *  添加操作人
+     * 添加操作人
      */
     @TableField(value = "operator_id")
     private String operatorId;
 
     /**
-     *  操作时间
+     * 操作时间
      */
     @TableField(value = "operator_time")
     private Date operatorTime;
 
     /**
-     *  添加操作人
+     * 添加操作人
      */
     @TableField(value = "operator_name")
     private String operatorName;
 
     /**
-     *  新操作人
+     * 新操作人
      */
     @TableField(value = "new_operator_id")
     private String newOperatorId;
 
     /**
-     *  新操作人
+     * 新操作人
      */
     @TableField(value = "new_operator_name")
     private String newOperatorName;
@@ -436,6 +437,23 @@ public class InsAreaCompany implements Serializable {
     @TableField(value = "product")
     private String product;
 
+    /**
+     * 交强续保
+     *
+     * @see com.ydtech.constants.enums.dict.insurance.Renewal
+     */
+    @ApiModelProperty(value = "jq_renewal")
+    private String jqRenewal;
+
+    /**
+     * 商业续保
+     *
+     * @see com.ydtech.constants.enums.dict.insurance.Renewal
+     */
+    @ApiModelProperty(value = "sy_renewal")
+    private String syRenewal;
+
+
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();
         this.orderno = quoteRespVo.getOrderno();
@@ -473,8 +491,10 @@ public class InsAreaCompany implements Serializable {
         this.syapplyno = quoteRespVo.getSyApplyNo();
         // 折扣率
         this.totalAdjustRate = quoteRespVo.getTotalAdjustRate();
-        this.jqAdjustRate = StringUtils.parseDouble(quoteRespVo.getJqAdjustRate()) ;
+        this.jqAdjustRate = StringUtils.parseDouble(quoteRespVo.getJqAdjustRate());
         this.syAdjustRate = StringUtils.parseDouble(quoteRespVo.getSyAdjustRate());
+        this.jqRenewal = quoteRespVo.getJqRenewal();
+        this.syRenewal = quoteRespVo.getSyRenewal();
 
     }
 

+ 14 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java

@@ -244,6 +244,20 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("sy_discount")
         private String syDiscount;
 
+        /**
+         * 交强续保转保标志
+         * 0转保  1续保
+         */
+        @JsonProperty("jq_renewalflag")
+        private String jqRenewalFlag;
+
+        /**
+         * 商业续保转保标志
+         * 0转保  1续保
+         */
+        @JsonProperty("sy_renewalflag")
+        private String syRenewalFlag;
+
         /**
          * 返回1需要验车,返回0不验车。
          * 是否需要验车

+ 12 - 8
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -115,7 +115,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         //  折扣
         crawlerQuoteRequest.setDiscount(t.getDiscount());
         // 上次订单
-        if(StringUtils.isNotEmpty(t.getLastCompanyId())){
+        if (StringUtils.isNotEmpty(t.getLastCompanyId())) {
             InsAreaCompany insAreaCompany = insAreaCompanyService.getById(t.getLastCompanyId());
             crawlerQuoteRequest.setPlyappno(insAreaCompany.getInsOrderNo());
         }
@@ -132,7 +132,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = new InsAreaCompanyAccidentalDriving();
         insAreaCompanyAccidentalDriving.convertCrawler(t);
         //处理订单信息
-        QuoteRespVo responseVo = responseOrder(response, quoteRespVo, ptlAgreementAttribution,insAreaCompanyAccidentalDriving);
+        QuoteRespVo responseVo = responseOrder(response, quoteRespVo, ptlAgreementAttribution, insAreaCompanyAccidentalDriving);
 
         return HttpResult.ok("成功", responseVo);
     }
@@ -365,11 +365,16 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         if (!ObjectUtils.isEmpty(infoList)) {
             quoteRespVo.getWarnMessageList().addAll(infoList);
         }
+        // 交强是否续保
+        quoteRespVo.setJqRenewal(other.getJqRenewalFlag());
+        // 商业是否续保
+        quoteRespVo.setSyRenewal(other.getSyRenewalFlag());
         return quoteRespVo;
     }
 
     private QuoteRespVo responseOrder(CrawlerQuoteResponse response, QuoteRespVo quoteRespVo,
-                                      PtlAgreementAttribution ptlAgreementAttribution,InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
+                                      PtlAgreementAttribution ptlAgreementAttribution,
+                                      InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving) {
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
 
@@ -382,12 +387,11 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         }
 
         //太平绿黄红区
-        for (String item:quoteRespVo.getWarnMessageList())
-        {
+        for (String item : quoteRespVo.getWarnMessageList()) {
             String regex = "小货车.{0,5}承保业务";
             Pattern pattern = Pattern.compile(regex);
             Matcher matcher = pattern.matcher(item);
-            if(matcher.find()){
+            if (matcher.find()) {
                 insAreaCompany.setTpColorScore(item);
                 break;
             }
@@ -396,7 +400,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
 
         // 保险公司订单号
         insAreaCompany.setInsOrderNo(response.getOrderNo());
-        insAreaCompanyService.insertCompanyAndOrders(insAreaCompany,insAreaCompanyAccidentalDriving);
+        insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);
         quoteRespVo.setCompanyId(insAreaCompany.getId());
         return quoteRespVo;
     }
@@ -459,7 +463,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             insAreaCompany.setSypolicyno(crawlerAuditResponse.getSyApplication());
 
             //设置支付时间
-            if(insAreaCompany.getPayDate()==null){
+            if (insAreaCompany.getPayDate() == null) {
                 insAreaCompany.setPayDate(LocalDateTime.now());
             }
             // 3 交叉销售