Sfoglia il codice sorgente

Merge branch 'master' into wrq_dev

wangrq 3 mesi fa
parent
commit
51ee5750ed
17 ha cambiato i file con 1183 aggiunte e 962 eliminazioni
  1. 7 0
      commons/src/main/java/com/jzg/commons/entity/finance/dto/ExportSuperviseSettlementDetailExcelDto.java
  2. 5 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/base/OrderBase.java
  3. 3 0
      commons/src/main/java/com/jzg/commons/entity/vo/IncomeAndExpenseVo.java
  4. 23 7
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerCalculationRequest.java
  5. 1 1
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java
  6. 0 0
      tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/utils/HengBangAESUtil.java
  7. 749 896
      tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java
  8. 64 0
      tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/component/RenBaoNewCrawlerRequestComponent.java
  9. 16 1
      tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/constant/enums/RequestUrl.java
  10. 7 7
      tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestBuilder.java
  11. 253 3
      tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestImpl.java
  12. 1 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/classifier/impl/PassengerCarClassifier.java
  13. 1 1
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/service/Impl/ZhongMeiCrawlerRequestImpl.java
  14. 8 8
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java
  15. 5 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  16. 3 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java
  17. 37 37
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/finance/dto/ExportSuperviseSettlementDetailExcelDto.java

@@ -105,4 +105,11 @@ public class ExportSuperviseSettlementDetailExcelDto {
     @ExcelProperty(value = "结算时间")
     @ExcelProperty(value = "结算时间")
     private LocalDateTime settlementTime;
     private LocalDateTime settlementTime;
 
 
+    @Schema(description = "对接人")
+    @ExcelProperty(value = "对接人")
+    private String contactPerson;
+
+    @Schema(description = "对接人手机号")
+    @ExcelProperty(value = "对接人手机号")
+    private  String contactPersonPhone;
 }
 }

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/base/OrderBase.java

@@ -31,6 +31,11 @@ public class OrderBase implements Serializable {
      */
      */
     private String quoteNo;
     private String quoteNo;
 
 
+    /**
+     * 订单来源 0 pc  1 app
+     */
+    private String orderSource;
+
     /**
     /**
      * 保司订单号
      * 保司订单号
      */
      */

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/vo/IncomeAndExpenseVo.java

@@ -50,5 +50,8 @@ public class IncomeAndExpenseVo {
 
 
         @Schema(description = "审核状态 0-待审核 1-审核通过 2-审核驳回")
         @Schema(description = "审核状态 0-待审核 1-审核通过 2-审核驳回")
         private String status;
         private String status;
+
+        @Schema(description = "银行名称")
+        private String bankName;
     }
     }
 }
 }

+ 23 - 7
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/entity/request/HbCrawlerCalculationRequest.java

@@ -77,7 +77,7 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
     @Serial
     @Serial
     private static final long serialVersionUID = -6130320344004620564L;
     private static final long serialVersionUID = -6130320344004620564L;
 
 
-    public HbCrawlerCalculationRequest(QuoteVo quoteVo, String plyappno) {
+    public HbCrawlerCalculationRequest(QuoteVo quoteVo, String plyappno, String depreciationPrice) {
         this.clauseType = "2";
         this.clauseType = "2";
         List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
         List<KindInfoVo> kindInfoVoList = quoteVo.getKindInfoVo();
         this.risktype = "0";
         this.risktype = "0";
@@ -88,12 +88,11 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
             this.risktype = "1";
             this.risktype = "1";
         }
         }
         if (CollUtil.isNotEmpty(kindInfoVoList)) {
         if (CollUtil.isNotEmpty(kindInfoVoList)) {
-            this.epersonliabilityList = getEpersonliabilityList(kindInfoVoList);
+            this.epersonliabilityList = getEpersonliabilityList(kindInfoVoList, depreciationPrice);
             this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
             this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
             this.begintimeAccident = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
             this.begintimeAccident = DateUtil.toUtcDateTime(quoteVo.getBiRiskInfoVo().getStartDate());
             this.risktype = "2";
             this.risktype = "2";
         } else {
         } else {
-//            this.begintimeBi = DateUtil.toUtcDateTime(quoteVo.getCiRiskInfoVo().getStartDate());
             this.epersonliabilityList = new ArrayList<>();
             this.epersonliabilityList = new ArrayList<>();
         }
         }
         this.plyappno = plyappno;
         this.plyappno = plyappno;
@@ -107,18 +106,34 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
         this.effectfLag = null;
         this.effectfLag = null;
         this.ecarChargingPosts = new ArrayList<>();
         this.ecarChargingPosts = new ArrayList<>();
         this.carInsureDevices = new ArrayList<>();
         this.carInsureDevices = new ArrayList<>();
+        this.outofwarrantytype = "N";
+        this.drivingtype = "";
+        this.endtimeAccident = "";
         this.accidentInsuranceList = getAccidentInsuranceList(quoteVo.getBiRiskInfoVo(), quoteVo.getAccidentalDrivings());
         this.accidentInsuranceList = getAccidentInsuranceList(quoteVo.getBiRiskInfoVo(), quoteVo.getAccidentalDrivings());
     }
     }
 
 
-    public List<EpersonliabilityDTO> getEpersonliabilityList(List<KindInfoVo> kindInfoVoList) {
+    public List<EpersonliabilityDTO> getEpersonliabilityList(List<KindInfoVo> kindInfoVoList, String depreciationPrice) {
         List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
         List<EpersonliabilityDTO> epersonliabilityDTOList = new ArrayList<>();
         for (KindInfoVo kindInfoVo : kindInfoVoList) {
         for (KindInfoVo kindInfoVo : kindInfoVoList) {
             EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();
             EpersonliabilityDTO epersonliabilityDTO = new EpersonliabilityDTO();
             epersonliabilityDTO.setKindcode(kindInfoVo.getKindCode());
             epersonliabilityDTO.setKindcode(kindInfoVo.getKindCode());
             epersonliabilityDTO.setLiabname(kindInfoVo.getKindName());
             epersonliabilityDTO.setLiabname(kindInfoVo.getKindName());
-            epersonliabilityDTO.setLiabamt(kindInfoVo.getAmount());
-            epersonliabilityDTO.setQuantity(kindInfoVo.getQuantity());
-            epersonliabilityDTO.setUnitAmount(kindInfoVo.getUnitAmount());
+            // kindcode "101"(机动车损失保险)的保额必须使用车辆折旧价(实际价值),
+            // 否则保司会校验"协商价格范围建议在实际价值上下30%浮动"并拒绝
+            if ("101".equals(kindInfoVo.getKindCode()) && depreciationPrice != null) {
+                epersonliabilityDTO.setLiabamt(depreciationPrice);
+                epersonliabilityDTO.setUnitAmount(depreciationPrice);
+            } else if (!"116".equals(kindInfoVo.getKindCode())) {
+                // kindcode "116"不需要liabamt和unitAmount
+                epersonliabilityDTO.setLiabamt(kindInfoVo.getAmount());
+                epersonliabilityDTO.setUnitAmount(kindInfoVo.getUnitAmount());
+            }
+            if ("116".equals(kindInfoVo.getKindCode())) {
+                // 道路救援服务特约条款:只需要serviceTimes字段
+                epersonliabilityDTO.setServiceTimes(kindInfoVo.getServiceTimes() != null ? kindInfoVo.getServiceTimes() : "2");
+            } else {
+                epersonliabilityDTO.setQuantity(kindInfoVo.getQuantity() != null ? kindInfoVo.getQuantity() : "4");
+            }
             epersonliabilityDTOList.add(epersonliabilityDTO);
             epersonliabilityDTOList.add(epersonliabilityDTO);
         }
         }
         return epersonliabilityDTOList;
         return epersonliabilityDTOList;
@@ -300,6 +315,7 @@ public class HbCrawlerCalculationRequest extends HbBaseRequest {
         private String liabname;
         private String liabname;
         private String model = "0";
         private String model = "0";
         private String quantity;
         private String quantity;
+        private String serviceTimes;
         private String unitAmount;
         private String unitAmount;
     }
     }
 
 

+ 1 - 1
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java

@@ -148,7 +148,7 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
         HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest = new HbCrawlerQuoteimmediatelyRequest(quoteVo, salesInfo, depreciationPrice, parameters, contentDTO);
         HbCrawlerQuoteimmediatelyRequest quoteimmediatelyRequest = new HbCrawlerQuoteimmediatelyRequest(quoteVo, salesInfo, depreciationPrice, parameters, contentDTO);
         String plyappno = hbCrawlerRequestComponent.quoteImmediately(quoteimmediatelyRequest, headers);
         String plyappno = hbCrawlerRequestComponent.quoteImmediately(quoteimmediatelyRequest, headers);
         // 5.1 报价第二步,提交报价数据,返回是否重复投保,脱保等提示信息,用于页面展示
         // 5.1 报价第二步,提交报价数据,返回是否重复投保,脱保等提示信息,用于页面展示
-        HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno);
+        HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno, depreciationPrice);
         // 非车信息匹配核心
         // 非车信息匹配核心
         matchingAccident(quoteVo, headers, plyappno, calculationRequest);
         matchingAccident(quoteVo, headers, plyappno, calculationRequest);
         String resJson = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
         String resJson = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);

File diff suppressed because it is too large
+ 0 - 0
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/utils/HengBangAESUtil.java


File diff suppressed because it is too large
+ 749 - 896
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java


+ 64 - 0
tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/component/RenBaoNewCrawlerRequestComponent.java

@@ -1006,6 +1006,70 @@ public class RenBaoNewCrawlerRequestComponent {
         return requestComponent.formData(url, parts, String.class, headers);
         return requestComponent.formData(url, parts, String.class, headers);
     }
     }
 
 
+    /**
+     * 获取滑块验证信息
+     *
+     * <p>对应Python的get_spilder方法,获取滑块拼图图片和验证参数</p>
+     *
+     * @param headers 请求头
+     * @return 滑块信息(包含jigsawImageBase64、originalImageBase64、secretKey、token)
+     */
+    public Map<String, Object> getSpilder(HttpHeaders headers) {
+        String url = buildUrl(RequestUrl.SPILDER_GET.getUrl());
+
+        Map<String, Object> requestData = new HashMap<>();
+        requestData.put("captchaType", "blockPuzzle");
+        requestData.put("clientUid", "slider-" + java.util.UUID.randomUUID().toString());
+        requestData.put("ts", System.currentTimeMillis());
+
+        log.info("获取滑块验证信息");
+        ResponseEntity<String> responseEntity = requestComponent.stringPost(url, requestData, String.class, headers);
+        return JSON.parseObject(responseEntity.getBody(), new TypeReference<Map<String, Object>>() {});
+    }
+
+    /**
+     * 校验滑块验证
+     *
+     * <p>对应Python的check_spilder方法,提交滑块验证结果</p>
+     *
+     * @param data 滑块验证数据(包含captchaType、pointJson、token)
+     * @param headers 请求头
+     * @return 校验结果
+     */
+    public Map<String, Object> checkSpilder(Map<String, Object> data, HttpHeaders headers) {
+        String url = buildUrl(RequestUrl.SPILDER_CHECK.getUrl());
+
+        log.info("提交滑块验证结果");
+        ResponseEntity<String> responseEntity = requestComponent.stringPost(url, data, String.class, headers);
+        return JSON.parseObject(responseEntity.getBody(), new TypeReference<Map<String, Object>>() {});
+    }
+
+    /**
+     * 滑块二次验证接口
+     *
+     * <p>对应Python的verify_spilder方法,滑块初步验证通过后需要二次验证</p>
+     *
+     * @param data 验证数据(包含captchaVerification)
+     * @param validate0 来自报价响应的statusText
+     * @param validate1 触发滑块的接口路径
+     * @param headers 请求头
+     * @return 验证结果
+     */
+    public Map<String, Object> verifySpilder(Map<String, Object> data, String validate0, String validate1,
+                                            HttpHeaders headers) {
+        String url = buildUrl(RequestUrl.SPILDER_VERIFY.getUrl());
+
+        // 对应Python: headers2 = self.headers.copy(); headers2['validate0'] = validate0; headers2['validate1'] = validate1
+        HttpHeaders verifyHeaders = new HttpHeaders();
+        verifyHeaders.addAll(headers);
+        verifyHeaders.set("validate0", validate0);
+        verifyHeaders.set("validate1", validate1);
+
+        log.info("滑块二次验证: validate0={}, validate1={}", validate0, validate1);
+        ResponseEntity<String> responseEntity = requestComponent.stringPost(url, data, String.class, verifyHeaders);
+        return JSON.parseObject(responseEntity.getBody(), new TypeReference<Map<String, Object>>() {});
+    }
+
     /**
     /**
      * 查询投保单信息(获取评分)
      * 查询投保单信息(获取评分)
      *
      *

+ 16 - 1
tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/constant/enums/RequestUrl.java

@@ -135,7 +135,22 @@ public enum RequestUrl {
     /**
     /**
      * 查询投保单信息接口(获取评分)
      * 查询投保单信息接口(获取评分)
      */
      */
-    QUERY_PROPOSAL_INFO("/front/019K0000003/ipdi/queryProposalInfo");
+    QUERY_PROPOSAL_INFO("/front/019K0000003/ipdi/queryProposalInfo"),
+
+    /**
+     * 获取滑块验证信息接口
+     */
+    SPILDER_GET("/front/019K0000003/spilder/get"),
+
+    /**
+     * 滑块验证校验接口
+     */
+    SPILDER_CHECK("/front/019K0000003/spilder/check"),
+
+    /**
+     * 滑块验证二次校验接口
+     */
+    SPILDER_VERIFY("/front/019K0000003/spilder/verify");
 
 
     /**
     /**
      * 接口URL路径
      * 接口URL路径

+ 7 - 7
tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestBuilder.java

@@ -3102,10 +3102,10 @@ public class RenBaoNewCrawlerRequestBuilder {
         carShipTax.put("prePolicyEndDate", "");
         carShipTax.put("prePolicyEndDate", "");
 
 
         // ========== 税款金额 ==========
         // ========== 税款金额 ==========
-        carShipTax.put("thisPayTax", "");
-        carShipTax.put("prePayTax", "");
-        carShipTax.put("delayPayTax", "");
-        carShipTax.put("sumPayTax", "");
+        carShipTax.put("thisPayTax", "300.00");
+        carShipTax.put("prePayTax", "0.00");
+        carShipTax.put("delayPayTax", "0.00");
+        carShipTax.put("sumPayTax", "300.00");
         carShipTax.put("sumRefundTax", "");
         carShipTax.put("sumRefundTax", "");
         carShipTax.put("taxUnitAmount", "");
         carShipTax.put("taxUnitAmount", "");
         carShipTax.put("taxUnit", "");
         carShipTax.put("taxUnit", "");
@@ -3114,9 +3114,9 @@ public class RenBaoNewCrawlerRequestBuilder {
         carShipTax.put("payEndDate", "");
         carShipTax.put("payEndDate", "");
 
 
         // ========== 禁用标志 - req2.json 为空字符串 ==========
         // ========== 禁用标志 - req2.json 为空字符串 ==========
-        carShipTax.put("disableThisPayTax", "");
-        carShipTax.put("disablePrePayTax", "");
-        carShipTax.put("disableDelayPayTax", "");
+        carShipTax.put("disableThisPayTax", true);
+        carShipTax.put("disablePrePayTax", true);
+        carShipTax.put("disableDelayPayTax", true);
 
 
         // ========== 显示标志 ==========
         // ========== 显示标志 ==========
         carShipTax.put("jeShow", false);
         carShipTax.put("jeShow", false);

+ 253 - 3
tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestImpl.java

@@ -7,6 +7,7 @@ import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.commons.util.AESUtils;
 import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
 import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.quotation.commons.entity.DetectLoginRequest;
 import com.jzg.quotation.commons.entity.DetectLoginRequest;
@@ -30,13 +31,18 @@ import org.redisson.api.RMap;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Objects;
+import java.util.UUID;
 
 
 /**
 /**
  * 人保车险爬虫服务实现 * 
  * 人保车险爬虫服务实现 * 
@@ -149,9 +155,36 @@ public class RenBaoNewCrawlerRequestImpl implements RenBaoNewCrawlerRequest {
                                                         LoginInfoBO loginInfo, String username) {
                                                         LoginInfoBO loginInfo, String username) {
         int modelCodeRetryCount = 0;
         int modelCodeRetryCount = 0;
         int duplicateInsuranceRetryCount = 0;
         int duplicateInsuranceRetryCount = 0;
+        int hkcs = 0; // 滑块风控重试计数器
         for (int retry = 0; retry < 6; retry++) {
         for (int retry = 0; retry < 6; retry++) {
             RenBaoNewCrawlerQuoteResponse response = requestComponent.quote(request, headers);
             RenBaoNewCrawlerQuoteResponse response = requestComponent.quote(request, headers);
 
 
+            // 判断触发滑块风控
+            if (response.getStatus() != null && response.getStatus() == -2) {
+                boolean passSpilderMainRes = false;
+                // 对应Python: validate0 = caculatePremium_res['statusText']; validate1 = '/bizSave/caculatePremium'
+                String validate0 = response.getStatusText();
+                String validate1 = "/bizSave/caculatePremium";
+                log.error("检测到滑块: statusText={}, {}", validate0, JSONUtil.toJsonStr(response));
+                if (hkcs < 2) {
+                    while (hkcs < 2) {
+                        hkcs++;
+                        passSpilderMainRes = passSpilderMain(headers, username, validate0, validate1);
+                        if (passSpilderMainRes) {
+                            break;
+                        }
+                    }
+                    if (passSpilderMainRes) {
+                        log.info("滑块验证通过,重新发起报价");
+                        continue;
+                    } else {
+                        throw new SystemException("触发滑块风控,未通过,请稍后报价");
+                    }
+                } else {
+                    throw new SystemException("触发滑块风控,未通过,请稍后报价");
+                }
+            }
+
             if (isSuccess(response)) {
             if (isSuccess(response)) {
                 return response;
                 return response;
             }
             }
@@ -463,6 +496,221 @@ public class RenBaoNewCrawlerRequestImpl implements RenBaoNewCrawlerRequest {
         return "未知错误";
         return "未知错误";
     }
     }
 
 
+    /**
+     * 滑块验证主程序(对应Python的pass_spilder_main方法)
+     *
+     * <p>获取滑块图片、计算滑块位置、提交验证,通过后还需二次验证</p>
+     *
+     * @param headers   请求头
+     * @param username  用户名
+     * @param validate0 来自报价响应的statusText(对应Python: caculatePremium_res['statusText'])
+     * @param validate1 触发滑块的接口路径(对应Python: '/bizSave/caculatePremium')
+     * @return true-滑块通过,false-未通过
+     */
+    private boolean passSpilderMain(HttpHeaders headers, String username, String validate0, String validate1) {
+        try {
+            // 1. 获取滑块验证信息(对应Python的get_spilder)
+            Map<String, Object> spilderInfo = requestComponent.getSpilder(headers);
+
+            // 检查响应是否有效
+            if (spilderInfo == null || !spilderInfo.containsKey("repData")) {
+                log.error("获取滑块信息失败: {}", JSONUtil.toJsonStr(spilderInfo));
+                return false;
+            }
+
+            @SuppressWarnings("unchecked")
+            Map<String, Object> repData = (Map<String, Object>) spilderInfo.get("repData");
+            if (repData == null) {
+                log.error("滑块信息repData为空");
+                return false;
+            }
+
+            String jigsawImageBase64 = (String) repData.get("jigsawImageBase64");
+            String originalImageBase64 = (String) repData.get("originalImageBase64");
+            String secretKey = (String) repData.get("secretKey");
+            String token = (String) repData.get("token");
+
+            if (jigsawImageBase64 == null || originalImageBase64 == null
+                    || secretKey == null || token == null) {
+                log.error("滑块信息不完整: jigsaw={}, original={}, secretKey={}, token={}",
+                        jigsawImageBase64 != null, originalImageBase64 != null,
+                        secretKey != null, token != null);
+                return false;
+            }
+
+            // 2. 解码图片
+            byte[] targetBytes = Base64.getDecoder().decode(jigsawImageBase64);
+            byte[] backgroundBytes = Base64.getDecoder().decode(originalImageBase64);
+
+            // 3. 获取背景图宽度
+            BufferedImage backgroundImage = ImageIO.read(new ByteArrayInputStream(backgroundBytes));
+            if (backgroundImage == null) {
+                log.error("无法解码背景图");
+                return false;
+            }
+            int width = backgroundImage.getWidth();
+
+            // 4. 计算滑块X位置(对应Python的get_X)
+            int X = getX(targetBytes, backgroundBytes);
+
+            // 5. 计算归一化坐标(对应Python: t = 320 * t / setSize_imgWidth)
+            double t = 320.0 * X / width;
+            String pointJson = "{\"x\":" + t + ",\"y\":5}";
+
+            // 6. AES加密坐标(对应Python的aes_encrypt)
+            String encryptedPointJson = aesEncryptForSpilder(pointJson, secretKey);
+
+            // 7. 提交滑块验证(对应Python的check_spilder)
+            Map<String, Object> checkData = new HashMap<>();
+            checkData.put("captchaType", "blockPuzzle");
+            checkData.put("pointJson", encryptedPointJson);
+            checkData.put("token", token);
+
+            Map<String, Object> checkResult = requestComponent.checkSpilder(checkData, headers);
+
+            // 8. 判断初步验证结果
+            if (checkResult == null || !"0000".equals(checkResult.get("repCode"))) {
+                String repMsg = checkResult != null ? (String) checkResult.get("repMsg") : "滑块验证失败";
+                log.error("滑块初步验证失败: {}", repMsg);
+                return false;
+            }
+
+            log.info("滑块初步验证通过,进行二次验证");
+
+            // 9. 二次验证(Python新增步骤)
+            // 对应Python: rstoken = check_spilder_res['repData']['token']; captchaVerification = aes_encrypt(rstoken + '---' + point_json, secretKey)
+            @SuppressWarnings("unchecked")
+            Map<String, Object> checkRepData = (Map<String, Object>) checkResult.get("repData");
+            if (checkRepData == null) {
+                log.error("滑块初步验证repData为空");
+                return false;
+            }
+            String rsToken = (String) checkRepData.get("token");
+            if (rsToken == null) {
+                log.error("滑块初步验证返回token为空");
+                return false;
+            }
+            String captchaVerification = aesEncryptForSpilder(rsToken + "---" + pointJson, secretKey);
+
+            Map<String, Object> verifyData = new HashMap<>();
+            verifyData.put("captchaVerification", captchaVerification);
+
+            Map<String, Object> verifyResult = requestComponent.verifySpilder(verifyData, validate0, validate1, headers);
+
+            // 10. 判断二次验证结果(对应Python: verify_spilder_res['repCode'] == '0000')
+            if (verifyResult != null && "0000".equals(verifyResult.get("repCode"))) {
+                log.info("滑块二次验证通过");
+                return true;
+            } else {
+                String repMsg = verifyResult != null ? (String) verifyResult.get("repMsg") : "滑块二次验证失败";
+                log.error("滑块二次验证失败: {}", repMsg);
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("滑块验证异常: {}", e.getMessage(), e);
+            return false;
+        }
+    }
+
+    /**
+     * 计算滑块匹配位置(对应Python的get_X方法,使用模板匹配算法)
+     *
+     * <p>通过比较拼图块与背景图的像素差异,找到拼图块在背景图中的最佳匹配位置</p>
+     *
+     * @param jigsawBytes    拼图块图片字节(带透明通道的滑块图)
+     * @param backgroundBytes 背景图图片字节
+     * @return 滑块X坐标
+     */
+    private int getX(byte[] jigsawBytes, byte[] backgroundBytes) {
+        try {
+            BufferedImage jigsaw = ImageIO.read(new ByteArrayInputStream(jigsawBytes));
+            BufferedImage background = ImageIO.read(new ByteArrayInputStream(backgroundBytes));
+
+            if (jigsaw == null || background == null) {
+                log.warn("无法解码滑块图片,使用默认X=0");
+                return 0;
+            }
+
+            int bgWidth = background.getWidth();
+            int bgHeight = background.getHeight();
+            int jgWidth = jigsaw.getWidth();
+            int jgHeight = jigsaw.getHeight();
+
+            // 搜索范围:只在X方向滑动(滑块验证通常只需要水平匹配)
+            int searchEnd = bgWidth - jgWidth;
+            if (searchEnd <= 0) {
+                return 0;
+            }
+
+            double bestMatch = Double.MAX_VALUE;
+            int bestX = 0;
+
+            // 遍历X方向搜索最佳匹配位置
+            for (int x = 0; x <= searchEnd; x++) {
+                double diff = 0;
+                int count = 0;
+
+                // 比较拼图块非透明像素与背景对应位置的像素差异
+                for (int jx = 0; jx < jgWidth; jx++) {
+                    for (int jy = 0; jy < jgHeight; jy++) {
+                        int jigsawPixel = jigsaw.getRGB(jx, jy);
+                        int jigsawAlpha = (jigsawPixel >> 24) & 0xff;
+
+                        // 只比较非透明的拼图像素
+                        if (jigsawAlpha > 128) {
+                            int bgPixel = background.getRGB(x + jx, jy);
+
+                            int jr = (jigsawPixel >> 16) & 0xff;
+                            int jg = (jigsawPixel >> 8) & 0xff;
+                            int jb = jigsawPixel & 0xff;
+                            int br = (bgPixel >> 16) & 0xff;
+                            int bg = (bgPixel >> 8) & 0xff;
+                            int bb = bgPixel & 0xff;
+
+                            // 使用颜色差异的平方和作为相似度度量
+                            diff += Math.pow(jr - br, 2) + Math.pow(jg - bg, 2) + Math.pow(jb - bb, 2);
+                            count++;
+                        }
+                    }
+                }
+
+                if (count > 0) {
+                    diff /= count;
+                    if (diff < bestMatch) {
+                        bestMatch = diff;
+                        bestX = x;
+                    }
+                }
+            }
+
+            log.info("滑块匹配结果: X={}, diff={}", bestX, bestMatch);
+            return bestX;
+        } catch (Exception e) {
+            log.error("滑块图片匹配异常: {}", e.getMessage(), e);
+            return 0;
+        }
+    }
+
+    /**
+     * AES加密(对应Python的aes_encrypt方法)
+     *
+     * <p>使用AES/ECB/PKCS5Padding模式加密,密钥不足16位时右侧补空格,超出16位截断</p>
+     *
+     * @param plainText 明文
+     * @param key       密钥
+     * @return Base64编码的密文
+     */
+    private String aesEncryptForSpilder(String plainText, String key) {
+        // 确保密钥长度为16字节(对应Python: key.ljust(16)[:16])
+        String paddedKey;
+        if (key.length() < 16) {
+            paddedKey = String.format("%-16s", key);
+        } else {
+            paddedKey = key.substring(0, 16);
+        }
+        return AESUtils.encryptECBPK5Base64(plainText, paddedKey);
+    }
+
     /**
     /**
      * 构建报价结果VO
      * 构建报价结果VO
      *
      *
@@ -543,10 +791,12 @@ public class RenBaoNewCrawlerRequestImpl implements RenBaoNewCrawlerRequest {
                                 costs.setCiPremium(planFee);
                                 costs.setCiPremium(planFee);
                                 totalPremium += fee;
                                 totalPremium += fee;
                             } else if ("RM9".equals(payReason)) {
                             } else if ("RM9".equals(payReason)) {
-                                vvTax = fee;
-                                costs.setVvTax(planFee);
+                                vvTax = vvTax +fee;
+                                totalPremium += fee;
+                            } else if ("RM8".equals(payReason)) {
+                                vvTax = vvTax +fee;
                                 totalPremium += fee;
                                 totalPremium += fee;
-                            } else if (proposalNo != null && proposalNo.contains("DAA")) {
+                            }else if (proposalNo != null && proposalNo.contains("DAA")) {
                                 biPremium += fee;
                                 biPremium += fee;
                                 totalPremium += fee;
                                 totalPremium += fee;
                             } else if (proposalNo != null && proposalNo.contains("DZA")) {
                             } else if (proposalNo != null && proposalNo.contains("DZA")) {

+ 1 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/classifier/impl/PassengerCarClassifier.java

@@ -22,7 +22,7 @@ public class PassengerCarClassifier implements CarKindClassifier {
     @Override
     @Override
     public CarKindDetailIdCode getKind(CarInfoVo car) {
     public CarKindDetailIdCode getKind(CarInfoVo car) {
         int seats = Integer.parseInt(car.getSeatCount());
         int seats = Integer.parseInt(car.getSeatCount());
-        if (seats <= 6) {
+        if (seats < 6) {
             return CarKindDetailIdCode.K01;
             return CarKindDetailIdCode.K01;
         }
         }
         if (seats <= 10) {
         if (seats <= 10) {

+ 1 - 1
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/service/Impl/ZhongMeiCrawlerRequestImpl.java

@@ -198,7 +198,7 @@ public class ZhongMeiCrawlerRequestImpl implements ZhongMeiCrawlerRequest {
                 quotedPriceResponse = zmCrawlerRequestComponent.quotedPrice(quotedPriceRequest);
                 quotedPriceResponse = zmCrawlerRequestComponent.quotedPrice(quotedPriceRequest);
             }
             }
         }
         }
-        if (!quotedPriceResponse.getHead().getReturnCode().equals("0") ) {
+        if (quotedPriceResponse.getHead().getReturnCode().equals("0") ) {
             // 商业险重复投保提示
             // 商业险重复投保提示
             ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO contract =
             ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO contract =
                     quotedPriceResponse.getBussinessMain().getContract().stream()
                     quotedPriceResponse.getBussinessMain().getContract().stream()

+ 8 - 8
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java

@@ -8,20 +8,14 @@ import com.jzg.commons.entity.dto.AgreementRulesAddParam;
 import com.jzg.commons.entity.dto.AgreementRulesEditParam;
 import com.jzg.commons.entity.dto.AgreementRulesEditParam;
 import com.jzg.commons.entity.dto.CostAgreementParam;
 import com.jzg.commons.entity.dto.CostAgreementParam;
 import com.jzg.commons.entity.dto.RulesGroupParam;
 import com.jzg.commons.entity.dto.RulesGroupParam;
-import com.jzg.commons.entity.po.PtlAgreementUndwrtRules;
-import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttr;
-import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
-import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesDictLabal;
+import com.jzg.commons.entity.po.*;
 import com.jzg.commons.entity.vo.AgreementRulesVo;
 import com.jzg.commons.entity.vo.AgreementRulesVo;
 import com.jzg.commons.entity.vo.CostListVo;
 import com.jzg.commons.entity.vo.CostListVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesAttrLinkMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesMapper;
 import com.jzg.organization.mapper.PtlAgreementUndwrtRulesMapper;
-import com.jzg.organization.service.PtlAgreementCostService;
-import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrLinkService;
-import com.jzg.organization.service.PtlAgreementUndwrtRulesAttrService;
-import com.jzg.organization.service.PtlAgreementUndwrtRulesService;
+import com.jzg.organization.service.*;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
@@ -62,6 +56,9 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
     @Autowired
     @Autowired
     private PtlAgreementCostService ptlAgreementCostService;
     private PtlAgreementCostService ptlAgreementCostService;
 
 
+    @Autowired
+    private PtlAgreementService ptlAgreementService;
+
     /**
     /**
      * 协议规则列表
      * 协议规则列表
      *
      *
@@ -352,12 +349,15 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
     @Override
     @Override
     public AgreementRulesVo rulesGet(String ruleId) {
     public AgreementRulesVo rulesGet(String ruleId) {
         PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
         PtlAgreementUndwrtRules rules = baseMapper.selectById(ruleId);
+        PtlAgreement agreement = ptlAgreementService.getById(rules.getAgreementId());
         AgreementRulesVo rulesVo = new AgreementRulesVo();
         AgreementRulesVo rulesVo = new AgreementRulesVo();
         BeanUtils.copyProperties(rules, rulesVo);
         BeanUtils.copyProperties(rules, rulesVo);
 
 
         // 获取费用因子属性(公共逻辑,仅查询一次)
         // 获取费用因子属性(公共逻辑,仅查询一次)
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
         Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
+                .filter(attr -> attr.getCompanyIds().equals("all"))
+                .filter(attr -> attr.getCompanyIds().equals(agreement.getCompanyId()))
                 .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
                 .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
 
 
         // 确定需要处理的规则ID列表
         // 确定需要处理的规则ID列表

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

@@ -3104,6 +3104,11 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             log.info(msg);
             log.info(msg);
             return HttpResult.error(msg, Collections.emptyList());
             return HttpResult.error(msg, Collections.emptyList());
         }
         }
+        // add by lipf, 前端保险公司的查询条件未生效,进行bug修复
+        if(StrUtil.isNotEmpty(queryVo.getCompanyId())){
+            allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream()
+                    .filter(action-> queryVo.getCompanyId().equals(action.getCompanyId())).toList();
+        }
         // 2. 汇总后,计算得到已开票,未开票,已结算,未结算的数据
         // 2. 汇总后,计算得到已开票,未开票,已结算,未结算的数据
         allCompaniesIncomeDatas = this.calStatisAmount(allCompaniesIncomeDatas, queryVo, systemCode);
         allCompaniesIncomeDatas = this.calStatisAmount(allCompaniesIncomeDatas, queryVo, systemCode);
         // 3. 填充保险公司的父级保险公司
         // 3. 填充保险公司的父级保险公司

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java

@@ -294,6 +294,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setCreateTime(auditing.getCreateTime());
             item.setCreateTime(auditing.getCreateTime());
             item.setStatus(auditing.getAuditingStatus().toString());
             item.setStatus(auditing.getAuditingStatus().toString());
             item.setRemark("提现支出");
             item.setRemark("提现支出");
+            item.setBankName(auditing.getBankName());
             allRecords.add(item);
             allRecords.add(item);
         }
         }
         // 处理收入记录
         // 处理收入记录
@@ -305,6 +306,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setStatus(null);
             item.setStatus(null);
             item.setRemark("车险收入");
             item.setRemark("车险收入");
             item.setLicenseNo(insFeeOrders.getLicenseNo());
             item.setLicenseNo(insFeeOrders.getLicenseNo());
+            item.setBankName(null);
             allRecords.add(item);
             allRecords.add(item);
         }
         }
         // 处理分销收入记录
         // 处理分销收入记录
@@ -322,6 +324,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setStatus(null);
             item.setStatus(null);
             item.setRemark("分销收入");
             item.setRemark("分销收入");
             item.setLicenseNo(insFeeOrders.getLicenseNo());
             item.setLicenseNo(insFeeOrders.getLicenseNo());
+            item.setBankName(null);
             allRecords.add(item);
             allRecords.add(item);
         }
         }
         // 排序
         // 排序

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

@@ -462,7 +462,7 @@
         ipi.agreement_name as agreementName,
         ipi.agreement_name as agreementName,
         io.entry_status as entryStatus,
         io.entry_status as entryStatus,
         ipi.license_no as licenseNo,
         ipi.license_no as licenseNo,
-        (ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium) as receivableAmount,
+        (COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  + COALESCE(ipi.jy_receivable_premium,0) ) as receivableAmount,
         io.product_name as productName,
         io.product_name as productName,
         iocui.name AS insuredPerson,
         iocui.name AS insuredPerson,
         ipi.jy_premium as jqPremium,
         ipi.jy_premium as jqPremium,
@@ -728,7 +728,7 @@
     </select>
     </select>
 
 
     <select id="getSuperviseSettlementDetailExcelDtos" resultType="com.jzg.commons.entity.finance.dto.ExportSuperviseSettlementDetailExcelDto">
     <select id="getSuperviseSettlementDetailExcelDtos" resultType="com.jzg.commons.entity.finance.dto.ExportSuperviseSettlementDetailExcelDto">
-        select
+        select ipi.contact_person, ipi.contact_person_phone,
         ipiis.id as settlementId,
         ipiis.id as settlementId,
         ipiis.invoice_id as invoiceId,
         ipiis.invoice_id as invoiceId,
         io.company_name as companyName,
         io.company_name as companyName,
@@ -739,7 +739,7 @@
         ipii.invoice_type as invoiceType,
         ipii.invoice_type as invoiceType,
         ipii.invoice_party as invoiceParty,
         ipii.invoice_party as invoiceParty,
         ipii.tax_point as taxPoint,
         ipii.tax_point as taxPoint,
-        (ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums) as receivableSuperviseCosts,
+        (COALESCE(ipi.jq_supervise_costs_premiums,0)  + COALESCE(ipi.sy_supervise_costs_premiums,0)  + COALESCE(ipi.jy_supervise_costs_premiums,0) ) as receivableSuperviseCosts,
         ipi.jq_premium as jqPremium,
         ipi.jq_premium as jqPremium,
         ipi.jq_supervise_costs_proportion as jqSuperviseCostsProportion,
         ipi.jq_supervise_costs_proportion as jqSuperviseCostsProportion,
         ipi.jq_policy_no as jqPolicyNo,
         ipi.jq_policy_no as jqPolicyNo,
@@ -810,7 +810,7 @@
         ipii.invoice_type as invoiceType,
         ipii.invoice_type as invoiceType,
         ipii.invoice_party as invoiceParty,
         ipii.invoice_party as invoiceParty,
         ipii.tax_point as taxPoint,
         ipii.tax_point as taxPoint,
-        (ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums) as receivableSuperviseCosts,
+        (COALESCE(ipi.jq_supervise_costs_premiums,0) + COALESCE(ipi.sy_supervise_costs_premiums,0) + COALESCE(ipi.jy_supervise_costs_premiums,0)) as receivableSuperviseCosts,
         ipi.jy_premium as jqPremium,
         ipi.jy_premium as jqPremium,
         ipi.jy_supervise_costs_proportion as jySuperviseCostsProportion,
         ipi.jy_supervise_costs_proportion as jySuperviseCostsProportion,
         ipi.jy_policy_no as jqPolicyNo,
         ipi.jy_policy_no as jqPolicyNo,
@@ -870,7 +870,7 @@
         ipi.agreement_name as agreementName,
         ipi.agreement_name as agreementName,
         io.entry_status as entryStatus,
         io.entry_status as entryStatus,
         ipi.license_no as licenseNo,
         ipi.license_no as licenseNo,
-        (ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) as receivableAmount,
+        (COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  + COALESCE(ipi.jy_other_costs_premiums,0) ) as receivableAmount,
         io.product_name as productName,
         io.product_name as productName,
         iocui.name AS insuredPerson,
         iocui.name AS insuredPerson,
         ipi.jq_premium as jqPremium,
         ipi.jq_premium as jqPremium,
@@ -931,7 +931,7 @@
         ipi.agreement_name as agreementName,
         ipi.agreement_name as agreementName,
         io.entry_status as entryStatus,
         io.entry_status as entryStatus,
         ipi.license_no as licenseNo,
         ipi.license_no as licenseNo,
-        (ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) as receivableAmount,
+        (COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  + COALESCE(ipi.jy_other_costs_premiums,0) ) as receivableAmount,
         ipi.product_name as productName,
         ipi.product_name as productName,
         iocui.name AS insuredPerson,
         iocui.name AS insuredPerson,
         ipi.jy_premium as jyPremium,
         ipi.jy_premium as jyPremium,
@@ -1027,7 +1027,7 @@
         ipii.invoice_type as invoiceType,
         ipii.invoice_type as invoiceType,
         ipii.invoice_party as invoiceParty,
         ipii.invoice_party as invoiceParty,
         ipii.tax_point as taxPoint,
         ipii.tax_point as taxPoint,
-        (ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) as receivableOtherCosts,
+        (COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  + COALESCE(ipi.jy_other_costs_premiums,0) ) as receivableOtherCosts,
         ipi.jq_premium as jqPremium,
         ipi.jq_premium as jqPremium,
         ipi.jq_other_costs_proportion as jqOtherCostsProportion,
         ipi.jq_other_costs_proportion as jqOtherCostsProportion,
         ipi.jq_policy_no as jqPolicyNo,
         ipi.jq_policy_no as jqPolicyNo,
@@ -1092,7 +1092,7 @@
         ipii.invoice_type as invoiceType,
         ipii.invoice_type as invoiceType,
         ipii.invoice_party as invoiceParty,
         ipii.invoice_party as invoiceParty,
         ipii.tax_point as taxPoint,
         ipii.tax_point as taxPoint,
-        (ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) as receivableSuperviseCosts,
+        (COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  + COALESCE(ipi.jy_other_costs_premiums,0) ) as receivableSuperviseCosts,
         ipi.jy_premium as jqPremium,
         ipi.jy_premium as jqPremium,
         ipi.jy_other_costs_proportion as jqOtherCostsProportion,
         ipi.jy_other_costs_proportion as jqOtherCostsProportion,
         ipi.jy_policy_no as jqPolicyNo,
         ipi.jy_policy_no as jqPolicyNo,
@@ -1308,9 +1308,9 @@
         eic.id as company_id,
         eic.id as company_id,
         eic.parent_id,
         eic.parent_id,
         eic.name as company_name,
         eic.name as company_name,
-        COALESCE(SUM(ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium), 0) as total_receivable,
-        COALESCE(SUM(ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums), 0) as supervise_fee,
-        COALESCE(SUM(ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums), 0) as follow_fee,
+        COALESCE(SUM(COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  + COALESCE(ipi.jy_receivable_premium,0) ), 0) as total_receivable,
+        COALESCE(SUM(COALESCE(ipi.jq_supervise_costs_premiums,0)  + COALESCE(ipi.sy_supervise_costs_premiums,0)  + COALESCE(ipi.jy_supervise_costs_premiums,0) ), 0) as supervise_fee,
+        COALESCE(SUM(COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  +COALESCE(ipi.jy_other_costs_premiums,0) ), 0) as follow_fee,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
         COALESCE(SUM(invoice_summary.unsettled_invoice), 0) as un_settled_amount
         COALESCE(SUM(invoice_summary.unsettled_invoice), 0) as un_settled_amount
@@ -1343,7 +1343,7 @@
         LEFT JOIN (
         LEFT JOIN (
         SELECT
         SELECT
         ifo.order_no,
         ifo.order_no,
-        SUM(DISTINCT (ifo.jq_commission_premium + ifo.sy_commission_premium + ifo.jy_commission_premium)) as total_commission
+        SUM(DISTINCT (COALESCE(ifo.jq_commission_premium,0)  + COALESCE(ifo.sy_commission_premium,0)  + COALESCE(ifo.jy_commission_premium,0) )) as total_commission
         FROM ins_fee_orders ifo
         FROM ins_fee_orders ifo
         WHERE ifo.is_delete = 0
         WHERE ifo.is_delete = 0
         GROUP BY ifo.order_no
         GROUP BY ifo.order_no
@@ -1361,7 +1361,7 @@
                 )
                 )
             </if>
             </if>
         </where>
         </where>
-        GROUP BY eic.id, eic.name, eic.parent_id;
+        GROUP BY eic.id, eic.name, eic.parent_id
     </select>
     </select>
 
 
 
 
@@ -1370,9 +1370,9 @@
         eic.id AS company_id,
         eic.id AS company_id,
         eic.parent_id AS parent_id,
         eic.parent_id AS parent_id,
         eic.NAME AS company_name,
         eic.NAME AS company_name,
-        COALESCE ( SUM( ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium ), 0 ) AS total_receivable,
-        COALESCE ( SUM( ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums ), 0 ) AS supervise_fee,
-        COALESCE ( SUM( ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums ), 0 ) AS follow_fee,
+        COALESCE ( SUM( COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  +  COALESCE(ipi.jy_receivable_premium,0)  ), 0 ) AS total_receivable,
+        COALESCE ( SUM( COALESCE(ipi.jq_supervise_costs_premiums,0)  + COALESCE(ipi.sy_supervise_costs_premiums,0)  + COALESCE(ipi.jy_supervise_costs_premiums,0)  ), 0 ) AS supervise_fee,
+        COALESCE ( SUM( COALESCE(ipi.jq_other_costs_premiums,0)  + COALESCE(ipi.sy_other_costs_premiums,0)  + COALESCE(ipi.jy_other_costs_premiums,0)  ), 0 ) AS follow_fee,
         COALESCE ( SUM( invoice_summary.total_invoice ), 0 ) AS invoiced_amount,
         COALESCE ( SUM( invoice_summary.total_invoice ), 0 ) AS invoiced_amount,
         COALESCE ( SUM( invoice_summary.settled_invoice ), 0 ) AS settled_amount,
         COALESCE ( SUM( invoice_summary.settled_invoice ), 0 ) AS settled_amount,
         COALESCE ( SUM( invoice_summary.unsettled_invoice ), 0 ) AS un_settled_amount
         COALESCE ( SUM( invoice_summary.unsettled_invoice ), 0 ) AS un_settled_amount
@@ -1417,9 +1417,9 @@
         SELECT
         SELECT
         eic.id as company_id,
         eic.id as company_id,
         eic.name as company_name,
         eic.name as company_name,
-        COALESCE(SUM(ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium), 0) as total_receivable,
-        COALESCE(SUM(ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums), 0) as supervise_fee,
-        COALESCE(SUM(ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums), 0) as follow_fee,
+        COALESCE(SUM(COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  + COALESCE(ipi.jy_receivable_premium,0) ), 0) as total_receivable,
+        COALESCE(SUM(COALESCE(ipi.jq_supervise_costs_premiums,0)  +COALESCE(ipi.sy_supervise_costs_premiums,0)  +COALESCE(ipi.jy_supervise_costs_premiums,0) ), 0) as supervise_fee,
+        COALESCE(SUM(COALESCE(ipi.jq_other_costs_premiums,0) + COALESCE(ipi.sy_other_costs_premiums,0) + COALESCE(ipi.jy_other_costs_premiums,0)), 0) as follow_fee,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(fee_summary.total_commission) - SUM(invoice_summary.total_invoice), 0) as un_invoiced_amount,
         COALESCE(SUM(fee_summary.total_commission) - SUM(invoice_summary.total_invoice), 0) as un_invoiced_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
@@ -1453,7 +1453,7 @@
         LEFT JOIN (
         LEFT JOIN (
         SELECT
         SELECT
         ifo.order_no,
         ifo.order_no,
-        SUM(DISTINCT (ifo.jq_commission_premium + ifo.sy_commission_premium + ifo.jy_commission_premium)) as total_commission
+        SUM(DISTINCT (COALESCE(ifo.jq_commission_premium,0)  + COALESCE(ifo.sy_commission_premium,0)  + COALESCE(ifo.jy_commission_premium,0) )) as total_commission
         FROM ins_fee_orders ifo
         FROM ins_fee_orders ifo
         WHERE ifo.is_delete = 0
         WHERE ifo.is_delete = 0
         GROUP BY ifo.order_no
         GROUP BY ifo.order_no
@@ -1474,7 +1474,7 @@
         </where>
         </where>
         GROUP BY
         GROUP BY
         eic.id,
         eic.id,
-        eic.name;
+        eic.name
     </select>
     </select>
 
 
     <!-- 获取子公司 -->
     <!-- 获取子公司 -->
@@ -1482,8 +1482,8 @@
         SELECT
         SELECT
         eic.id as company_id,
         eic.id as company_id,
         eic.name as company_name,
         eic.name as company_name,
-        COALESCE(SUM(ipi.jq_receivable_premium + ipi.sy_receivable_premium + ipi.jy_receivable_premium), 0) as total_receivable,
-        COALESCE(SUM(ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums), 0) as supervise_fee,
+        COALESCE(SUM(COALESCE(ipi.jq_receivable_premium,0)  + COALESCE(ipi.sy_receivable_premium,0)  + COALESCE(ipi.jy_receivable_premium,0) ), 0) as total_receivable,
+        COALESCE(SUM(COALESCE(ipi.jq_supervise_costs_premiums,0) +COALESCE(ipi.sy_supervise_costs_premiums,0) + COALESCE(ipi.jy_supervise_costs_premiums,0) ), 0) as supervise_fee,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(invoice_summary.total_invoice), 0) as invoiced_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
         COALESCE(SUM(invoice_summary.settled_invoice), 0) as settled_amount,
         COALESCE(SUM(invoice_summary.unsettled_invoice), 0) as un_settled_amount
         COALESCE(SUM(invoice_summary.unsettled_invoice), 0) as un_settled_amount
@@ -1529,7 +1529,7 @@
         </where>
         </where>
         GROUP BY
         GROUP BY
         eic.id,
         eic.id,
-        eic.name;
+        eic.name
     </select>
     </select>
 
 
 
 
@@ -1552,18 +1552,18 @@
         SELECT
         SELECT
         ipi.contact_person AS receiver,
         ipi.contact_person AS receiver,
         ipi.company_id,
         ipi.company_id,
-        SUM(ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums) AS superviseFee,
-        SUM(ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums) AS followFee,
+        SUM(COALESCE(ipi.jq_supervise_costs_premiums,0)  +COALESCE(ipi.sy_supervise_costs_premiums,0)  +COALESCE(ipi.jy_supervise_costs_premiums,0) ) AS superviseFee,
+        SUM(COALESCE(ipi.jq_other_costs_premiums,0) + COALESCE(ipi.sy_other_costs_premiums,0) +COALESCE(ipi.jy_other_costs_premiums,0) ) AS followFee,
         SUM(
         SUM(
-        (ipi.jq_supervise_costs_premiums + ipi.sy_supervise_costs_premiums + ipi.jy_supervise_costs_premiums) +
-        (ipi.jq_other_costs_premiums + ipi.sy_other_costs_premiums + ipi.jy_other_costs_premiums)
+        (COALESCE(ipi.jq_supervise_costs_premiums,0) + COALESCE(ipi.sy_supervise_costs_premiums,0) + COALESCE(ipi.jy_supervise_costs_premiums,0)) +
+        (COALESCE(ipi.jq_other_costs_premiums,0) + COALESCE(ipi.sy_other_costs_premiums,0) + COALESCE(ipi.jy_other_costs_premiums,0))
         ) AS totalReceivable,
         ) AS totalReceivable,
-        SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type in (1,3) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledSuperviseFee,
-        SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type in (2,4) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledFollowFee,
-        SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type IN (1,2) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledAmount,
-        SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type in (1,3) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledSuperviseFee,
-        SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type in (2,4) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledFollowFee,
-        SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type IN (1,2) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledAmount
+        --SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type in (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledSuperviseFee,
+        -- SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type in (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledFollowFee,
+        SUM(CASE WHEN ipii.`status` = 1 AND ipii.invoice_type IN (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS settledAmount,
+        --SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type in (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledSuperviseFee
+        -- ,SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type in (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledFollowFee,
+        SUM(CASE WHEN ipii.`status` = 0 AND ipii.invoice_type IN (5,6) THEN ipii.receivable_supervise_premium ELSE 0 END) AS unSettledAmount
         FROM
         FROM
         ins_ply_income ipi
         ins_ply_income ipi
         LEFT JOIN ins_ply_income_invoice_link ipil ON ipi.id = ipil.income_id AND ipil.is_delete = 0
         LEFT JOIN ins_ply_income_invoice_link ipil ON ipi.id = ipil.income_id AND ipil.is_delete = 0
@@ -1602,9 +1602,9 @@
         eic.parent_id,
         eic.parent_id,
         ipi.company_id,
         ipi.company_id,
         ipi.system_code,
         ipi.system_code,
-        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_proportion,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalReceivable ,
-        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_proportion,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalFollowFee,
-        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_proportion,0 )) as superviseFee,
+        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalReceivable ,
+        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )+COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as totalFollowFee,
+        sum(COALESCE(ipi.jq_supervise_costs_premiums, 0)+ COALESCE(ipi.sy_supervise_costs_premiums,0)+coalesce(ipi.jy_supervise_costs_premiums,0 )) as superviseFee,
         sum(COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as followFee
         sum(COALESCE(ipi.jq_other_costs_premiums, 0)+ COALESCE(ipi.sy_other_costs_premiums,0)+coalesce(ipi.jy_other_costs_premiums,0 )) as followFee
         from
         from
         ins_ply_income ipi
         ins_ply_income ipi

Some files were not shown because too many files changed in this diff