Przeglądaj źródła

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260622'

jiakai 3 tygodni temu
rodzic
commit
cbe637c791
16 zmienionych plików z 224 dodań i 42 usunięć
  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. 11 2
      commons/src/main/java/com/jzg/commons/entity/vo/OrdersTrackVo.java
  6. 5 0
      commons/src/main/java/com/jzg/commons/util/OrderComponents.java
  7. 5 34
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  8. 14 1
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/orderstrack/InsOrdersTrackServiceImpl.java
  9. 52 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/userinfo/UserInfoServiceImpl.java
  10. 13 0
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/userinfo/UserInfoService.java
  11. 15 2
      tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java
  12. 10 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/InsPlyIncomeInvoiceSettlementMapper.java
  13. 11 0
      tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java
  14. 41 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  15. 19 0
      tenant/organization/src/main/resources/mapper/InsPlyIncomeInvoiceSettlementMapper.xml
  16. 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 = "凭证")
     @Schema(description = "凭证")
     private List<String> voucherList;
     private List<String> voucherList;
 
 
+    @Schema(description = "租户代码")
+    private String systemCode;
+
+    @Schema(description = "对接人")
+    private String contactPerson;
+
     public InsPlyIncomeInvoiceSettlement(){
     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 = "保险公司")
     @Schema(description = "保险公司")
     private String companyId;
     private String companyId;
 
 
+    @Schema(description = "保险公司和保险机构列表")
+    private List<String> companyIds;
+
     @Schema(description = "签单时间开始时间")
     @Schema(description = "签单时间开始时间")
     private String signingTimeStart;
     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
 @Data
 public class SettlementReportQueryVo extends PageRequest {
 public class SettlementReportQueryVo extends PageRequest {
+
+
+    @Schema(description = "是否结算完成, 10 结算完成,20 未结算完成")
+    private String isRemained;
+
     @Schema(description = "应收项/10车险20非车险30全部")
     @Schema(description = "应收项/10车险20非车险30全部")
     private String accountsReceivable;
     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 = "过户日期")
     @Schema(description = "过户日期")
     @DiffProperty(name = "过户日期")
     @DiffProperty(name = "过户日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime transferDate;
     private LocalDateTime transferDate;
 
 
     @Schema(description = "是否过户")
     @Schema(description = "是否过户")

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

@@ -1,15 +1,24 @@
 package com.jzg.commons.entity.vo;
 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 com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.io.Serial;
+
 @Data
 @Data
 @Schema(description = "订单轨迹列表VO")
 @Schema(description = "订单轨迹列表VO")
 public class OrdersTrackVo extends BaseModel {
 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")
     @Schema(description = "轨迹ID")
     private String 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.jqInletRatio","交强入口比例");
         nameMap.put("costRatio.jqKeepPointRatio","交强留点比例");
         nameMap.put("costRatio.jqKeepPointRatio","交强留点比例");
 
 
+
+        nameMap.put("insFeeOrders.jqExportRatio","交强出口比例");
+        nameMap.put("insFeeOrders.syExportRatio","商业出口比例");
+        nameMap.put("insFeeOrders.jyExportRatio","驾意出口比例");
+
         nameMap.put("costRatio.syExportRatio","商业出口比例");
         nameMap.put("costRatio.syExportRatio","商业出口比例");
         nameMap.put("costRatio.syFollowRatio","商业跟单比例");
         nameMap.put("costRatio.syFollowRatio","商业跟单比例");
         nameMap.put("costRatio.syInletRatio","商业入口比例");
         nameMap.put("costRatio.syInletRatio","商业入口比例");

+ 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.InsOrderRightsMapper;
 import com.jzg.quotation.summary.mapper.InsOrderRightsPackageMapper;
 import com.jzg.quotation.summary.mapper.InsOrderRightsPackageMapper;
 import com.jzg.quotation.summary.service.*;
 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.AuditState;
 import com.jzg.quotation.summary.state.listener.AuditStateListener;
 import com.jzg.quotation.summary.state.listener.AuditStateListener;
 import io.seata.spring.annotation.GlobalTransactional;
 import io.seata.spring.annotation.GlobalTransactional;
@@ -121,6 +122,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 
 
     @Autowired
     @Autowired
     InsOrdersCarInfoService insOrdersCarInfoService;
     InsOrdersCarInfoService insOrdersCarInfoService;
+    @Autowired
+    private UserInfoService userInfoService;
 
 
     @Autowired
     @Autowired
     private AuditStateListener auditStateListener;
     private AuditStateListener auditStateListener;
@@ -177,8 +180,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
 //            feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
 //            feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
             feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
             feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
             // auditUser 非空时,判断是名称还是手机号
             // 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 并计算权益金额
             // 查询订单的 ins_fee_orders 数据
             // 查询订单的 ins_fee_orders 数据
@@ -1220,36 +1223,4 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         return res.getRecords();
         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;
 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.commons.entity.vo.OrdersTrackVo;
 import com.jzg.quotation.summary.mapper.InsOrdersTrackMapper;
 import com.jzg.quotation.summary.mapper.InsOrdersTrackMapper;
 import com.jzg.quotation.summary.service.InsOrdersTrackService;
 import com.jzg.quotation.summary.service.InsOrdersTrackService;
+import com.jzg.quotation.summary.service.userinfo.UserInfoService;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
@@ -25,10 +27,21 @@ public class InsOrdersTrackServiceImpl extends ServiceImpl<InsOrdersTrackMapper,
 
 
     private static final Logger log = LoggerFactory.getLogger(InsOrdersTrackServiceImpl.class);
     private static final Logger log = LoggerFactory.getLogger(InsOrdersTrackServiceImpl.class);
 
 
+    @Autowired
+    private UserInfoService userInfoService;
+
     @Override
     @Override
     public List<OrdersTrackVo> list(OrdersTrackParam param) {
     public List<OrdersTrackVo> list(OrdersTrackParam param) {
         log.info("查询订单轨迹:param=[{}]", JSONUtil.toJsonStr(param));
         log.info("查询订单轨迹:param=[{}]", JSONUtil.toJsonStr(param));
         List<OrdersTrackVo> ordersTrackVos = baseMapper.queryList(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;
         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);
+}

+ 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.entity.po.EsmInsCompany;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.AssertionUtils;
+import com.jzg.organization.client.EsmInsCompanyClient;
 import com.jzg.organization.service.ReceivableService;
 import com.jzg.organization.service.ReceivableService;
 import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
 import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
 import com.jzg.quotation.summary.constants.QuoteNumberConstant;
 import com.jzg.quotation.summary.constants.QuoteNumberConstant;
@@ -55,6 +56,8 @@ public class ReceivableController {
     private ReceivableService receivableService;
     private ReceivableService receivableService;
     @Autowired
     @Autowired
     private BaseController baseController;
     private BaseController baseController;
+    @Autowired
+    private EsmInsCompanyClient esmInsCompanyClient;
 
 
     // 拉取已审核订单
     // 拉取已审核订单
 //    @PostMapping("pullAuditedOrder")
 //    @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.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"));
             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());
         receivableQueryVo.setSystemCode(baseController.getSystemCode());
         Page<InsPlyIncome> data = receivableService.getPlatFormReceivableList(receivableQueryVo);
         Page<InsPlyIncome> data = receivableService.getPlatFormReceivableList(receivableQueryVo);
         InsPlyIncomeVO vo = receivableService.getReceivablePageIds(receivableQueryVo);
         InsPlyIncomeVO vo = receivableService.getReceivablePageIds(receivableQueryVo);
@@ -820,7 +826,14 @@ public class ReceivableController {
     @Operation(summary = "对接人结算报表")
     @Operation(summary = "对接人结算报表")
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
         Page page = settlementReportQueryVo.getPage();
         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")
     @PostMapping("exportReceiverSettlementReportExcel")

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

@@ -1,7 +1,9 @@
 package com.jzg.organization.mapper;
 package com.jzg.organization.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 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.po.InsPlyIncomeInvoiceSettlement;
+import com.jzg.commons.entity.finance.vo.SettlementReportQueryVo;
 import com.jzg.commons.entity.finance.vo.SettlementVo;
 import com.jzg.commons.entity.finance.vo.SettlementVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 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 ")
     @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);
     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);
     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);
     void exportReceiverSettlementReportExcel(Page page,SettlementReportQueryVo settlementReportQueryVo);
 
 
     /**
     /**
@@ -535,4 +544,6 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      * @param systemCode 租户代码
      * @param systemCode 租户代码
      */
      */
     void setDisableFlagForOtherReceivable(List<InsPlyIncome> records, String systemCode);
     void setDisableFlagForOtherReceivable(List<InsPlyIncome> records, String systemCode);
+
+
 }
 }

+ 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;
         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());
                     action.setUnSettledAmount(BigDecimalUtil.subtract(new BigDecimal(action.getTotalReceivable()),BigDecimal.ZERO).toString());
                 }
                 }
             }).toList();
             }).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);
             receiverSettlementReport.setRecords(records);
         }
         }
         return receiverSettlementReport;
         return receiverSettlementReport;

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

@@ -3,6 +3,11 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.organization.mapper.InsPlyIncomeInvoiceSettlementMapper">
 <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  -->
     <!-- 查询所有已结算记录的结算金额和回款差额的汇总值 lipf 2026年6月30日15:43:15  -->
     <select id="querySettlementAndDiff" resultType="com.jzg.commons.entity.finance.vo.SettlementVo">
     <select id="querySettlementAndDiff" resultType="com.jzg.commons.entity.finance.vo.SettlementVo">
         select
         select
@@ -20,4 +25,18 @@
             </if>
             </if>
         </where>
         </where>
     </select>
     </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>
 </mapper>

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

@@ -377,9 +377,19 @@
         <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">
         <if test="receivableQueryVo.licenseNo != null and receivableQueryVo.licenseNo != ''">
             AND ipi.license_no LIKE CONCAT('%', #{receivableQueryVo.licenseNo}, '%')
             AND ipi.license_no LIKE CONCAT('%', #{receivableQueryVo.licenseNo}, '%')
         </if>
         </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 != ''">
         <if test="receivableQueryVo.businessSource != null and receivableQueryVo.businessSource != ''">
             AND ipi.business_source = #{receivableQueryVo.businessSource}
             AND ipi.business_source = #{receivableQueryVo.businessSource}
         </if>
         </if>