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

Merge remote-tracking branch 'origin/master'

liub 3 недель назад
Родитель
Сommit
fe342a2de3
28 измененных файлов с 402 добавлено и 82 удалено
  1. 6 0
      commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncomeInvoiceSettlement.java
  2. 3 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/ReceivableQueryVo.java
  3. 5 0
      commons/src/main/java/com/jzg/commons/entity/finance/vo/SettlementReportQueryVo.java
  4. 1 0
      commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrdersCarInfo.java
  5. 1 1
      commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java
  6. 11 2
      commons/src/main/java/com/jzg/commons/entity/vo/OrdersTrackVo.java
  7. 5 0
      commons/src/main/java/com/jzg/commons/util/OrderComponents.java
  8. 11 1
      tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestImpl.java
  9. 5 34
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  10. 14 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/orderstrack/InsOrdersTrackServiceImpl.java
  11. 52 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/userinfo/UserInfoServiceImpl.java
  12. 13 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/userinfo/UserInfoService.java
  13. 3 0
      tenant/insurance/quotation-summary/src/main/resources/application-dev.yaml
  14. 25 1
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKSimpleService.java
  15. 23 8
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/impl/TKQuotationBaseServiceImpl.java
  16. 2 0
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/component/ZmCrawlerRequestComponent.java
  17. 34 7
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Request/ZmCrawlerQuotedPriceRequest.java
  18. 12 0
      tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Response/ZmCrawlerQuotedPriceResponse.java
  19. 35 9
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/component/ZiJinCrawlerRequestComponent.java
  20. 5 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/properties/ZiJinCrawlerProperties.java
  21. 2 13
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/util/RS6Item.java
  22. 15 2
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  23. 10 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/InsPlyIncomeInvoiceSettlementMapper.java
  24. 11 0
      tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java
  25. 25 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java
  26. 41 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  27. 19 0
      tenant/organization/src/main/resources/mapper/InsPlyIncomeInvoiceSettlementMapper.xml
  28. 13 3
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

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

@@ -40,6 +40,12 @@ public class InsPlyIncomeInvoiceSettlement extends BaseModel {
     @Schema(description = "凭证")
     private List<String> voucherList;
 
+    @Schema(description = "租户代码")
+    private String systemCode;
+
+    @Schema(description = "对接人")
+    private String contactPerson;
+
     public InsPlyIncomeInvoiceSettlement(){
 
     }

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

@@ -47,6 +47,9 @@ public class ReceivableQueryVo extends PageRequest {
     @Schema(description = "保险公司")
     private String companyId;
 
+    @Schema(description = "保险公司和保险机构列表")
+    private List<String> companyIds;
+
     @Schema(description = "签单时间开始时间")
     private String signingTimeStart;
 

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

@@ -13,6 +13,11 @@ import java.util.List;
 
 @Data
 public class SettlementReportQueryVo extends PageRequest {
+
+
+    @Schema(description = "是否结算完成, 10 结算完成,20 未结算完成")
+    private String isRemained;
+
     @Schema(description = "应收项/10车险20非车险30全部")
     private String accountsReceivable;
 

+ 1 - 0
commons/src/main/java/com/jzg/commons/entity/orders/po/InsOrdersCarInfo.java

@@ -119,6 +119,7 @@ public class InsOrdersCarInfo extends BaseModel {
 
     @Schema(description = "过户日期")
     @DiffProperty(name = "过户日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime transferDate;
 
     @Schema(description = "是否过户")

+ 1 - 1
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -230,7 +230,7 @@ public class PtlSchemeSaveVo {
         result.append("包含");
         for(int i=0;i<minArray.length;i++) {
             int finalI = i;
-            PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream()
+            PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementProductCostsAttrLink.getDictLabal().stream()
                     .filter(x -> x.getCode().equals(minArray[finalI])).findAny().get();
             result.append(ptlAgreementUndwrtRulesDictLabal.getName());
         }

+ 11 - 2
commons/src/main/java/com/jzg/commons/entity/vo/OrdersTrackVo.java

@@ -1,15 +1,24 @@
 package com.jzg.commons.entity.vo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 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 = "订单轨迹列表VO")
 public class OrdersTrackVo extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = 2737229802683155236L;
+
+    @Schema(description = "创建人姓名")
+    private String createByName;
+
+    @Schema(description = "更新人姓名")
+    private String updateByName;
+
     @Schema(description = "轨迹ID")
     private String id;
 

+ 5 - 0
commons/src/main/java/com/jzg/commons/util/OrderComponents.java

@@ -14,6 +14,11 @@ public class OrderComponents {
         nameMap.put("costRatio.jqInletRatio","交强入口比例");
         nameMap.put("costRatio.jqKeepPointRatio","交强留点比例");
 
+
+        nameMap.put("insFeeOrders.jqExportRatio","交强出口比例");
+        nameMap.put("insFeeOrders.syExportRatio","商业出口比例");
+        nameMap.put("insFeeOrders.jyExportRatio","驾意出口比例");
+
         nameMap.put("costRatio.syExportRatio","商业出口比例");
         nameMap.put("costRatio.syFollowRatio","商业跟单比例");
         nameMap.put("costRatio.syInletRatio","商业入口比例");

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

@@ -984,6 +984,16 @@ public class RenBaoNewCrawlerRequestImpl implements RenBaoNewCrawlerRequest {
                 log.warn("获取人保评分失败: {}", e.getMessage());
             }
         }
+        // 获取商业险,交强险折扣率
+        if(quoteResponse.getData() != null && quoteResponse.getData().getPrpQmain() != null && quoteResponse.getData().getPrpQmain().getDiscount() != null){
+            // 设置商业险折扣率
+            resultsVo.getScoreVo().setSyAdjustRate(BigDecimal.valueOf(quoteResponse.getData().getPrpQmain().getDiscount()).toString());
+        }
+        if(quoteResponse.getData() != null && quoteResponse.getData().getPrpQmainCI() != null && quoteResponse.getData().getPrpQmainCI().getDiscount() != null) {
+            // 设置交强险折扣率
+            resultsVo.getScoreVo().setJqAdjustRate(BigDecimal.valueOf(quoteResponse.getData().getPrpQmainCI().getDiscount()).toString());
+        }
+
         // 处理上一年的投保险别
         if(!lastYeseRisks.isEmpty()){
             try{
@@ -1010,7 +1020,7 @@ public class RenBaoNewCrawlerRequestImpl implements RenBaoNewCrawlerRequest {
 
         // 获取交强险出险次数
         RenBaoNewCrawlerQuoteResponse.CarQuoteRiskItemCIRsp carQuoteRiskItemCIRsp = quoteResponse.getData().getCarQuoteRiskItemCIRsp();
-        JSONArray scoreJson1 = resultsVo.getScoreVo().getScoreJson();
+        JSONArray scoreJson1 = resultsVo.getScoreVo().getScoreJson() != null ?resultsVo.getScoreVo().getScoreJson() : new JSONArray() ;
         if( carQuoteRiskItemCIRsp != null){
             scoreJson1.add(new JSONObject()
                     .fluentPut("scoreName", "交强险出险情况")

+ 5 - 34
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java

@@ -49,6 +49,7 @@ import com.jzg.quotation.summary.mapper.InsFeeAuditMapper;
 import com.jzg.quotation.summary.mapper.InsOrderRightsMapper;
 import com.jzg.quotation.summary.mapper.InsOrderRightsPackageMapper;
 import com.jzg.quotation.summary.service.*;
+import com.jzg.quotation.summary.service.userinfo.UserInfoService;
 import com.jzg.quotation.summary.state.AuditState;
 import com.jzg.quotation.summary.state.listener.AuditStateListener;
 import io.seata.spring.annotation.GlobalTransactional;
@@ -121,6 +122,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
     @Autowired
     InsOrdersCarInfoService insOrdersCarInfoService;
+    @Autowired
+    private UserInfoService userInfoService;
 
     @Autowired
     private AuditStateListener auditStateListener;
@@ -177,8 +180,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 //            feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
             feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
             // auditUser 非空时,判断是名称还是手机号
-            feeAuditVo.setAuditUser(getUserNameByMobile(feeAuditVo.getAuditUser()));
-            feeAuditVo.setCreateBy(getUserNameByMobile(feeAuditVo.getCreateBy()));
+            feeAuditVo.setAuditUser(userInfoService.getUserNameByMobile(feeAuditVo.getAuditUser()));
+            feeAuditVo.setCreateBy(userInfoService.getUserNameByMobile(feeAuditVo.getCreateBy()));
 
             // 循环每条数据,查询 ins_fee_orders 并计算权益金额
             // 查询订单的 ins_fee_orders 数据
@@ -1220,36 +1223,4 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         return res.getRecords();
     }
 
-
-    /**
-     * 根据用户手机号查询名称
-     * @param mobile
-     * @return
-     */
-    private String getUserNameByMobile(String mobile) {
-        if (StringUtils.isNotBlank(mobile)) {
-            // 国内手机号正则:1开头,第二位3-9,共11位数字
-            String mobileRegex = "^1[3-9]\\d{9}$";
-            if (ReUtil.contains(mobileRegex, mobile)) {
-                // auditUser 是手机号:先从 sys_user 表根据 mobile 查询数据
-                HttpResult<SysUser> sysUserResult = orgClient.getUserOnlyIdByMobile(mobile);
-                if (sysUserResult != null && sysUserResult.isSuccess() && sysUserResult.getData() != null) {
-                    SysUser sysUser = sysUserResult.getData();
-                    String userName = sysUser.getUsername();
-                    // 如果 sys_user 的 username 字段是手机号,则再去 sys_user_jzg_info 根据 user_id 查询数据,展示 name
-                    if (StringUtils.isNotBlank(userName) && userName.matches(mobileRegex)) {
-                        HttpResult<SysUserJzgInfo> jzgInfoResult = orgClient.getUserInfo(sysUser.getId());
-                        if (jzgInfoResult != null && jzgInfoResult.isSuccess() && jzgInfoResult.getData() != null
-                                && StringUtils.isNotBlank(jzgInfoResult.getData().getName())) {
-                            return jzgInfoResult.getData().getName();
-                        }
-                    } else if (StringUtils.isNotBlank(userName)) {
-                        // 如果 sys_user 的 username 是名称,则直接展示
-                        return userName;
-                    }
-                }
-            }
-        }
-        return StrUtil.EMPTY;
-    }
 }

+ 14 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersTrackServiceImpl.java → tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/orderstrack/InsOrdersTrackServiceImpl.java

@@ -1,4 +1,4 @@
-package com.jzg.quotation.summary.service.impl;
+package com.jzg.quotation.summary.service.impl.orderstrack;
 
 
 import cn.hutool.json.JSONUtil;
@@ -8,8 +8,10 @@ import com.jzg.commons.entity.orders.po.InsOrdersTrack;
 import com.jzg.commons.entity.vo.OrdersTrackVo;
 import com.jzg.quotation.summary.mapper.InsOrdersTrackMapper;
 import com.jzg.quotation.summary.service.InsOrdersTrackService;
+import com.jzg.quotation.summary.service.userinfo.UserInfoService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -25,10 +27,21 @@ public class InsOrdersTrackServiceImpl extends ServiceImpl<InsOrdersTrackMapper,
 
     private static final Logger log = LoggerFactory.getLogger(InsOrdersTrackServiceImpl.class);
 
+    @Autowired
+    private UserInfoService userInfoService;
+
     @Override
     public List<OrdersTrackVo> list(OrdersTrackParam param) {
         log.info("查询订单轨迹:param=[{}]", JSONUtil.toJsonStr(param));
         List<OrdersTrackVo> ordersTrackVos = baseMapper.queryList(param);
+        for (OrdersTrackVo ordersTrackVo : ordersTrackVos) {
+            String createBy = ordersTrackVo.getCreateBy();
+            String updateBy =  ordersTrackVo.getUpdateBy();
+            String createByName = userInfoService.getUserNameByMobile(createBy);
+            String updateByName = userInfoService.getUserNameByMobile(updateBy);
+            ordersTrackVo.setCreateByName(createByName);
+            ordersTrackVo.setUpdateByName(updateByName);
+        }
         return ordersTrackVos;
     }
 }

+ 52 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/userinfo/UserInfoServiceImpl.java

@@ -0,0 +1,52 @@
+package com.jzg.quotation.summary.service.impl.userinfo;
+
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.core.util.StrUtil;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.SysUser;
+import com.jzg.commons.entity.po.SysUserJzgInfo;
+import com.jzg.commons.util.StringUtils;
+import com.jzg.quotation.commons.client.OrgClient;
+import com.jzg.quotation.summary.service.userinfo.UserInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class UserInfoServiceImpl implements UserInfoService {
+
+
+    @Autowired
+    private OrgClient orgClient;
+
+    /**
+     * 根据用户手机号查询名称
+     * @param mobile
+     * @return
+     */
+    public String getUserNameByMobile(String mobile) {
+        if (StringUtils.isNotBlank(mobile)) {
+            // 国内手机号正则:1开头,第二位3-9,共11位数字
+            String mobileRegex = "^1[3-9]\\d{9}$";
+            if (ReUtil.contains(mobileRegex, mobile)) {
+                // auditUser 是手机号:先从 sys_user 表根据 mobile 查询数据
+                HttpResult<SysUser> sysUserResult = orgClient.getUserOnlyIdByMobile(mobile);
+                if (sysUserResult != null && sysUserResult.isSuccess() && sysUserResult.getData() != null) {
+                    SysUser sysUser = sysUserResult.getData();
+                    String userName = sysUser.getUsername();
+                    // 如果 sys_user 的 username 字段是手机号,则再去 sys_user_jzg_info 根据 user_id 查询数据,展示 name
+                    if (StringUtils.isNotBlank(userName) && userName.matches(mobileRegex)) {
+                        HttpResult<SysUserJzgInfo> jzgInfoResult = orgClient.getUserInfo(sysUser.getId());
+                        if (jzgInfoResult != null && jzgInfoResult.isSuccess() && jzgInfoResult.getData() != null
+                                && StringUtils.isNotBlank(jzgInfoResult.getData().getName())) {
+                            return jzgInfoResult.getData().getName();
+                        }
+                    } else if (StringUtils.isNotBlank(userName)) {
+                        // 如果 sys_user 的 username 是名称,则直接展示
+                        return userName;
+                    }
+                }
+            }
+        }
+        return StrUtil.EMPTY;
+    }
+}

+ 13 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/userinfo/UserInfoService.java

@@ -0,0 +1,13 @@
+package com.jzg.quotation.summary.service.userinfo;
+
+public interface UserInfoService {
+
+
+    /**
+     * 根据用户手机号查询名称
+     *
+     * @param mobile
+     * @return
+     */
+     String getUserNameByMobile(String mobile);
+}

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

@@ -225,6 +225,9 @@ zijin:
     # 对接三方渠道验车链接接口
     sendCheckCarLink: http://open.zking.com/api/v1/open/open-aggregate/auth/wanJiaYun/sendCheckCarLink
 
+  crawler:
+    baseUrl: https://kscd.zking.com
+    cookie-path: https://test.baoxianzhanggui.com/ck-api/ck
 
 #    # 为接入方提供获取token服务
 #    accessTokenUrl: https://open.zking.com/api/v1/public/token/getAccessToken

+ 25 - 1
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKSimpleService.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.taikang.crawler.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
 import com.jzg.commons.entity.quote.vo.*;
 
@@ -1185,23 +1186,46 @@ public class TKSimpleService {
      * @return
      */
     public TKEntranceFor000038Result orderSubmit(TKLoginSession session, String mainOrderId, TKInsureInfo insureInfo) {
+        // 方法入口日志:打印订单号便于追踪整个核保提交流程
+        log.info("orderSubmit 开始执行,mainOrderId={}", mainOrderId);
+
+        // 从会话中提取调用保司接口所需的全局固定参数
         String tplatformId = session.getTplatformId();
         String tplatLoginKey = session.getTplatLoginKey();
         String fromId = session.getFromid();
         String token = session.getToken();
+        log.info("orderSubmit 会话参数已就绪,mainOrderId={}, tplatformId={}, fromId={}", mainOrderId, tplatformId, fromId);
 
+        // 步骤1:调用 entranceFor000012(核保前置接口)
+        log.info("orderSubmit 开始调用 entranceFor000012,mainOrderId={}", mainOrderId);
         httpService.entranceFor000012(token, tplatformId, fromId, mainOrderId, insureInfo);
+        log.info("orderSubmit entranceFor000012 调用完成,mainOrderId={}", mainOrderId);
 
+        // 步骤2:调用 preciseInitToVipQuote(核保报价接口),返回核保报价结果
+        log.info("orderSubmit 开始调用 preciseInitToVipQuote(核保),mainOrderId={}", mainOrderId);
         PreciseInitResult preciseQuoteResult = httpService.preciseInitToVipQuote(token, tplatformId, tplatLoginKey, mainOrderId, insureInfo);
+        log.info("orderSubmit preciseInitToVipQuote(核保)调用完成,preciseQuoteResult={}", JSONObject.toJSONString(preciseQuoteResult));
         if (preciseQuoteResult == null) {
             throw new RuntimeException("HttpService#preciseInitToQuote (核保)失败!");
         }
+
+        // 步骤3:调用 entranceFor000038,获取核保结果
+        log.info("orderSubmit 开始调用 entranceFor000038,mainOrderId={}", mainOrderId);
         TKEntranceFor000038Result tkEntranceFor000038Result = httpService.entranceFor000038(token, tplatformId, fromId, mainOrderId);
-        // 为获取支付链接预处理 TODO
+        log.info("orderSubmit entranceFor000038 调用完成,tkEntranceFor000038Result={}", JSONObject.toJSONString(tkEntranceFor000038Result));
+
+        // 步骤4:调用 entranceFor000021,为获取支付链接做预处理 TODO
+        log.info("orderSubmit 开始调用 entranceFor000021(支付链接预处理),mainOrderId={}", mainOrderId);
         TKEntranceFor000021Result tkEntranceFor000021Result = httpService.entranceFor000021(token, fromId, mainOrderId);
+        log.info("orderSubmit entranceFor000021 调用完成,tkEntranceFor000021Result={}", JSONObject.toJSONString(tkEntranceFor000021Result));
 
+        // 步骤5:调用 entranceFor000052,基于核保结果做后续处理
+        log.info("orderSubmit 开始调用 entranceFor000052,mainOrderId={}", mainOrderId);
         TKEntranceFor000052Result tkEntranceFor000052Result = httpService.entranceFor000052(token, tkEntranceFor000038Result);
+        log.info("orderSubmit entranceFor000052 调用完成,tkEntranceFor000052Result={}", JSONObject.toJSONString(tkEntranceFor000052Result));
 
+        // 方法出口日志:标记整个流程执行结束
+        log.info("orderSubmit 执行完成,mainOrderId={}", mainOrderId);
         return tkEntranceFor000038Result;
     }
 

+ 23 - 8
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/impl/TKQuotationBaseServiceImpl.java

@@ -174,6 +174,7 @@ public class TKQuotationBaseServiceImpl implements TKQuotationBaseService {
 
     @Override
     public UnderwritingResultsVo underwriting(UnderwritingVo underwritingVo) {
+        log.info("泰康开始处理核保流程,参数:{}", JSONObject.toJSONString(underwritingVo));
         AttributionInformationVo attributionInformationVo = underwritingVo.getOrder().getAttributionInformationVo();
         TKLoginSession session = loginSession(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
         PreciseInitResult preciseInitResult = redisCacheUtil.getPreciseInitResult(underwritingVo.getOrder().getOrdersNo());
@@ -194,8 +195,26 @@ public class TKQuotationBaseServiceImpl implements TKQuotationBaseService {
             tkCrawlerOrderService.save(underwritingVo, underwritingResultsVo, preciseInitResult.getMainOrderId(), false);
             return underwritingResultsVo;
         }
-        // 核保通过
+        // 获取核保返回数据
         TKOrderData tkOrderData = tkEntranceFor000038Result.getData();
+
+        // 检查 resultType 判断核保是否自核通过(与Python逻辑一致)
+        String resultType = tkOrderData.getResultType();
+        if (!"自核通过".equals(resultType)) {
+            // 非自核通过,判定为人工核保或其他状态
+            String spResMsg = tkOrderData.getSpResMsg();
+            String checkReason = tkEntranceFor000038Result.getCheckReason() != null
+                    ? tkEntranceFor000038Result.getCheckReason().toString()
+                    : "";
+            String msg = (spResMsg != null && !spResMsg.isEmpty()) ? spResMsg : ("请联系运维人员处理" + checkReason);
+            underwritingResultsVo.setUnderwritingResult("人工审核返回:" + msg);
+            underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
+            tkCrawlerOrderService.save(underwritingVo, underwritingResultsVo, preciseInitResult.getMainOrderId(), true);
+            log.info("泰康核保流程结束(人工核保),结果:{}", JSONObject.toJSONString(underwritingResultsVo));
+            return underwritingResultsVo;
+        }
+
+        // 自核通过,继续处理
         // 核保成功,保单编号缓存
         redisCacheUtil.setCache(tkOrderData.getProposalNo(), underwritingVo.getOrder().getOrdersNo(), "HB");
         // 保司订单号
@@ -210,16 +229,12 @@ public class TKQuotationBaseServiceImpl implements TKQuotationBaseService {
         underwritingResultsVo.setUnderwritingResult("核保成功");
         // 核保状态
         underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.PAY_PENDING);
-        // 验车标志,需要验车,需要上传影像
-        if ("1".equals(tkEntranceFor000038Result.getCheckCarFlag()) && "9".equals(tkEntranceFor000038Result.getData().getUnderWriteFlag())) {
+        // 验车标志,需要验车,需要上传影像(仅检查 checkCarFlag 是否为 1)
+        if ("1".equals(tkEntranceFor000038Result.getCheckCarFlag())) {
             buildCheckCar(tkEntranceFor000038Result, underwritingVo, preciseInitResult, underwritingResultsVo);
         }
-        // 人工核保
-        if ("2".equals(tkOrderData.getCarCheckStatus())) {
-            underwritingResultsVo.setUnderwritingResult("人工审核返回:" + tkOrderData.getSpResMsg());
-            underwritingResultsVo.setUnderwritingStatus(InsOrderStatusEnum.AUDIT_FAIL);
-        }
         tkCrawlerOrderService.save(underwritingVo, underwritingResultsVo, preciseInitResult.getMainOrderId(), true);
+        log.info("泰康核保流程结束,结果:{}", JSONObject.toJSONString(underwritingResultsVo));
         return underwritingResultsVo;
     }
 

+ 2 - 0
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/component/ZmCrawlerRequestComponent.java

@@ -259,6 +259,8 @@ public class ZmCrawlerRequestComponent {
      * @return
      */
     public Mono<ZmCrawlerNetpointQueryResponse> netpointQuery(ZmCrawlerNetpointQueryRequest modelQueryRequest) {
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+                "爬虫网点查询",RequestUrl.NETPOINT_QUERY.getRequestUrl(zmCrawlerProperties.getBaseUrl()),JSON.toJSONString(modelQueryRequest));
         return requestComponent.postGbk(RequestUrl.NETPOINT_QUERY.getRequestUrl(zmCrawlerProperties.getBaseUrl()),
                 Base64Tool.encode(JSONObject.toJSONString(modelQueryRequest)), ZmCrawlerNetpointQueryResponse.class,new HttpHeaders(),"网点查询");
     }

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

@@ -404,7 +404,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
             private ModelDetailsDTO modelDetails;
 
             public InsuredObjectDTO(ZmCrawlerModelQueryResponse.FullCarDataDTO fullCarDataDTO, QuoteVo quoteVo, ZmCrawlerActualValueResponse actualValueResponse) {
-                SimpleStadarCarDTO stadarCarDTO = new SimpleStadarCarDTO(fullCarDataDTO.getFullCarData());
+                SimpleStadarCarDTO stadarCarDTO = new SimpleStadarCarDTO(fullCarDataDTO.getFullCarData(),quoteVo.getCarInfoVo());
                 this.simpleStadarCar = stadarCarDTO;
 
                 PlatformCarDTO platformCarDTO = new PlatformCarDTO();
@@ -425,7 +425,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                 PolicyCarDTO policyCar = new PolicyCarDTO(carInfoVo, actualValueResponse,fullCarDataDTO.getFullCarData());
                 this.policyCar = policyCar;
 
-                ModelDetailsDTO modelDetails = new ModelDetailsDTO();
+                ModelDetailsDTO modelDetails = new ModelDetailsDTO(fullCarDataDTO);
                 this.modelDetails = modelDetails;
 
                 this.violationBeanlist = new ArrayList<>();
@@ -634,6 +634,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     this.carCheckTime = "";
                     this.carChecker = "";
                     this.carQueryCheckCode = "";
+                    this.isrelief = fullCarData.getIsrelief();
                     this.carUseType = carInfoVo.getVehicleUseCode();
                     this.engine = carInfoVo.getEngineNo();
                     this.issueDate = carInfoVo.getIssueDate() + " 00:00:00";
@@ -823,7 +824,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                 @JsonProperty("series")
                 private String series;
 
-                public SimpleStadarCarDTO(ZmCrawlerModelQueryResponse.FullCarDataDTO.FullCarData fullCarData){
+                public SimpleStadarCarDTO(ZmCrawlerModelQueryResponse.FullCarDataDTO.FullCarData fullCarData,CarInfoVo carInfo){
                     this.approvedLoad = fullCarData.getApprovedLoad();
                     this.approvedPassengersCapacity = fullCarData.getApprovedPassengersCapacity();
                     this.brand = fullCarData.getModelName();
@@ -832,6 +833,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     this.energyTypes = fullCarData.getEnergyTypes();
                     this.fuelType = fullCarData.getFuelType();
                     this.localModelCode = fullCarData.getLocalModelCode();
+                    this.isrelief = fullCarData.getIsrelief();
                     this.modelCode = fullCarData.getLocalModelCode();
                     this.newVehicleClassCode = fullCarData.getNewVehicleClassCode();
                     this.originalPurchasePrice = fullCarData.getOriginalPurchasePrice();
@@ -842,7 +844,12 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     this.purchasePrice = fullCarData.getPurchasePrice();
                     this.purchasePriceCopy = fullCarData.getPurchasePrice();
                     this.series = fullCarData.getSeries();
-                    this.unladenMass = fullCarData.getUnladenMass();
+                    if (fullCarData.getUnladenMass() != null && !fullCarData.getUnladenMass().equals(0.00)) {
+                        this.unladenMass = fullCarData.getUnladenMass();
+                    } else {
+                        this.unladenMass = Double.parseDouble(carInfo.getCompleteKerbMass())/1000;
+                    }
+
                 }
             }
 
@@ -932,13 +939,33 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
 
                 public ModelDetailsDTO(ZmCrawlerModelQueryResponse.FullCarDataDTO fullCarDataDTO) {
                     ZmCrawlerModelQueryResponse.FullCarDataDTO.FullCarData fullCarData = fullCarDataDTO.getFullCarData();
+                    this.approvedLoad = fullCarData.getApprovedLoad();
+                    this.approvedPassengersCapacity = fullCarData.getApprovedPassengersCapacity();
                     this.brand = fullCarData.getModelName();
+                    this.carAlias = fullCarData.getModelName();
+                    this.carType = fullCarData.getCarType();
+                    this.carYear = fullCarData.getCarYear();
+                    this.deptCode = fullCarDataDTO.getPlatFormCar().getDeptCode();
                     this.displacement = fullCarData.getDisplacement()/1000;
+                    this.fuelType = fullCarData.getFuelType();
                     this.grossMass = "--";
-                    this.deptCode = fullCarDataDTO.getPlatFormCar().getDeptCode();
-                    this.platSeriesGroup = "--";
-                    this.modelCode = "--";
                     this.groupName = "--";
+                    this.localModelCode = fullCarData.getLocalModelCode();
+                    this.modelCode = "--";
+                    this.modelName = fullCarData.getModelName();
+                    this.newVehicleClass = fullCarData.getNewVehicleClass();
+                    this.platSeriesGroup = "--";
+                    this.power = fullCarData.getPower();
+                    this.purchasePrice = fullCarData.getPurchasePrice();
+                    this.remark = fullCarData.getRemark();
+                    this.series = fullCarData.getSeries();
+                    this.taxReliefFlag = fullCarData.getTaxReliefFlag();
+                    this.transmissionType = fullCarData.getTransmissionType();
+                    this.unladenMass = fullCarData.getUnladenMass();
+                    this.vehicleRisk = new VehicleRiskDTO();
+
+
+
                 }
 
                 @Data

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

@@ -1327,6 +1327,12 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                 @JsonProperty("deductionDueProportion")
                 private Double deductionDueProportion;
 
+                @JsonProperty("deductionDueCode")
+                private String deductionDueCode;
+
+                @JsonProperty("deductionDueType")
+                private String deductionDueType;
+
                 @JsonProperty("documentNumber")
                 private String documentNumber;
 
@@ -1410,6 +1416,12 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                     @JsonProperty("deductionDueProportion")
                     private String deductionDueProportion;
 
+                    @JsonProperty("deductionDueCode")
+                    private String deductionDueCode;
+
+                    @JsonProperty("deductionDueType")
+                    private String deductionDueType;
+
                     @JsonProperty("exceedDate")
                     private String exceedDate;
 

+ 35 - 9
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/component/ZiJinCrawlerRequestComponent.java

@@ -9,7 +9,6 @@ import com.jzg.quotation.zijin.crawler.entity.response.*;
 import com.jzg.quotation.zijin.crawler.enums.RequestUrl;
 import com.jzg.quotation.zijin.crawler.properties.ZiJinCrawlerProperties;
 import com.jzg.quotation.zijin.crawler.util.DESEncryption;
-import com.jzg.quotation.zijin.crawler.util.RS6Item;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.jetbrains.annotations.NotNull;
@@ -19,6 +18,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 import org.springframework.util.StringUtils;
+import org.springframework.web.client.RestTemplate;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -39,13 +39,15 @@ public class ZiJinCrawlerRequestComponent {
     // 循环次数
     public static final int CIRCULATE_NUMBER = 3;
 
-
     private final RequestComponent requestComponent;
 
     private final ZiJinCrawlerProperties ziJinCrawlerProperties;
 
     private final ExteriorUtilsRequest exteriorUtilsRequest;
 
+    // 用于调用Python外放接口获取Cookie
+    private final RestTemplate restTemplate = new RestTemplate();
+
     /**
      * 获取验证码
      *
@@ -513,15 +515,39 @@ public class ZiJinCrawlerRequestComponent {
 
     /**
      * 获取Cookie的值
+     * 通过调用Python外放接口获取Cookie
      *
-     * @return String
-     * @throws IOException
+     * @return String Cookie字符串
+     * @throws IOException 如果获取Cookie时发生错误
      */
-    public static String getCookie() throws IOException {
-        RS6Item rs6Item = RS6Item.createRS6Instance();
-        rs6Item.updata_js_rs6();
-        Map<String, String> cookies = rs6Item.updateCookies();
-        return rs6Item.convertJsonCookieToSemicolonFormat(cookies.toString());
+    public String getCookie() throws IOException {
+        String cookieUrl = ziJinCrawlerProperties.getCookiePath();
+        if (cookieUrl == null || cookieUrl.trim().isEmpty()) {
+            throw new IOException("紫金crawler.cookie-path未配置");
+        }
+        try {
+            ResponseEntity<String> response = restTemplate.getForEntity(cookieUrl, String.class);
+            String body = response.getBody();
+            if (body == null || body.trim().isEmpty()) {
+                throw new IOException("获取Cookie失败: Python接口返回空内容");
+            }
+            // 解析JSON响应,提取cookie字段
+            com.alibaba.fastjson2.JSONObject jsonObject = JSON.parseObject(body);
+            if (!jsonObject.getBooleanValue("ok")) {
+                throw new IOException("获取Cookie失败: Python接口返回ok=false");
+            }
+            String cookie = jsonObject.getString("cookie");
+            if (cookie == null || cookie.trim().isEmpty()) {
+                throw new IOException("获取Cookie失败: 响应中cookie字段为空");
+            }
+            log.info("紫金Cookie获取成功");
+            return cookie.trim();
+        } catch (IOException e) {
+            throw e;
+        } catch (Exception e) {
+            log.error("调用Python接口获取Cookie失败: {}", e.getMessage(), e);
+            throw new IOException("获取Cookie失败: " + e.getMessage(), e);
+        }
     }
 
     /**

+ 5 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/properties/ZiJinCrawlerProperties.java

@@ -16,4 +16,9 @@ public class ZiJinCrawlerProperties {
 
     private String baseUrl;
 
+    /**
+     * 用 python 跑的外放接口获取Cookie
+     */
+    private String cookiePath;
+
 }

+ 2 - 13
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/crawler/util/RS6Item.java

@@ -10,23 +10,12 @@ import org.apache.http.util.EntityUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.select.Elements;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UncheckedIOException;
+import java.io.*;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.FileSystemException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.Arrays;
+import java.nio.file.*;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 

+ 15 - 2
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -17,6 +17,7 @@ import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.commons.util.AssertionUtils;
+import com.jzg.organization.client.EsmInsCompanyClient;
 import com.jzg.organization.service.ReceivableService;
 import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
 import com.jzg.quotation.summary.constants.QuoteNumberConstant;
@@ -55,6 +56,8 @@ public class ReceivableController {
     private ReceivableService receivableService;
     @Autowired
     private BaseController baseController;
+    @Autowired
+    private EsmInsCompanyClient esmInsCompanyClient;
 
     // 拉取已审核订单
 //    @PostMapping("pullAuditedOrder")
@@ -484,7 +487,10 @@ public class ReceivableController {
             receivableQueryVo.setSigningTimeStart(DateUtil.format(LocalDate.parse(receivableQueryVo.getSigningTime()[0], DateTimeFormatter.ISO_DATE).atStartOfDay(), "yyyy-MM-dd HH:mm:ss"));
             receivableQueryVo.setSigningTimeEnd(DateUtil.format(LocalDate.parse(receivableQueryVo.getSigningTime()[1], DateTimeFormatter.ISO_DATE).plusDays(1).atStartOfDay(), "yyyy-MM-dd HH:mm:ss"));
         }
-
+        if(StrUtil.isNotEmpty(receivableQueryVo.getCompanyId())){
+            HttpResult<List<String>> listHttpResult = esmInsCompanyClient.queryOwnAndSubCompandyIds(receivableQueryVo.getCompanyId());
+            receivableQueryVo.setCompanyIds(listHttpResult.getData());
+        }
         receivableQueryVo.setSystemCode(baseController.getSystemCode());
         Page<InsPlyIncome> data = receivableService.getPlatFormReceivableList(receivableQueryVo);
         InsPlyIncomeVO vo = receivableService.getReceivablePageIds(receivableQueryVo);
@@ -820,7 +826,14 @@ public class ReceivableController {
     @Operation(summary = "对接人结算报表")
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
         Page page = settlementReportQueryVo.getPage();
-        return HttpResult.ok(receivableService.receiverSettlementReport(page,settlementReportQueryVo));
+        settlementReportQueryVo.setSettlementStartTime(settlementReportQueryVo.getStartTime());
+        settlementReportQueryVo.setSettlementEndTime(settlementReportQueryVo.getEndTime());
+        if(StrUtil.isEmpty(settlementReportQueryVo.getSettlementEndTime()) && StrUtil.isEmpty(settlementReportQueryVo.getSettlementStartTime()) )  {
+            return HttpResult.ok(receivableService.receiverSettlementReport(page,settlementReportQueryVo));
+        }else{
+            // 当勾选了结算时间后,需要反着进行查询
+            return HttpResult.ok(receivableService.receiverSettlementReportWithSettlemetnDate(page,settlementReportQueryVo));
+        }
     }
 
     @PostMapping("exportReceiverSettlementReportExcel")

+ 10 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/InsPlyIncomeInvoiceSettlementMapper.java

@@ -1,7 +1,9 @@
 package com.jzg.organization.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
+import com.jzg.commons.entity.finance.vo.SettlementReportQueryVo;
 import com.jzg.commons.entity.finance.vo.SettlementVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -23,4 +25,12 @@ public interface InsPlyIncomeInvoiceSettlementMapper extends BaseMapper<InsPlyIn
     @Select("select * from ins_ply_income_invoice_settlement ipiis where ipiis.invoice_id = #{invoiceId,jdbcType=VARCHAR} and ipiis.is_delete = 0 order by ipiis.create_time desc ")
     List<InsPlyIncomeInvoiceSettlement> querySettlementRecent(@Param("invoiceId") String invoiceId);
 
+    /**
+     * 根据结算时间查询结算记录
+     *
+     * @author lipf
+     * @date 2026/8/14 11:10
+     */
+    Page<InsPlyIncomeInvoiceSettlement> querySettlementBySettlementDate(Page page, @Param("vo") SettlementReportQueryVo vo);
+
 }

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

@@ -331,6 +331,15 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      */
     Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page,SettlementReportQueryVo settlementReportQueryVo);
 
+    /**
+     * 对接人结算报表
+     *     结算时间不为空
+     *
+     * @author modify by lipf
+     * @date 2026/5/23 8:57
+     */
+    Page<ReceiverSettlementReportDto> receiverSettlementReportWithSettlemetnDate(Page page, SettlementReportQueryVo settlementReportQueryVo);
+
     void exportReceiverSettlementReportExcel(Page page,SettlementReportQueryVo settlementReportQueryVo);
 
     /**
@@ -535,4 +544,6 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      * @param systemCode 租户代码
      */
     void setDisableFlagForOtherReceivable(List<InsPlyIncome> records, String systemCode);
+
+
 }

+ 25 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlSchemeServiceImpl.java

@@ -647,6 +647,31 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
         List<SchemeResultVo.SchemeVo> schemeInsuranceInfo = ptlSchemeMapper.getSchemeInsuranceInfo(companyId, productId);
         List<SchemeResultVo.SchemeVo> schemeDrivingInfo = ptlSchemeMapper.getSchemeDrivingInfo(companyId, productId);
 
+        // 过滤驾意险 ->根据座位数
+        if (StrUtil.isNotBlank(seatCount)) {
+            int seats = Integer.parseInt(seatCount);
+            schemeDrivingInfo.forEach(scheme -> {
+                scheme.getInfos().forEach(info -> {
+                    List<SchemeResultVo.Driving> drivings = info.getDrivings();
+                    if (drivings != null && !drivings.isEmpty()) {
+                        List<SchemeResultVo.Driving> filteredList = drivings.stream()
+                                .filter(driving -> {
+                                    // 如果 minSeatCount 和 maxSeatCount 都为 null,视为没有限制,不过滤
+                                    if (driving.getMinSeatCount() == null && driving.getMaxSeatCount() == null) {
+                                        return true;
+                                    }
+                                    // 检查座位数是否在范围内
+                                    int minSeat = driving.getMinSeatCount() != null ? driving.getMinSeatCount() : Integer.MIN_VALUE;
+                                    int maxSeat = driving.getMaxSeatCount() != null ? driving.getMaxSeatCount() : Integer.MAX_VALUE;
+                                    return seats >= minSeat && seats <= maxSeat;
+                                })
+                                .collect(Collectors.toList());
+                        info.setDrivings(filteredList);
+                    }
+                });
+            });
+        }
+
         // 过滤类型
         List<SchemeResultVo.SchemeVo> newSchemeList = schemeInsuranceInfo.stream()
                 .filter(scheme -> scheme.getVehicleType().contains(vehicleType)

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

@@ -6217,6 +6217,39 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         return val == null ? BigDecimal.ZERO : val;
     }
 
+    /**
+     * 对接人结算报表
+     * 结算时间不为空
+     *
+     * @param page
+     * @param vo
+     * @author modify by lipf
+     * @date 2026/5/23 8:57
+     */
+    @Override
+    public Page<ReceiverSettlementReportDto> receiverSettlementReportWithSettlemetnDate(Page page, SettlementReportQueryVo vo) {
+        log.info("平台协议应收-结算报表-对接人结算报表查询。結算时间不为空 settlementReportQueryVo=[{}]", JSONUtil.toJsonStr(vo));
+        Page<InsPlyIncomeInvoiceSettlement> pageRes = insPlyIncomeInvoiceSettlementMapper.querySettlementBySettlementDate(page,vo);
+        List<InsPlyIncomeInvoiceSettlement> records = pageRes.getRecords();
+        Map<String, List<InsPlyIncomeInvoiceSettlement>> res =  records.stream()
+                .collect(Collectors.groupingBy(InsPlyIncomeInvoiceSettlement::getContactPerson));
+        Page<ReceiverSettlementReportDto> pagDto = new Page<>(page.getPages(), page.getSize());
+        List<ReceiverSettlementReportDto> dtos = new ArrayList<>();
+        for (String s : res.keySet()) {
+            ReceiverSettlementReportDto dto = new ReceiverSettlementReportDto();
+            dto.setReceiver(s);
+            List<InsPlyIncomeInvoiceSettlement> settlements = res.get(s);
+            BigDecimal diffAmount = settlements.stream().map(InsPlyIncomeInvoiceSettlement::getSettlementPaymentDifference).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal actualReceivedAmount = settlements.stream().map(InsPlyIncomeInvoiceSettlement::getActualReceivedAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            dto.setSettledAmount(actualReceivedAmount.toString());
+            dto.setUnSettledAmount(BigDecimal.ZERO.toString());
+            dto.setTotalReceivable(BigDecimalUtil.add(diffAmount, actualReceivedAmount).toString());
+            dto.setTotalPaymentDifference(diffAmount);
+            dtos.add(dto);
+        }
+        pagDto.setRecords(dtos);
+        return pagDto;
+    }
 
     /**
      * 平台协议应收-结算报表-对接人结算报表查询
@@ -6282,6 +6315,14 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                     action.setUnSettledAmount(BigDecimalUtil.subtract(new BigDecimal(action.getTotalReceivable()),BigDecimal.ZERO).toString());
                 }
             }).toList();
+            // 根据实际情况判断,是否计算完成
+            if(StrUtil.isNotEmpty(settlementReportQueryVo.getIsRemained())){
+                if("10".equals(settlementReportQueryVo.getIsRemained())){
+                    records = records.stream().filter(action-> "0".equals(action.getUnSettledAmount())).toList();
+                }else if("20".equals(settlementReportQueryVo.getIsRemained())){
+                    records = records.stream().filter(action-> !"0".equals(action.getUnSettledAmount())).toList();
+                }
+            }
             receiverSettlementReport.setRecords(records);
         }
         return receiverSettlementReport;

+ 19 - 0
tenant/organization/src/main/resources/mapper/InsPlyIncomeInvoiceSettlementMapper.xml

@@ -3,6 +3,11 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.organization.mapper.InsPlyIncomeInvoiceSettlementMapper">
+
+    <resultMap id="BaseResultMap" type="com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement">
+
+    </resultMap>
+
     <!-- 查询所有已结算记录的结算金额和回款差额的汇总值 lipf 2026年6月30日15:43:15  -->
     <select id="querySettlementAndDiff" resultType="com.jzg.commons.entity.finance.vo.SettlementVo">
         select
@@ -20,4 +25,18 @@
             </if>
         </where>
     </select>
+    <!-- 根据结算日期查询结算记录 2026年8月14日11:28:34 lipf  -->
+    <select id="querySettlementBySettlementDate"  resultMap="BaseResultMap">
+        select  ipiis.*, ipii.contact_person  from
+        ins_ply_income_invoice_settlement ipiis
+        left join ins_ply_income_invoice ipii on
+        ipiis.invoice_id = ipii.id
+        <where>
+            ipii.invoice_type in (5, 6)
+            and ipiis.receive_payment_date &gt;= #{vo.settlementStartTime} and ipiis.receive_payment_date &lt;= #{vo.settlementEndTime}
+            <if test="vo.contactPerson != null and vo.contactPerson != ''">
+                and ipii.contact_person = #{vo.contactPerson}
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -377,9 +377,19 @@
         <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">
             AND ipi.license_no LIKE CONCAT('%', #{receivableQueryVo.licenseNo}, '%')
         </if>
-        <if test="receivableQueryVo.companyId != null and receivableQueryVo.companyId != ''">
-            AND (ipi.partner_company_id = #{receivableQueryVo.companyId} or ipi.company_id = #{receivableQueryVo.companyId})
-        </if>
+        <choose>
+            <when  test="receivableQueryVo.companyIds != null and receivableQueryVo.companyIds.size() > 0">
+                AND ipi.partner_company_id in
+                <foreach collection="receivableQueryVo.companyIds" item="companyId" open="(" close=")" separator=",">
+                    #{companyId}
+                </foreach>
+            </when>
+            <otherwise>
+                <if test="receivableQueryVo.companyId != null and receivableQueryVo.companyId != ''">
+                    AND (ipi.partner_company_id = #{receivableQueryVo.companyId} or ipi.company_id = #{receivableQueryVo.companyId})
+                </if>
+            </otherwise>
+        </choose>
         <if test="receivableQueryVo.businessSource != null and receivableQueryVo.businessSource != ''">
             AND ipi.business_source = #{receivableQueryVo.businessSource}
         </if>