Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

lixiaolong 2 mēneši atpakaļ
vecāks
revīzija
45c62c31e6
14 mainītis faili ar 296 papildinājumiem un 496 dzēšanām
  1. 2 0
      commons/src/main/java/com/jzg/commons/entity/finance/dto/CompanySuperviseSettlementReportDto.java
  2. 33 14
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java
  3. 6 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/SettlementReportQueryVo.java
  4. 58 40
      commons/src/main/java/com/jzg/commons/entity/vo/PtlAgreementCostRatioVo.java
  5. 3 4
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java
  6. 22 17
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java
  7. 1 4
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  8. 18 19
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/build/TkCrawlerQuoteResultsBuild.java
  9. 3 0
      tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/build/TaiShanCrawlerQuoteResultsVoBuild.java
  10. 24 45
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/build/ZiJinCrawlerQuoteResultsVoBuild.java
  11. 5 282
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/service/impl/ZiJinCrawlerRequestImpl.java
  12. 3 0
      tenant/organization/src/main/java/com/jzg/organization/entity/dto/CalRes.java
  13. 17 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  14. 101 71
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/finance/dto/CompanySuperviseSettlementReportDto.java

@@ -69,6 +69,8 @@ public class CompanySuperviseSettlementReportDto implements Serializable {
     private String gdfSettledAmount;
     @Schema(description = "跟单费未结算金额")
     private String gdfUnSettledAmount;
+    @Schema(description = "虚增金额合计")
+    private String totalOverinflatedAmount;
 
     @Schema(description = "子保险公司数据")
     private List<CompanySuperviseSettlementReportDto> children;

+ 33 - 14
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java

@@ -27,11 +27,12 @@ public class InsPlyIncome extends BaseModel {
     private String orderNo;
 
     @Schema(description = "协议类型")
-    @ExcelProperty("协议类型")
+    @ExcelIgnore
     private String agreementType;
 
     @Schema(description = "机构")
     @ExcelProperty("机构id")
+    @ExcelIgnore
     private String deptId;
 
     @Schema(description = "机构名称")
@@ -40,31 +41,36 @@ public class InsPlyIncome extends BaseModel {
 
     @Schema(description = "产品id")
     @ExcelProperty("产品id")
+    @ExcelIgnore
     private String productId;
 
     @Schema(description = "产品名称")
-    @ExcelProperty("产品名称")
+    @ExcelProperty("险种")
     private String productName;
 
     @Schema(description = "险种")
     @ExcelProperty("险种")
+    @ExcelIgnore
     private String riskCode;
 
     @Schema(description = "签单时间")
     //@TableField(exist = false)
-    @ExcelProperty("签单时间")
+    @ExcelIgnore
     private LocalDateTime signingTime;
 
     @Schema(description = "签单年份")
     @TableField(exist = false)
+    @ExcelIgnore
     private String signYear;
 
     @Schema(description = "签单日期 yyyy-mm-dd 格式")
     @TableField(exist = false)
+    @ExcelIgnore
     private String signDate;
 
     @Schema(description = "保司ID")
     @ExcelProperty("保司ID")
+    @ExcelIgnore
     private String companyId;
 
     @Schema(description = "保司名称")
@@ -74,6 +80,7 @@ public class InsPlyIncome extends BaseModel {
 
     @Schema(description = "协议Id")
     @ExcelProperty("协议Id")
+    @ExcelIgnore
     private String agreementId;
 
     @Schema(description = "协议名称")
@@ -192,35 +199,35 @@ public class InsPlyIncome extends BaseModel {
     private String receivableAmount;
 
     @Schema(description = "手续费是否已经结算")
-    @ExcelProperty("手续费是否已经结算")
+    @ExcelIgnore
     private String superviseSettlement;
 
     @Schema(description = "跟单费是否已经结算")
-    @ExcelProperty("跟单费是否已经结算")
+    @ExcelIgnore
     private String otherSettlement;
 
     @Schema(description = "驾意险手续费是否已经结算")
-    @ExcelProperty("驾意险手续费是否已经结算")
+    @ExcelIgnore
     private String jySuperviseSettlement;
 
     @Schema(description = "驾意跟单位是否已经结算")
-    @ExcelProperty("驾意跟单位是否已经结算")
+    @ExcelIgnore
     private String jyOtherSettlement;
 
     @Schema(description = "平台协议车险应收是否已经结算  0 未结算  1 结算")
-    @ExcelProperty("平台协议车险应收是否已经结算")
+    @ExcelIgnore
     private String platformSuperviseSettlement;
 
     @Schema(description = "平台协议非车险应收是否已经结算  0 未结算  1 结算")
-    @ExcelProperty("平台协议非车险应收是否已经结算")
+    @ExcelIgnore
     private String platformOtherSettlement;
 
     @Schema(description = "维护人工号")
-    @ExcelProperty("维护人工号")
+    @ExcelIgnore
     private String leaderId;
 
     @Schema(description = "维护人名称")
-    @ExcelProperty("维护人名称")
+    @ExcelIgnore
     private String leaderName;
 
     @Schema(description = "对接人")
@@ -235,11 +242,11 @@ public class InsPlyIncome extends BaseModel {
     }
 
     @Schema(description = "系统code")
-    @ExcelProperty("系统code")
+    @ExcelIgnore
     private String systemCode;
 
     @Schema(description = "业务来源")
-    @ExcelProperty("业务来源")
+    @ExcelIgnore
     private String businessSource;
 
     @Schema(description = "结算时间")
@@ -256,7 +263,7 @@ public class InsPlyIncome extends BaseModel {
     private String settlementStatusName;
 
     @Schema(description = "增加类型")
-    @ExcelProperty("增加类型")
+    @ExcelIgnore
     private String addType;
 
     @TableField(exist = false)
@@ -276,50 +283,62 @@ public class InsPlyIncome extends BaseModel {
 
     @TableField(exist = false)
     @Schema(description = "订单类型(code)")
+    @ExcelIgnore
     private String entryStatus;
 
     @TableField(exist = false)
     @Schema(description = "业务员类型 团队/渠道/电销/个代 5:团队 6:个代 7:渠道 8 :电销")
+    @ExcelIgnore
     private String typeAttr;
 
     @TableField(exist = false)
     @Schema(description = "业务员类型 团队/渠道/电销/个代 5:团队 6:个代 7:渠道 8 :电销")
+    @ExcelIgnore
     private String typeAttrName;
 
     @TableField(exist = false)
     @Schema(description = "实际签单用户手机号2")
+    @ExcelIgnore
     private String realQuoteUserId;
 
     @TableField(exist = false)
     @Schema(description = "实际签单用户手机号")
+    @ExcelProperty("实际签单用户手机号")
     private String realQuoteUserName;
 
     @TableField(exist = false)
     @Schema(description = "订单费用表")
+    @ExcelIgnore
     private InsFeeOrders insFeeOrders;
 
     @TableField(exist = false)
     @Schema(description = "是否已经开票")
+    @ExcelIgnore
     private String invoiceStatusName;
 
     @TableField(exist = false)
     @Schema(description = "订单关联的发票信息")
+    @ExcelIgnore
     private String invoiceId;
 
     @TableField(exist = false)
     @Schema(description = "地区归属")
+    @ExcelIgnore
     private String companyNameSimple;
 
     @TableField(exist = false)
     @Schema(description = "交强总比例")
+    @ExcelIgnore
     private String jqTotalProportion;
 
     @TableField(exist = false)
     @Schema(description = "商业总比例")
+    @ExcelIgnore
     private String syTotalProportion;
 
     @TableField(exist = false)
     @Schema(description = "非车总比例")
+    @ExcelIgnore
     private String jyTotalProportion;
 
 

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/SettlementReportQueryVo.java

@@ -54,4 +54,10 @@ public class SettlementReportQueryVo extends PageRequest {
 
     @Schema(description = "租户代码")
     private String systemCode;
+
+    @Schema(description = "签单开始时间")
+    private String signingStartTime;
+
+    @Schema(description = "签单结束时间")
+    private String signingEndTime;
 }

+ 58 - 40
commons/src/main/java/com/jzg/commons/entity/vo/PtlAgreementCostRatioVo.java

@@ -22,66 +22,84 @@ public class PtlAgreementCostRatioVo {
 
     @Schema(description = "交强险手续费比例")
     private BigDecimal jqCommissionRatio;
-
-    @Schema(description = "商业险手续费比例")
-    private BigDecimal syCommissionRatio;
-
-    @Schema(description = "驾意险手续费比例")
-    private BigDecimal jyCommissionRatio;
-
     @Schema(description = "交强险跟单费比例")
     private BigDecimal jqFollowRatio;
-
-    @Schema(description = "商业险跟单费比例")
-    private BigDecimal syFollowRatio;
-
-    @Schema(description = "驾意险跟单费比例")
-    private BigDecimal jyFollowRatio;
-
     @Schema(description = "交强险加投费比例")
     private BigDecimal jqAdditionalRatio;
-
-    @Schema(description = "商业险加投费比例")
-    private BigDecimal syAdditionalRatio;
-
-    @Schema(description = "驾意险加投费比例")
-    private BigDecimal jyAdditionalRatio;
-
     @Schema(description = "交强险出口比例")
     private BigDecimal jqExportRatio;
-
-    @Schema(description = "商业险出口比例")
-    private BigDecimal syExportRatio;
-
-    @Schema(description = "驾意险出口比例")
-    private BigDecimal jyExportRatio;
-
     @Schema(description = "交强险入口比例")
     private BigDecimal jqInletRatio;
+    @Schema(description = "交强险留点比例")
+    private BigDecimal jqKeepPointRatio;
+    @Schema(description = "交强险出口留点比例")
+    private BigDecimal jqExportKeepPointRatio;
 
+    @Schema(description = "商业险手续费比例")
+    private BigDecimal syCommissionRatio;
+    @Schema(description = "商业险跟单费比例")
+    private BigDecimal syFollowRatio;
+    @Schema(description = "商业险加投费比例")
+    private BigDecimal syAdditionalRatio;
+    @Schema(description = "商业险出口比例")
+    private BigDecimal syExportRatio;
     @Schema(description = "商业险入口比例")
     private BigDecimal syInletRatio;
+    @Schema(description = "商业险留点比例")
+    private BigDecimal syKeepPointRatio;
+    @Schema(description = "商业险出口留点比例")
+    private BigDecimal syExportKeepPointRatio;
 
+    @Schema(description = "驾意险手续费比例")
+    private BigDecimal jyCommissionRatio;
+    @Schema(description = "驾意险跟单费比例")
+    private BigDecimal jyFollowRatio;
+    @Schema(description = "驾意险加投费比例")
+    private BigDecimal jyAdditionalRatio;
+    @Schema(description = "驾意险出口比例")
+    private BigDecimal jyExportRatio;
     @Schema(description = "驾意险入口比例")
     private BigDecimal jyInletRatio;
+    @Schema(description = "非车险留点比例")
+    private BigDecimal jyKeepPointRatio;
+    @Schema(description = "驾意险出口留点比例")
+    private BigDecimal jyExportKeepPointRatio;
 
-    @Schema(description = "交强险留点比例")
-    private BigDecimal jqKeepPointRatio;
 
-    @Schema(description = "商业险留点比例")
-    private BigDecimal syKeepPointRatio;
+    // 建议放在类内部作为私有方法,方便复用
+    private BigDecimal multiplyBy100(BigDecimal value) {
+        return value != null ? value.multiply(new BigDecimal("100")) : BigDecimal.ZERO;
+    }
 
-    @Schema(description = "非车险留点比例")
-    private BigDecimal jyKeepPointRatio;
+    public void multiply100() {
+        // 交强险比例
+        this.jqCommissionRatio = multiplyBy100(this.jqCommissionRatio);
+        this.jqFollowRatio = multiplyBy100(this.jqFollowRatio);
+        this.jqAdditionalRatio = multiplyBy100(this.jqAdditionalRatio);
+        this.jqExportRatio = multiplyBy100(this.jqExportRatio);
+        this.jqInletRatio = multiplyBy100(this.jqInletRatio);
+        this.jqKeepPointRatio = multiplyBy100(this.jqKeepPointRatio);
+        this.jqExportKeepPointRatio = multiplyBy100(this.jqExportKeepPointRatio);
 
-    @Schema(description = "交强险出口留点比例")
-    private BigDecimal jqExportKeepPointRatio;
+        // 商业险比例
+        this.syCommissionRatio = multiplyBy100(this.syCommissionRatio);
+        this.syFollowRatio = multiplyBy100(this.syFollowRatio);
+        this.syAdditionalRatio = multiplyBy100(this.syAdditionalRatio);
+        this.syExportRatio = multiplyBy100(this.syExportRatio);
+        this.syInletRatio = multiplyBy100(this.syInletRatio);
+        this.syKeepPointRatio = multiplyBy100(this.syKeepPointRatio);
+        this.syExportKeepPointRatio = multiplyBy100(this.syExportKeepPointRatio);
 
-    @Schema(description = "商业险出口留点比例")
-    private BigDecimal syExportKeepPointRatio;
+        // 驾意险比例
+        this.jyCommissionRatio = multiplyBy100(this.jyCommissionRatio);
+        this.jyFollowRatio = multiplyBy100(this.jyFollowRatio);
+        this.jyAdditionalRatio = multiplyBy100(this.jyAdditionalRatio);
+        this.jyExportRatio = multiplyBy100(this.jyExportRatio);
+        this.jyInletRatio = multiplyBy100(this.jyInletRatio);
+        this.jyKeepPointRatio = multiplyBy100(this.jyKeepPointRatio);
+        this.jyExportKeepPointRatio = multiplyBy100(this.jyExportKeepPointRatio);
+    }
 
-    @Schema(description = "驾意险出口留点比例")
-    private BigDecimal jyExportKeepPointRatio;
     public PtlAgreementCostRatioVo(List<PtlAgreementCostTypeVo> ptlAgreementCostTypeList, PtlAgreement ptlAgreement) {
         ptlAgreementCostTypeList.forEach(ptlAgreementCostType -> {
             switch (ptlAgreementCostType.getCostType()) {

+ 3 - 4
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -369,8 +369,7 @@ public class QuoteVerificationAspect {
             BiConsumer<InsFeeOrders, BigDecimal> setFollow,
             BiConsumer<InsFeeOrders, BigDecimal> setAdditional,
             BiConsumer<InsFeeOrders, BigDecimal> keepPointRate,
-            BiConsumer<InsFeeOrders, BigDecimal> keepPointPremium
-    ) {
+            BiConsumer<InsFeeOrders, BigDecimal> keepPointPremium) {
         // 若险种配置为空,默认应收应付为0
         if (costType == null || premium == null) {
             setReceivable.accept(insFeeOrders, BigDecimal.ZERO);
@@ -404,8 +403,8 @@ public class QuoteVerificationAspect {
         receivable = receivable.setScale(5, RoundingMode.HALF_EVEN);
         setReceivable.accept(insFeeOrders, receivable);
 
-        // 设置留点比例 入口比例+加投比例-出口比例
-        BigDecimal keepPointRateCal  = BigDecimalUtil.subtract(BigDecimalUtil.add(BigDecimalUtil.multiply(inletPercent,taxFactor),addThrowPercent),exportPercent)
+        // 设置留点比例 入口比例/taxFactor+加投比例-出口比例
+        BigDecimal keepPointRateCal  = BigDecimalUtil.subtract(BigDecimalUtil.add(BigDecimalUtil.divide(inletPercent,taxFactor),addThrowPercent),exportPercent)
                 .setScale(5,RoundingMode.HALF_EVEN);
         keepPointRate.accept(insFeeOrders, keepPointRateCal);
         // 设置留点比例和留点费用

+ 22 - 17
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java

@@ -31,7 +31,6 @@ import org.springframework.stereotype.Service;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -78,8 +77,14 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
     }
 
 
+    /**
+     *
+     * @author lipf
+     * @date 2026/6/24 9:46
+     */
     @Override
     public InsFeeOrders calcCosts(PtlAgreementCostRatioVo ptlAgreementCostRatioVo) {
+        log.info("调整费用。不同费用的比例信息是:[{}]", JSONUtil.toJsonStr(ptlAgreementCostRatioVo));
         InsFeeOrders insFeeOrders = getInsFeeOrders(ptlAgreementCostRatioVo);
         log.info("调整后费用.参数[{}]真实结果是[{}]", JSONUtil.toJsonStr(ptlAgreementCostRatioVo), JSONUtil.toJsonStr(insFeeOrders));
         // 保存比例
@@ -185,7 +190,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         // ===================== 按比例计算各项费用 =====================
         BigDecimal inlet = base.multiply(inletRatio).setScale(scale, RoundingMode.HALF_EVEN);
         BigDecimal commission = base.multiply(commissionRatio).setScale(scale, RoundingMode.HALF_EVEN);
-        BigDecimal follow = base.multiply(followRatio).setScale(scale, RoundingMode.HALF_EVEN);
+        BigDecimal follow = BigDecimalUtil.subtract(inlet,commission); //BigDecimal follow = base.multiply(followRatio).setScale(scale, RoundingMode.HALF_EVEN);
 
         // 加投直接乘
         BigDecimal addThrow = premium.multiply(addThrowRatio).setScale(scale, RoundingMode.HALF_EVEN);
@@ -209,11 +214,11 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
             insFeeOrders.setJqPayablePremium(export);
 
             // add by lipf, 2026年6月23日10:42:36  更新具体某个险种的出口费用的时候,同步更新总的出口费用
-            List<BigDecimal> exportAmount = new ArrayList<>();
-            exportAmount.add(insFeeOrders.getJqExportPremium());
-            exportAmount.add(insFeeOrders.getSyExportPremium());
-            exportAmount.add(insFeeOrders.getJyExportPremium());
-            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
+//            List<BigDecimal> exportAmount = new ArrayList<>();
+//            exportAmount.add(inlet);
+//            exportAmount.add(insFeeOrders.getSyExportPremium());
+//            exportAmount.add(insFeeOrders.getJyExportPremium());
+//            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
         } else if ("sy".equals(type)) {
             insFeeOrders.setSyCommissionPremium(commission);
             insFeeOrders.setSyReceivablePremium(inlet);
@@ -225,11 +230,11 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
             insFeeOrders.setSyPayablePremium(export);
 
             // add by lipf, 2026年6月23日10:42:36  更新具体某个险种的出口费用的时候,同步更新总的出口费用
-            List<BigDecimal> exportAmount = new ArrayList<>();
-            exportAmount.add(insFeeOrders.getJqExportPremium());
-            exportAmount.add(insFeeOrders.getSyExportPremium());
-            exportAmount.add(insFeeOrders.getJyExportPremium());
-            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
+//            List<BigDecimal> exportAmount = new ArrayList<>();
+//            exportAmount.add(insFeeOrders.getJqExportPremium());
+//            exportAmount.add(insFeeOrders.getSyExportPremium());
+//            exportAmount.add(insFeeOrders.getJyExportPremium());
+//            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
         } else if ("jy".equals(type)) {
             insFeeOrders.setJyCommissionPremium(commission);
             insFeeOrders.setJyReceivablePremium(inlet);
@@ -241,11 +246,11 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
             insFeeOrders.setJyPayablePremium(export);
 
             // add by lipf, 2026年6月23日10:42:36  更新具体某个险种的出口费用的时候,同步更新总的出口费用
-            List<BigDecimal> exportAmount = new ArrayList<>();
-            exportAmount.add(insFeeOrders.getJqExportPremium());
-            exportAmount.add(insFeeOrders.getSyExportPremium());
-            exportAmount.add(insFeeOrders.getJyExportPremium());
-            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
+//            List<BigDecimal> exportAmount = new ArrayList<>();
+//            exportAmount.add(insFeeOrders.getJqExportPremium());
+//            exportAmount.add(insFeeOrders.getSyExportPremium());
+//            exportAmount.add(insFeeOrders.getJyExportPremium());
+//            insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
         }
     }
 

+ 1 - 4
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -61,7 +61,6 @@ import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.RequiredArgsConstructor;
 import lombok.Setter;
-import org.apache.commons.beanutils.BeanUtils;
 import org.apache.http.util.TextUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,7 +72,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
-import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.net.URL;
 import java.time.Instant;
@@ -1695,6 +1693,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             if(this.rationIsNotNull(batchModifyVo)){
                 log.info("费用比例不为空,同步调整费用。batchModifyVo=[{}]", JSONUtil.toJsonStr(batchModifyVo));
                 PtlAgreementCostRatioVo param = this.calRatio(insFeeOrders,batchModifyVo);
+                param.multiply100();
                 insFeeAuditService.saveCostInfo(param);
             }
             log.info("车险订单[{}]对应的订单明细是[{}]", orderNo, JSONUtil.toJsonStr(oldInsOrders));
@@ -1734,9 +1733,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
      */
     private PtlAgreementCostRatioVo calRatio(InsFeeOrders insFeeOrders, BatchModifyVo batchModifyVo) {
         log.info("batchModifyVo.转换百分比之前的数据=【{}】", JSONUtil.toJsonStr(batchModifyVo));
-
         batchModifyVo.divide100();
-
         PtlAgreementCostRatioVo vo = new PtlAgreementCostRatioVo();
         vo.setOrderNo(insFeeOrders.getOrderNo());
 

+ 18 - 19
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/build/TkCrawlerQuoteResultsBuild.java

@@ -2,7 +2,9 @@ package com.jzg.quotation.taikang.crawler.build;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
+import com.jzg.commons.constants.quote.enums.quote.KindCode;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
@@ -10,7 +12,6 @@ import com.jzg.commons.entity.quote.vo.TaxInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.util.DateTimeUtils;
 import com.jzg.commons.util.StringUtils;
-import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.quotation.commons.constant.enums.quote.RenewalEnum;
 import com.jzg.quotation.commons.utils.DateTimeUtil;
 import com.jzg.quotation.taikang.crawler.ConvertUtil;
@@ -28,6 +29,9 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @description: 泰康爬虫报价返回结果构建器
@@ -104,24 +108,8 @@ public class TkCrawlerQuoteResultsBuild {
         }
 
         // 商业险险种信息
-        List<TKCiKindsVo> ciKindsVo = preciseInitResult.getCiKindsVo();
-        if (ciKindsVo != null && !ciKindsVo.isEmpty()) {
-            List<KindInfoVo> kindInfoVos = new ArrayList<>();
-            for (TKCiKindsVo tKCiKindsVo : ciKindsVo) {
-                String kindCode = null; // 险种编码
-                String kindName = null; // 险种名称
-                String platformKindCode = tKCiKindsVo.getKindCode(); // 平台险种编码
-                String platformKindName = tKCiKindsVo.getKindCName(); // 平台险种名称
-                String amount = tKCiKindsVo.getQuoteAmount().toString(); // 保额
-                String unitAmount = tKCiKindsVo.getUnitAmount().toString(); // 每座保额
-                Integer quantity = tKCiKindsVo.getQuantity(); // 座位数
-                String premium = tKCiKindsVo.getPremium().toString(); // 保费
-                String deductibleRate = null; // 附加绝对免赔率
-                String serviceTimes = null; // 服务次数
-                KindInfoVo kindInfoVo = new KindInfoVo(IdGenerate.nextId(), kindCode, kindName, platformKindCode, platformKindName, amount, unitAmount, quantity, premium, deductibleRate, serviceTimes);
-                kindInfoVos.add(kindInfoVo);
-            }
-            quoteResultsVo.setKindInfoVo(kindInfoVos);
+        if (CollectionUtils.isNotEmpty(preciseInitResult.getCiKindsVo())) {
+            quoteResultsVo.setKindInfoVo(buildKindInfoVo(commonQuoteVo.getKindInfoVo(), preciseInitResult.getCiKindsVo()));
         }
 
         // 交强保费 车船税 商业保费
@@ -186,4 +174,15 @@ public class TkCrawlerQuoteResultsBuild {
             return String.valueOf(RenewalEnum.Transfer.getCode());
         }
     }
+
+    private static List<KindInfoVo> buildKindInfoVo(List<KindInfoVo> kindInfoVo, List<TKCiKindsVo> ciKindsVo) {
+        Map<String, TKCiKindsVo> collect = ciKindsVo.stream().collect(Collectors.toMap(TKCiKindsVo::getKindCode, x -> x));
+        kindInfoVo.forEach(kind -> {
+            TKCiKindsVo itemKindListDTO = collect.get(kind.getKindCode());
+            if (Objects.nonNull(itemKindListDTO) && itemKindListDTO.getKindCode().equals(kind.getPlatformKindCode())) {
+                kind.setPremium(itemKindListDTO.getPremium() + "");
+            }
+        });
+        return kindInfoVo;
+    }
 }

+ 3 - 0
tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/build/TaiShanCrawlerQuoteResultsVoBuild.java

@@ -180,6 +180,9 @@ public class TaiShanCrawlerQuoteResultsVoBuild {
             if (Objects.nonNull(coverageListDTO) && coverageListDTO.getKindCode().equals(kind.getKindCode())) {
                 kind.setAmount(String.valueOf(coverageListDTO.getAmount()));//设置保额
                 kind.setPremium(String.valueOf(coverageListDTO.getPremium()));//设置保费
+                // 补充商业险种详细信息
+                kind.setServiceTimes(coverageListDTO.getResvNumberRoad());//服务次数(道路救援等)
+                kind.setDeductibleRate(coverageListDTO.getDeductibleRatio());//免赔率
             }
         });
         return kindInfoVo;

+ 24 - 45
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/build/ZiJinCrawlerQuoteResultsVoBuild.java

@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
+import com.jzg.commons.constants.quote.enums.quote.KindCode;
 import com.jzg.commons.entity.po.InsFeeOrders;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.util.DateTimeUtils;
@@ -20,6 +22,9 @@ import lombok.extern.slf4j.Slf4j;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @description: 紫金财险爬虫报价结果构建器
@@ -48,30 +53,22 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
     /**
      * 处理报价结果
      *
-     * @param ordersNo
+     * @param quoteVo
      * @param ziJinCrawlerQuotationResponse
      * @param ziJinCrawlerSaveProposalResponse
      * @return QuoteResultsVo
      */
-    public static QuoteResultsVo buildQuoteResultsVo(String ordersNo, ZiJinCrawlerQuotationResponse ziJinCrawlerQuotationResponse, ZiJinCrawlerSaveProposalResponse ziJinCrawlerSaveProposalResponse) {
+    public static QuoteResultsVo buildQuoteResultsVo(QuoteVo quoteVo, ZiJinCrawlerQuotationResponse ziJinCrawlerQuotationResponse, ZiJinCrawlerSaveProposalResponse ziJinCrawlerSaveProposalResponse) {
         QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
-        quoteResultsVo.setOrdersNo(ordersNo);
+        quoteResultsVo.setOrdersNo(quoteVo.getOrder().getOrdersNo());
 
-
-        // if (ResponseCode.R_0003.getCode().equals(ziJinCrawlerSaveProposalResponse.getRtnCode())) {
-        //     handleQuoteFailure(quoteResultsVo, ziJinCrawlerSaveProposalResponse.getRtnMsg(), "保存投保单失败");
-        //     return quoteResultsVo;
-        // }
-
-        if (ziJinCrawlerQuotationResponse.getItemKindList() != null) {
+        if (CollectionUtils.isNotEmpty(ziJinCrawlerQuotationResponse.getItemKindList())) {
             // 设置交强险投保时间信息
             quoteResultsVo.setCiRiskInfoVo(buildCiRiskInfoVo(ziJinCrawlerQuotationResponse));
             // 设置商业险投保时间信息
             quoteResultsVo.setBiRiskInfoVo(buildBiRiskInfoVo(ziJinCrawlerQuotationResponse));
-            // 设置驾意险投保时间信息
-            // quoteResultsVo.setJyRiskInfoVo(buildJyRiskInfoVo(ziJinCrawlerQuotationResponse));
-            // 设置险种明细列表
-            quoteResultsVo.setKindInfoVo(buildKindInfoVoList(ziJinCrawlerQuotationResponse));
+            // 设置商业险种的详细保费
+            quoteResultsVo.setKindInfoVo(buildKindInfoVoList(quoteVo.getKindInfoVo(), ziJinCrawlerQuotationResponse));
         }
 
         // 设置投保单号
@@ -90,7 +87,7 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
         }
 
         // 交强保费 车船税 商业保费
-        buildPremium(quoteResultsVo, ziJinCrawlerQuotationResponse);
+        buildResultsPremium(quoteResultsVo, ziJinCrawlerQuotationResponse);
 
         // 设置警告消息(预核保消息)
         warnMessageList(ziJinCrawlerQuotationResponse, quoteResultsVo);
@@ -98,16 +95,6 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
         // 设置评分、折扣、影响因子、转保标识
         quoteResultsVo.setScoreVo(ZiJinCrawlerQuoteResultsVoBuild.buildScoreVo(ziJinCrawlerQuotationResponse));
 
-        // 构建因子
-        // ZiJinCrawlerQuotationResponse.PriceInfoList priceInfo = ziJinCrawlerQuotationResponse.getPriceInfoList().get(0);
-        // ExpenseFactor expenseFactor = new ExpenseFactor(null, priceInfo.getEffectNameUPOne(), priceInfo.getEffectValueUPOne());
-        // ExpenseFactor expenseFactor2 = new ExpenseFactor(null, priceInfo.getEffectNameUPTwo(), priceInfo.getEffectValueUPTwo());
-        // ExpenseFactor expenseFactor3 = new ExpenseFactor(null, priceInfo.getEffectNameUPThree(), priceInfo.getEffectValueUPThree());
-        // ExpenseFactor expenseFactor4 = new ExpenseFactor(null, priceInfo.getEffectNameDownFour(), priceInfo.getEffectValueDownFour());
-        // ExpenseFactor expenseFactor5 = new ExpenseFactor(null, priceInfo.getEffectNameDownFive(), priceInfo.getEffectValueDownFive());
-        // ExpenseFactor expenseFactor6 = new ExpenseFactor(null, priceInfo.getEffectNameDownSix(), priceInfo.getEffectValueDownSix());
-        // quoteResultsVo.setExpenseFactors();
-
         // 设置报价状态:待核保
         quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.WAIT_AUDIT);
 
@@ -171,27 +158,19 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
     /**
      * 处理险种明细列表
      *
+     * @param kindInfoVo
      * @param quotationResponse
      * @return List<KindInfoVo>
      */
-    public static List<KindInfoVo> buildKindInfoVoList(ZiJinCrawlerQuotationResponse quotationResponse) {
-        List<KindInfoVo> kindInfoVoList = new java.util.ArrayList<>();
-        if (quotationResponse.getItemKindList() == null) {
-            return kindInfoVoList;
-        }
-
-        for (ZiJinCrawlerQuotationResponse.ItemKindList item : quotationResponse.getItemKindList()) {
-            KindInfoVo kindInfoVo = new KindInfoVo();
-            kindInfoVo.setKindCode(item.getKindCode());
-            kindInfoVo.setKindName(item.getKindName());
-            kindInfoVo.setAmount(item.getAmount());
-            kindInfoVo.setUnitAmount(item.getUnitAmount());
-            kindInfoVo.setQuantity(item.getQuantity());
-            kindInfoVo.setPremium(item.getPremium());
-            kindInfoVoList.add(kindInfoVo);
-        }
-
-        return kindInfoVoList;
+    public static List<KindInfoVo> buildKindInfoVoList(List<KindInfoVo> kindInfoVo, ZiJinCrawlerQuotationResponse quotationResponse) {
+        Map<String, ZiJinCrawlerQuotationResponse.ItemKindList> collect = quotationResponse.getItemKindList().stream().collect(Collectors.toMap(ZiJinCrawlerQuotationResponse.ItemKindList::getKindCode, x -> x));
+        kindInfoVo.forEach(kind -> {
+            ZiJinCrawlerQuotationResponse.ItemKindList itemKindListDTO = collect.get(kind.getKindCode());
+            if (Objects.nonNull(itemKindListDTO) && itemKindListDTO.getKindCode().equals(kind.getPlatformKindCode())) {
+                kind.setPremium(itemKindListDTO.getPremium());
+            }
+        });
+        return kindInfoVo;
     }
 
     /**
@@ -200,7 +179,7 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
      * @param quoteResultsVo
      * @param quotationResponse
      */
-    private static void buildPremium(QuoteResultsVo quoteResultsVo, ZiJinCrawlerQuotationResponse quotationResponse) {
+    private static void buildResultsPremium(QuoteResultsVo quoteResultsVo, ZiJinCrawlerQuotationResponse quotationResponse) {
         if (CollectionUtils.isEmpty(quotationResponse.getPlanList())) {
             return;
         }
@@ -447,7 +426,7 @@ public class ZiJinCrawlerQuoteResultsVoBuild {
         if (!StringUtils.hasText(renewalFlag)) {
             return null;
         }
-        if (renewalFlag.equals("0")) {
+        if ("0".equals(renewalFlag)) {
             return String.valueOf(RenewalEnum.Renewal.getCode());
         } else {
             return String.valueOf(RenewalEnum.Transfer.getCode());

+ 5 - 282
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/service/impl/ZiJinCrawlerRequestImpl.java

@@ -254,7 +254,7 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
                 log.info("ziJinCrawlerSaveProposalResponse参数的值:{}", JSON.toJSONString(ziJinCrawlerSaveProposalResponse));
 
                 ziJinCrawlerOrderService.save(quoteVo, ziJinCrawlerQuotationResponse, ziJinCrawlerSaveProposalResponse, ziJinCrawlerSaveQuoteInfoResponse.getOrderNo(), ziJinCrawlerQuotationRequest.getOrderId(), true);
-                return ZiJinCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(quoteVo.getOrder().getOrdersNo(), ziJinCrawlerQuotationResponse, ziJinCrawlerSaveProposalResponse);
+                return ZiJinCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(quoteVo, ziJinCrawlerQuotationResponse, ziJinCrawlerSaveProposalResponse);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -1080,8 +1080,6 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
             ciItem.setKindCode(MotorVehicleInsuranceEnum.MVI_BZ.getCode());
             ciItem.setKindName(MotorVehicleInsuranceEnum.MVI_BZ.getName());
             ciItem.setRiskCode(RiskCodeEnum.TRAFFIC_CODE);
-            // ciItem.setBasePremium("950.0000");
-            // ciItem.setBenchMarkPremium("950.0000");
             itemKindList.add(ciItem);
         }
 
@@ -1104,219 +1102,6 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
         return itemKindList;
     }
 
-    /**
-     * 根据平台险种代码构建紫金险种对象
-     *
-     * @param zgKindCode  平台险种代码
-     * @param kindItem    平台险种信息
-     * @param seatCount   座位数
-     * @param actualValue 车辆实际价值
-     * @return ZiJinCrawlerQuotationRequest.ItemKindList
-     */
-    private ZiJinCrawlerQuotationRequest.ItemKindList buildZiJinKindItem(String zgKindCode, KindInfoVo kindItem,
-                                                                         int seatCount, Double actualValue) {
-        ZiJinCrawlerQuotationRequest.ItemKindList item = new ZiJinCrawlerQuotationRequest.ItemKindList();
-
-        switch (zgKindCode) {
-            case "A": // 机动车损失保险
-                item.setKindCode("A");
-                item.setKindName("机动车损失保险");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(actualValue != null ? actualValue.longValue() : 0);
-                item.setValue("0");
-                break;
-
-            case "B": // 机动车第三者责任保险
-                item.setKindCode("B");
-                item.setKindName("机动车第三者责任保险");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    item.setAmount(Long.parseLong(kindItem.getAmount()));
-                }
-                // item.setBasePremium("515.8200");
-                // item.setBenchMarkPremium("687.7600");
-                break;
-
-            case "D3": // 机动车车上人员责任保险(司机)
-                item.setKindCode("D3");
-                item.setKindName("机动车车上人员责任保险(司机)");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    item.setAmount(Long.parseLong(kindItem.getAmount()));
-                    item.setUnitAmount(kindItem.getAmount());
-                }
-                item.setQuantity(1);
-                break;
-
-            case "D4": // 机动车车上人员责任保险(乘客)
-                item.setKindCode("D4");
-                item.setKindName("机动车车上人员责任保险(乘客)");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    long perSeatAmount = Long.parseLong(kindItem.getAmount());
-                    int passengerCount = seatCount - 1;
-                    item.setAmount(perSeatAmount * passengerCount);
-                    item.setUnitAmount(kindItem.getAmount());
-                    item.setQuantity(passengerCount);
-                }
-                break;
-
-            case "L": // 附加车身划痕损失险
-                item.setKindCode("L");
-                item.setKindName("附加车身划痕损失险");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(kindItem.getAmount());
-                break;
-
-            case "BD": // 附加法定节假日限额翻倍险
-                item.setKindCode("B2");
-                item.setKindName("附加法定节假日限额翻倍险");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    item.setAmount(Long.parseLong(kindItem.getAmount()));
-                }
-                break;
-
-            case "SY_FJ_YBW1": // 附加医保外用药责任险(机动车第三者责任保险)
-                item.setKindCode("S1");
-                item.setKindName("附加医保外用药责任险(机动车第三者责任保险)");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(kindItem.getAmount());
-                // item.setBasePremium("32.0000");
-                // item.setBenchMarkPremium("42.6700");
-                break;
-
-            case "SY_FJ_YBW3": // 附加医保外用药责任险(司机)
-                item.setKindCode("S2");
-                item.setKindName("附加医保外用药责任险(机动车车上人员责任保险(司机))");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    item.setAmount(Long.parseLong(kindItem.getAmount()));
-                }
-                break;
-
-            case "SY_FJ_YBW2": // 附加医保外用药责任险(乘客)
-                item.setKindCode("S3");
-                item.setKindName("附加医保外用药责任险(机动车车上人员责任保险(乘客))");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                if (StringUtils.hasLength(kindItem.getAmount())) {
-                    long perSeatAmount = Long.parseLong(kindItem.getAmount());
-                    int passengerCount = seatCount - 1;
-                    item.setAmount(perSeatAmount * passengerCount);
-                    item.setUnitAmount(kindItem.getAmount());
-                    item.setQuantity(passengerCount);
-                }
-                break;
-
-            case "TY1": // 道路救援服务特约条款
-                item.setKindCode("T1");
-                item.setKindName("道路救援服务特约条款");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
-                        kindItem.getServiceTimes() : kindItem.getAmount());
-                break;
-
-            case "TY2": // 车辆安全检测特约条款
-                item.setKindCode("T2");
-                item.setKindName("车辆安全检测特约条款");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
-                        kindItem.getServiceTimes() : kindItem.getAmount());
-                break;
-
-            case "TY3": // 代为驾驶服务特约条款
-                item.setKindCode("T3");
-                item.setKindName("代为驾驶服务特约条款");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
-                        kindItem.getServiceTimes() : kindItem.getAmount());
-                break;
-
-            case "TY4": // 代为送检服务特约条款
-                item.setKindCode("T4");
-                item.setKindName("代为送检服务特约条款");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setServiceTimes(StringUtils.hasLength(kindItem.getServiceTimes()) ?
-                        kindItem.getServiceTimes() : kindItem.getAmount());
-                break;
-
-            case "MJ1": // 附加绝对免赔率特约险(车损险)
-                item.setKindCode("FA");
-                item.setKindName("附加绝对免赔率特约险(机动车损失保险)");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(0);
-                if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
-                    // 提取数字部分
-                    String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
-                    item.setDeductibleRate(Integer.parseInt(deductibleRate));
-                }
-                break;
-
-            case "MJ2": // 附加绝对免赔率特约条款(三者险)
-                item.setKindCode("FB");
-                item.setKindName("附加绝对免赔率特约险(机动车第三者责任保险)");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(0);
-                if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
-                    String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
-                    item.setDeductibleRate(Integer.parseInt(deductibleRate));
-                }
-                break;
-
-            case "MJ3": // 附加绝对免赔率特约险(司机)
-                item.setKindCode("FD3");
-                item.setKindName("附加绝对免赔率特约险(机动车车上人员责任保险(司机))");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(0);
-                if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
-                    String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
-                    item.setDeductibleRate(Integer.parseInt(deductibleRate));
-                }
-                break;
-
-            case "MJ4": // 附加绝对免赔率特约险(乘客)
-                item.setKindCode("FD4");
-                item.setKindName("附加绝对免赔率特约险(机动车车上人员责任保险(乘客))");
-                item.setRiskCode(RiskCodeEnum.BUSINESS_CODE);
-                item.setAmount(0);
-                if (StringUtils.hasLength(kindItem.getDeductibleRate())) {
-                    String deductibleRate = kindItem.getDeductibleRate().replaceAll("[^0-9]", "");
-                    item.setDeductibleRate(Integer.parseInt(deductibleRate));
-                }
-                break;
-
-            default:
-                // 未知险种代码,返回null
-                return null;
-        }
-
-        return item;
-    }
-
-    /**
-     * 构建附加保单信息列表
-     *
-     * @return List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList>
-     */
-//    private List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> buildCarPolicySubInfoList() {
-//        List<ZiJinCrawlerQuotationRequest.CarPolicySubInfoList> carPolicySubInfoList = new ArrayList<>();
-//
-//        ZiJinCrawlerQuotationRequest.CarPolicySubInfoList carPolicySubInfo1 = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
-//        carPolicySubInfo1.setPlanName("山西9座以内非营业客车驾乘险10万档:36元/座-10万+1万+30元/天");
-//        carPolicySubInfo1.setInsureGradeNo("214000737028");
-//        carPolicySubInfo1.setIsUseInsured("1");
-//        carPolicySubInfo1.setQuantity("1");
-//        carPolicySubInfo1.setRiskCode("0737");
-//        carPolicySubInfo1.setRiskName("驾乘人员人身意外伤害保险");
-//        carPolicySubInfo1.setSumAmount(577000);
-//        carPolicySubInfo1.setSumPremium(180);
-//        carPolicySubInfo1.setActualPremium("180.00");
-//        carPolicySubInfo1.setProductCode("ZKICATM_GRDL_Plan");
-//        carPolicySubInfoList.add(carPolicySubInfo1);
-//        return carPolicySubInfoList;
-//    }
-
-
     /**
      * 构建附加保单信息列表
      *
@@ -1340,12 +1125,11 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
 
         for (AccidentalDrivingVo accidentalDriving : quoteVo.getAccidentalDrivings()) {
             ZiJinCrawlerQuotationRequest.CarPolicySubInfoList carPolicySubInfo = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
+            carPolicySubInfo.setInsureGradeNo(accidentalDriving.getProductCode());
+            carPolicySubInfo.setProductCode(accidentalDriving.getProductCode());
             carPolicySubInfo.setPlanName(accidentalDriving.getProductName());
-            carPolicySubInfo.setInsureGradeNo("200000736004"); // 前端没传
-            carPolicySubInfo.setProductCode(accidentalDriving.getProductCode());// 这个值前端传过来的是乱码200000736004%%0736%%%0
-            carPolicySubInfo.setPlanName(accidentalDriving.getProductName());
-            carPolicySubInfo.setRiskCode(accidentalDriving.getRiskCode()); // 完了要调整编码,是否要转换
-            carPolicySubInfo.setRiskName(accidentalDriving.getProductName()); // 前端没传
+            carPolicySubInfo.setRiskCode(accidentalDriving.getRiskCode());
+            carPolicySubInfo.setRiskName(accidentalDriving.getProductName());
             carPolicySubInfo.setSumAmount(ObjectUtils.isEmpty(accidentalDriving.getSumAmount()) ? 0 : (int) Double.parseDouble(accidentalDriving.getSumAmount()));
             carPolicySubInfo.setQuantity(accidentalDriving.getQuantity() == 0 ? "0" : String.valueOf(accidentalDriving.getQuantity()));
             carPolicySubInfo.setIsUseInsured("1");
@@ -1355,67 +1139,6 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
         return carPolicySubInfoList;
     }
 
-    /**
-     * 构建紫金驾驶人意外伤害保险(riskCode=0733)信息
-     *
-     * @param drivingInsurance 驾乘险信息
-     * @return ZiJinCrawlerQuotationRequest.CarPolicySubInfoList
-     */
-    private ZiJinCrawlerQuotationRequest.CarPolicySubInfoList buildRideRisk0733(AccidentalDrivingVo drivingInsurance) {
-        ZiJinCrawlerQuotationRequest.CarPolicySubInfoList subInfo = new ZiJinCrawlerQuotationRequest.CarPolicySubInfoList();
-
-        // 默认值
-        subInfo.setPlanName("全国家用驾驶人意外险50万档:160元-50万+5万+150元/天");
-        subInfo.setInsureGradeNo("200000733009");
-        subInfo.setIsUseInsured("1");
-        subInfo.setQuantity("1");
-        subInfo.setRiskCode("0733");
-        subInfo.setRiskName("紫金驾驶人意外伤害保险");
-        subInfo.setSumAmount(577000);
-        subInfo.setSumPremium(160);
-        subInfo.setProductCode("ZKICATM_Driver_Plan_Common");
-
-        // 根据 planId(这里用 productCode 代替)匹配具体计划
-        String planId = drivingInsurance.getProductCode();
-        if (StringUtils.hasLength(planId)) {
-            switch (planId) {
-                case "214000733008":
-                    subInfo.setPlanName("山西驾驶20座(不含)以下非营业型客车(不包括摩托车、拖拉机、农用运输车、电瓶车)2.5万档:25元/车-2.5万+2500元");
-                    subInfo.setInsureGradeNo("214000733008");
-                    subInfo.setSumAmount(27500);
-                    subInfo.setSumPremium(25);
-                    break;
-                case "200000733007":
-                    subInfo.setPlanName("全国家用驾驶人意外险30万档:120元-30万+3万+100元/天");
-                    subInfo.setInsureGradeNo("200000733007");
-                    subInfo.setSumAmount(348000);
-                    subInfo.setSumPremium(120);
-                    break;
-                case "200000733009":
-                    // 默认值就是这个计划,无需修改
-                    break;
-                case "214000733004":
-                    subInfo.setPlanName("太原驾驶人意外险5万档:50元-5万+0.5万");
-                    subInfo.setInsureGradeNo("214000733004");
-                    subInfo.setSumAmount(55000);
-                    subInfo.setSumPremium(2607);
-                    break;
-                // 其他计划可以继续添加
-                default:
-                    // 使用默认值
-                    break;
-            }
-        }
-
-        // 设置实际保费
-        if (subInfo.getSumPremium() != null) {
-            subInfo.setActualPremium(String.format("%.2f", subInfo.getSumPremium().doubleValue()));
-        }
-
-        return subInfo;
-    }
-
-
     /**
      * 构建车辆信息对象
      *

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/entity/dto/CalRes.java

@@ -25,5 +25,8 @@ public class CalRes implements Serializable {
     @Schema(description = "结算金额")
     private BigDecimal settlement;
 
+    @Schema(description = "虚增金额")
+    private BigDecimal overinflatedAmount;
+
 
 }

+ 17 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -2319,6 +2319,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         // 一次性查询所有需要修改的记录
         List<InsPlyIncome> incomeList = baseMapper.selectBatchIds(incomeIds);
         if (CollUtil.isEmpty(incomeList)) {
+            log.info("未找到需要修改的应收订单. incomeList=[{}]", JSONUtil.toJsonStr(incomeList));
             throw new ServiceException("未找到需要修改的应收订单");
         }
 
@@ -2344,6 +2345,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             BigDecimal taxRate = taxRateMap.getOrDefault(income.getOrderNo(), BigDecimal.ONE);
             InsPlyIncome updateIncome = new InsPlyIncome();
             updateIncome.setId(income.getId());
+            // 因为 实体对象的settlementStatus设置了初始默认值0, 为了避免已经结算的数据被调整未未结算, 这里将settlementStatus设置为null 2026-6-24 14:33:47
+            updateIncome.setSettlementStatus(null);
+            // 根据income的order_no查询inss_fee_order
+            List<InsFeeOrders> insFeeOrderByOrderNo = insFeeOrdersClient.getInsFeeOrderByOrderNo(income.getOrderNo());
+            if (CollUtil.isNotEmpty(insFeeOrderByOrderNo)){
+                InsFeeOrders insFeeOrders = CollUtil.getFirst(insFeeOrderByOrderNo);
+                income.setInsFeeOrders(insFeeOrders);
+            }
 
             boolean hasUpdate = false;
             String updateFlag = batchModifyVo.getUpdateFlag();
@@ -3298,7 +3307,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     @Override
     public String exportPlatFormReceivable(ReceivableQueryVo receivableQueryVo) {
         receivableQueryVo.setSystemCode(baseController.getSystemCode());
+
         List<InsPlyIncome> receivableList = baseMapper.getReceivableList(receivableQueryVo);
+        receivableList = this.fillOtherInfo(receivableList);
 
         // 调用动态导出
         return exportBaseService.upLoadFile(
@@ -3630,6 +3641,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         List<CalRes> calRes;
         calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(1, 3), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> sxfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
+        Map<String, BigDecimal> sxfOverinflatedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getOverinflatedAmount, (o1,o2)->o1));
         calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(2, 4), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> gdfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
 
@@ -3645,6 +3657,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             CompanySuperviseSettlementReportDto companySuperviseSettlementReportDto = companyMap.get(companyId);
             BigDecimal sxf = sxfInvoicedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setSxfInvoicedAmount(Objects.toString(sxf,BigDecimal.ZERO+""));
+            BigDecimal sxfOverinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
+            companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(sxfOverinflatedAmount,BigDecimal.ZERO+""));
             BigDecimal gdf = gdfInvoicedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setGdfInvoicedAmount(Objects.toString(gdf,BigDecimal.ZERO+""));
             // 平台就没有未结算的,只要结算就是已结算的
@@ -3658,8 +3672,10 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
 
             BigDecimal sxfS = sxfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             BigDecimal gdfS = gdfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
+            BigDecimal overinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setSxfSettledAmount(Objects.toString(sxfS, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setSxfUnSettledAmount(BigDecimalUtil.subtract(sxf,sxfS).toString());
+            companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(overinflatedAmount, BigDecimal.ZERO+""));
 
             companySuperviseSettlementReportDto.setGdfSettledAmount(Objects.toString(gdfS, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setGdfUnSettledAmount(BigDecimalUtil.subtract(gdf,gdfS).toString());
@@ -3781,6 +3797,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             tree.putExtra("sxfUnSettledAmount",dto.getSxfUnSettledAmount());
             tree.putExtra("gdfSettledAmount",dto.getGdfSettledAmount());
             tree.putExtra("gdfUnSettledAmount",dto.getGdfUnSettledAmount());
+            tree.putExtra("totalOverinflatedAmount",dto.getTotalOverinflatedAmount());
         });
         log.info("树形结构构建:一级数据[{}]个", CollUtil.size(build));
         return build;

+ 101 - 71
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -405,79 +405,101 @@
         ORDER BY ipi.create_time DESC
     </select>
 
-
     <select id="getReceivableList" resultType="com.jzg.commons.entity.finance.po.InsPlyIncome">
-        SELECT
-        *,
-        (COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  + COALESCE(ipi.jy_receivable_premium,0) ) as receivableAmount,  -- 总应收金额
-        (COALESCE(ipi.jq_supervise_costs_premiums,0)  + COALESCE(ipi.sy_supervise_costs_premiums,0)  + COALESCE(ipi.jy_supervise_costs_premiums,0)) as superviseCostsPremiums, -- 总应收手续费
-        iocui.name AS insuredPerson,
-        ior1.start_date as jqStartDate,
-        ior2.start_date as syStartDate,
-        io.product_name AS productName,
-        iop.jq_policy_no,
-        iop.sy_policy_no,
-        iop.jy_policy_no
-        FROM
-        ins_ply_income ipi
-        LEFT JOIN ins_orders io ON ipi.order_no = io.id AND io.is_delete = 0
-        LEFT JOIN ins_orders_car_user_info iocui ON ipi.order_no = iocui.order_no and iocui.policy_person_type = '3' AND iocui.is_delete = 0
-        LEFT JOIN ins_orders_risk ior1 ON ipi.order_no = ior1.order_no and ior1.risk_code = '0507' AND ior1.is_delete = 0
-        LEFT JOIN ins_orders_risk ior2 ON ipi.order_no = ior2.order_no and ior2.risk_code = '0510' AND ior2.is_delete = 0
-        LEFT JOIN ins_orders_policy iop ON ipi.order_no = iop.order_no AND iop.is_delete = 0
-        <where>
-            ipi.is_delete  = 0
-            AND ipi.settlement_status = '0'
-            AND ipi.system_code = #{receivableQueryVo.systemCode}
-            <if test="receivableQueryVo.queryType != null and receivableQueryVo.queryType == 1">
-                AND ipi.supervise_settlement = 0
-            </if>
-            <if test="receivableQueryVo.queryType!= null and receivableQueryVo.queryType == 2">
-                AND ipi.other_settlement = 1
-            </if>
-            <if test="receivableQueryVo.queryType!= null and (receivableQueryVo.queryType == 3 or receivableQueryVo.queryType == 4)">
-                AND ipi.jy_premium != 0
-            </if>
-            <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">
-                AND ipi.license_no LIKE CONCAT('%', #{receivableQueryVo.licenseNo}, '%')
-            </if>
-            <if test="receivableQueryVo.companyId != null and receivableQueryVo.companyId != ''">
-                AND ipi.company_id = #{receivableQueryVo.companyId}
-            </if>
-            <if test="receivableQueryVo.orderNo != null and receivableQueryVo.orderNo != ''">
-                AND ipi.order_no = #{receivableQueryVo.orderNo}
-            </if>
-            <if test="receivableQueryVo.ids != null and receivableQueryVo.ids != ''">
-                AND ipi.id IN
-                <foreach collection="receivableQueryVo.ids" item="id" open="(" separator="," close=")">
-                    #{id}
-                </foreach>
-            </if>
-            <if test="receivableQueryVo.orderNos != null and receivableQueryVo.orderNos != ''">
-                AND ipi.order_no IN
-                <foreach collection="receivableQueryVo.orderNos" item="orderNo" open="(" separator="," close=")">
-                    #{orderNo}
-                </foreach>
-            </if>
-            <if test="receivableQueryVo.agreementId != null and receivableQueryVo.agreementId != ''">
-                AND ipi.agreement_id = #{receivableQueryVo.agreementId}
-            </if>
-            <if test="receivableQueryVo.deptId != null and receivableQueryVo.deptId != ''">
-                AND ipi.dept_id = #{receivableQueryVo.deptId}
-            </if>
-            <if test="receivableQueryVo.productId!= null and receivableQueryVo.productId!= ''">
-                AND ipi.product_id = #{receivableQueryVo.productId}
-            </if>
-            <if test="receivableQueryVo.signingTimeStart != null and receivableQueryVo.signingTimeStart != ''">
-                AND ipi.signing_time between #{receivableQueryVo.signingTimeStart} and  #{receivableQueryVo.signingTimeEnd}
-            </if>
-            <if test="receivableQueryVo.agreementType != null and receivableQueryVo.agreementType != ''">
-                AND ipi.agreement_type = #{receivableQueryVo.agreementType}
-            </if>
-        </where>
+        <include refid="query"/>
+        and ipi.system_code = #{receivableQueryVo.systemCode}
+        <if test="receivableQueryVo.invoiceId != null and receivableQueryVo.invoiceId != ''" >
+            AND ipi.id  in (
+            select ipiil.income_id  from ins_ply_income_invoice_link ipiil where ipiil.invoice_id  = #{receivableQueryVo.invoiceId} and ipiil.is_delete = 0
+            )
+        </if>
+        <if test="receivableQueryVo.typeAttr != null and receivableQueryVo.typeAttr != ''">
+            AND io.real_quote_user_id  in (select su.username  from sys_user_jzg_info_salesman sujis
+            left join sys_user_jzg_info suji on sujis.sys_user_jzg_info_id = suji.id and suji.is_delete = 0
+            left join sys_user su on su.id = suji.user_id and su.is_delete = 0
+            where sujis.type_attr =#{receivableQueryVo.typeAttr})
+        </if>
+        <if test = "receivableQueryVo.agreementType != null and receivableQueryVo.agreementType != ''">
+            AND ipi.agreement_type = #{receivableQueryVo.agreementType}
+        </if>
+        <if test = "receivableQueryVo.ids != null and receivableQueryVo.ids.size > 0">
+            AND ipi.id in
+            <foreach collection="receivableQueryVo.ids" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+        <if test="receivableQueryVo.queryType != null and receivableQueryVo.queryType == 1">
+            AND ipi.supervise_settlement = 0
+        </if>
+        <if test="receivableQueryVo.queryType!= null and receivableQueryVo.queryType == 2">
+            AND ipi.other_settlement = 0
+        </if>
+        <if test="receivableQueryVo.queryType!= null and (receivableQueryVo.queryType == 3 or receivableQueryVo.queryType == 4)">
+            AND ipi.jy_premium != 0
+            AND ipi.jy_supervise_settlement = 0
+            AND ipi.jy_other_settlement = 0
+        </if>
+        <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">
+            AND ipi.license_no LIKE CONCAT('%', #{receivableQueryVo.licenseNo}, '%')
+        </if>
+        <if test="receivableQueryVo.companyId != null and receivableQueryVo.companyId != ''">
+            AND ipi.company_id = #{receivableQueryVo.companyId}
+        </if>
+        <if test="receivableQueryVo.businessSource != null and receivableQueryVo.businessSource != ''">
+            AND ipi.business_source = #{receivableQueryVo.businessSource}
+        </if>
+        <if test="receivableQueryVo.settlementStatus != null and receivableQueryVo.settlementStatus != ''">
+            AND ipi.settlement_status = #{receivableQueryVo.settlementStatus}
+        </if>
+        <if test="receivableQueryVo.addType != null and receivableQueryVo.addType != ''">
+            AND ipi.add_type = #{receivableQueryVo.addType}
+        </if>
+        <if test="receivableQueryVo.orderNo != null and receivableQueryVo.orderNo != ''">
+            AND ipi.order_no = #{receivableQueryVo.orderNo}
+        </if>
+        <if test="receivableQueryVo.agreementId != null and receivableQueryVo.agreementId != ''">
+            AND ipi.agreement_id = #{receivableQueryVo.agreementId}
+        </if>
+        <if test="receivableQueryVo.deptId != null and receivableQueryVo.deptId != ''">
+            AND ipi.dept_id = #{receivableQueryVo.deptId}
+        </if>
+        <if test="receivableQueryVo.productId!= null and receivableQueryVo.productId!= ''">
+            AND ipi.product_id = #{receivableQueryVo.productId}
+        </if>
+        <if test="receivableQueryVo.signingTimeStart != null and receivableQueryVo.signingTimeStart != ''">
+            AND ipi.signing_time between #{receivableQueryVo.signingTimeStart} and  #{receivableQueryVo.signingTimeEnd}
+        </if>
+        <if test="receivableQueryVo.insuredName != null and receivableQueryVo.insuredName != ''">
+            AND iocui.name = #{receivableQueryVo.insuredName}
+        </if>
+        <if test="receivableQueryVo.orderType != null and receivableQueryVo.orderType != ''">
+            AND io.entry_status = #{receivableQueryVo.orderType}
+        </if>
+        <if test="receivableQueryVo.productName != null and receivableQueryVo.productName != ''">
+            AND io.product_name = #{receivableQueryVo.productName}
+        </if>
+        <if test="receivableQueryVo.jqPolicyNo != null and receivableQueryVo.jqPolicyNo != ''">
+            AND iop.jq_policy_no = #{receivableQueryVo.jqPolicyNo}
+        </if>
+        <if test="receivableQueryVo.syPolicyNo != null and receivableQueryVo.syPolicyNo != ''">
+            AND iop.sy_policy_no = #{receivableQueryVo.syPolicyNo}
+        </if>
+        <if test="receivableQueryVo.jyPolicyNo != null and receivableQueryVo.jyPolicyNo != ''">
+            AND iop.jy_policy_no = #{receivableQueryVo.jyPolicyNo}
+        </if>
+        <if test="receivableQueryVo.dockingPerson != null and receivableQueryVo.dockingPerson != ''">
+            AND io.docking_person = #{receivableQueryVo.dockingPerson}
+        </if>
+        <if test="receivableQueryVo.jqStartDate != null and receivableQueryVo.jqStartDate != ''">
+            AND ior1.start_date between #{receivableQueryVo.jqStartDate} and  #{receivableQueryVo.jqEndDate}
+        </if>
+        <if test="receivableQueryVo.syStartDate != null and receivableQueryVo.syStartDate != ''">
+            AND ior2.start_date between #{receivableQueryVo.syStartDate} and  #{receivableQueryVo.syStartDate}
+        </if>
         ORDER BY ipi.create_time DESC
     </select>
 
+
     <select id="getSuperviseJyExcelDtos" resultType="com.jzg.commons.entity.finance.dto.ExportSuperviseJyExcelDto">
         SELECT
         ipi.signing_time as signingTime,
@@ -1693,6 +1715,12 @@
             <if test="vo.agreementType != null and vo.agreementType != ''">
                 AND ipi.agreement_type = #{vo.agreementType}
             </if>
+            <if test="vo.signingStartTime != null and vo.signingStartTime != '' and vo.signingEndTime != null and vo.signingEndTime != ''">
+                AND DATE(ipi.signing_time) between #{vo.signingStartTime} and #{vo.signingEndTime}
+            </if>
+            <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
+                AND DATE(ipi.create_time) between #{vo.startTime} and #{vo.endTime}
+            </if>
         </where>
         group by
         eic.parent_id,
@@ -1704,12 +1732,14 @@
     <select id="queryInvoicedAmount" resultType="com.jzg.organization.entity.dto.CalRes">
         select
         a.company_id as companyId,
-        sum(a.amount) as amount
+        sum(a.amount) as amount,
+        sum(a.overinflatedAmount) as overinflatedAmount
         from
         (
         select
         ipii.company_id,
-        COALESCE(ipii.receivable_supervise_premium) as amount
+        COALESCE(ipii.receivable_supervise_premium) as amount,
+        COALESCE(ipii.overinflated_amount) as overinflatedAmount
         from
         ins_ply_income_invoice ipii
         where