Ver código fonte

Merge branch 'master' into wrq_dev

wangrq 3 meses atrás
pai
commit
6260a51398
35 arquivos alterados com 1187 adições e 409 exclusões
  1. 9 0
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsFeeFollowOrder.java
  2. 9 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/InsFeeFollowOrderVo.java
  3. 203 0
      commons/src/main/java/com/jzg/commons/entity/orders/vo/FeeAuditVo.java
  4. 4 0
      commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementCostRule.java
  5. 6 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserActivityCompleteInRule.java
  6. 3 0
      commons/src/main/java/com/jzg/commons/entity/vo/AgreementVo.java
  7. 37 0
      commons/src/main/java/com/jzg/commons/entity/vo/AmountAuditVo.java
  8. 50 36
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java
  9. 21 16
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java
  10. 4 0
      tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/entity/Response/HtCrawlerCarQueryResponse.java
  11. 52 20
      tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java
  12. 37 18
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java
  13. 306 168
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java
  14. 6 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsFeeOrdersService.java
  15. 21 16
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java
  16. 2 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java
  17. 3 91
      tenant/insurance/quotation-summary/src/main/resources/application-dev.yaml
  18. 3 1
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml
  19. 96 2
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/build/ZmCrawlerQuoteResultVoBuild.java
  20. 66 0
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/constant/enums/ZmCrawlerFloatFlag.java
  21. 3 1
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Request/ZmCrawlerQuotedPriceRequest.java
  22. 8 0
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Response/ZmCrawlerQuotedPriceResponse.java
  23. 1 1
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/service/Impl/ZhongMeiCrawlerRequestImpl.java
  24. 40 0
      tenant/organization/src/main/java/com/jzg/organization/client/LocalLiveResult.java
  25. 3 3
      tenant/organization/src/main/java/com/jzg/organization/client/LotteryActivityClient.java
  26. 1 1
      tenant/organization/src/main/java/com/jzg/organization/client/UnifiedUserCenterClient.java
  27. 12 0
      tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java
  28. 5 4
      tenant/organization/src/main/java/com/jzg/organization/service/LotteryActivityService.java
  29. 8 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java
  30. 72 13
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  31. 61 16
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SignInServiceImpl.java
  32. 21 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  33. 2 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserServiceImpl.java
  34. 3 0
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml
  35. 9 2
      tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/finance/po/InsFeeFollowOrder.java

@@ -45,6 +45,15 @@ public class InsFeeFollowOrder extends BaseModel {
     @Schema(description = "本次开票金额")
     private BigDecimal invoicedAmountTime;
 
+    @Schema(description = "对账金额")
+    private BigDecimal reconciliationAmount;
+
+    @Schema(description = "虚增差额")
+    private BigDecimal falselyIncreasedDifference;
+
+    @Schema(description = "虚增原因")
+    private String falselyIncreasedReason;
+
     @Schema(description = "系统编码")
     private String systemCode;
 

+ 9 - 0
commons/src/main/java/com/jzg/commons/entity/finance/vo/InsFeeFollowOrderVo.java

@@ -47,6 +47,15 @@ public class InsFeeFollowOrderVo implements Serializable {
     @Schema(description = "未开票金额")
     private BigDecimal uninvoiced;
 
+    @Schema(description = "对账金额")
+    private BigDecimal reconciliationAmount;
+
+    @Schema(description = "虚增差额")
+    private BigDecimal falselyIncreasedDifference;
+
+    @Schema(description = "虚增原因")
+    private String falselyIncreasedReason;
+
     @Schema(description = "本次开票金额")
     private BigDecimal invoicedAmountTime;
 

+ 203 - 0
commons/src/main/java/com/jzg/commons/entity/orders/vo/FeeAuditVo.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.orders.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jzg.commons.core.base.BaseModel;
@@ -24,11 +25,13 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "保险公司")
     private String companyName;
 
+    @ExcelIgnore
     @Schema(description = "保险公司ID")
     private String companyId;
     /**
      * 保险公司名称及父级的名称,例如
      */
+    @ExcelIgnore
     @Schema(description = "保险公司名称及父级的名称")
     private String companyALlName;
 
@@ -141,12 +144,212 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "权益金额")
     private BigDecimal equityAmount;
 
+    @ExcelIgnore
     @Schema(description = "是否是疑问单")
     private int problem;
 
+    @ExcelProperty("设置为疑问单的原因")
     @Schema(description = "设置为疑问单的原因")
     private String problemReason;
 
+    @ExcelProperty("设为疑问单的时间")
     @Schema(description = "设为疑问单的时间")
     private String problemTime;
+
+
+    @ExcelProperty("总保费")
+    @Schema(description = "总保费")
+    private BigDecimal totalPremium;
+
+    @ExcelProperty("交强险应收费用")
+    @Schema(description = "交强险应收费用")
+    private BigDecimal jqReceivablePremium;
+
+    @ExcelProperty("商业险应收费用")
+    @Schema(description = "商业险应收费用")
+    private BigDecimal syReceivablePremium;
+
+    @ExcelProperty("驾意险应收费用")
+    @Schema(description = "驾意险应收费用")
+    private BigDecimal jyReceivablePremium;
+
+    @ExcelProperty("总应收费用")
+    @Schema(description = "总应收费用")
+    private BigDecimal totalReceivablePremium;
+
+    @ExcelProperty("交强险应付费用")
+    @Schema(description = "交强险应付费用")
+    private BigDecimal jqPayablePremium;
+
+    @ExcelProperty("商业险应付费用")
+    @Schema(description = "商业险应付费用")
+    private BigDecimal syPayablePremium;
+
+    @ExcelProperty("驾意险应付费用")
+    @Schema(description = "驾意险应付费用")
+    private BigDecimal jyPayablePremium;
+
+    @ExcelProperty("总应付费用")
+    @Schema(description = "总应付费用")
+    private BigDecimal totalPayablePremium;
+
+    @ExcelProperty("交强险手续费费用")
+    @Schema(description = "交强险手续费费用")
+    private BigDecimal jqCommissionPremium;
+
+    @ExcelProperty("商业险手续费费用")
+    @Schema(description = "商业险手续费费用")
+    private BigDecimal syCommissionPremium;
+
+    @ExcelProperty("驾意险手续费费用")
+    @Schema(description = "驾意险手续费费用")
+    private BigDecimal jyCommissionPremium;
+
+    @ExcelProperty("交强险跟单费费用")
+    @Schema(description = "交强险跟单费费用")
+    private BigDecimal jqFollowPremium;
+
+    @ExcelProperty("商业险跟单费费用")
+    @Schema(description = "商业险跟单费费用")
+    private BigDecimal syFollowPremium;
+
+    @ExcelProperty("驾意险跟单费费用")
+    @Schema(description = "驾意险跟单费费用")
+    private BigDecimal jyFollowPremium;
+
+    @ExcelProperty("交强险加投费费用")
+    @Schema(description = "交强险加投费费用")
+    private BigDecimal jqAdditionalPremium;
+
+    @ExcelProperty("商业险加投费费用")
+    @Schema(description = "商业险加投费费用")
+    private BigDecimal syAdditionalPremium;
+
+    @ExcelProperty("驾意险加投费费用")
+    @Schema(description = "驾意险加投费费用")
+    private BigDecimal jyAdditionalPremium;
+
+    @ExcelProperty("交强留点费用")
+    @Schema(description = "交强留点费用")
+    private BigDecimal jqKeepPointPremium;
+
+    @ExcelProperty("商业留点费用")
+    @Schema(description = "商业留点费用")
+    private BigDecimal syKeepPointPremium;
+
+    @ExcelProperty("驾意留点费用")
+    @Schema(description = "驾意留点费用")
+    private BigDecimal jyKeepPointPremium;
+
+    @ExcelProperty("交强入口比例")
+    @Schema(description = "交强入口比例")
+    private BigDecimal jqInletRatio;
+
+    @ExcelProperty("商业入口比例")
+    @Schema(description = "商业入口比例")
+    private BigDecimal syInletRatio;
+
+    @ExcelProperty("驾意入口比例")
+    @Schema(description = "驾意入口比例")
+    private BigDecimal jyInletRatio;
+
+    @ExcelProperty("交强手续费比例")
+    @Schema(description = "交强手续费比例")
+    private BigDecimal jqCommissionRatio;
+
+    @ExcelProperty("商业手续费比例")
+    @Schema(description = "商业手续费比例")
+    private BigDecimal syCommissionRatio;
+
+    @ExcelProperty("驾意手续费比例")
+    @Schema(description = "驾意手续费比例")
+    private BigDecimal jyCommissionRatio;
+
+    @ExcelProperty("交强跟单比例")
+    @Schema(description = "交强跟单比例")
+    private BigDecimal jqFollowRatio;
+
+    @ExcelProperty("商业跟单比例")
+    @Schema(description = "商业跟单比例")
+    private BigDecimal syFollowRatio;
+
+    @ExcelProperty("驾意跟单比例")
+    @Schema(description = "驾意跟单比例")
+    private BigDecimal jyFollowRatio;
+
+    @ExcelProperty("交强加投比例")
+    @Schema(description = "交强加投比例")
+    private BigDecimal jqAdditionalRatio;
+
+    @ExcelProperty("商业加投比例")
+    @Schema(description = "商业加投比例")
+    private BigDecimal syAdditionalRatio;
+
+    @ExcelProperty("驾意加投比例")
+    @Schema(description = "驾意加投比例")
+    private BigDecimal jyAdditionalRatio;
+
+    @ExcelProperty("交强留点比例")
+    @Schema(description = "交强留点比例")
+    private BigDecimal jqKeepPointRatio;
+
+    @ExcelProperty("商业留点比例")
+    @Schema(description = "商业留点比例")
+    private BigDecimal syKeepPointRatio;
+
+    @ExcelProperty("驾意留点比例")
+    @Schema(description = "驾意留点比例")
+    private BigDecimal jyKeepPointRatio;
+
+    @ExcelProperty("交强出口比例")
+    @Schema(description = "交强出口比例")
+    private BigDecimal jqExportRatio;
+
+    @ExcelProperty("商业出口比例")
+    @Schema(description = "商业出口比例")
+    private BigDecimal syExportRatio;
+
+    @ExcelProperty("驾意出口比例")
+    @Schema(description = "驾意出口比例")
+    private BigDecimal jyExportRatio;
+
+    @ExcelProperty("交强出口费用")
+    @Schema(description = "交强出口费用")
+    private BigDecimal jqExportPremium;
+
+    @ExcelProperty("商业出口费用")
+    @Schema(description = "商业出口费用")
+    private BigDecimal syExportPremium;
+
+    @ExcelProperty("驾意出口费用")
+    @Schema(description = "驾意出口费用")
+    private BigDecimal jyExportPremium;
+
+    @ExcelProperty("交强出口留点比例")
+    @Schema(description = "交强出口留点比例")
+    private BigDecimal jqExportKeepPointRatio;
+
+    @ExcelProperty("商业出口留点比例")
+    @Schema(description = "商业出口留点比例")
+    private BigDecimal syExportKeepPointRatio;
+
+    @ExcelProperty("驾意出口留点比例")
+    @Schema(description = "驾意出口留点比例")
+    private BigDecimal jyExportKeepPointRatio;
+
+    @ExcelProperty("交强出口留点费用")
+    @Schema(description = "交强出口留点费用")
+    private BigDecimal jqExportKeepPointPremium;
+
+    @ExcelProperty("商业出口留点费用")
+    @Schema(description = "商业出口留点费用")
+    private BigDecimal syExportKeepPointPremium;
+
+    @ExcelProperty("驾意出口留点费用")
+    @Schema(description = "驾意出口留点费用")
+    private BigDecimal jyExportKeepPointPremium;
+
+    @ExcelProperty("权益相关:可用金额<可用金额=出口费用➖出口人留点费用>")
+    @Schema(description = "权益相关:可用金额<可用金额=出口费用➖出口人留点费用>")
+    private BigDecimal availableAmount;
 }

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAgreementCostRule.java

@@ -8,11 +8,15 @@ import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
+
 @Data
 @Schema(description = "协议费用管理规则")
 @TableName("ptl_agreement_cost_rule")
 public class PtlAgreementCostRule extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = 6453347371073301817L;
     @TableId(type = IdType.ASSIGN_ID)
     private String id;
 

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserActivityCompleteInRule.java

@@ -1,6 +1,7 @@
 package com.jzg.commons.entity.po;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jzg.commons.core.base.BaseModel;
@@ -59,4 +60,9 @@ public class SysUserActivityCompleteInRule extends BaseModel {
 
     @Schema(description = "领取时间")
     private LocalDateTime receiveTime;
+    /**
+     * 本地生活userId
+     */
+    @TableField(exist=false)
+    private String liveUserId;
 }

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

@@ -5,6 +5,7 @@ import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
@@ -12,6 +13,8 @@ import java.time.LocalDateTime;
 @Data
 public class AgreementVo extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = -7102028681863699045L;
     /** 主键 */
     @Schema(description = "主键")
     private String id;

+ 37 - 0
commons/src/main/java/com/jzg/commons/entity/vo/AmountAuditVo.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -11,12 +12,35 @@ import lombok.EqualsAndHashCode;
 import java.io.Serial;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
 
 @EqualsAndHashCode(callSuper = true)
 @Schema(description = "提现申请表VO")
 @Data
 public class AmountAuditVo  extends BaseModel {
 
+    @ExcelIgnore
+    @Schema(description = "主键")
+    private int auditingStatus;
+
+    @ExcelProperty("付款状态")
+    @Schema(description = "付款状态")
+    private String auditingStatusName;
+
+    @ExcelIgnore
+    private static Map<String,String> auditingStatusMap= new HashMap<>();
+    static {
+        auditingStatusMap.put("0","待付款");
+        auditingStatusMap.put("1","已付款");
+        auditingStatusMap.put("2","拒绝付款");
+
+    }
+    public String getAuditingStatusName() {
+        return auditingStatusMap.getOrDefault(Objects.toString(this.auditingStatus),this.auditingStatus+"");
+    }
+
     @Serial
     private static final long serialVersionUID = 4658187667789639800L;
     @ExcelProperty("主键")
@@ -107,17 +131,30 @@ public class AmountAuditVo  extends BaseModel {
     @Schema(description = "驳回人")
     private String rejectPerson;
 
+    @ExcelIgnore
     @Schema(description = "提现人")
     private String withdrawalRequester;
 
+    @ExcelProperty("提现时间")
     @Schema(description = "提现时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime withdrawalRequestTime;
 
+    @ExcelProperty("审核时间")
     @Schema(description = "审核时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime auditingTime;
 
     @Schema(description = "凭证号")
+    @ExcelProperty("凭证号")
     private String voucherId;
+
+    @Schema(description = "付款账号简称")
+    @ExcelProperty("付款账号简称")
+    private String payAccountName;
+
+    @Schema(description = "付款账号的银行卡")
+    @ExcelProperty("付款账号的银行卡")
+    private String payAccountBankNo;
+
 }

+ 50 - 36
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java

@@ -52,7 +52,7 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
         }
         if (!ObjectUtils.isEmpty(quoteVo.getBiRiskInfoVo())) {
             ContractsDTO baseContracts = getBaseContracts(quoteVo.getBiRiskInfoVo(), quoteVo, dataDTO, customerNegotiatePrice, userDetailResponse, departmentPlanCode.getCode(), departmentPlanCode.getProductCode(), checkVehicleCodeSecret);
-            baseContracts.addBusinessInsurance(quoteVo.getKindInfoVo(),quoteVo,energyTypeCode);
+            baseContracts.addBusinessInsurance(quoteVo.getKindInfoVo(),quoteVo,energyTypeCode, customerNegotiatePrice);
             baseContracts.addBiPolicyRatios();
             this.contracts.add(baseContracts);
         }
@@ -153,51 +153,65 @@ public class AnShengCrawlerCalculatePremiumApplyMessage {
             System.out.println(i);
         }
 
-        public void addBusinessInsurance(List<KindInfoVo> kindInfoVo, QuoteVo quoteVo,String energyTypeCode) {
+        public void addBusinessInsurance(List<KindInfoVo> kindInfoVo, QuoteVo quoteVo,String energyTypeCode,String customerNegotiatePrice) {
             String seatCount = String.valueOf(Integer.parseInt(quoteVo.getCarInfoVo().getSeatCount()) - 1);
             for (KindInfoVo kind : kindInfoVo) {
                 PolicyCoveragesDTO dto = new PolicyCoveragesDTO(kind);
+                if (StringUtils.equals("机动车损失保险",dto.getDutyChineseName()) || StringUtils.equals("新能源汽车损失保险",dto.getDutyChineseName())){
+                    dto.setInsuredAmount(customerNegotiatePrice);
+                }
                 String code = dto.getDutyCode();
                 if (StringUtils.equalsAny(code, "APL", "APLDUOM","NEAPL")) dto.setSeats(seatCount);
                 else if (StringUtils.equalsAny(code, "ADL", "NEADL")) dto.setSeats("1");
                 policyCoverages.add(dto);
             }
-            PolicyCoveragesDTO dto = new PolicyCoveragesDTO();
-            dto.setDutyCode(StringUtils.equals("0",energyTypeCode) ? "STORRS" : "NESTORR");
-            dto.setDutyChineseName(StringUtils.equals("0",energyTypeCode) ? "道路救援服务特约条款" : "道路救援服务特约条款(新能源车)");
-            dto.setInsuredAmount("0");
-            dto.setEquipmentInsureAmount("");
-            dto.setPremiumRate("");
-            dto.setDeductibleDiscount("");
-            dto.setTotalActualPremium("");
-            dto.setDeductionRate("0");
-            dto.setServiceNum("2");
-            dto.setIsTelpeson("1");
-            dto.setTelPhone("");
-            dto.setMileage("");
-            dto.setSetMeal("");
-            dto.setFireMultiple("");
-            dto.setAllAmount("");
-            dto.setRiskPremum("");
-            dto.setSeats("");
-            dto.setDeductible("");
-            dto.setTotalStandardPremium(0);
-            dto.setAddedValueTax(0);
-            dto.setTotalAgreePremium(0);
-            dto.setTotalNetPremium(0);
-            dto.setNewEquipmentList(Lists.newArrayList());
-            dto.setChargingPostDataList(Lists.newArrayList());
-            dto.setFullYearPremium("");
-            dto.setDieAmount("");
-            dto.setMedicalAmount("");
-            dto.setPropertyAmount("");
-            dto.setNoFaultDieAmount("");
-            dto.setNoFaultMedicalAmount("");
-            dto.setNoFaultPropertyAmount("");
-            dto.setBasePremium("");
-
         }
 
+
+        /**
+         *
+
+
+         PolicyCoveragesDTO dto = new PolicyCoveragesDTO();
+         dto.setDutyCode(StringUtils.equals("0",energyTypeCode) ? "STORRS" : "NESTORR");
+         dto.setDutyChineseName(StringUtils.equals("0",energyTypeCode) ? "道路救援服务特约条款" : "道路救援服务特约条款(新能源车)");
+         dto.setInsuredAmount("0");
+         dto.setEquipmentInsureAmount("");
+         dto.setPremiumRate("");
+         dto.setDeductibleDiscount("");
+         dto.setTotalActualPremium("");
+         dto.setDeductionRate("0");
+         dto.setServiceNum("2");
+         dto.setIsTelpeson("1");
+         dto.setTelPhone("");
+         dto.setMileage("");
+         dto.setSetMeal("");
+         dto.setFireMultiple("");
+         dto.setAllAmount("");
+         dto.setRiskPremum("");
+         dto.setSeats("");
+         dto.setDeductible("");
+         dto.setTotalStandardPremium(0);
+         dto.setAddedValueTax(0);
+         dto.setTotalAgreePremium(0);
+         dto.setTotalNetPremium(0);
+         dto.setNewEquipmentList(Lists.newArrayList());
+         dto.setChargingPostDataList(Lists.newArrayList());
+         dto.setFullYearPremium("");
+         dto.setDieAmount("");
+         dto.setMedicalAmount("");
+         dto.setPropertyAmount("");
+         dto.setNoFaultDieAmount("");
+         dto.setNoFaultMedicalAmount("");
+         dto.setNoFaultPropertyAmount("");
+         dto.setBasePremium("");
+
+
+
+         */
+
+
+
         public ContractsDTO(RiskInfoVo riskInfoVo, QuoteVo quoteVo, AnShengCrawlerSearchVehicleByVinResponse.DataDTO dataDTO,
                             String customerNegotiatePrice, AnShengCrawlerGetUserDetailResponse.DataDTO.AgentDefineDTO userDetailResponse,
                             String planCode, String productCode, String checkVehicleCodeSecret) {

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

@@ -238,28 +238,33 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
         saveThePolicyNumber(ordersNo, applyApplicationResponse);
         UnderwritingResultsVo underwritingResultsVo = new UnderwritingResultsVo();
         AnShengCrawlerOrder anShengCrawlerOrder = anShengCrawlerOrderService.getById(ordersNo);
-
-        PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
-        if (applyApplicationResponse.getCode().equals(200)) {
-            PaymentLinkVo paymentLinkVo = new PaymentLinkVo();
-            paymentLinkVo.setOrder(underwritingVo.getOrder());
-            paymentLinkResultsVo = loopAcquisitionPaymentLink(paymentLinkVo);
+        PaymentLinkResultsVo paymentLinkResultsVo;
+        Integer code = applyApplicationResponse.getCode();
+        if (!code.equals(200)) {
+            underwritingResultsVo.setUnderwritingResult(applyApplicationResponse.getMessage());
+            underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
+            return underwritingResultsVo;
         }
-
-        if (!applyApplicationResponse.getCode().equals(200) && StringUtils.isEmpty(paymentLinkResultsVo.getPaymentLink())) {
+        PaymentLinkVo paymentLinkVo = new PaymentLinkVo();
+        paymentLinkVo.setOrder(underwritingVo.getOrder());
+        paymentLinkResultsVo = loopAcquisitionPaymentLink(paymentLinkVo);
+        // 支付链接为空直接失败返回
+        if (StringUtils.isEmpty(paymentLinkResultsVo.getPaymentLink())) {
             underwritingResultsVo.setUnderwritingResult(applyApplicationResponse.getMessage());
             underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
             return underwritingResultsVo;
-        } else {
-            underwritingResultsVo.setJqApplyNo(anShengCrawlerOrder.getCiPolicyNumber());
-            underwritingResultsVo.setSyApplyNo(anShengCrawlerOrder.getBiPolicyNumber());
-            if (anShengCrawlerOrder.getNiInfos().size() > 0) {
-                underwritingResultsVo.setJyApplyNo(anShengCrawlerOrder.getNiInfos().get(0).getNiPolicyNumber());
-            }
-            underwritingResultsVo.setPaymentLink(paymentLinkResultsVo.getPaymentLink());
-            underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.PAY_PENDING);
         }
+        // 正常赋值逻辑
+        underwritingResultsVo.setJqApplyNo(anShengCrawlerOrder.getCiPolicyNumber());
+        underwritingResultsVo.setSyApplyNo(anShengCrawlerOrder.getBiPolicyNumber());
+        if (anShengCrawlerOrder.getNiInfos().size() > 0) {
+            underwritingResultsVo.setJyApplyNo(anShengCrawlerOrder.getNiInfos().get(0).getNiPolicyNumber());
+        }
+        underwritingResultsVo.setPaymentLink(paymentLinkResultsVo.getPaymentLink());
+        underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.PAY_PENDING);
         return underwritingResultsVo;
+
+
     }
 
     /**

+ 4 - 0
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/entity/Response/HtCrawlerCarQueryResponse.java

@@ -1,8 +1,10 @@
 package com.jzg.quotation.huatai.crawler.entity.Response;
 
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.commons.filter.CarModelsFilter;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.io.Serial;
 import java.io.Serializable;
@@ -14,6 +16,8 @@ import java.util.List;
  * @date: 2025/4/15 10:03
  **/
 @Data
+@NoArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class HtCrawlerCarQueryResponse implements Serializable {
     @Serial
     private static final long serialVersionUID = -5451109570218394790L;

+ 52 - 20
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java

@@ -2,6 +2,8 @@ package com.jzg.quotation.huatai.crawler.service.Impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
@@ -325,13 +327,35 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         //车辆查询
         HtCrawlerCarQueryResponse.DataDTO dataDTO = req.carQuery(
                 new HtCrawlerCarQueryRequest(car, modelcodexh), req.getHeaders1(), car);
-        //过滤车型
+        //过滤车辆
         HtCrawlerCarQueryResponse.DataDTO.DataListDTO carDTO = CarModelsFilterUtils.to(dataDTO.getDatalist(), car);
         log.info("过滤后的车型carDTO: {}", JSONObject.toJSONString(carDTO));
         //保存车辆信息
         executeSaveCarQuery(carDTO, dataDTO, car, cookie);
         //车型查询
-        executeCarModelCodexhQuery(carDTO, car, cookie, quotationNo);
+        String carData = executeCarModelCodexhQuery(carDTO, car, cookie, quotationNo);
+        // 核心:关闭「未知字段抛出异常」,优先级 > 类注解
+        MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        // 可选:兼容空字符串、大小写字段(对接第三方接口常用)
+        MAPPER.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+        Map<String, Object> rootMap = MAPPER.readValue(carData, new TypeReference<Map<String, Object>>() {});
+        String datalistStr = (String) rootMap.get("datalist");
+        String datalist2Str = (String) rootMap.get("datalist2");
+        if (StringUtils.hasText(datalistStr) && StringUtils.hasText(datalist2Str)) {
+            List<HtCrawlerCarQueryResponse.DataDTO.DataListDTO> dataList = new ArrayList<>();
+            if (StringUtils.hasText(datalistStr)) {
+                dataList = MAPPER.readValue(datalistStr, new TypeReference<List<HtCrawlerCarQueryResponse.DataDTO.DataListDTO>>() {});
+            }
+            List<HtCrawlerCarQueryResponse.DataDTO.DataList2DTO> dataList2 = new ArrayList<>();
+            if (StringUtils.hasText(datalist2Str)) {
+                dataList2 = MAPPER.readValue(datalist2Str, new TypeReference<List<HtCrawlerCarQueryResponse.DataDTO.DataList2DTO>>() {});
+            }
+            dataDTO = new HtCrawlerCarQueryResponse.DataDTO();
+            dataDTO.setDatalist(dataList);
+            dataDTO.setDatalist2(dataList2);
+            //过滤车型
+            carDTO = CarModelsFilterUtils.to(dataDTO.getDatalist(), car);
+        }
         //额外请求
         executeMessageCentreTimeBoom(cookie);
         //以上请求模拟浏览器请求流程,否则报价失败
@@ -355,7 +379,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         post(BASE_URL + "/htcsp/VehicleInfoEntryAction.do?cmd=savecarquery", buildCarQueryHeaders(cookie), fd);
     }
 
-    private void executeCarModelCodexhQuery(HtCrawlerCarQueryResponse.DataDTO.DataListDTO carDTO,
+    private String executeCarModelCodexhQuery(HtCrawlerCarQueryResponse.DataDTO.DataListDTO carDTO,
                                             CarInfoVo car, String cookie, String quotationNo) {
         MultiValueMap<String, String> fd = new LinkedMultiValueMap<>();
         fd.add("modelCode", carDTO.getModelcodexh());
@@ -376,7 +400,9 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         fd.add("carModelComCode", XBCOM_CODE);
         fd.add("quotationNo", quotationNo);
 
-        post(BASE_URL + "/htcsp/VehicleInfoEntryAction.do?cmd=carModelCodexhQuery", buildCarModelCodexhHeaders(cookie), fd);
+        String carDataResponse = post(BASE_URL + "/htcsp/VehicleInfoEntryAction.do?cmd=carModelCodexhQuery", buildCarModelCodexhHeaders(cookie), fd);
+        log.info("carModelCodexhQuery carDataResponse: {}", carDataResponse);
+        return carDataResponse;
     }
 
     private void executeMessageCentreTimeBoom(String cookie) {
@@ -437,6 +463,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
                 HttpHeaders h = buildQuoteStep1Headers(cookie);
                 HtCrawlerSaveOneStepRequest r = new HtCrawlerSaveOneStepRequest(q, currentPre.carDTO(),
                         currentPre.params(), quotationNo, currentPre.dataDTO(), dto, gsInfo);
+                log.info("saveOneStept: {}", JSONObject.toJSONString(r));
                 String body = req.saveOneStept(r, h).getBody().toString();
                 String mealid = extractMealId(body);
                 //机动车损失保险
@@ -604,16 +631,28 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
 
     private HtCrawlerQuoteResponse.DataDTO resolveQuoteResponse(DuplQuoteResult duplQuoteResult, String decryptData, String mealid, String limitAmount,
                                                                 HttpHeaders h, String personalInsuredJSON) {
+        log.info("报价结果: {}", convertResponseMsg(decryptData));
+        if (decryptData.contains("未传送车辆过户标志")) {
+            log.error("报价失败: {}", convertResponseMsg(decryptData));
+            throw new SystemException(ERR_PREFIX + convertResponseMsg(decryptData));
+        }
         if (!decryptData.contains("录入的校验码有误") && decryptData.contains("erroeInfo") && !duplQuoteResult.dupl()) {
-            log.error("报价失败: {}", decryptData);
+            log.error("报价失败: {}", convertResponseMsg(decryptData));
             throw new SystemException(ERR_PREFIX + convertResponseMsg(decryptData));
         }
+        if (decryptData.contains("车损险保额不能高于")) {
+            Pattern pattern = Pattern.compile("车损险保额不能高于(\\d+\\.?\\d*)元");
+            Matcher matcher = pattern.matcher(decryptData);
+            if (matcher.find()) limitAmount = matcher.group(1);
+            decryptData = req.quote(new HtCrawlerQuoteRequest(duplQuoteResult.q(), mealid, limitAmount, "", personalInsuredJSON), h);
+            return resolveQuoteResponse(duplQuoteResult, decryptData, mealid, limitAmount, h, personalInsuredJSON);
+        }
         HtCrawlerQuoteResponse.DataDTO data = JSONObject.parseObject(decryptData, HtCrawlerQuoteResponse.DataDTO.class);
-        if (data.getApplicationdto() != null) return data;
+        if (data.getApplicationdto() != null && !decryptData.contains("车损险保额不能高于")) return data;
 
         List<HtCrawlerQuoteResponse.DataDTO.BasePartDTOListDTO.BasePartDTO> list =
                 data.getBasepartdtolist() != null ? data.getBasepartdtolist().getBasepartdto() : null;
-        if (list == null || list.isEmpty()) return data;
+        if ((list == null || list.isEmpty()) && !decryptData.contains("车损险保额不能高于")) return data;
 
         for (int i = 0; i < MAX_RETRIES; i++) {
             String basePartJSON = buildBasePartJSON(list);
@@ -704,36 +743,29 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         HtCrawlerSubmitRequest submit = new HtCrawlerSubmitRequest(vo, params, order.getCiCategory(), order.getBiCategory());
         String res = req.submit2(submit, req.getHeaders());
         log.info("提交核保结果: {}", res);
+
         Map<String, Object> map = new HashMap<>();
         try {
             map = MAPPER.readValue(res, Map.class);
         } catch (JsonProcessingException e) {
-            throw new SystemException("核保失败,未知异常");
+            throw new SystemException("核保失败,未知异常, {}", convertResponseMsg(res));
         }
 
-        if (isUnderwritingFailed(order.getCiCategory(), map, res)) {
-            throw new SystemException("核保失败-------" + convertResponseMsg(map.get("MSG").toString()));
+        if (!"1,2,3,4".contains(order.getCiCategory()) || "Y".equals(str(map, "isOver"))
+                || "重新计算保费".equals(str(map, "MSG")) || res.contains("下发修改意见") || res.contains("转人工意见")) {
+            throw new SystemException("核保失败-------" + convertResponseMsg(res));
         }
         if (res.contains("起保时间不正确")) {
             throw new SystemException("起保时间不正确-------即时起保分钟数必须为00/15/30/45\n请重新选择起保时间!");
         }
         if (res.contains("转人工")) return handleManualUnderwriting(order, params);
-        if (res.contains("已通过核保未实收") || isPassHB(map)) return handlePassedUnderwriting(order, params, vo);
+        if (res.contains("已通过核保未实收") || "Y".equals(str(map, "isPassHB"))) return handlePassedUnderwriting(order, params, vo);
 
         UnderwritingResultsVo r = new UnderwritingResultsVo();
         r.setUnderwritingStatus(InsOrderStatusEnum.WAIT_AUDIT);
         return r;
     }
 
-    private boolean isUnderwritingFailed(String ci, Map<String, Object> m, String res) {
-        return !"1,2,3,4".contains(ci)
-                || "Y".equals(str(m, "isOver"))
-                || "重新计算保费".equals(str(m, "MSG"))
-                || res.contains("强制下发修改意见");
-    }
-
-    private boolean isPassHB(Map<String, Object> m) { return "Y".equals(str(m, "isPassHB")); }
-
     private UnderwritingResultsVo handleManualUnderwriting(HtCrawlerOrder order, HtCrawlerConfigureParameters params) {
         try {
             // 提交人工核保

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

@@ -15,6 +15,7 @@ import com.jzg.commons.entity.po.*;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.vo.*;
+import com.jzg.commons.util.BigDecimalUtil;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.summary.aop.FactorMatch;
 import com.jzg.quotation.summary.client.PtlNewAgreementClient;
@@ -230,6 +231,7 @@ public class QuoteVerificationAspect {
         insFeeOrders.setJyPremium(insOrdersCosts.getJyPremium());
         insFeeOrders.setTotalPremium(insOrdersCosts.getSumPremium());
         // 获取协议是平台协议还是私有协议 1 平台协议 2 私有协议
+        AgreementVo agreement = agreementInfoVo.getAgreement();
         String agreementType = agreementInfoVo.getAgreement().getAgreementType();
         BigDecimal jqEntranceFeeRatio = convertPercent(agreementInfoVo.getAgreement().getJqEntranceFeeRatio());
         BigDecimal syEntranceFeeRatio = convertPercent(agreementInfoVo.getAgreement().getSyEntranceFeeRatio());
@@ -249,32 +251,36 @@ public class QuoteVerificationAspect {
         BigDecimal syFollowRatio = calculateFollowRatio(syCostType, syEntranceFeeRatio);
         BigDecimal jyFollowRatio = calculateFollowRatio(jyCostType, jyEntranceFeeRatio);
 
-        // 5. 根据协议类型确定税率因子(平台协议为1,私有协议为1/1.06)
-        BigDecimal taxFactor = "1".equals(agreementType)
-                ? BigDecimal.ONE
-                : new BigDecimal("1").divide(new BigDecimal("1.06"), 10, RoundingMode.HALF_EVEN);
+        // modify by lipf ,2026年6月17日15:30:54 是否除以1.06,不再根据平台协议还是私有协议进行判断,而是根据协议的是否含税来进行判断
+        String withTax = agreement.getWithTax();
+        BigDecimal taxFactor = new BigDecimal("1");
+        if ("0".equals(withTax)) {
+            // 不含税:保费 / 1.06
+            taxFactor =  new BigDecimal("1.06");
+        }
+
 
         // 6. 统一处理各险种的费用计算(应收、应付、各类费用)
         processInsuranceType(
                 insOrdersCosts.getJqPremium(), jqCostType, jqEntranceFeeRatio, jqFollowRatio, taxFactor,
                 insFeeOrders,
                 InsFeeOrders::setJqReceivablePremium, InsFeeOrders::setJqPayablePremium,
-                InsFeeOrders::setJqCommissionPremium, InsFeeOrders::setJqFollowPremium, InsFeeOrders::setJqAdditionalPremium
-        );
+                InsFeeOrders::setJqCommissionPremium, InsFeeOrders::setJqFollowPremium, InsFeeOrders::setJqAdditionalPremium,
+                InsFeeOrders::setJqKeepPointRatio,InsFeeOrders::setJqKeepPointPremium);
 
         processInsuranceType(
                 insOrdersCosts.getSyPremium(), syCostType, syEntranceFeeRatio, syFollowRatio, taxFactor,
                 insFeeOrders,
                 InsFeeOrders::setSyReceivablePremium, InsFeeOrders::setSyPayablePremium,
-                InsFeeOrders::setSyCommissionPremium, InsFeeOrders::setSyFollowPremium, InsFeeOrders::setSyAdditionalPremium
-        );
+                InsFeeOrders::setSyCommissionPremium, InsFeeOrders::setSyFollowPremium, InsFeeOrders::setSyAdditionalPremium,
+                InsFeeOrders::setSyKeepPointRatio,InsFeeOrders::setSyKeepPointPremium);
 
         processInsuranceType(
                 insOrdersCosts.getJyPremium(), jyCostType, jyEntranceFeeRatio, jyFollowRatio, taxFactor,
                 insFeeOrders,
                 InsFeeOrders::setJyReceivablePremium, InsFeeOrders::setJyPayablePremium,
-                InsFeeOrders::setJyCommissionPremium, InsFeeOrders::setJyFollowPremium, InsFeeOrders::setJyAdditionalPremium
-        );
+                InsFeeOrders::setJyCommissionPremium, InsFeeOrders::setJyFollowPremium, InsFeeOrders::setJyAdditionalPremium,
+                InsFeeOrders::setJyKeepPointRatio,InsFeeOrders::setJyKeepPointPremium);
 
 
         // 7. 计算总应收、总应付、保存费用比例 入库
@@ -332,6 +338,8 @@ public class QuoteVerificationAspect {
      * @param setCommission   手续费setter
      * @param setFollow       跟单费setter
      * @param setAdditional   加投费setter
+     * @param keepPointRate 留点比例
+     * @param keepPointPremium 留点费用
      */
     private void processInsuranceType(
             BigDecimal premium,
@@ -344,7 +352,9 @@ public class QuoteVerificationAspect {
             BiConsumer<InsFeeOrders, BigDecimal> setPayable,
             BiConsumer<InsFeeOrders, BigDecimal> setCommission,
             BiConsumer<InsFeeOrders, BigDecimal> setFollow,
-            BiConsumer<InsFeeOrders, BigDecimal> setAdditional
+            BiConsumer<InsFeeOrders, BigDecimal> setAdditional,
+            BiConsumer<InsFeeOrders, BigDecimal> keepPointRate,
+            BiConsumer<InsFeeOrders, BigDecimal> keepPointPremium
     ) {
         // 若险种配置为空,默认应收应付为0
         if (costType == null || premium == null) {
@@ -358,7 +368,7 @@ public class QuoteVerificationAspect {
         BigDecimal addThrowPercent = convertPercent(costType.getAddThrow());
         BigDecimal exportPercent = convertPercent(costType.getExport());
 
-        // 计算应收金额(保费 * 税率因子 * (入口比例 + 加投比例 + 跟单比例))
+        // 计算应收金额
         BigDecimal taxablePremium = premium.multiply(taxFactor);
 
         // 计算应付金额(保费 * 出口比例,保留2位小数)
@@ -370,14 +380,23 @@ public class QuoteVerificationAspect {
         BigDecimal follow = taxablePremium.multiply(followRatio).setScale(5, RoundingMode.HALF_EVEN);
         setCommission.accept(insFeeOrders, commission);
         setFollow.accept(insFeeOrders, commission);
-        setAdditional.accept(insFeeOrders, taxablePremium.multiply(addThrowPercent).setScale(5, RoundingMode.HALF_EVEN));
+        // modify by lipf, 2026年6月16日15:35:09  加投比例,不需要根据平台/私有进行1.06的计算
 
-        BigDecimal receivable = taxablePremium.add(commission)
-                .add(follow)
-//                .add(taxablePremium.multiply(addThrowPercent))
-//                .add(taxablePremium.multiply(followRatio))
-                .setScale(5, RoundingMode.HALF_EVEN);
+        BigDecimal addAmount = premium.multiply(addThrowPercent).setScale(5, RoundingMode.HALF_EVEN);
+        setAdditional.accept(insFeeOrders,addAmount);
+
+        BigDecimal receivable = BigDecimalUtil.add(commission,follow);
+        receivable = receivable.setScale(5, RoundingMode.HALF_EVEN);
         setReceivable.accept(insFeeOrders, receivable);
+
+        // 设置留点比例 入口比例+加投比例-出口比例
+        BigDecimal keepPointRateCal  = BigDecimalUtil.subtract(BigDecimalUtil.add(BigDecimalUtil.multiply(inletPercent,taxFactor),addThrowPercent),exportPercent)
+                .setScale(5,RoundingMode.HALF_EVEN);
+        keepPointRate.accept(insFeeOrders, keepPointRateCal);
+        // 设置留点比例和留点费用
+        BigDecimal keepPointAmount  = BigDecimalUtil.subtract(BigDecimalUtil.add(receivable,addAmount),payable)
+                .setScale(5,RoundingMode.HALF_EVEN);
+        keepPointPremium.accept(insFeeOrders,keepPointAmount);
     }
 
     /**

+ 306 - 168
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -18,6 +18,7 @@ import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.base.StateResult;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.LotteryCounDTO;
+import com.jzg.commons.entity.dto.MessageAddParam;
 import com.jzg.commons.entity.dto.UnifiedUserCenterDTO;
 import com.jzg.commons.entity.enums.MessageCodeEnum;
 import com.jzg.commons.entity.enums.YesNoEnum;
@@ -170,6 +171,8 @@ public class UnifyOrderManager {
     @Value("${lottery.activity.scene:3}")
     private Integer lotteryScene;
 
+
+
     //本地生活在一账通的固定平台ID
     private static final String CLIENT_ID = "bdsh-X9yZ1wV3uT5sR7qP9o";
 
@@ -286,7 +289,6 @@ public class UnifyOrderManager {
             if (CollUtil.isNotEmpty(quoteVo.getKindInfoVo())) {
                 QuoteInfoConverter.converterKindInfoVo(quoteVo.getKindInfoVo(), quoteKindMappingMap.get(QuoteRuleCategory.KIND.getCode()), quoteVo.getCarInfoVo());
             }
-            log.info("报价后数据");
             log.info("调用保险公司的api进行报价:报价参数: quoteVO=[{}]", JSONUtil.toJsonStr(quoteVo));
             quoteResultsVo = quoteService.quote(quoteVo);
             log.info("调用保险公司的api进行报价:报价结果: quoteResultsVo=[{}]", JSONUtil.toJsonStr(quoteResultsVo));
@@ -305,86 +307,8 @@ public class UnifyOrderManager {
             insOrdersService.orderAfterUpdateQuote(ordersNo, quoteResultsVo);
             log.info("报价返回:{}", JSON.toJSONString(quoteResultsVo));
 
-            //////////////////////////////////////////新增营销抽奖活动////////////////////////////////////////////////
-            //远程调用活动列表
-            //匹配规则 每报价()次,可得()次抽奖机会,每日最多()次抽奖
-//            HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
-//            if (result == null || result.getCode() != 200 || result.getData() == null) {
-//                log.error("统一报价,查询本地生活的活动列表异常");
-//            } else {
-//                for (LotteryActivityVO activity : result.getData()) {
-//                    // 检查活动是否有效
-//                    if (!LocalDate.now().isBefore(activity.getActivityStartTime())
-//                            && !LocalDate.now().isAfter(activity.getActivityEndTime())) {
-//                        continue;
-//                    }
-//
-//                    if (activity.getLocalActivityTables() == null) {
-//                        continue;
-//                    }
-//                    // 遍历所有本地活动表
-//                    for (LocalActivityTableVO table : activity.getLocalActivityTables()) {
-//                        // 只处理 type=6 的报价规则
-//                        if (!"6".equals(table.getType())) {
-//                            continue;
-//                        }
-//
-//                        // 只处理本租户的报价规则
-//                        if (!baseController.getUserSystemCode().equals(table.getTenantId())) {
-//                            continue;
-//                        }
-//                        // 查询是否在一账通绑定
-//                        UnifiedUserCenterDTO unifiedUserCenterDTO = new UnifiedUserCenterDTO();
-//                        unifiedUserCenterDTO.setUserId(quoteVo.getOrder().getRealQuoteUserId());
-//                        unifiedUserCenterDTO.setClientId(CLIENT_ID);
-//                        unifiedUserCenterDTO.setTenantId(baseController.getUserSystemCode());
-//                        HttpResult<UnifiedUserClientVO> unifiedUserClientVOHttpResult = null;
-//                        try {
-//                            unifiedUserClientVOHttpResult = localLivingClient.queryBind(unifiedUserCenterDTO);
-//                        } catch (Exception e) {
-//                            log.info("业务员报价,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-//                            log.error("业务员报价,查询用户绑定一账通接口异常", e);
-//                        }
-//                        if (unifiedUserClientVOHttpResult == null || unifiedUserClientVOHttpResult.getCode() != 200 || unifiedUserClientVOHttpResult.getData() == null) {
-//                            // 判断是否满足条件
-//                            // 业务员报价次数是否大于等于本活动规定时间范围内的报价次数
-//                            // 统计业务员的报价次数
-//                            int count = insOrdersService.countQuoteNum(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), activity.getActivityStartTime(), activity.getActivityEndTime());
-//                            if (count >= Integer.parseInt(table.getQutNum()) && count <= Integer.parseInt(table.getQutLotteryMax())) {
-//                                // 存本地记录 等绑定后更新本地记录的同步状态字段即可
-//                                completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
-//                                        table.getId(), table.getQutNum() ,table.getQutLotteryNum() ,table.getQutLotteryMax() ,YesNoEnum.NO.getCode(), 6);
-//                                log.info("业务员报价,满足条件插入记录,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-//                            }
-//                        }else {
-//                            Map<String, List<UnifiedUserClientVO>> userClientGroupMap = unifiedUserClientVOHttpResult.getData().getUserClients()
-//                                    .stream()
-//                                    .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
-//                            // 首先查业务员是否在一账通绑定过本地生活  【已绑定过 远程调抽奖次数增加接口 标记已同步
-//                            if (userClientGroupMap.containsKey(CLIENT_ID)) {
-//                                LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
-//                                lotteryCounDTO.setAppUserId(quoteVo.getOrder().getRealQuoteUserId());
-//                                lotteryCounDTO.setActivityId(activity.getId());
-//                                lotteryCounDTO.setCount(Integer.parseInt(table.getQutLotteryNum()));
-//                                HttpResult<LotteryCountVO> lotteryCountVOHttpResult = null;
-//                                try {
-//                                    lotteryCountVOHttpResult = localLivingClient.addLotteryCount(lotteryCounDTO);
-//                                } catch (Exception e) {
-//                                    log.info("业务员报价,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), table.getQutLotteryNum(), baseController.getUserSystemCode());
-//                                    log.error("业务员报价,远程调用本地生活抽奖次数增加异常", e);
-//                                }
-//                                if (lotteryCountVOHttpResult != null && lotteryCountVOHttpResult.getData().getSuccess()) {
-//                                    // 记录规则完成  标记已同步
-//                                    completeRule(baseController.getUserSystemCode(), quoteVo.getOrder().getRealQuoteUserId(), null, activity.getId(),
-//                                            table.getId(), table.getQutNum(), table.getQutLotteryNum(), table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 6);
-//
-//                                    log.info("业务员报价,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}", quoteVo.getOrder().getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-//                                }
-//                            }
-//                        }
-//                    }
-//                }
-//            }
+            // 处理营销抽奖活动(报价规则 type=6),异常不影响主报价流程
+            handleQuoteLotteryActivity(quoteVo);
 
 
         } catch (Exception e) {
@@ -450,6 +374,164 @@ public class UnifyOrderManager {
                 tenantId, userId, activityId, qutNum, qutLotteryNum, qutLotteryMax);
     }
 
+    /**
+     * 处理报价后的营销抽奖活动(type=6 报价规则)
+     * <p>
+     * 匹配规则:每报价N次,可得M次抽奖机会
+     * 1. 查询本地生活活动列表,筛选有效活动 + 本租户的 type=6 报价规则
+     * 2. 查询用户是否在一账通绑定过本地生活
+     *    - 未绑定:统计报价次数,满足条件则存本地记录,等绑定后同步
+     *    - 已绑定:远程调用抽奖次数增加接口,成功后标记已同步
+     * <p>
+     * 该方法异常不影响主报价流程,所有异常均在内部捕获。
+     *
+     * @param quoteVo 报价请求参数
+     */
+    private void handleQuoteLotteryActivity(QuoteVo quoteVo) {
+        try {
+            // 远程调用活动列表
+            HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
+            if (result == null || result.getCode() != 200 || result.getData() == null) {
+                log.error("统一报价,查询本地生活的活动列表异常");
+                return;
+            }
+
+            String tenantId = baseController.getUserSystemCode();
+            String userId = quoteVo.getOrder().getRealQuoteUserId();
+
+            for (LotteryActivityVO activity : result.getData()) {
+                // 检查活动是否有效(当前时间需在活动时间范围内)
+                if (LocalDate.now().isBefore(activity.getActivityStartTime())
+                        || LocalDate.now().isAfter(activity.getActivityEndTime())) {
+                    continue;
+                }
+                if (activity.getLocalActivityTables() == null) {
+                    continue;
+                }
+
+                for (LocalActivityTableVO table : activity.getLocalActivityTables()) {
+                    // 只处理 type=6 的报价规则
+                    if (!"6".equals(table.getType())) {
+                        continue;
+                    }
+                    // 只处理本租户的报价规则
+                    if (!tenantId.equals(table.getTenantId())) {
+                        continue;
+                    }
+
+                    // 查询用户是否在一账通绑定过本地生活
+                    HttpResult<UnifiedUserClientVO> bindResult = queryUserBind(userId, tenantId);
+                    if (bindResult == null || bindResult.getCode() != 200 || bindResult.getData() == null) {
+                        // 未绑定:统计报价次数,满足条件则存本地记录
+                        handleUnboundQuoteRule(tenantId, userId, activity, table);
+                    } else {
+                        // 已绑定:检查是否绑定了本地生活客户端,若绑定了则远程同步抽奖次数
+                        handleBoundQuoteRule(tenantId, userId, activity, table, bindResult.getData());
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("处理报价抽奖活动异常,不影响主报价流程", e);
+        }
+    }
+
+    /**
+     * 查询用户在一账通的绑定状态
+     */
+    private HttpResult<UnifiedUserClientVO> queryUserBind(String userId, String tenantId) {
+        UnifiedUserCenterDTO dto = new UnifiedUserCenterDTO();
+        dto.setUserId(userId);
+        dto.setClientId(CLIENT_ID);
+        dto.setTenantId(tenantId);
+        try {
+            return localLivingClient.queryBind(dto);
+        } catch (Exception e) {
+            log.info("业务员报价,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", userId, CLIENT_ID, tenantId);
+            log.error("业务员报价,查询用户绑定一账通接口异常", e);
+            return null;
+        }
+    }
+
+    /**
+     * 处理未绑定用户的报价规则:统计报价次数,满足条件则存本地记录
+     */
+    private void handleUnboundQuoteRule(String tenantId, String userId,
+                                         LotteryActivityVO activity, LocalActivityTableVO table) {
+        int count = insOrdersService.countQuoteNum(tenantId, userId,
+                activity.getActivityStartTime(), activity.getActivityEndTime());
+        if (count >= Integer.parseInt(table.getQutNum())
+                && count <= Integer.parseInt(table.getQutLotteryMax())) {
+            completeRule(tenantId, userId, null, activity.getId(),
+                    table.getId(), table.getQutNum(), table.getQutLotteryNum(),
+                    table.getQutLotteryMax(), YesNoEnum.NO.getCode(), 6);
+            log.info("业务员报价,满足条件插入记录,userId:{},clientId:{},tenantId:{}",
+                    userId, CLIENT_ID, tenantId);
+            // 发送抽奖次数下发通知消息
+            HttpResult<SysUserJzgInfo> sysUser = orgClient.queryUserByUserId(userId,tenantId);
+
+            MessageAddParam param = new MessageAddParam();
+            param.setTitle("抽奖次数下发通知消息");
+            param.setContent("{\"eventId\":\"" + activity.getId() + "\",\"localActivityTableId\":\"" + table.getId() + "\",\"message\":\"抽奖次数奖励下发\"}");
+            param.setTplCode("template_13");
+            param.setReceive(List.of(sysUser.getData().getMobile()));
+            orgClient.messageAdd(param);
+        }
+    }
+
+    /**
+     * 处理已绑定用户的报价规则:先判断是否满足规则条件,满足后再远程同步抽奖次数并标记已同步
+     */
+    private void handleBoundQuoteRule(String tenantId, String userId,
+                                       LotteryActivityVO activity, LocalActivityTableVO table,
+                                       UnifiedUserClientVO bindData) {
+        Map<String, List<UnifiedUserClientVO>> clientGroupMap = bindData.getUserClients()
+                .stream()
+                .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
+        if (!clientGroupMap.containsKey(CLIENT_ID)) {
+            return;
+        }
+
+        // 先判断是否满足规则条件
+        int qutLotteryNum = Integer.parseInt(table.getQutLotteryNum());
+        int count = insOrdersService.countQuoteNum(tenantId, userId,
+                activity.getActivityStartTime(), activity.getActivityEndTime());
+        if (count < Integer.parseInt(table.getQutNum()) || count > Integer.parseInt(table.getQutLotteryMax())) {
+            return;
+        }
+        HttpResult<SysUserJzgInfo> sysUser = orgClient.queryUserByUserId(userId,tenantId);
+
+        // 满足条件,远程调用抽奖次数增加接口
+        LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
+        lotteryCounDTO.setAppUserId(userId);
+        lotteryCounDTO.setActivityId(activity.getId());
+        lotteryCounDTO.setCount(qutLotteryNum);
+
+        HttpResult<LotteryCountVO> lotteryResult = null;
+        try {
+            lotteryResult = localLivingClient.addLotteryCount(lotteryCounDTO);
+        } catch (Exception e) {
+            log.info("业务员报价,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}",
+                    userId, table.getQutLotteryNum(), tenantId);
+            log.error("业务员报价,远程调用本地生活抽奖次数增加异常", e);
+        }
+
+        if (lotteryResult != null && lotteryResult.getData().getSuccess()) {
+            completeRule(tenantId, userId, null, activity.getId(),
+                    table.getId(), table.getQutNum(), table.getQutLotteryNum(),
+                    table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 6);
+            log.info("业务员报价,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}",
+                    userId, CLIENT_ID, tenantId);
+
+            // 发送抽奖次数下发通知消息
+            MessageAddParam param = new MessageAddParam();
+            param.setTitle("抽奖次数下发通知消息");
+            param.setContent("{\"eventId\":\"" + activity.getId() + "\",\"localActivityTableId\":\"" + table.getId() + "\",\"message\":\"抽奖次数奖励下发\"}");
+            param.setTplCode("template_13");
+            param.setReceive(List.of(sysUser.getData().getMobile()));
+            orgClient.messageAdd(param);
+        }
+    }
+
 
     @OrderOperationLog(
             module = "车险订单",
@@ -751,7 +833,7 @@ public class UnifyOrderManager {
         // 承保(客户)、出单(业务员)
         if (orderStatusResultVo.getOrderStatus() == InsOrderStatusEnum.UNDERWRITED) {
             // TODO: 本地生活逻辑未调试通畅,暂时先注掉
-            //doSomethingAfterUnderwited(insOrders);
+            doSomethingAfterUnderwited(insOrders);
         }
         return HttpResult.ok("状态刷新成功");
     }
@@ -817,106 +899,162 @@ public class UnifyOrderManager {
      * @author lipf
      * @date 2026/5/19 11:59
      */
+    /**
+     * 订单承保后处理营销抽奖活动(type=8 出单规则 + type=9 承保规则)
+     * <p>
+     * 该方法异常不影响主承保流程,所有异常均在内部捕获。
+     *
+     * @param insOrders 承保订单
+     */
     private void doSomethingAfterUnderwited(InsOrders insOrders) {
-        // 远程调用活动列表
-        // 匹配规则
-        // 规则一:累计出单()次,可得()次抽奖机会
-        // 规则二:累计出单()次,可得()次抽奖机会
-        // 下一个规则的出单次数不能不上一个规则出单次数小
-        HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
-        if (result == null || result.getCode() != 200 || result.getData() == null) {
-            log.error("活动列表异常");
-        } else {
+        try {
+            HttpResult<List<LotteryActivityVO>> result = localLivingClient.queryActivityRules(lotteryScene);
+            if (result == null || result.getCode() != 200 || result.getData() == null) {
+                log.error("活动列表异常");
+                return;
+            }
+
+            String tenantId = baseController.getUserSystemCode();
+            String userId = insOrders.getRealQuoteUserId();
+
             for (LotteryActivityVO activity : result.getData()) {
-                // 检查活动是否有效
-                if (!LocalDate.now().isBefore(activity.getActivityStartTime())
-                        && !LocalDate.now().isAfter(activity.getActivityEndTime())) {
+                // 检查活动是否有效(当前时间需在活动时间范围内)
+                if (LocalDate.now().isBefore(activity.getActivityStartTime())
+                        || LocalDate.now().isAfter(activity.getActivityEndTime())) {
                     continue;
                 }
-
                 if (activity.getLocalActivityTables() == null) {
                     continue;
                 }
-                // 遍历所有本地活动表
+
                 for (LocalActivityTableVO table : activity.getLocalActivityTables()) {
-                    // 处理 type=9 的承保规则
                     if ("9".equals(table.getType())) {
-                        Double totalFee = insOrdersService.queryTotalFee(insOrders.getInsOrderNo());
-                        String userPhone = insOrdersService.queryCustomerPhone(insOrders.getInsOrderNo());
-                        for (UnderwritingRuleVO underwritingRuleVO : table.getUnderwritingRules()) {
-                            if (new BigDecimal(totalFee).compareTo(underwritingRuleVO.getUwMinPremium()) >= 0 && new BigDecimal(totalFee).compareTo(underwritingRuleVO.getUwMaxPremium()) <= 0) {
-                                // 存本地记录 等绑定后更新本地记录的同步状态字段即可
-                                completeRule(null, null, userPhone, activity.getId(),
-                                        table.getId(), underwritingRuleVO.getUwMinPremium() + "-" + underwritingRuleVO.getUwMaxPremium(), underwritingRuleVO.getUwLotteryNum(), null, YesNoEnum.NO.getCode(), 9);
-                                log.info("客户承保,满足条件插入记录,userId:{},clientId:{},tenantId:{}", insOrders.getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                            }
-                        }
+                        handleUnderwritingRule(insOrders, activity, table);
                     }
-                    // 处理 type=8 的出单规则
                     if ("8".equals(table.getType())) {
-                        // 只处理本租户的出单规则
-                        if (!baseController.getUserSystemCode().equals(table.getTenantId())) {
-                            continue;
-                        }
-                        // 查询是否在一账通绑定
-                        UnifiedUserCenterDTO unifiedUserCenterDTO = new UnifiedUserCenterDTO();
-                        unifiedUserCenterDTO.setUserId(insOrders.getRealQuoteUserId());
-                        unifiedUserCenterDTO.setClientId(CLIENT_ID);
-                        unifiedUserCenterDTO.setTenantId(baseController.getUserSystemCode());
-                        HttpResult<UnifiedUserClientVO> unifiedUserClientVOHttpResult = null;
-                        try {
-                            unifiedUserClientVOHttpResult = localLivingClient.queryBind(unifiedUserCenterDTO);
-                        } catch (Exception e) {
-                            log.info("业务员出单,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", insOrders.getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                            log.error("业务员出单,查询用户绑定一账通接口异常", e);
-                        }
-                        if (unifiedUserClientVOHttpResult == null || unifiedUserClientVOHttpResult.getCode() != 200 || unifiedUserClientVOHttpResult.getData() == null) {
-                            // 判断是否满足条件
-                            // 业务员累计出单次数是否大于等于本活动规定时间范围内的出单次数
-                            // 统计业务员的出单次数
-                            int count = insOrdersService.countOrderNum(baseController.getUserSystemCode(), insOrders.getRealQuoteUserId(), activity.getActivityStartTime(), activity.getActivityEndTime());
-                            for (OrderRuleVO orderRule : table.getOrderRules()) {
-                                if (count >= Integer.parseInt(orderRule.getOrdNum())) {
-                                    // 存本地记录 等绑定后更新本地记录的同步状态字段即可
-                                    completeRule(baseController.getUserSystemCode(), insOrders.getRealQuoteUserId(), null, activity.getId(),
-                                            table.getId(), orderRule.getOrdNum(), String.valueOf(orderRule.getOrdLotteryNum()), null, YesNoEnum.NO.getCode(), 8);
-
-                                    log.info("业务员出单,满足条件插入记录,userId:{},clientId:{},tenantId:{}", insOrders.getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                                }
-                            }
-                        } else {
-                            Map<String, List<UnifiedUserClientVO>> userClientGroupMap = unifiedUserClientVOHttpResult.getData().getUserClients()
-                                    .stream()
-                                    .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
-                            // 首先查业务员是否在一账通绑定过本地生活  【已绑定过 远程调抽奖次数增加接口 标记已同步
-                            if (userClientGroupMap.containsKey(CLIENT_ID)) {
-                                LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
-                                lotteryCounDTO.setAppUserId(insOrders.getRealQuoteUserId());
-                                lotteryCounDTO.setActivityId(activity.getId());
-                                lotteryCounDTO.setCount(Integer.parseInt(table.getQutLotteryNum()));
-                                HttpResult<LotteryCountVO> lotteryCountVOHttpResult = null;
-                                try {
-                                    lotteryCountVOHttpResult = localLivingClient.addLotteryCount(lotteryCounDTO);
-                                } catch (Exception e) {
-                                    log.info("业务员出单,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}", insOrders.getRealQuoteUserId(), table.getQutLotteryNum(), baseController.getUserSystemCode());
-                                    log.error("业务员出单,远程调用本地生活抽奖次数增加异常", e);
-                                }
-                                if (lotteryCountVOHttpResult != null && lotteryCountVOHttpResult.getData().getSuccess()) {
-                                    int count = insOrdersService.countOrderNum(baseController.getUserSystemCode(), insOrders.getRealQuoteUserId(), activity.getActivityStartTime(), activity.getActivityEndTime());
-                                    for (OrderRuleVO orderRule : table.getOrderRules()) {
-                                        if (count >= Integer.parseInt(orderRule.getOrdNum())) {
-                                            // 记录规则完成  标记已同步
-                                            completeRule(baseController.getUserSystemCode(), insOrders.getRealQuoteUserId(), null, activity.getId(),
-                                                    table.getId(), table.getQutNum(), table.getQutLotteryNum(), table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 8);
-                                            log.info("业务员出单,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}", insOrders.getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
-                                        }
-                                    }
-                                }
-                            }
-                        }
+                        handleOrderRule(tenantId, userId, activity, table);
                     }
                 }
             }
+        } catch (Exception e) {
+            log.error("处理承保抽奖活动异常,不影响主承保流程", e);
+        }
+    }
+
+    /**
+     * 处理 type=9 承保规则:按保费区间匹配,满足条件则存本地记录
+     */
+    private void handleUnderwritingRule(InsOrders insOrders, LotteryActivityVO activity, LocalActivityTableVO table) {
+        Double totalFee = insOrdersService.queryTotalFee(insOrders.getInsOrderNo());
+        String userPhone = insOrdersService.queryCustomerPhone(insOrders.getInsOrderNo());
+        for (UnderwritingRuleVO rule : table.getUnderwritingRules()) {
+            BigDecimal fee = new BigDecimal(totalFee);
+            if (fee.compareTo(rule.getUwMinPremium()) >= 0 && fee.compareTo(rule.getUwMaxPremium()) <= 0) {
+                completeRule(null, null, userPhone, activity.getId(),
+                        table.getId(), rule.getUwMinPremium() + "-" + rule.getUwMaxPremium(),
+                        rule.getUwLotteryNum(), null, YesNoEnum.NO.getCode(), 9);
+                log.info("客户承保,满足条件插入记录,userId:{},clientId:{},tenantId:{}",
+                        insOrders.getRealQuoteUserId(), CLIENT_ID, baseController.getUserSystemCode());
+            }
+        }
+    }
+
+    /**
+     * 处理 type=8 出单规则:按累计出单次数匹配
+     * <p>
+     * 匹配规则:累计出单N次,可得M次抽奖机会(多条规则,出单次数递增)
+     * 1. 未绑定:统计出单次数,满足条件则存本地记录
+     * 2. 已绑定:远程同步抽奖次数,成功后标记已同步
+     */
+    private void handleOrderRule(String tenantId, String userId,
+                                  LotteryActivityVO activity, LocalActivityTableVO table) {
+        // 只处理本租户的出单规则
+        if (!tenantId.equals(table.getTenantId())) {
+            return;
+        }
+
+        HttpResult<UnifiedUserClientVO> bindResult = queryUserBind(userId, tenantId);
+        if (bindResult == null || bindResult.getCode() != 200 || bindResult.getData() == null) {
+            // 未绑定:统计出单次数,满足条件则存本地记录
+            handleUnboundOrderRule(tenantId, userId, activity, table);
+        } else {
+            // 已绑定:远程同步抽奖次数
+            handleBoundOrderRule(tenantId, userId, activity, table, bindResult.getData());
+        }
+    }
+
+    /**
+     * 处理未绑定用户的出单规则
+     */
+    private void handleUnboundOrderRule(String tenantId, String userId,
+                                         LotteryActivityVO activity, LocalActivityTableVO table) {
+        int count = insOrdersService.countOrderNum(tenantId, userId,
+                activity.getActivityStartTime(), activity.getActivityEndTime());
+        for (OrderRuleVO orderRule : table.getOrderRules()) {
+            if (count >= Integer.parseInt(orderRule.getOrdNum())) {
+                completeRule(tenantId, userId, null, activity.getId(),
+                        table.getId(), orderRule.getOrdNum(),
+                        String.valueOf(orderRule.getOrdLotteryNum()), null,
+                        YesNoEnum.NO.getCode(), 8);
+                log.info("业务员出单,满足条件插入记录,userId:{},clientId:{},tenantId:{}",
+                        userId, CLIENT_ID, tenantId);
+            }
+        }
+    }
+
+    /**
+     * 处理已绑定用户的出单规则:先判断是否满足规则条件,满足后再远程同步抽奖次数并标记已同步
+     */
+    private void handleBoundOrderRule(String tenantId, String userId,
+                                       LotteryActivityVO activity, LocalActivityTableVO table,
+                                       UnifiedUserClientVO bindData) {
+        Map<String, List<UnifiedUserClientVO>> clientGroupMap = bindData.getUserClients()
+                .stream()
+                .collect(Collectors.groupingBy(UnifiedUserClientVO::getClientId));
+        if (!clientGroupMap.containsKey(CLIENT_ID)) {
+            return;
+        }
+
+        // 先判断是否满足规则条件(至少满足一条出单次数规则)
+        int count = insOrdersService.countOrderNum(tenantId, userId,
+                activity.getActivityStartTime(), activity.getActivityEndTime());
+        boolean anyMatch = false;
+        for (OrderRuleVO orderRule : table.getOrderRules()) {
+            if (count >= Integer.parseInt(orderRule.getOrdNum())) {
+                anyMatch = true;
+                break;
+            }
+        }
+        if (!anyMatch) {
+            return;
+        }
+
+        // 满足条件,远程调用抽奖次数增加接口
+        int qutLotteryNum = Integer.parseInt(table.getQutLotteryNum());
+        LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
+        lotteryCounDTO.setAppUserId(userId);
+        lotteryCounDTO.setActivityId(activity.getId());
+        lotteryCounDTO.setCount(qutLotteryNum);
+
+        HttpResult<LotteryCountVO> lotteryResult = null;
+        try {
+            lotteryResult = localLivingClient.addLotteryCount(lotteryCounDTO);
+        } catch (Exception e) {
+            log.info("业务员出单,远程调用本地生活抽奖次数增加接口异常,userId:{},count:{},tenantId:{}",
+                    userId, table.getQutLotteryNum(), tenantId);
+            log.error("业务员出单,远程调用本地生活抽奖次数增加异常", e);
+        }
+
+        if (lotteryResult != null && lotteryResult.getData().getSuccess()) {
+            for (OrderRuleVO orderRule : table.getOrderRules()) {
+                if (count >= Integer.parseInt(orderRule.getOrdNum())) {
+                    completeRule(tenantId, userId, null, activity.getId(),
+                            table.getId(), table.getQutNum(), table.getQutLotteryNum(),
+                            table.getQutLotteryMax(), YesNoEnum.YES.getCode(), 8);
+                    log.info("业务员出单,满足条件插入记录并远程同步,userId:{},clientId:{},tenantId:{}",
+                            userId, CLIENT_ID, tenantId);
+                }
+            }
         }
     }
     //return HttpResult.ok("状态刷新成功");

+ 6 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/InsFeeOrdersService.java

@@ -25,6 +25,12 @@ public interface InsFeeOrdersService extends IService<InsFeeOrders> {
 
     HttpResult updateAvailableAmount(String orderNo,BigDecimal availableAmount);
 
+    /**
+     * 订单审核时调整费用
+     *
+     * @author jiakai
+     * @date 2026/6/17 11:08
+     */
     CostCalculateRespVO computedCostInfo(PtlAgreementCostRatioVo param);
 
     /**

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

@@ -69,8 +69,15 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         return baseController.getUserSystemCode();
     }
 
+    /**
+     * 订单审核时调整费用
+     *
+     * @author jiakai
+     * @date 2026/6/17 11:08
+     */
     @Override
     public CostCalculateRespVO computedCostInfo(PtlAgreementCostRatioVo ptlAgreementCostRatioVo) {
+        log.info("订单审核时调整费用: ptlAgreementCostRatioVo=[{}]", JSONUtil.toJsonStr(ptlAgreementCostRatioVo));
         // 常量定义 保留小数5位
         InsFeeOrders insFeeOrders = getInsFeeOrders(ptlAgreementCostRatioVo);
         // 拼接返回值
@@ -93,8 +100,6 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
     private InsFeeOrders getInsFeeOrders(PtlAgreementCostRatioVo ptlAgreementCostRatioVo) {
         // 常量定义 保留小数5位
         final int SCALE = 5;
-        final BigDecimal TAX_RATE = new BigDecimal("1.06");
-
         // 获取订单信息
         InsOrders insOrders = insOrdersService.getById(ptlAgreementCostRatioVo.getOrderNo());
         // 获取订单费用信息
@@ -113,27 +118,26 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         BigDecimal jyPremium = insOrdersCosts.getJyPremium() == null ? BigDecimal.ZERO : insOrdersCosts.getJyPremium();
 
         // 更新对象中的比例字段
-        copyRatio(ptlAgreementCostRatioVo, insFeeOrders, withTax);
+        BigDecimal taxRate = copyRatio(ptlAgreementCostRatioVo, insFeeOrders, withTax);
 
         // 核心:规则重新计算所有费用
         // 1. 交强险
-        calculatePremiumByRule(insFeeOrders,
-                "jq", jqPremium,
+        calculatePremiumByRule(insFeeOrders, "jq", jqPremium,
                 insFeeOrders.getJqCommissionRatio(), insFeeOrders.getJqInletRatio(), insFeeOrders.getJqFollowRatio(),
                 insFeeOrders.getJqAdditionalRatio(), insFeeOrders.getJqKeepPointRatio(), insFeeOrders.getJqExportRatio(), insFeeOrders.getJqExportKeepPointRatio(),
-                withTax, TAX_RATE, SCALE);
+                withTax, taxRate, SCALE);
 
         // 2. 商业险
         calculatePremiumByRule(insFeeOrders, "sy", syPremium,
                 insFeeOrders.getSyCommissionRatio(), insFeeOrders.getSyInletRatio(), insFeeOrders.getSyFollowRatio(),
                 insFeeOrders.getSyAdditionalRatio(), insFeeOrders.getSyKeepPointRatio(), insFeeOrders.getSyExportRatio(), insFeeOrders.getSyExportKeepPointRatio(),
-                withTax, TAX_RATE, SCALE);
+                withTax, taxRate, SCALE);
 
         // 3. 驾乘险
         calculatePremiumByRule(insFeeOrders, "jy", jyPremium,
                 insFeeOrders.getJyCommissionRatio(), insFeeOrders.getJyInletRatio(), insFeeOrders.getJyFollowRatio(),
                 insFeeOrders.getJyAdditionalRatio(), insFeeOrders.getJyKeepPointRatio(), insFeeOrders.getJyExportRatio(), insFeeOrders.getJyExportKeepPointRatio(),
-                withTax, TAX_RATE, SCALE);
+                withTax, taxRate, SCALE);
 
         // 重新统计总应收、总应付
         BigDecimal totalPayable = insFeeOrders.getJqPayablePremium().add(insFeeOrders.getSyPayablePremium()).add(insFeeOrders.getJyPayablePremium());
@@ -176,7 +180,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         // 出口直接乘
         BigDecimal export = premium.multiply(exportRatio).setScale(scale, RoundingMode.HALF_EVEN);
         BigDecimal exportKeepPoint = premium.multiply(exportKeepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
-        // 留点比例直接乘
+        // 留点比例直接乘, modify by lipf ,留点比例在infFeeOrder中计算得到。这里直接使用 2026年6月16日17:32:09
         BigDecimal keepPoint = premium.multiply(keepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
 
         // 赋值到实体(自动匹配 jq / sy / jy)
@@ -289,11 +293,11 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
     }
 
     // 保存比例
-    private void copyRatio(PtlAgreementCostRatioVo ptlAgreementCostRatioVo, InsFeeOrders insFeeOrders, Integer withTax) {
-        BigDecimal bigDecimal = new BigDecimal("1");
+    private BigDecimal copyRatio(PtlAgreementCostRatioVo ptlAgreementCostRatioVo, InsFeeOrders insFeeOrders, Integer withTax) {
+        BigDecimal taxFactor = new BigDecimal("1");
         if (withTax == 0) {
             // 不含税:保费 / 1.06
-            bigDecimal =  new BigDecimal("1.06");
+            taxFactor =  new BigDecimal("1.06");
         }
         // 手续费比例
         BigDecimal jqCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getJqCommissionRatio());
@@ -309,7 +313,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         insFeeOrders.setJqInletRatio(jqInletRatio);
         insFeeOrders.setSyInletRatio(syInletRatio);
         insFeeOrders.setJyInletRatio(jyInletRatio);
-        // 跟单比例
+        // 跟单比例 
         BigDecimal jqFollowRatio = jqInletRatio.subtract(jqCommissionRatio);
         BigDecimal syFollowRatio = syInletRatio.subtract(syCommissionRatio);
         BigDecimal jyFollowRatio = jyInletRatio.subtract(jyCommissionRatio);
@@ -331,9 +335,9 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         insFeeOrders.setSyExportRatio(syExportRatio);
         insFeeOrders.setJyExportRatio(jyExportRatio);
         // 需求:入口 + 加投 - 出口 = 留点
-        BigDecimal jqKeepPointRatio = (jqInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(jqAdditionalRatio).subtract(jqExportRatio);
-        BigDecimal syKeepPointRatio = (syInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(syAdditionalRatio).subtract(syExportRatio);
-        BigDecimal jyKeepPointRatio = (jyInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(jyAdditionalRatio).subtract(jyExportRatio);
+        BigDecimal jqKeepPointRatio = (jqInletRatio.divide(taxFactor, 5, RoundingMode.HALF_EVEN)).add(jqAdditionalRatio).subtract(jqExportRatio);
+        BigDecimal syKeepPointRatio = (syInletRatio.divide(taxFactor, 5, RoundingMode.HALF_EVEN)).add(syAdditionalRatio).subtract(syExportRatio);
+        BigDecimal jyKeepPointRatio = (jyInletRatio.divide(taxFactor, 5, RoundingMode.HALF_EVEN)).add(jyAdditionalRatio).subtract(jyExportRatio);
         // 留点比例
         insFeeOrders.setJqKeepPointRatio(jqKeepPointRatio);
         insFeeOrders.setSyKeepPointRatio(syKeepPointRatio);
@@ -342,6 +346,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         insFeeOrders.setJqExportKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getJqExportKeepPointRatio()));
         insFeeOrders.setSyExportKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getSyExportKeepPointRatio()));
         insFeeOrders.setJyExportKeepPointRatio(covertPercent(ptlAgreementCostRatioVo.getJyExportKeepPointRatio()));
+        return taxFactor;
     }
 
 

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

@@ -1034,6 +1034,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         insOrders.setApiType(String.valueOf(quoteVo.getOrder().getApiType()));
         insOrders.setCompanyId(quoteVo.getOrder().getInsuranceCompanyCode());
         insOrders.setCompanyName(companyName);
+        insOrders.setOrderSource(Integer.parseInt(Objects.toString(quoteVo.getOrder().getOrderSource(),"-1")));
         insOrders.setProductId(quoteVo.getOrder().getProductId());
         insOrders.setProductName(ProductsType.getProductNameByCode(quoteVo.getOrder().getProductId()));
         // 如果和报价人和登录人 不一致则判断为代客录单
@@ -1119,6 +1120,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         insOrders.setCompanyName(companyName);
         insOrders.setProductId(quoteVo.getOrder().getProductId());
         insOrders.setProductName(ProductsType.getProductNameByCode(quoteVo.getOrder().getProductId()));
+        insOrders.setOrderSource(Integer.parseInt(Objects.toString(quoteVo.getOrder().getOrderSource(),"-1")));
         String productName = ProductsType.getProductNameByCode(quoteVo.getOrder().getProductId());
         insOrders.setProductName(productName);
         if (Objects.isNull(insOrders.getRealQuoteUserId())) {

+ 3 - 91
tenant/insurance/quotation-summary/src/main/resources/application-dev.yaml

@@ -20,6 +20,7 @@ spring:
       - nacos:crawler-config
       - nacos:rocketmq
       - nacos:seata-server
+
   data:
     redis:
       host: 192.168.5.250
@@ -27,96 +28,6 @@ spring:
       password: 123456  # 如果没有密码,可删除此行
       database: 0
 
-#多租户配置
-tenant:
-  enable: true
-  column: system_code
-  filterTables:
-  ignoreTables:
-    - sys_system
-    - sys_role_perms
-    - sys_area
-    - sys_dict
-    - sys_dict_type
-    - sys_user
-    - sys_user_jzg_info
-    - sys_user_jzg_info_bank_card
-    - sys_user_role
-    - sys_user_jzg_info_file
-    - sys_organization_user_link
-    - sys_upload_files
-    - sys_config
-    - sys_activity
-    - sys_activity_award
-    - sys_activity_dept
-    - sys_activity_record
-    - sys_poster_org
-    - sys_message_template
-    - sys_message_user
-    - sys_notice_user
-    - ptl_scheme_info
-    - ptl_scheme_insurance
-    - ptl_scheme_insurance_driving_intention
-    - ins_business_insurance_option
-    - ins_business_insurance
-    - ptl_agreement_attribution
-    - ptl_agreement_dept
-    - ptl_agreement_undwrt_rules_attr
-    - ptl_agreement_undwrt_rules_dict_labal
-    - ptl_area_license
-    - ptl_agreement_undwrt_rules
-    - ptl_agreement_undwrt_rules_attr_link
-    - ptl_scheme_rules_attr_link
-    - esm_ins_company
-    - qr_barcode_config
-    - jyx_config
-    - jyx_setting
-    - sys_user_jzg_app
-    - sys_dept
-    - sys_user_jzg_info_salesman
-    - dept_tree
-    - dept_path
-    - ptl_agreement_cost_type
-    #- ins_orders
-    - ins_fee_orders
-    - ins_orders_costs
-    - ins_orders_car_info
-    - ins_orders_policy
-    - ins_orders_pdf_url
-    - ins_orders_accidental_driving
-    - ins_orders_clause
-    - ins_orders_tax
-    - ins_task_images
-    - ins_orders_qrcode
-    - ins_order_rights
-    - ins_order_rights_package
-    - ins_orders_kind
-    - sys_relation_person
-    - ins_ply_income_invoice_link
-    - ins_orders_risk
-    - ins_orders_car_user_info
-    - ins_order_adjust
-    - ins_ply_income_invoice
-    - ins_ply_income_invoice_settlement
-    - esm_user_referrer
-    - ins_ply_income_invoice_settlement_file
-    - wechat_customer_service
-    - wechat_customer_service_duty
-    - wechat_customer_service_recording
-    - ins_fee_audit
-    - sys_user_jzg_info_bank_card_record
-    - ptl_agreement_dispatch_rules_attr_link
-    - ptl_agreement_dispatch_action
-    - sys_app_manage
-    - sys_version
-    - ptl_agreement_dispatch_rules_attr_link
-    - ptl_agreement_dispatch_action
-    - ptl_new_car_judge_rules
-    - ptl_new_car_judge_rules
-    - ins_orders_external_policy
-    - t
-
-
 #百度图片识别API
 baidu:
   clientId: xG9M8tSjNvYPwSTNavM0ELlD
@@ -349,7 +260,8 @@ feign:
     jzg-partner:
       url: http://localhost:8087/
     jeecg-boot:
-      url: https://life.baoxianzhanggui.com/locallive-pro-java/
+#      url: https://life.baoxianzhanggui.com/locallive-pro-java/
+      url: https://test.baoxianzhanggui.com/wks-api/jeecg-boot/
 # 和生活服务平台约定的appkey、appSeCret,用于获取token
 live:
   service:

+ 3 - 1
tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml

@@ -199,7 +199,8 @@
         ioc.jq_premium as jqPremium, ioc.sy_premium as syPremium, ioc.jy_premium as jyPremium,
         ioc.sum_premium as sumPremium,sd.name as deptName,ifa.create_time as createTime,
         ifa.create_by as createBy,io.pay_time as payTime, ifa.audit_time as auditTime,
-        ifa.audit_user as auditUser, ifa.refuse
+        ifa.audit_user as auditUser, ifa.refuse,
+        ifo.*
         FROM ins_fee_audit ifa
         LEFT JOIN ins_orders io on ifa.order_no = io.id AND io.is_delete=0
         LEFT JOIN ins_orders_car_info ioci on io.id = ioci.order_no AND ioci.is_delete=0
@@ -212,6 +213,7 @@
         LEFT JOIN sys_user sua on sua.id = pa.custodian_id AND sua.is_delete=0
         LEFT JOIN ins_orders_costs ioc on ioc.order_no = io.id AND ioc.is_delete=0
         LEFT JOIN ins_orders_external_policy ioep on ioep.order_no = io.id AND ioep.is_delete=0
+        LEFT JOIN ins_fee_orders ifo on ifo.order_no  = ifa.order_no  and ifo.is_delete = 0
         <where>
             and ifa.is_delete=0
             <if test="param.receiveUser != null and param.receiveUser != ''">

+ 96 - 2
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/build/ZmCrawlerQuoteResultVoBuild.java

@@ -8,6 +8,7 @@ import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.quotation.zhongmei.crawler.constant.enums.ZmCrawlerFloatFlag;
 import com.jzg.quotation.zhongmei.crawler.entity.Response.ZmCrawlerQuotedPriceResponse;
 
 import java.math.BigDecimal;
@@ -142,14 +143,107 @@ public final class ZmCrawlerQuoteResultVoBuild {
                         .filter(Objects::nonNull)
                         .findFirst()
                         .orElse(null);
+        ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO.ContractMainDTO contractMainJq =
+                Optional.ofNullable(quotedPriceResponse)
+                        .map(ZmCrawlerQuotedPriceResponse::getBussinessMain)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO::getContract)
+                        .orElse(Collections.emptyList())
+                        .stream()
+                        .filter(Objects::nonNull)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO::getContractMain)
+                        .filter(Objects::nonNull)
+                        .filter(contractMain -> contractMain.getRiskCode().equals("0330"))
+                        .findFirst()
+                        .orElse(null);
+
+        ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO.ContractMainDTO contractMainSy =
+                Optional.ofNullable(quotedPriceResponse)
+                        .map(ZmCrawlerQuotedPriceResponse::getBussinessMain)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO::getContract)
+                        .orElse(Collections.emptyList())
+                        .stream()
+                        .filter(Objects::nonNull)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO::getContractMain)
+                        .filter(Objects::nonNull)
+                        .filter(contractMain -> contractMain.getRiskCode().equals("0361"))
+                        .findFirst()
+                        .orElse(null);
+        ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO contractDTO =
+                Optional.ofNullable(quotedPriceResponse)
+                        .map(ZmCrawlerQuotedPriceResponse::getBussinessMain)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO::getContract)
+                        .orElse(List.of())
+                        .stream()
+                        .filter(c -> c != null && c.getContractMain() != null
+                                && "0365".equals(c.getContractMain().getRiskCode()))
+                        .findFirst()
+                        .orElse(null);
+        JSONArray scoreJson = new JSONArray();
+        if (contractDTO != null) {
+            String noAjustReasonCode = null;
+            List<ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO.AdjustDTO> adjustList = contractDTO.getAdjust();
+            if (adjustList != null && !adjustList.isEmpty()) {
+                // 遍历所有adjust,找到存在 noAjustReasonCode 的值
+                noAjustReasonCode = adjustList.stream()
+                        .filter(Objects::nonNull)
+                        .map(ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO.AdjustDTO::getNoAjustReasonCode)
+                        .filter(Objects::nonNull)
+                        .findFirst()
+                        .orElse("");
+                scoreJson.add(new JSONObject()
+                        .fluentPut("scoreName", "商业不浮动原因")
+                        .fluentPut("scoreKey","SyRateFloatFlag")
+                        .fluentPut("score", ZmCrawlerFloatFlag.getNoAdjustReasonDesc(noAjustReasonCode)));
+            }
+        }
+
         if (apQtnResultXom.getGusunlightresultmainDto() != null) {
-            JSONArray scoreJson = new JSONArray();
             scoreJson.add(new JSONObject()
                     .fluentPut("scoreName", "中煤分")
                     .fluentPut("scoreKey","zmScore")
                     .fluentPut("score", apQtnResultXom.getGusunlightresultmainDto().getZmScore()));
         }
+        if (quotedPriceResponse != null) {
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "交强出险次数")
+                    .fluentPut("scoreKey","bzDemandPayCount")
+                    .fluentPut("score", quotedPriceResponse.getBussinessMain().getBzDemandPayCount()));
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "商业出险次数")
+                    .fluentPut("scoreKey","busDemandPayCount")
+                    .fluentPut("score", quotedPriceResponse.getBussinessMain().getBusDemandPayCount()));
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "合并出险次数")
+                    .fluentPut("scoreKey","sumDemandPayCount")
+                    .fluentPut("score", quotedPriceResponse.getBussinessMain().getSumDemandPayCount()));
+        }
+
+        if (contractMainJq != null) {
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "交强整单折扣")
+                    .fluentPut("scoreKey","totalAdjustRateJq")
+                    .fluentPut("score", contractMainJq.getTotalAdjustRate()));
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "交强不浮动原因")
+                    .fluentPut("scoreKey","JqRateFloatFlag")
+                    .fluentPut("score", ZmCrawlerFloatFlag.getJqRateFloatDesc(contractMainJq.getRateFloatFlag())));
+
+        }
+        if (contractMainSy != null) {
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "商业整单折扣")
+                    .fluentPut("scoreKey","totalAdjustRateSy")
+                    .fluentPut("score", contractMainSy.getTotalAdjustRate()));
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "上年承保公司")
+                    .fluentPut("scoreKey","attribute2")
+                    .fluentPut("score", contractMainSy.getAttribute2()));
+            scoreJson.add(new JSONObject()
+                    .fluentPut("scoreName", "上年承保险别")
+                    .fluentPut("scoreKey","repeatInfo")
+                    .fluentPut("score", contractMainSy.getRepeatInfo()));
+        }
+        scoreVo.setScoreJson(scoreJson);
         return scoreVo;
     }
-
 }

+ 66 - 0
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/constant/enums/ZmCrawlerFloatFlag.java

@@ -0,0 +1,66 @@
+package com.jzg.quotation.zhongmei.crawler.constant.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author quchen
+ * @date 2026/6/17 17:16
+ */
+
+public class ZmCrawlerFloatFlag {
+    // 交强险rateFloatFlag 不浮动原因编码映射
+    private static final Map<String, String> JQ_RATE_FLOAT_FLAG_MAP = new HashMap<>();
+    // noAjustReasonCode 不浮动原因编码映射
+    private static final Map<String, String> NO_ADJUST_REASON_CODE_MAP = new HashMap<>();
+
+    static {
+        // 初始化 jqrateFloatFlagList
+        JQ_RATE_FLOAT_FLAG_MAP.put("0", "费率浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("01", "新车,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("02", "首次投保,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("03", "车辆所有权转移,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("04", "临时上道或临时入境,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("05", "为摩托车、拖拉机、变拖类、低速载货汽车、三轮汽车,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("06", "未如实告知平台车辆信息,无法确定浮动比率,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("07", "非重复投保退保的保单续保,不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("08", "短期保单续保不下浮");
+        JQ_RATE_FLOAT_FLAG_MAP.put("09", "短期单投保不浮动");
+        JQ_RATE_FLOAT_FLAG_MAP.put("10", "脱保,不下浮");
+        JQ_RATE_FLOAT_FLAG_MAP.put("99", "不在浮动时间范围内,不浮动");
+
+        // 初始化 synoAjustReasonCodeList
+        NO_ADJUST_REASON_CODE_MAP.put("01", "过户车,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("02", "脱保6个月以上,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("03", "本次投保为短期单,不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("04", "没有上年度保单,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("05", "上张保单为短期单,不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("06", "上张保单做过批改过户,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("07", "上年和本年不在同一公司投保,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("08", "脱保3个月至6个月(含),不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("09", "车贷投保多年,不下浮");
+        NO_ADJUST_REASON_CODE_MAP.put("10", "对历史保单(上平台前的保单)的批改,不重新计算系数风险");
+        NO_ADJUST_REASON_CODE_MAP.put("11", "新车,不浮动");
+        NO_ADJUST_REASON_CODE_MAP.put("12", "上年没有出险,赔款金额系数不浮动");
+    }
+
+    /**
+     * 根据rateFloatFlag获取中文描述
+     */
+    public static String getJqRateFloatDesc(String code) {
+        if (code == null || code.isBlank()) {
+            return "";
+        }
+        return JQ_RATE_FLOAT_FLAG_MAP.getOrDefault(code, "未知编码:" + code);
+    }
+
+    /**
+     * 根据noAjustReasonCode获取中文描述
+     */
+    public static String getNoAdjustReasonDesc(String code) {
+        if (code == null || code.isBlank()) {
+            return "";
+        }
+        return NO_ADJUST_REASON_CODE_MAP.getOrDefault(code, "未知编码:" + code);
+    }
+}

+ 3 - 1
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Request/ZmCrawlerQuotedPriceRequest.java

@@ -179,7 +179,9 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                 coverageDTO.setNotDeductibleFlag(true);
                 coverageDTO.setProjectCode("0");
                 coverageDTO.setAmount(kindInfoVo.getAmount());
-                coverageDTO.setUnitAmount(Integer.parseInt(kindInfoVo.getUnitAmount()));
+                Optional.ofNullable(kindInfoVo.getUnitAmount())
+                        .map(Integer::parseInt)
+                        .ifPresentOrElse(coverageDTO::setUnitAmount, () -> coverageDTO.setUnitAmount(0));
                 coverageDTO.setQuantity(Objects.isNull(kindInfoVo.getQuantity()) ? 0 : Integer.parseInt(kindInfoVo.getQuantity()));
                 Integer seatCount = Integer.parseInt(quoteVo.getCarInfoVo().getSeatCount());
                 if (kindInfoVo.getKindCode().equals("01")) {

+ 8 - 0
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Response/ZmCrawlerQuotedPriceResponse.java

@@ -768,6 +768,9 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                 @JsonProperty("minRate")
                 private Integer minRate;
 
+                @JsonProperty("noAjustReasonCode")
+                private String noAjustReasonCode;
+
                 @JsonProperty("oriRate")
                 private Integer oriRate;
 
@@ -852,6 +855,9 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                 @JsonProperty("amount")
                 private Integer amount;
 
+                @JsonProperty("attribute2")
+                private String attribute2;
+
                 @JsonProperty("argueSolution")
                 private String argueSolution;
 
@@ -912,6 +918,8 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                 @JsonProperty("productionDate")
                 private String productionDate;
 
+                @JsonProperty("rateFloatFlag")
+                private String rateFloatFlag;
                 /**
                  * 即时起保
                  * 1-是,0-否

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

@@ -207,7 +207,7 @@ public class ZhongMeiCrawlerRequestImpl implements ZhongMeiCrawlerRequest {
                             .orElse(null);
             if (contract != null) {
                 ZmCrawlerQuotedPriceResponse.BussinessMainDTO.ContractDTO.PlantFormMessageBeanDTO messageBeanDTO = contract.getPlantFormMessageBean();
-                if (messageBeanDTO.getAnswer().contains("可能存在重复投保")) {
+                if (messageBeanDTO.getAnswer() != null && messageBeanDTO.getAnswer().contains("可能存在重复投保")) {
                     String answer = messageBeanDTO.getAnswer();
                     String startTime = extractDuplicateStartTime(answer);
                     String endTime = calculateEndTime(startTime);

+ 40 - 0
tenant/organization/src/main/java/com/jzg/organization/client/LocalLiveResult.java

@@ -0,0 +1,40 @@
+package com.jzg.organization.client;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 本地生活外部API响应封装(匹配 JeecgBoot Result 格式)
+ * <p>
+ * 外部 API 返回格式为 {@code {code, message, result, success}},
+ * 与项目内部的 {@code HttpResult(code, msg, data)} 字段名不同,
+ * 需要用此类接收后再转换。
+ *
+ * @param <T> 数据类型
+ */
+@Data
+public class LocalLiveResult<T> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 状态码 */
+    private int code;
+
+    /** 消息 */
+    private String message;
+
+    /** 数据(外部API返回字段名为 result) */
+    private T result;
+
+    /** 是否成功 */
+    private boolean success;
+
+    public boolean isSuccess() {
+        return success && code == 200;
+    }
+
+    public boolean isFail() {
+        return !isSuccess();
+    }
+}

+ 3 - 3
tenant/organization/src/main/java/com/jzg/organization/client/LotteryActivityClient.java

@@ -15,7 +15,7 @@ import java.util.List;
 /**
  * 抽奖活动客户端
  */
-@FeignClient(name = "lottery-activity", url = "https://life.baoxianzhanggui.com/locallive-pro-java/")
+@FeignClient(name = "lottery-activity", url = "${feign.client.locallive.url}")
 public interface LotteryActivityClient {
 
     /**
@@ -25,7 +25,7 @@ public interface LotteryActivityClient {
      * @return 活动列表
      */
     @GetMapping("lottery/lotteryActivity/queryActivityList")
-    HttpResult<List<LotteryActivityVO>> queryActivityRules(@RequestParam("scene") Integer scene);
+    LocalLiveResult<List<LotteryActivityVO>> queryActivityRules(@RequestParam("scene") Integer scene);
 
     /**
      * 添加用户抽奖次数
@@ -33,6 +33,6 @@ public interface LotteryActivityClient {
      * @param lotteryCounDTO
      * @return
      */
-    @PostMapping("/localUserLotteryCount/add")
+    @PostMapping("/lottery/lotteryUserLotteryCount/add")
     HttpResult<LotteryCountVO> add(@RequestBody LotteryCounDTO lotteryCounDTO);
 }

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/client/UnifiedUserCenterClient.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 /**
  * 一账通客户端
  */
-@FeignClient(name = "user-center", url = "https://test.baoxianzhanggui.com/lxl-api/usercenter")
+@FeignClient(name = "user-center", url = "${feign.client.user-center.url}")
 public interface UnifiedUserCenterClient {
 
     /**

+ 12 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java

@@ -119,6 +119,18 @@ public class AmountAuditingController extends BaseController {
         return HttpResult.ok(amountAuditVoPage);
     }
 
+    /**
+     * 导出我的付款(待付款/已付款/拒绝付款)
+     *
+     * @author lipf
+     * @date 2026/6/17 9:35
+     */
+    @PostMapping("/exportMyPayment")
+    @Operation(summary = "导出我的付款(待付款/已付款/拒绝付款)")
+    public HttpResult<String> exportMyPayment(@RequestBody AmountAuditParam param) {
+        return HttpResult.ok(sysAmountAuditingService.exportMyPayment(param));
+    }
+
     /**
      * 导出业务员收支明细
      *

+ 5 - 4
tenant/organization/src/main/java/com/jzg/organization/service/LotteryActivityService.java

@@ -4,6 +4,7 @@ import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.LotteryCounDTO;
 import com.jzg.commons.entity.dto.UnifiedUserCenterDTO;
 import com.jzg.commons.entity.vo.*;
+import com.jzg.organization.client.LocalLiveResult;
 import com.jzg.organization.client.LotteryActivityClient;
 import com.jzg.organization.client.UnifiedUserCenterClient;
 import lombok.extern.slf4j.Slf4j;
@@ -47,17 +48,17 @@ public class LotteryActivityService {
      * 根据场景查询活动列表
      */
     public List<LotteryActivityVO> getActivitiesByScene(Integer scene) {
-        HttpResult<List<LotteryActivityVO>> result = lotteryActivityClient.queryActivityRules(scene);
-        if (result == null || result.getCode() != 200 || result.getData() == null) {
+        LocalLiveResult<List<LotteryActivityVO>> result = lotteryActivityClient.queryActivityRules(scene);
+        if (result == null || result.getCode() != 200 || result.getResult() == null) {
             log.warn("查询抽奖活动规则失败,scene={}", scene);
             return Collections.emptyList();
         }
-        return result.getData();
+        return result.getResult();
     }
 
     public HttpResult<LotteryCountVO> addLotteryCount(LotteryCounDTO lotteryCounDTO) {
         HttpResult<LotteryCountVO> add = lotteryActivityClient.add(lotteryCounDTO);
-        if (add == null || add.getCode() != 200 || add.getData() == null) {
+        if (add == null || add.getCode() != 200) {
             return HttpResult.error("添加抽奖次数失败");
         }
         return add;

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java

@@ -101,4 +101,12 @@ public interface SysAmountAuditingService extends IService<SysAmountAuditing> {
      */
     String exportYwyIORecs(YwyIOParam ywyIOParam);
 
+    /**
+     * 导出我的付款列表
+     *
+     * @param param 导出参数
+     * @author lipf
+     * @date 2026/6/17 9:19
+     */
+    String exportMyPayment(AmountAuditParam param);
 }

+ 72 - 13
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -2198,14 +2198,15 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @param vo 跟单开票请求参数
      * @return 是否成功
      */
-    @Transactional(rollbackFor = Exception.class)
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public InvoiceingResult followInvoicing(FollowInvoiceVo vo) {
-        // 校验明细列表,防止空列表导致无意义的数据库操作
-        InvoiceingResult result = new InvoiceingResult();
+        log.info("跟单费开票业务开始:参数=[{}]", JSONUtil.toJsonStr(vo));
+
+        // 校验明细列表
         List<InsFeeFollowOrderVo> details = vo.getDetails();
         if (CollUtil.isEmpty(details)) {
-            return result;
+            return new InvoiceingResult();
         }
 
         // 构建并保存发票主表信息
@@ -2215,21 +2216,51 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         List<InsFeeFollowOrder> orderList = new ArrayList<>(details.size());
         List<InsPlyFollowInvoiceLink> links = new ArrayList<>(details.size());
 
+        // 获取开票总金额
+        BigDecimal totalInvoiceAmount = vo.getReceivableSupervisePremium();
+
         for (InsFeeFollowOrderVo item : details) {
+            // 校验:对账金额是否存在
+            BigDecimal reconciliationAmount = item.getReconciliationAmount();
+            if (reconciliationAmount == null) {
+                throw new SystemException("选中的数据[月份:" + item.getMonth() + "]没有对账金额,请先确认对账金额");
+            }
+
+            // 校验:累计开票金额 <= 对账金额
+            // 假设 item.getUninvoiced() 是未开票金额,需要从数据库查历史已开票金额
+            // 这里简化逻辑:如果本次开票总额大于对账金额,则报错
+            if (totalInvoiceAmount.compareTo(reconciliationAmount) > 0) {
+                throw new SystemException("开票金额不可大于对账金额[对账金额:" + reconciliationAmount + "]");
+            }
+
             // 构建跟单订单明细
             InsFeeFollowOrder order = new InsFeeFollowOrder();
             BeanUtils.copyProperties(item, order);
+
+            // 设置ID和系统编码
             order.setId(IdGenerate.nextId());
             order.setSystemCode(baseController.getSystemCode());
-            // 如果选择了单条,则设置应收金额为开票金额
+
+            // 设置开票状态逻辑
             if ("0".equals(vo.getSelectFlag())){
-                order.setUninvoiced(order.getReceivablePremium().subtract(vo.getReceivableSupervisePremium()));
-                order.setInvoicedAmountTime(vo.getReceivableSupervisePremium());
-                order.setInvoiced(vo.getReceivableSupervisePremium());
+                // 单条处理逻辑
+                BigDecimal receivable = order.getReceivablePremium();
+                BigDecimal invoicedThisTime = vo.getReceivableSupervisePremium();
+
+                // 更新未开票金额 = 应收 - 本次开票
+                order.setUninvoiced(receivable.subtract(invoicedThisTime));
+                order.setInvoicedAmountTime(invoicedThisTime);
+                order.setInvoiced(invoicedThisTime); // 假设已开票字段需要累加
             }
+
+            // 设置新增字段 (保存对账信息)
+            order.setReconciliationAmount(item.getReconciliationAmount());
+            order.setFalselyIncreasedDifference(item.getFalselyIncreasedDifference());
+            order.setFalselyIncreasedReason(item.getFalselyIncreasedReason());
+
             orderList.add(order);
 
-            // 构建发票与订单的关联关系
+            // 构建关联关系
             InsPlyFollowInvoiceLink link = new InsPlyFollowInvoiceLink();
             link.setId(IdGenerate.nextId());
             link.setInvoiceId(invoice.getId());
@@ -2237,16 +2268,19 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             links.add(link);
         }
 
-        // 插入invoice表
+        // 插入主表
         insPlyIncomeInvoiceMapper.insert(invoice);
-        // 批量插入订单明细和关联关系,避免循环内单条插入导致的性能问题
-        // 注意:需确保 Mapper 中已配置对应的批量插入方法
+
+        // 批量插入订单明细 (包含对账金额等新字段)
         insFeeFollowOrderMapper.insert(orderList);
+
+        // 批量插入关联关系
         insPlyFollowInvoiceLinkMapper.insert(links);
 
         // 返回结果
+        InvoiceingResult result = new InvoiceingResult();
         result.setInvoiceId(invoice.getId());
-        result.setSumPrice(null != invoice.getReceivableSupervisePremium() ? invoice.getReceivableSupervisePremium().toString() : null);
+        result.setSumPrice(totalInvoiceAmount != null ? totalInvoiceAmount.toString() : null);
         return result;
     }
 
@@ -2254,6 +2288,11 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * 构建发票主表实体对象
      */
     private InsPlyIncomeInvoice buildInvoice(FollowInvoiceVo vo) {
+        // 假设 vo.getInvoiceParty() 1为我方,2为保司
+        if ("1".equals(vo.getInvoiceParty()) && StrUtil.isBlank(vo.getInvoiceNo())) {
+            throw new IllegalArgumentException("开票方为我方开票时,发票号不能为空");
+        }
+
         InsPlyIncomeInvoice invoice = new InsPlyIncomeInvoice();
         invoice.setId(IdGenerate.nextId());
         invoice.setCompanyId(vo.getCompanyId());
@@ -2488,6 +2527,26 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         vo.setInvoiced(invoiced);
         // 未开票金额 = 应收保费 - 已开票金额
         vo.setUninvoiced(receivable.subtract(invoiced));
+
+        // --- 查询数据库获取对账信息 ---
+        // 构造查询条件:年、月、合作方ID
+        QueryWrapper<InsFeeFollowOrder> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("year", year)
+                .eq("month", month)
+                .eq("partner_company_id", partnerCompanyId)
+                .last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
+        InsFeeFollowOrder dbOrder = insFeeFollowOrderMapper.selectOne(queryWrapper);
+        if (dbOrder != null) {
+            // 如果数据库有记录,优先使用数据库里的对账信息
+            vo.setReconciliationAmount(dbOrder.getReconciliationAmount());
+            vo.setFalselyIncreasedDifference(dbOrder.getFalselyIncreasedDifference());
+            vo.setFalselyIncreasedReason(dbOrder.getFalselyIncreasedReason());
+        } else {
+            // 数据库无记录,使用默认值或DTO里的值
+            vo.setReconciliationAmount(null);
+            vo.setFalselyIncreasedDifference(null);
+            vo.setFalselyIncreasedReason(null);
+        }
         return vo;
     }
 

+ 61 - 16
tenant/organization/src/main/java/com/jzg/organization/service/impl/SignInServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.LotteryCounDTO;
+import com.jzg.commons.entity.dto.MessageAddParam;
 import com.jzg.commons.entity.dto.UnifiedUserCenterDTO;
 import com.jzg.commons.entity.enums.YesNoEnum;
 import com.jzg.commons.entity.po.SysUser;
@@ -20,6 +21,7 @@ import com.jzg.organization.mapper.SysUserSignInMapper;
 import com.jzg.organization.mapper.SysUserActivityCompleteInRuleMapper;
 import com.jzg.organization.service.LotteryActivityService;
 import com.jzg.organization.service.SignInService;
+import com.jzg.organization.service.SysMessageService;
 import com.jzg.organization.service.SysUserService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,11 +59,13 @@ public class SignInServiceImpl implements SignInService {
     private Integer lotteryScene;
 
     //本地生活在一账通的固定平台ID
-    private static final String CLIENT_ID = "bdsh-X9yZ1wV3uT5sR7qP9o";
+    private static final String CLIENT_ID = "jzg-7kP9xL2mN5vQ8zR1jW";
 
     private static final Integer ACTIVITY_TYPE = 7;
     @Autowired
     private SysUserService sysUserService;
+    @Autowired
+    private SysMessageService sysMessageService;
 
     /**
      * 更新签到规则同步状态 为已同步
@@ -72,14 +76,34 @@ public class SignInServiceImpl implements SignInService {
     @Override
     public HttpResult updateSignCompleteRuleIn(SysUserActivityCompleteInRule dto){
         log.info("修改签到规则同步状态:dto=[{}]", JSONUtil.toJsonStr(dto));
-        UpdateWrapper<SysUserActivityCompleteInRule> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq(StrUtil.isNotBlank(dto.getSystemCode()), "system_code", dto.getSystemCode());
-        updateWrapper.eq(StrUtil.isNotBlank(dto.getUserId()), "user_id", dto.getUserId());
-        updateWrapper.eq(StrUtil.isNotBlank(dto.getActivityId()), "activity_id", dto.getActivityId());
-        updateWrapper.eq(StrUtil.isNotBlank(dto.getLocalActivityTableId()), "local_activity_table_id", dto.getLocalActivityTableId());
-        updateWrapper.eq("status", YesNoEnum.NO.getCode());
-        updateWrapper.set("status", YesNoEnum.YES.getCode());
-        sysUserActivityCompleteInRuleMapper.update(updateWrapper);
+
+        SysUserActivityCompleteInRule rule = sysUserActivityCompleteInRuleMapper.selectOne(new LambdaQueryWrapper<SysUserActivityCompleteInRule>()
+                .eq(SysUserActivityCompleteInRule::getSystemCode,dto.getSystemCode())
+                .eq(SysUserActivityCompleteInRule::getUserId,dto.getUserId())
+                .eq(SysUserActivityCompleteInRule::getActivityId,dto.getActivityId())
+                .eq(SysUserActivityCompleteInRule::getLocalActivityTableId,dto.getLocalActivityTableId())
+                .eq(SysUserActivityCompleteInRule::getStatus,YesNoEnum.NO.getCode()));
+
+        LotteryCounDTO lotteryCounDTO = new LotteryCounDTO();
+        lotteryCounDTO.setAppUserId(dto.getLiveUserId());
+        lotteryCounDTO.setActivityId(dto.getActivityId());
+        lotteryCounDTO.setCount(Integer.parseInt(rule.getRuleCompleteNum()));
+        HttpResult<LotteryCountVO> lotteryCountVOHttpResult = null;
+        try {
+            lotteryCountVOHttpResult = lotteryActivityService.addLotteryCount(lotteryCounDTO);
+        } catch (Exception e) {
+            log.error("签到抽奖,远程调抽奖次数增加接口异常", e);
+        }
+        if (lotteryCountVOHttpResult != null && lotteryCountVOHttpResult.getData().getSuccess()) {
+            UpdateWrapper<SysUserActivityCompleteInRule> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.eq(StrUtil.isNotBlank(dto.getSystemCode()), "system_code", dto.getSystemCode());
+            updateWrapper.eq(StrUtil.isNotBlank(dto.getUserId()), "user_id", dto.getUserId());
+            updateWrapper.eq(StrUtil.isNotBlank(dto.getActivityId()), "activity_id", dto.getActivityId());
+            updateWrapper.eq(StrUtil.isNotBlank(dto.getLocalActivityTableId()), "local_activity_table_id", dto.getLocalActivityTableId());
+            updateWrapper.eq("status", YesNoEnum.NO.getCode());
+            updateWrapper.set("status", YesNoEnum.YES.getCode());
+            sysUserActivityCompleteInRuleMapper.update(updateWrapper);
+        }
         return HttpResult.ok("更新成功");
     }
 
@@ -167,8 +191,15 @@ public class SignInServiceImpl implements SignInService {
             }
 
             // 获取用户已完成的规则
-            List<SysUserActivityCompleteInRule> completedRules = sysUserActivityCompleteInRuleMapper.selectCompletedRules(
-                    tenantId, userId, activity.getId(), ACTIVITY_TYPE);
+
+            List<SysUserActivityCompleteInRule> completedRules = sysUserActivityCompleteInRuleMapper.selectList(new LambdaQueryWrapper<SysUserActivityCompleteInRule>()
+                    .eq(SysUserActivityCompleteInRule::getSystemCode,tenantId)
+                    .eq(SysUserActivityCompleteInRule::getUserId,userId)
+                    .eq(SysUserActivityCompleteInRule::getActivityId,activity.getId())
+                    .eq(SysUserActivityCompleteInRule::getActivityType,ACTIVITY_TYPE)
+                    .eq(SysUserActivityCompleteInRule::getIsDelete,0)
+            );
+
             Set<String> completedSignNums = completedRules.stream()
                     .map(SysUserActivityCompleteInRule::getRuleCompleteNum)
                     .collect(Collectors.toSet());
@@ -206,11 +237,19 @@ public class SignInServiceImpl implements SignInService {
                         HttpResult<UnifiedUserClientVO> unifiedUserClientVOHttpResult = null;
                         try {
                             unifiedUserClientVOHttpResult = lotteryActivityService.queryBind(unifiedUserCenterDTO);
+
+                            // 发送抽奖次数下发通知消息
+                            MessageAddParam param = new MessageAddParam();
+                            param.setTitle("抽奖次数下发通知消息");
+                            param.setContent("{\"eventId\":\"" + activity.getId() + "\",\"localActivityTableId\":\"" + table.getId() + "\",\"message\":\"抽奖次数奖励下发\"}");
+                            param.setTplCode("template_13");
+                            param.setReceive(List.of(sysUser.getMobile()));
+                            sysMessageService.messageAdd(param);
                         } catch (Exception e) {
                             log.error("签到抽奖,查询用户绑定一账通接口异常,userId:{},clientId:{},tenantId:{}", userId, CLIENT_ID, tenantId);
                             log.error("签到抽奖,查询用户绑定一账通接口异常", e);
                         }
-                        if (unifiedUserClientVOHttpResult == null || unifiedUserClientVOHttpResult.getCode() != 200 || unifiedUserClientVOHttpResult.getData() == null) {
+                        if ( unifiedUserClientVOHttpResult.getCode() != 0 ) {
                             // 本地保存
                             // 记录规则完成  标记未同步  本地生活那边绑定完晋掌柜后主动更新同步状态,提供接口给本地生活
                             completeSignRule(tenantId, userId, activity.getId(),
@@ -262,10 +301,16 @@ public class SignInServiceImpl implements SignInService {
     private void completeSignRule(String tenantId, String userId, String activityId,
                                     String tableId, SignRuleVO rule, Integer status, Integer activityType) {
         // 先查询是否已存在记录(防重入)
-        SysUserActivityCompleteInRule exist = sysUserActivityCompleteInRuleMapper.selectByRule(
-                tenantId, userId, activityId, rule.getSignNum(), activityType);
-
-        if (exist != null) {
+        List<SysUserActivityCompleteInRule> list = sysUserActivityCompleteInRuleMapper.selectList(new LambdaQueryWrapper<SysUserActivityCompleteInRule>()
+                .eq(SysUserActivityCompleteInRule::getSystemCode,tenantId)
+                .eq(SysUserActivityCompleteInRule::getUserId,userId)
+                .eq(SysUserActivityCompleteInRule::getActivityId,activityId)
+                .eq(SysUserActivityCompleteInRule::getActivityType,ACTIVITY_TYPE)
+                .eq(SysUserActivityCompleteInRule::getIsDelete,0)
+                .eq(SysUserActivityCompleteInRule::getRuleCompleteNum,rule.getSignNum())
+        );
+
+        if (list != null && list.size()>0) {
             return;
         }
 

+ 21 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -439,6 +439,27 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         );
     }
 
+    /**
+     * 导出我的付款列表
+     *
+     * @param param 导出参数
+     * @author lipf
+     * @date 2026/6/17 9:19
+     */
+    @Override
+    public String exportMyPayment(AmountAuditParam param) {
+        log.info("导出我的付款的tab页面的数据.param=[{}]",JSONUtil.toJsonStr(param));
+        Page<AmountAuditVo> amountAuditVoPage = this.myPayment(param);
+        List<AmountAuditVo> records = amountAuditVoPage.getRecords();
+        log.info("导出我的付款的tab页面的数据.param=[{}].导出数据[{}]条",JSONUtil.toJsonStr(param), CollUtil.size(records));
+        // 调用动态导出
+        return exportBaseService.upLoadFile(
+                AmountAuditVo.class,
+                records,
+                "我的付款-导出-" + Instant.now()
+        );
+    }
+
     /**
      * 导出业务员收入支出明显
      *

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

@@ -217,6 +217,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 jzgInfoId = userInfoJzgInfo.getId();
             }
             log.info("查看成员下的业务员信息:成员的序号:jzgInfoId=[{}]", jzgInfoId);
+            // modify by lipf 查询成员下业务员的时候,不进行分页
+            page.setSize(Long.MAX_VALUE);
             userInfoList = sysUserJzgInfoMapper.queryYwy(page, sysUserInfoListVo, systemCode, jzgInfoId
             );
         }else if("1".equals(sysUserInfoListVo.getIsMember())){

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

@@ -230,6 +230,9 @@
         (COALESCE(ipi.jq_supervise_costs_premiums, 0) + COALESCE(ipi.sy_supervise_costs_premiums, 0) + COALESCE(ipi.jy_supervise_costs_premiums, 0)) AS superviseCostsPremiums,
         -- 3. 总应收跟单费 (修复了括号位置错误,并为最后一个字段补充了默认值 0)
         (COALESCE(ipi.jq_other_costs_premiums, 0) + COALESCE(ipi.sy_other_costs_premiums, 0) + COALESCE(ipi.jy_other_costs_premiums, 0)) AS otherCostsPremiums,
+        ipi.jq_supervise_costs_premiums,
+        ipi.sy_supervise_costs_premiums,
+        ipi.jy_supervise_costs_premiums,
         io.product_name,
         iocui.name AS insuredPerson,
         ipi.jq_premium,

+ 9 - 2
tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml

@@ -47,7 +47,10 @@
         sujim.name as managerName,sum.mobile as managerMobile,saa.create_time as createTime,
         saa.amount, saa.balance_amount as balanceAmount,saa.account_name AS accountName,
         saa.bank_card_num as bankCardNum, saa.bank_name as bankName, saa.bank_num as bankNum, suji.id as userJzgInfoId,
-        saa.payment_time as paymentTime, saa.reject_reason as rejectReason, saa.reject_time as rejectTime, saa.reject_person as rejectPerson
+        saa.payment_time as paymentTime, saa.reject_reason as rejectReason, saa.reject_time as rejectTime, saa.reject_person as rejectPerson,
+        saa.account_id, saa.auditing_status,
+        (select iac.card_name  from inv_account_card iac where iac.id = saa.account_id) as pay_account_name,
+        (select iac.bank_card_num   from inv_account_card iac where iac.id =  saa.account_id ) as pay_account_bank_no
         FROM sys_amount_auditing saa
         LEFT JOIN sys_user_jzg_info suji on saa.user_id = suji.user_id AND suji.is_delete = 0
         LEFT JOIN sys_user su on su.id = saa.user_id AND su.is_delete = 0
@@ -164,7 +167,11 @@
         saa.bank_num AS bankNum,
         saa.user_id,
         saa.system_code,
-        saa.auditing_time
+        saa.auditing_time,
+        saa.reject_reason, saa.reject_time, saa.reject_person,
+        saa.account_id, saa.auditing_status,
+        (select iac.card_name  from inv_account_card iac where iac.id = saa.account_id) as pay_account_name,
+        (select iac.bank_card_num   from inv_account_card iac where iac.id =  saa.account_id ) as pay_account_bank_no
         FROM sys_amount_auditing saa
         LEFT JOIN sys_user_jzg_info suji on saa.user_id = suji.user_id AND suji.is_delete = 0
         LEFT JOIN sys_user su on su.id = saa.user_id AND su.is_delete = 0