Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

Qchen 3 месяцев назад
Родитель
Сommit
d13c8fd490
28 измененных файлов с 402 добавлено и 94 удалено
  1. 3 0
      commons/src/main/java/com/jzg/commons/entity/dto/AgreementRulesAddParam.java
  2. 5 0
      commons/src/main/java/com/jzg/commons/entity/dto/AgreementRulesEditParam.java
  3. 8 0
      commons/src/main/java/com/jzg/commons/entity/finance/dto/ExportSuperviseSettlementExcelDto.java
  4. 3 0
      commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRules.java
  5. 13 13
      commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteEchoVo.java
  6. 3 0
      commons/src/main/java/com/jzg/commons/entity/vo/AgreementRulesVo.java
  7. 6 0
      commons/src/main/java/com/jzg/commons/entity/vo/IncomeAndExpenseVo.java
  8. 74 4
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java
  9. 10 2
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/build/DaDiCrawlerQuoteResultVoBuild.java
  10. 2 1
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/component/DaDiCrawlerRequestComponent.java
  11. 18 28
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/request/DaDiInsurancePlanRequest.java
  12. 1 1
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/request/DaDiQuoteRequest.java
  13. 4 0
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiJointSalesResponse.java
  14. 63 1
      tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiQuoteResponse.java
  15. 1 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/async/AsyncGetPayLink.java
  16. 17 2
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/QrCodeController.java
  17. 11 10
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  18. 7 0
      tenant/insurance/quotation-taiping/src/main/java/com/jzg/quotation/taiping/crawler/service/impl/TaipingCrawlerRequestImpl.java
  19. 32 11
      tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/build/TaiShanCrawlerQuoteRequestVoBuild.java
  20. 16 0
      tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/service/impl/TaiShanCrawlerRequestImpl.java
  21. 18 0
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  22. 8 8
      tenant/organization/src/main/java/com/jzg/organization/mapper/ReceivableMapper.java
  23. 9 0
      tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java
  24. 2 2
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementUndwrtRulesServiceImpl.java
  25. 1 2
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java
  26. 38 7
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  27. 18 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java
  28. 11 1
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/dto/AgreementRulesAddParam.java

@@ -21,6 +21,9 @@ public class AgreementRulesAddParam {
     @Schema(description = "生效截止时间")
     private String endTime;
 
+    @Schema(description = "人工输入描述")
+    private String inputDescription;
+
     @Schema(description = "规则属性")
     private List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList;
 

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/dto/AgreementRulesEditParam.java

@@ -2,6 +2,7 @@ package com.jzg.commons.entity.dto;
 
 import com.jzg.commons.entity.po.PtlAgreementUndwrtRulesAttrLink;
 import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 
@@ -27,6 +28,10 @@ public class AgreementRulesEditParam {
     @Schema(description = "生效截止时间")
     private String endTime;
 
+    @Schema(description = "人工输入描述")
+    private String inputDescription;
+
+    @NotEmpty(message = "规则属性不能为空")
     @Schema(description = "规则属性(单条模式)")
     private List<PtlAgreementUndwrtRulesAttrLink> rulesAttrList;
 

+ 8 - 0
commons/src/main/java/com/jzg/commons/entity/finance/dto/ExportSuperviseSettlementExcelDto.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.finance.dto;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -19,10 +20,12 @@ public class ExportSuperviseSettlementExcelDto {
     private String settlementId;
 
     @Schema(description = "结算状态")
+    @ExcelProperty(value = "结算状态")
     private String settlementStatus;
 
     // 结算状态转义
     @Schema(description = "结算状态")
+    @ExcelProperty(value = "结算状态")
     private String settlementStatusName;
 
     @Schema(description = "保险公司")
@@ -30,6 +33,7 @@ public class ExportSuperviseSettlementExcelDto {
     private String companyName;
 
     @Schema(description = "保险公司序号")
+    @ExcelIgnore
     private String companyId;
 
     @Schema(description = "开票方")
@@ -42,6 +46,7 @@ public class ExportSuperviseSettlementExcelDto {
 
     // 应收项转义
     @Schema(description = "应收项")
+    @ExcelProperty(value = "应收项")
     private String invoiceTypeName;
 
     @Schema(description = "税点")
@@ -73,12 +78,15 @@ public class ExportSuperviseSettlementExcelDto {
     private String invoiceId;
 
     @Schema(description = "附件id")
+    @ExcelIgnore
     private String fileId;
 
     @Schema(description = "附件url")
+    @ExcelIgnore
     private String fileUrl;
 
     @Schema(description = "订单号")
+    @ExcelProperty(value = "订单号")
     private String orderNo;
 
 }

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementUndwrtRules.java

@@ -29,6 +29,9 @@ public class PtlAgreementUndwrtRules extends BaseModel {
     @Schema(description = "生效结束时间")
     private String endTime;
 
+    @Schema(description = "人工输入描述")
+    private String inputDescription;
+
     /** 规则描述 */
     @Schema(description = "规则描述")
     private String ruleDescription;

+ 13 - 13
commons/src/main/java/com/jzg/commons/entity/quote/vo/aggregated/QuoteEchoVo.java

@@ -371,20 +371,20 @@ public class QuoteEchoVo extends QuoteVo {
             }
         });
         // 添加交强险种信息
-//        if(ProductsType.isContainDj(insOrdersVo.getProductId())){
-//            KindInfoVo jqKindInfoVo = new KindInfoVo();
-//            jqKindInfoVo.setKindCode("J1");
-//            jqKindInfoVo.setKindName("机动车交通事故责任强制保险");
-//            if(Objects.nonNull(insOrdersVo.getInsOrdersCosts().getJqPremium())) {
-//                jqKindInfoVo.setPremium(insOrdersVo.getInsOrdersCosts().getJqPremium().toString());
-//            }
-//            jqKindInfoVo.setAmount("200000");
-//            jqKindInfoVo.setServiceTimes("200000");
-//            jqKindInfoVo.setUnitAmount("200000");
-//            insOrdersVo.getKindInfoVo().add(0,jqKindInfoVo);
-//        }
+        if(ProductsType.isContainDj(insOrdersVo.getProductId())){
+            KindInfoVo jqKindInfoVo = new KindInfoVo();
+            jqKindInfoVo.setKindCode("J1");
+            jqKindInfoVo.setKindName("机动车交通事故责任强制保险");
+            if(Objects.nonNull(insOrdersVo.getInsOrdersCosts().getJqPremium())) {
+                jqKindInfoVo.setPremium(insOrdersVo.getInsOrdersCosts().getJqPremium().toString());
+            }
+            jqKindInfoVo.setAmount("200000");
+            jqKindInfoVo.setServiceTimes("200000");
+            jqKindInfoVo.setUnitAmount("200000");
+            insOrdersVo.getKindInfoVo().add(0,jqKindInfoVo);
+        }
         // 移除交强
-        insOrdersVo.getKindInfoVo().removeIf(item -> "J1".equals(item.getKindCode()));
+//        insOrdersVo.getKindInfoVo().removeIf(item -> "J1".equals(item.getKindCode()));
 
         this.setKindInfoVo(insOrdersVo.getKindInfoVo());
         this.setAccidentalDrivings(insOrdersVo.getAccidentalDrivings());

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

@@ -29,6 +29,9 @@ public class AgreementRulesVo extends BaseModel {
     @Schema(description = "生效截止时间")
     private String endTime;
 
+    @Schema(description = "人工输入描述")
+    private String inputDescription;
+
     /** 规则描述 */
     @Schema(description = "规则描述")
     private String ruleDescription;

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

@@ -53,5 +53,11 @@ public class IncomeAndExpenseVo {
 
         @Schema(description = "银行名称")
         private String bankName;
+
+        @Schema(description = "用户名")
+        private String userName;
+
+        @Schema(description = "银行卡号")
+        private String bankCardNum;
     }
 }

+ 74 - 4
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java

@@ -1,6 +1,7 @@
 package com.jzg.quotation.ansheng.crawler.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson2.JSONObject;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
@@ -33,7 +34,11 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpHeaders;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -56,6 +61,14 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
 
     private final AnShengCrawlerQuoteProcessService anShengCrawlerQuoteProcessService;
 
+
+    /** 最大重试次数:获取支付链接 */
+    private static final int MAX_PAY_LINK_RETRY = 15;
+    /** 每次重试间隔休眠毫秒:3秒 */
+    private static final long RETRY_SLEEP_MILLIS = 3000L;
+
+
+
     @Override
     public void login(LoginBase loginBase) {
         anShengCrawlerLoginService.login(loginBase.getUsername(), loginBase.getPassword());
@@ -221,7 +234,15 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
         saveThePolicyNumber(ordersNo, applyApplicationResponse);
         UnderwritingResultsVo underwritingResultsVo = new UnderwritingResultsVo();
         AnShengCrawlerOrder anShengCrawlerOrder = anShengCrawlerOrderService.getById(ordersNo);
-        if (!applyApplicationResponse.getCode().equals(200)) {
+
+        PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
+        if (applyApplicationResponse.getCode().equals(200)) {
+            PaymentLinkVo paymentLinkVo = new PaymentLinkVo();
+            paymentLinkVo.setOrder(underwritingVo.getOrder());
+            paymentLinkResultsVo = loopAcquisitionPaymentLink(paymentLinkVo);
+        }
+
+        if (!applyApplicationResponse.getCode().equals(200) && StringUtils.isEmpty(paymentLinkResultsVo.getPaymentLink())) {
             underwritingResultsVo.setUnderwritingResult(applyApplicationResponse.getMessage());
             underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
             return underwritingResultsVo;
@@ -231,12 +252,62 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
             if (anShengCrawlerOrder.getNiInfos().size() > 0) {
                 underwritingResultsVo.setJyApplyNo(anShengCrawlerOrder.getNiInfos().get(0).getNiPolicyNumber());
             }
+            underwritingResultsVo.setPaymentLink(paymentLinkResultsVo.getPaymentLink());
             underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.PAY_PENDING);
         }
-        underwritingResultsVo.setPaymentLink("");
         return underwritingResultsVo;
     }
 
+    /**
+     * 循环重试获取支付链接
+     * @param paymentLinkVo 请求参数
+     * @return 支付链接结果
+     */
+    private PaymentLinkResultsVo loopAcquisitionPaymentLink(PaymentLinkVo paymentLinkVo) {
+        if (paymentLinkVo == null || paymentLinkVo.getOrder() == null) {
+            log.error("获取支付链接入参为空");
+            return new PaymentLinkResultsVo();
+        }
+        String ordersNo = paymentLinkVo.getOrder().getOrdersNo();
+        PaymentLinkResultsVo linkResult = null;
+        for (int retryCount = 0; retryCount < MAX_PAY_LINK_RETRY; retryCount++) {
+            try {
+                linkResult = getPaymentLink(paymentLinkVo);
+                log.info("订单[{}]第{}次获取支付链接,返回结果:{}", ordersNo, retryCount + 1, JSONObject.toJSONString(linkResult));
+                if (linkResult != null && StrUtil.isNotBlank(linkResult.getPaymentLink())) {
+                    log.info("订单[{}]第{}次成功获取支付链接", ordersNo, retryCount + 1);
+                    break;
+                }
+            } catch (Exception e) {
+                log.error("订单[{}]第{}次调用获取支付链接接口异常", ordersNo, retryCount + 1, e);
+            }
+            if (retryCount != MAX_PAY_LINK_RETRY - 1) {
+                boolean sleepSuccess = sleep(RETRY_SLEEP_MILLIS);
+                if (!sleepSuccess) {
+                    log.warn("订单[{}]支付链接重试休眠被中断,终止重试", ordersNo);
+                    break;
+                }
+            }
+        }
+        return linkResult == null ? new PaymentLinkResultsVo() : linkResult;
+    }
+
+    /**
+     * @param millis 休眠毫秒数
+     * @return true=正常休眠完成;false=被中断
+     */
+    private boolean sleep(long millis) {
+        try {
+            TimeUnit.MILLISECONDS.sleep(millis);
+            return true;
+        } catch (InterruptedException ie) {
+            Thread.currentThread().interrupt();
+            return false;
+        }
+    }
+
+
+
     /**
      * 保存投保单号
      *
@@ -276,7 +347,6 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
         // 获取支付链接
         AnShengCrawlerPaymentRequest anShengCrawlerPaymentRequest = new AnShengCrawlerPaymentRequest(anShengCrawlerOrder, userDetailResponse.getDepartmentCode(), anShengCrawlerOrder.getTotalPremium());
         String paymentUrl = anShengCrawlerRequestComponent.payment(anShengCrawlerPaymentRequest, httpHeaders);
-        log.info("获取安盛支付二维码地址长度:{}", StringUtils.isNotEmpty(paymentUrl) ? paymentUrl.length() : "无法获取支付链接");
         return new PaymentLinkResultsVo(true, paymentUrl, "");
     }
 

+ 10 - 2
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/build/DaDiCrawlerQuoteResultVoBuild.java

@@ -105,8 +105,16 @@ public class DaDiCrawlerQuoteResultVoBuild {
         int sumPayment = daDiQuoteResponse.getInsurancePlan().getTax().getSumPayment();
         quoteResultsVo.getCosts().setVvTax(String.valueOf(sumPayment));
         //设置非车保费
-        int niPremium = daDiQuoteResponse.getInsurancePlan().getBusinessDuePremium();
-        quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
+        if (!daDiQuoteResponse.getInsurancePlan().getAccidentInsure().isEmpty()) {
+            int niPremium = daDiQuoteResponse.getInsurancePlan().getAccidentInsure().get(0).getWealthAccPremium();
+            quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
+        }else if (!daDiQuoteResponse.getInsurancePlan().getHealthInsurance().isEmpty()) {
+            int niPremium = daDiQuoteResponse.getInsurancePlan().getHealthInsurance().get(0).getWealthAccPremium();
+            quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
+        }else  if (!daDiQuoteResponse.getInsurancePlan().getPropertyInsurance().isEmpty()) {
+            int niPremium = daDiQuoteResponse.getInsurancePlan().getHealthInsurance().get(0).getWealthAccPremium();
+            quoteResultsVo.getCosts().setNiPremium(String.valueOf(niPremium));
+        }
 
         //总保费
         int sumPremium = trafficDuePremium + businessDuePremium + sumPayment;

+ 2 - 1
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/component/DaDiCrawlerRequestComponent.java

@@ -3,6 +3,7 @@ package com.jzg.quotation.dadi.crawler.component;
 import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.jzg.commons.entity.po.SysUploadFiles;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
@@ -440,7 +441,7 @@ public class DaDiCrawlerRequestComponent {
         String url = RequestUrl.CALCULATION_PREMIUM.getRequestUrl(daDiCrawlerProperties.getBaseUrl());
 
         DaDiQuoteRequest daDiQuoteRequest = new DaDiQuoteRequest(quoteVo, orderId, checks, daDiVehicleChannelRequest.getComCode(), daDiInsurancePlanRequest, carModelRequest, daDiVehicleChannelRequest);
-        String requestBody = DaDiAESUtils.encryptStr(JSON.toJSONString(daDiQuoteRequest));
+        String requestBody = DaDiAESUtils.encryptStr(JSON.toJSONString(daDiQuoteRequest, SerializerFeature.DisableCircularReferenceDetect));
         String responseBody = networkRequest.doPost(url, requestBody, headers);
         log.info("\n----------------------> 获取报价信息请求成功, \n----------------------> 响应结果:[{}],", responseBody);
         DaDiBaseResponse daDiBaseResponse = JSONObject.parseObject(responseBody, DaDiBaseResponse.class);

+ 18 - 28
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/request/DaDiInsurancePlanRequest.java

@@ -259,17 +259,17 @@ public class DaDiInsurancePlanRequest extends DaDiBaseRequest {
     /**
      * 意外险投保信息(可为空)
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> accidentInsure;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> accidentInsure = new ArrayList<>();
 
     /**
      * 健康险投保信息(可为空)
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> healthInsure;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> healthInsure = new ArrayList<>();
 
     /**
      * 财产险投保信息(可为空)
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> propertyInsure;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> propertyInsure = new ArrayList<>();
 
     /**
      * 总保费
@@ -279,17 +279,17 @@ public class DaDiInsurancePlanRequest extends DaDiBaseRequest {
     /**
      * 意外险方案
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> accidentInsurance;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> accidentInsurance = new ArrayList<>();
 
     /**
      * 健康险方案
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> healthInsurance;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> healthInsurance = new ArrayList<>();
 
     /**
      * 财产险方案
      */
-    private List<DaDiJointSalesResponse.InsuranceDTO> propertyInsurance;
+    private List<DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO> propertyInsurance = new ArrayList<>();
 
     /**
      * 再保险项
@@ -454,41 +454,31 @@ public class DaDiInsurancePlanRequest extends DaDiBaseRequest {
                 this.wealthAccSeatCount = quoteVo.getCarInfoVo().getSeatCount();
             }
 
-            DaDiJointSalesResponse.InsuranceDTO insuranceListDTO;
-            // 按产品分类拆分到意外险/健康险/财产险
-            List<DaDiJointSalesResponse.InsuranceDTO> accidentList = new ArrayList<>();
-            List<DaDiJointSalesResponse.InsuranceDTO> healthList = new ArrayList<>();
-            List<DaDiJointSalesResponse.InsuranceDTO> propertyList = new ArrayList<>();
-
-
             for (AccidentalDrivingVo accidentalDriving : accidentalDrivings) {
                 for (Map.Entry<String, List<DaDiJointSalesResponse.InsuranceDTO>> stringListEntry : jointSales.toMap().entrySet()) {
                     for (DaDiJointSalesResponse.InsuranceDTO insuranceDTO : stringListEntry.getValue()) {
-                        if (accidentalDriving.getProductCode().equals(insuranceDTO.getFormulaGroupCode())) {
-                            if (accidentalDriving.getProductCode().equals(insuranceDTO.getFormulaGroupCode())) {
-                                insuranceListDTO = insuranceDTO;
-                                insuranceListDTO.setFormulaGroupCode(insuranceDTO.getFormulaGroupCode());
-                                insuranceListDTO.setFormulaGroupName(insuranceDTO.getFormulaGroupName());
-                                insuranceListDTO.setIsNingdeEraVehicleBatteryCheck(insuranceDTO.getIsNingdeEraVehicleBatteryCheck());
+                        for (DaDiJointSalesResponse.InsuranceDTO.JointSalesSolutionVOSDTO jointSalesSolutionVO : insuranceDTO.getJointSalesSolutionVOS()) {
+                            if (accidentalDriving.getProductCode().equals(jointSalesSolutionVO.getFormulaCode())) {
+                                jointSalesSolutionVO.setFormulaGroupCode(insuranceDTO.getFormulaGroupCode());
+                                jointSalesSolutionVO.setFormulaGroupName(insuranceDTO.getFormulaGroupName());
+                                jointSalesSolutionVO.setIsNingdeEraVehicleBatteryCheck(insuranceDTO.getIsNingdeEraVehicleBatteryCheck());
                                 if (stringListEntry.getKey().equals("accidentInsurance")) {
-                                    accidentList.add(insuranceListDTO);
+                                    accidentInsurance.add(jointSalesSolutionVO);
+                                    accidentInsure.add(jointSalesSolutionVO);
                                 } else if (stringListEntry.getKey().equals("healthInsurance")) {
-                                    healthList.add(insuranceListDTO);
+                                    healthInsurance.add(jointSalesSolutionVO);
+                                    healthInsure.add(jointSalesSolutionVO);
                                 } else if (stringListEntry.getKey().equals("propertyInsurance")) {
-                                    propertyList.add(insuranceListDTO);
+                                    propertyInsurance.add(jointSalesSolutionVO);
+                                    propertyInsure.add(jointSalesSolutionVO);
                                 }
+                                break;
                             }
                         }
                     }
                 }
             }
 
-            this.accidentInsurance = accidentList;
-            this.healthInsurance = healthList;
-            this.propertyInsurance = propertyList;
-            this.accidentInsure = accidentList.isEmpty() ? null : accidentList;
-            this.healthInsure = healthList.isEmpty() ? null : healthList;
-            this.propertyInsure = propertyList.isEmpty() ? null : propertyList;
         } else {
             this.wealthAccChecked = "0";
             this.accidentInsurance = new ArrayList<>();

+ 1 - 1
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/request/DaDiQuoteRequest.java

@@ -129,7 +129,7 @@ public class DaDiQuoteRequest extends DaDiBaseRequest {
     /**
      * 投保方案
      */
-    private Object insurancePlan;
+    private DaDiInsurancePlanRequest insurancePlan;
 
     /**
      * 车主信息

+ 4 - 0
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiJointSalesResponse.java

@@ -57,10 +57,14 @@ public class DaDiJointSalesResponse extends DaDiBaseResponse{
             private String formulaCode;
             @SerializedName("scene")
             private String scene;
+            @SerializedName("isNingdeEraVehicleBatteryCheck")
+            private String isNingdeEraVehicleBatteryCheck;
             @SerializedName("customElement")
             private String customElement;
             @SerializedName("formulaName")
             private String formulaName;
+            @SerializedName("formulaGroupCode")
+            private String formulaGroupCode;
             @SerializedName("formulaGroupName")
             private String formulaGroupName;
             @SerializedName("productCode")

+ 63 - 1
tenant/insurance/quotation-dadi/src/main/java/com/jzg/quotation/dadi/crawler/entity/response/DaDiQuoteResponse.java

@@ -140,8 +140,13 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
         private String trafficProductCode;
         @SerializedName("accidentInsurance")
         private String accidentInsurance;
+        @SerializedName("accidentInsure")
+        private List<AccidentInsureDTO> accidentInsure;
         @SerializedName("healthInsurance")
-        private String healthInsurance;
+        private List<AccidentInsureDTO> healthInsurance;
+        @SerializedName("propertyInsurance")
+        private List<AccidentInsureDTO> propertyInsurance;
+
 
         @NoArgsConstructor
         @Data
@@ -183,6 +188,63 @@ public class DaDiQuoteResponse extends DaDiBaseResponse {
             }
 
         }
+
+        @NoArgsConstructor
+        @Data
+        public static class AccidentInsureDTO {
+            @SerializedName("forms")
+            private List<FormsDTO> forms;
+            @SerializedName("isShowInsured")
+            private String isShowInsured;
+            @SerializedName("jointSalesSolutionItems")
+            private List<JointSalesSolutionItemsDTO> jointSalesSolutionItems;
+            @SerializedName("policyNature")
+            private String policyNature;
+            @SerializedName("wealthAccPremium")
+            private int wealthAccPremium;
+
+            @NoArgsConstructor
+            @Data
+            public static class FormsDTO {
+                @SerializedName("customformcontent")
+                private String customformcontent;
+                @SerializedName("customformtitle")
+                private String customformtitle;
+                @SerializedName("formcategory")
+                private String formcategory;
+                @SerializedName("id")
+                private int id;
+                @SerializedName("plandefid")
+                private long plandefid;
+                @SerializedName("planformid")
+                private String planformid;
+                @SerializedName("productelementcode")
+                private String productelementcode;
+                @SerializedName("productelementid")
+                private String productelementid;
+            }
+
+            @NoArgsConstructor
+            @Data
+            public static class JointSalesSolutionItemsDTO {
+                @SerializedName("defaultAmount")
+                private int defaultAmount;
+                @SerializedName("defaultValue")
+                private int defaultValue;
+                @SerializedName("insureUnit")
+                private String insureUnit;
+                @SerializedName("kindCode")
+                private String kindCode;
+                @SerializedName("kindName")
+                private String kindName;
+                @SerializedName("linkSeats")
+                private int linkSeats;
+                @SerializedName("subsidyAmount")
+                private String subsidyAmount;
+                @SerializedName("subsidyDay")
+                private String subsidyDay;
+            }
+        }
     }
 
     @NoArgsConstructor

+ 1 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/async/AsyncGetPayLink.java

@@ -32,7 +32,7 @@ public class AsyncGetPayLink {
     @Async("asyncTaskExecutor")
     public void paymentLink(QuotationBaseService quoteService,OrderBase order, String companyCode ){
         try {
-            if (StringUtils.equals(CompanyConstants.TPBX.getCompanyCode(),companyCode) || StringUtils.equals(CompanyConstants.TKIC.getCompanyCode(),companyCode)
+            if (StringUtils.equals(CompanyConstants.TKIC.getCompanyCode(),companyCode)
                     || StringUtils.equals(CompanyConstants.TSBX.getCompanyCode(),companyCode) || StringUtils.equals(CompanyConstants.HTIC.getCompanyCode(),companyCode)
             ){
                 PaymentLinkVo paymentLinkVo = new PaymentLinkVo();

+ 17 - 2
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/QrCodeController.java

@@ -9,6 +9,8 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.orders.po.*;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.po.QrBarcodeConfig;
+import com.jzg.commons.entity.quote.vo.aggregated.PaymentLinkVo;
+import com.jzg.commons.entity.quote.vo.base.OrderBase;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.LocalDateTimeUtils;
@@ -51,6 +53,7 @@ public class QrCodeController extends BaseController {
     private final InsOrdersCarInfoService insOrdersCarInfoService;
     private final InsOrdersRiskService insOrdersRiskService;
     private final PlatformClient platformClient;
+    private final UnifyOrderManager unifyOrderManager;
     //二维码生成地址
     @Value("${qrcode.genAddress}")
     private String qrCodeGenAddress;
@@ -60,7 +63,7 @@ public class QrCodeController extends BaseController {
 
     @GetMapping(value = "/getQrCode")
     @Operation(summary = "获取二维码")
-    public ModelAndView getQrCode(@NotBlank(message = "订单号号不能为空") @RequestParam("orderNo") String orderNo) {
+    public ModelAndView getQrCode(@NotBlank(message = "订单号号不能为空") @RequestParam("orderNo") String orderNo) throws Exception {
         // 获取保存支付url
         InsOrders orders = insOrdersService.getById(orderNo);
         List<InsOrdersCarUserInfo> carUserInfoList = insOrdersCarUserInfoService.getByOrderId(orderNo);
@@ -96,6 +99,13 @@ public class QrCodeController extends BaseController {
 
         InsOrdersQrcode ordersQrcode = insOrdersQrcodeService.getOneOrSave(orders);
         if(ordersQrcode.getJumpUrl() == null || ordersQrcode.getJumpUrl().isEmpty()){
+            // 尝试获取支付连接
+            PaymentLinkVo paymentLinkVo = new PaymentLinkVo();
+            OrderBase orderBase = new OrderBase();
+            orderBase.setOrdersNo(orderNo);
+            paymentLinkVo.setOrder(orderBase);
+            HttpResult httpResult = unifyOrderManager.getPaymentLink(paymentLinkVo);
+
             throw new SystemException("订单不存在支付连接");
         }
 
@@ -203,7 +213,12 @@ public class QrCodeController extends BaseController {
                     }
                 } else {
                     // 本身就是 base64
-                    finalQrUrl = "data:image/png;base64," + jumpUrl;
+                    boolean isBase64Image = jumpUrl.startsWith("data:image/");
+                    if(!isBase64Image) {
+                        finalQrUrl = "data:image/png;base64," + jumpUrl;
+                    }else{
+                        finalQrUrl = jumpUrl;
+                    }
                 }
 
                 qrCodeVo.setQrCodeUrl(finalQrUrl);

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

@@ -42,10 +42,7 @@ import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
 import com.jzg.commons.entity.rights.vo.InsOrderRightsInfoVo;
 import com.jzg.commons.entity.vo.*;
 import com.jzg.commons.exception.SystemException;
-import com.jzg.commons.util.AssertionUtils;
-import com.jzg.commons.util.DateTimeUtils;
-import com.jzg.commons.util.MinioUtils;
-import com.jzg.commons.util.StringUtils;
+import com.jzg.commons.util.*;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.commons.client.PartnerDistributionClient;
@@ -1375,15 +1372,19 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         // 费用信息
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectOne(new LambdaQueryWrapper<InsFeeOrders>()
                 .eq(InsFeeOrders::getOrderNo, ordersNo));
-        String systemCode = getSystemCode();
         // 比例信息
         if (insFeeOrders != null) {
-            resultVo.setInsFeeOrders(new InsFeeOrdersVo(insFeeOrders));
-            // modify by lipf,  resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement)); 这一行代码被注视掉,那么上面两个查询也就没有必要调用了
-            // List<PtlAgreementCostTypeVo> ptlAgreementCostTypeList = orgClient.queryByCostId(insFeeOrders.getCostId());
-            //PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrdersVo.getInsOrders().getAgreementId());
-            //resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement));
+            // modify by lipf,
+            //resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement)); 这一行代码被注视掉,那么上面两个查询也就没有必要调用了
+//            List<PtlAgreementCostTypeVo> ptlAgreementCostTypeList = orgClient.queryByCostId(insFeeOrders.getCostId());
+//            PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrdersVo.getInsOrders().getAgreementId());
+//            resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement));
             resultVo.setCostRatio(new PtlAgreementCostRatioVo(insFeeOrders));
+            // add by lipf, 手动计算留点比例的费用 2026年6月11日11:31:39
+            insFeeOrders.setJqKeepPointPremium(BigDecimalUtil.divide( BigDecimalUtil.multiply(insFeeOrders.getJqPremium(),resultVo.getCostRatio().getJqKeepPointRatio()),new BigDecimal(100)));
+            insFeeOrders.setSyKeepPointPremium(BigDecimalUtil.divide(BigDecimalUtil.multiply(insFeeOrders.getSyPremium(),resultVo.getCostRatio().getSyKeepPointRatio()),new BigDecimal(100)));
+            insFeeOrders.setJyKeepPointPremium(BigDecimalUtil.divide(BigDecimalUtil.multiply(insFeeOrders.getJyPremium(),resultVo.getCostRatio().getJyKeepPointRatio()),new BigDecimal(100)));
+            resultVo.setInsFeeOrders(new InsFeeOrdersVo(insFeeOrders));
         }
         //权益信息
         InsOrderRightsInfoVo insOrderRightsInfoVo = insOrderRightsInfoService.queryByOrderNo(ordersNo);

+ 7 - 0
tenant/insurance/quotation-taiping/src/main/java/com/jzg/quotation/taiping/crawler/service/impl/TaipingCrawlerRequestImpl.java

@@ -7,6 +7,8 @@ import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.quotation.commons.entity.DetectLoginRequest;
+import com.jzg.quotation.commons.entity.GetCaptchaRequest;
+import com.jzg.quotation.commons.entity.GetCaptchaResponse;
 import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
 import com.jzg.quotation.taiping.crawler.build.TaiPingCrawlerQuoteResultsVoBuild;
 import com.jzg.quotation.taiping.crawler.component.TaiPingCrawlerCacheComponent;
@@ -40,6 +42,11 @@ public class TaipingCrawlerRequestImpl implements TaipingCrawlerRequest {
         taiPingCrawlerQuoteProcessService.login(loginBase.getUsername(), loginBase.getPassword());
     }
 
+    @Override
+    public GetCaptchaResponse getCaptcha(GetCaptchaRequest sendCaptchaRequest) {
+        return null;
+    }
+
     @Override
     public QuoteResultsVo quote(QuoteVo quoteVo) {
         HttpHeaders httpHeaders = taiPingCrawlerRequestComponent.getHeaders();

+ 32 - 11
tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/build/TaiShanCrawlerQuoteRequestVoBuild.java

@@ -17,6 +17,9 @@ import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
 public class TaiShanCrawlerQuoteRequestVoBuild {
 
     public static TaiShanCrawlerQuotationRequest toQuotationDto(QuoteVo quoteVo, TaiShanCrawlerCarResponse.CarModelInfo modelsDTO, String currentValue, TaiShanCrawlerConfigureParameters parameters, TaiShanCrawlerDeptResponse taiShanCrawlerDeptResponse, AttributionInformationVo attributionInformationVo, String policyPersonId, String insuredPersonId) {
@@ -240,7 +243,17 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
         int seatNumber = Integer.parseInt(modelsDTO.getNewSeatNumber());
 
         for (KindInfoVo infoVo : kindInfoVoList) {
-            String kindCode = infoVo.getKindCode();
+            // 注意:kindCode是泰山编码(如030006),platformKindCode才是掌柜编码(如A)
+            // switch使用掌柜编码匹配,与Python insurance_Map的key一致
+            String kindCode = infoVo.getPlatformKindCode();
+            log.info("泰山报价-险种编码: kindCode(泰山)={}, amount={}, platformKindCode(掌柜)={}", infoVo.getKindCode(), infoVo.getAmount(), kindCode);
+
+            // 跳过不在商业险映射表中的险种(如交强险等),与Python insurance_Map一致
+            if (!BUSINESS_KIND_CODES.contains(kindCode)) {
+                log.info("泰山报价-跳过非商业险种: platformKindCode={}", kindCode);
+                continue;
+            }
+
             TaiShanCrawlerQuotationRequest.BusinessInsurance.ItemKind itemKind;
 
             // 获取对应险种的模板默认值(与Python insurance_Map对应)
@@ -249,6 +262,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                 case "A":
                     itemKind = buildDefaultItemKind("030006", "机动车损失保险", 1);
                     itemKind.setAmount(actualValue);
+                    itemKind.setIndemLmt(actualValue);
                     itemKind.setDeductible("375001");
                     break;
 
@@ -260,7 +274,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setIndemLmtLvl("306006018"); // 默认200万以上
                     for (String[] limit : THIRD_LIMIT_AMT) {
                         double cnameVal = extractNumberFromWan(limit[0]);
-                        if (cnameVal == Double.parseDouble(infoVo.getAmount())) {
+                        if (Math.abs(cnameVal - Double.parseDouble(infoVo.getAmount())) < 0.01) {
                             itemKind.setIndemLmtLvl(limit[1]);
                             break;
                         }
@@ -270,12 +284,11 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                 // D3: 车上人员责任险(驾驶人)
                 case "D3":
                     itemKind = buildDefaultItemKind("030001", "车上人员责任险(驾驶人)", 3);
-                    itemKind.setAmount(Integer.parseInt(infoVo.getAmount()));
+                    itemKind.setAmount(infoVo.getAmount());
                     itemKind.setLiabDaysLmt(1);
                     // 匹配医保外医疗费用档次以获取indemLmtLvl(与Python一致)
                     for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
-                        if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
-                            itemKind.setAmount(infoVo.getAmount());
+                        if (!"保额共享".equals(med[0]) && Math.abs(Float.parseFloat(med[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setIndemLmt(actualValue);
                             itemKind.setIndemLmtLvl(med[1]);
                             break;
@@ -291,7 +304,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setPerAmt(d4Amount);
                     itemKind.setLiabDaysLmt(seatNumber - 1);
                     for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
-                        if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
+                        if (!"保额共享".equals(med[0]) && Math.abs(Float.parseFloat(med[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setIndemLmt(actualValue);
                             itemKind.setIndemLmtLvl(med[1]);
                             break;
@@ -305,7 +318,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setAmount(infoVo.getAmount());
                     itemKind.setIndemLmt(infoVo.getAmount());
                     for (String[] scratch : CAR_SCRATCH_LEVELS) {
-                        if (Float.parseFloat(scratch[0]) == Float.parseFloat(infoVo.getAmount())) {
+                        if (Math.abs(Float.parseFloat(scratch[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setIndemLmtLvl(scratch[1]);
                             break;
                         }
@@ -326,9 +339,9 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setIndemLmt("500000");
                     itemKind.setIndemLmtLvl("390N27"); // 默认50万
                     for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
-                        if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
+                        if (!"保额共享".equals(med[0]) && Math.abs(Float.parseFloat(med[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setAmount(infoVo.getAmount());
-                            itemKind.setIndemLmt(infoVo.getAmount());
+                            itemKind.setIndemLmt(actualValue);
                             itemKind.setIndemLmtLvl(med[1]);
                             break;
                         }
@@ -342,7 +355,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setIndemLmt("500000");
                     itemKind.setIndemLmtLvl("390N27"); // 默认50万
                     for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
-                        if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
+                        if (!"保额共享".equals(med[0]) && Math.abs(Float.parseFloat(med[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setIndemLmtLvl(med[1]);
                             itemKind.setAmount(infoVo.getAmount());
                             itemKind.setIndemLmt(infoVo.getAmount());
@@ -360,7 +373,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
                     itemKind.setPerAmt("500000");
                     itemKind.setIndemLmtLvl("390N27"); // 默认50万
                     for (String[] med : MEDICAL_EXPENSES_OUTSIDE) {
-                        if (!"保额共享".equals(med[0]) && Float.parseFloat(med[0]) == Float.parseFloat(infoVo.getAmount())) {
+                        if (!"保额共享".equals(med[0]) && Math.abs(Float.parseFloat(med[0]) - Float.parseFloat(infoVo.getAmount())) < 0.01) {
                             itemKind.setAmount(Integer.parseInt(infoVo.getAmount()) * (seatNumber - 1));
                             itemKind.setIndemLmt(infoVo.getAmount());
                             itemKind.setLiabDaysLmt(seatNumber - 1);
@@ -435,6 +448,7 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
 
                 default:
                     // 未识别的险种,回退原有逻辑填充
+                    log.warn("泰山报价-未识别的险种编码: kindCode={}, 走fallback逻辑", kindCode);
                     itemKind = fallbackBuildItemKind(infoVo, kindList.size());
                     break;
             }
@@ -564,6 +578,13 @@ public class TaiShanCrawlerQuoteRequestVoBuild {
 
     // ==================== Python 档位静态常量(与 tsbxitem.py 保持一致) ====================
 
+    /** 商业险种编码集合(与Python insurance_Map的key一致),用于过滤非商业险种 */
+    private static final Set<String> BUSINESS_KIND_CODES = new HashSet<>(Arrays.asList(
+            "A", "B", "D3", "D4", "G1", "L", "F",
+            "SY_FJ_YBW1", "SY_FJ_YBW2", "SY_FJ_YBW3",
+            "MJ1", "MJ2", "BD", "TY4"
+    ));
+
     /** 【第三者责任险】限额档次 */
     private static final List<String[]> THIRD_LIMIT_AMT = Arrays.asList(
             new String[]{"10万元", "306006005"},

+ 16 - 0
tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/service/impl/TaiShanCrawlerRequestImpl.java

@@ -233,6 +233,22 @@ public class TaiShanCrawlerRequestImpl implements TaiShanCrawlerRequest {
                         itemKind.setBefPremium(res.getBefPremium());
                         itemKind.setBefAnnPrm(res.getBefAnnPrm());
                         itemKind.setBasePrm(res.getBasePrm());
+                        itemKind.setPureRiskPremium(res.getPureRiskPremium());
+                        // 覆盖报价响应中的其他关键字段(与Python直接使用price_res['result']作为save数据一致)
+                        itemKind.setIndemLmtLvl(res.getIndemLmtLvl());
+                        itemKind.setDisCoef(res.getDisCoef());
+                        itemKind.setDuctDiscount(res.getDuctDiscount());
+                        itemKind.setDeductibleRatio(res.getDeductibleRatio());
+                        itemKind.setAfterPremiumYear(res.getAfterPremiumYear());
+                        itemKind.setCalcPrm(res.getCalcPrm());
+                        itemKind.setResvNumberRoad(res.getResvNumberRoad());
+                        itemKind.setResvNumberDriver(res.getResvNumberDriver());
+                        itemKind.setAbsoluteDeductible(res.getAbsoluteDeductible());
+                        itemKind.setResvNumAutonomy(res.getResvNumAutonomy());
+                        itemKind.setAmtVar(res.getAmtVar());
+                        itemKind.setPrmVar(res.getPrmVar());
+                        itemKind.setPkId(res.getPkId());
+                        itemKind.setSeqNo(res.getSeqNo());
                     }
                 });
             }

+ 18 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -663,6 +663,24 @@ public class ReceivableController {
         return receivableService.companySuperviseSettlementReport(settlementReportQueryVo);
     }
 
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    @PostMapping("updateSettlementStatus")
+    public HttpResult<String> updateSettlementStatus(@RequestParam("id") String invoiceId){
+        int count = receivableService.updateSettlementStatus(invoiceId);
+        if(count>0){
+            return HttpResult.ok("订单被标记为结算完成");
+        }else{
+            // 可能已经被其他人标记为结算完成
+            return HttpResult.ok("操作完成");
+        }
+    }
+
     @PostMapping("receiverSettlementReport")
     @Operation(summary = "对接人结算报表")
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {

+ 8 - 8
tenant/organization/src/main/java/com/jzg/organization/mapper/ReceivableMapper.java

@@ -3,10 +3,7 @@ package com.jzg.organization.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.entity.finance.dto.*;
-import com.jzg.commons.entity.finance.po.InsPlyIncome;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceLink;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeVO;
+import com.jzg.commons.entity.finance.po.*;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordQueryVo;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordResult;
 import com.jzg.commons.entity.finance.vo.InvoicingVo;
@@ -211,7 +208,8 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      * @author lipf
      * @date 2026/6/1 16:57
      */
-    List<CompanySuperviseSettlementReportDto> queryCumulativeAccountsReceivable(@Param("systemCode") String systemCode);
+    List<CompanySuperviseSettlementReportDto> queryCumulativeAccountsReceivable(@Param("systemCode") String systemCode,
+                                                                                @Param("agreementType") String agreementType);
 
     /**
      * 查询已开票金额
@@ -226,7 +224,8 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
     List<CalRes> queryInvoicedAmount(@Param("systemCode") String systemCode,
                                      @Param("invoiceType") List<Integer> invoiceType,
                                      @Param("invoiceStartDate") String invoiceStartDate,
-                                     @Param("invoiceEndDate") String invoiceEndDate);
+                                     @Param("invoiceEndDate") String invoiceEndDate,
+                                     @Param("agreementType") String agreementType);
 
     /**
      * 查询已结算金额
@@ -235,8 +234,9 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      * @return List<CalRes>
      */
     List<CalRes> querySettledAmount(@Param("systemCode") String systemCode,
-                                               @Param("settledStartDate") String settledStartDate,
-                                               @Param("settledEndDate") String settledEndDate);
+                                    @Param("settledStartDate") String settledStartDate,
+                                    @Param("settledEndDate") String settledEndDate,
+                                    @Param("agreementType") String agreementType);
 
     /**
      * 查询

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java

@@ -457,4 +457,13 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      * @return
      */
     Page<ExportSuperviseSettlementExcelDto> followSettlementExcel(Page page, SettlementQueryVo settlementQueryVo);
+
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    int updateSettlementStatus(String invoiceId);
 }

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

@@ -208,6 +208,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
         rules.setOrderNum(orderNum);
         rules.setStartTime(param.getStartTime());
         rules.setEndTime(param.getEndTime());
+        rules.setInputDescription(param.getInputDescription());
         rules.setAgreementId(param.getAgreementId());
         rules.setParentId(parentId);
         return rules;
@@ -356,8 +357,7 @@ public class PtlAgreementUndwrtRulesServiceImpl extends ServiceImpl<PtlAgreement
         // 获取费用因子属性(公共逻辑,仅查询一次)
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
-                .filter(attr -> attr.getCompanyIds().equals("all"))
-                .filter(attr -> attr.getCompanyIds().equals(agreement.getCompanyId()))
+                .filter(attr -> "all".equals(attr.getCompanyIds()) || attr.getCompanyIds().equals(agreement.getCompanyId()))
                 .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
 
         // 确定需要处理的规则ID列表

+ 1 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -302,8 +302,7 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         // 获取费用因子属性
         List<PtlAgreementUndwrtRulesAttr> attrList = agreementUndwrtRulesAttrService.getUndwrtRulesAttrList(companyId);
         Map<String, PtlAgreementUndwrtRulesAttr> attrMap = attrList.stream()
-                .filter(attr -> attr.getCompanyIds().equals("all"))
-                .filter(attr -> attr.getCompanyIds().equals(companyId))
+                .filter(attr -> "all".equals(attr.getCompanyIds()) || attr.getCompanyIds().equals(companyId))
                 .collect(Collectors.toMap(PtlAgreementUndwrtRulesAttr::getAttrCode, attr -> attr));
         List<PtlAgreementUndwrtRulesAttr> newAttrList = new ArrayList<>();
         linkList.forEach(link -> {

+ 38 - 7
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -1458,6 +1458,16 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     @Override
     public boolean deleteSettlementById(String id) {
         log.info("私有协议-结算记录-删除: id=[{}]",id);
+        InsPlyIncomeInvoiceSettlement settlement = insPlyIncomeInvoiceSettlementMapper.selectById(id);
+        if(settlement == null){
+            return false;
+        }
+        String invoiceId = settlement.getInvoiceId();
+        if(StrUtil.isNotEmpty(invoiceId)){
+            insPlyIncomeInvoiceMapper.update(null,
+                    new LambdaUpdateWrapper<InsPlyIncomeInvoice>()
+                            .set(InsPlyIncomeInvoice::getStatus,"0").eq(InsPlyIncomeInvoice::getId,invoiceId));
+        }
         return insPlyIncomeInvoiceSettlementMapper.deleteById(id) > 0;
     }
 
@@ -2786,7 +2796,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @return
      */
     @Override
-    public void exportSuperviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
+    public void exportSuperviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
+        verifyUploadPath();
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
         // 补充、转换列表的数据
         supplementaryListData(exportSuperviseSettlementExcelDtos);
@@ -2801,7 +2812,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @return
      */
     @Override
-    public void exportPlatformSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
+    public void exportPlatformSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
+        verifyUploadPath();
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.platformSettlementExcelDtos(page, settlementQueryVo);
         // 补充、转换列表的数据
         supplementaryListData(exportSuperviseSettlementExcelDtos);
@@ -3094,7 +3106,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         log.info("保险公司结算报表查询-区分租户并且按照日期进行过滤:systemCode=[{}],queryVo=[{}]", systemCode, JSONUtil.toJsonStr(queryVo));
         // 1. 先将有数据的保险公司进行汇总
         // 累计应收金额, 应收手续费(手续费), 应收手续费(手续费)
-        List<CompanySuperviseSettlementReportDto> allCompaniesIncomeDatas = baseMapper.queryCumulativeAccountsReceivable(systemCode);
+        List<CompanySuperviseSettlementReportDto> allCompaniesIncomeDatas = baseMapper.queryCumulativeAccountsReceivable(systemCode, queryVo.getAgreementType());
         allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().peek(action-> action.setId(action.getCompanyId())).toList();
         // for test, 查看一家公司的数据,将不可变对象变成 可变对象
 //        allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().filter(action-> "1738811735599338932".equals(action.getCompanyId())).toList();
@@ -3153,15 +3165,15 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         // 已开票(跟单费)
 
         List<CalRes> calRes;
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(1, 3), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        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));
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(2, 4), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        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));
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(4, 6), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(4, 6), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> ptInvoicedAmountMap =calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
 
         // 结算费用 
-        calRes = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> sxfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getSxfSettlement, (o1,o2)->o1));
         Map<String, BigDecimal> gdfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getGdfSettlement, (o1,o2)->o1));
 
@@ -3576,5 +3588,24 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         log.info(msg);
         return HttpResult.ok(msg);
     }
+
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    @Override
+    public int updateSettlementStatus(String invoiceId) {
+        String userName = baseController.getUserName();
+        String systemCode = baseController.getSystemCode();
+        log.info("租户[{}]下的用户[{}]标识发票[{}]为结算完成", systemCode, userName, invoiceId);
+        return insPlyIncomeInvoiceMapper.update(null, new LambdaUpdateWrapper<InsPlyIncomeInvoice>()
+                .set(InsPlyIncomeInvoice::getStatus,"1")
+                .set(InsPlyIncomeInvoice::getUpdateBy,userName)
+                .set(InsPlyIncomeInvoice::getUpdateTime, LocalDateTime.now())
+                .eq(InsPlyIncomeInvoice::getId, invoiceId));
+    }
 }
 

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

@@ -1,7 +1,9 @@
 package com.jzg.organization.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.core.base.BaseController;
@@ -25,6 +27,7 @@ import java.time.LocalDateTime;
 import java.time.YearMonth;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -263,6 +266,15 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         
         List<SysAmountAuditing> sysAmountAuditingList = sysAmountAuditingService.list(auditingWrapper);
 
+        // 批量查询用户信息
+        Set<String> collect = sysAmountAuditingList.stream().map(SysAmountAuditing::getUserId).collect(Collectors.toSet());
+        QueryWrapper<SysUser> idSet = new QueryWrapper<SysUser>().in("id", collect);
+        List<SysUser> list = sysUserService.list(idSet);
+        Map<String, SysUser> userMap = new HashMap<>();
+        if (CollUtil.isNotEmpty(list)){
+            userMap = list.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
+        }
+
         // 构建订单收入查询参数(手动设置时间,避免类型转换问题)
         InsFeeOrdersParam feeOrdersParam = new InsFeeOrdersParam();
         feeOrdersParam.setUserId(sysUserJzgInfo.getUserId());
@@ -295,6 +307,8 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setStatus(auditing.getAuditingStatus().toString());
             item.setRemark("提现支出");
             item.setBankName(auditing.getBankName());
+            item.setUserName(userMap.getOrDefault(auditing.getUserId(), new SysUser()).getUsername());
+            item.setBankCardNum(auditing.getBankCardNum());
             allRecords.add(item);
         }
         // 处理收入记录
@@ -307,6 +321,8 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setRemark("车险收入");
             item.setLicenseNo(insFeeOrders.getLicenseNo());
             item.setBankName(null);
+            item.setUserName(null);
+            item.setBankCardNum(null);
             allRecords.add(item);
         }
         // 处理分销收入记录
@@ -325,6 +341,8 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             item.setRemark("分销收入");
             item.setLicenseNo(insFeeOrders.getLicenseNo());
             item.setBankName(null);
+            item.setUserName(null);
+            item.setBankCardNum(null);
             allRecords.add(item);
         }
         // 排序

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

@@ -1612,6 +1612,9 @@
         <where>
             ipi.is_delete = 0
             and ipi.system_code = #{systemCode}
+            <if test="agreementType != null and agreementType != ''">
+                AND ipi.agreement_type = #{agreementType}
+            </if>
         </where>
         group by
         eic.parent_id,
@@ -1647,7 +1650,11 @@
             ins_ply_income ipi
             where
             ipi.is_delete = 0
-            and ipi.system_code = #{systemCode})
+            and ipi.system_code = #{systemCode}
+            <if test="agreementType != null and agreementType != ''">
+                AND ipi.agreement_type = #{agreementType}
+            </if>
+            )
             <if test="invoiceType != null and !invoiceType.isEmpty()">
                 AND ipii.invoice_type IN
                 <foreach collection="invoiceType" item="item" open="(" separator="," close=")">
@@ -1694,6 +1701,9 @@
             <if test="settledEndDate != null and settledEndDate != ''">
                 AND ipi.settlement_time &lt; cast('${settledEndDate}' as datetime)
             </if>
+            <if test="agreementType != null and agreementType != ''">
+                AND ipi.agreement_type = #{agreementType}
+            </if>
         </where>
         ) a
         group by  a.company_id