lipf 1 месяц назад
Родитель
Сommit
eadb2a7788

+ 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(){
 
     }

+ 8 - 1
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -826,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/ReceivableServiceImpl.java

@@ -6217,6 +6217,31 @@ 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();
+            dtos.add(dto);
+        }
+        pagDto.setRecords(dtos);
+        return null;
+    }
 
     /**
      * 平台协议应收-结算报表-对接人结算报表查询

+ 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>