Przeglądaj źródła

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260518' into dev_jzg_lipf_v20260518

lipf 3 miesięcy temu
rodzic
commit
cfb2ebafbf

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

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

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

@@ -208,7 +208,8 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      * @author lipf
      * @author lipf
      * @date 2026/6/1 16:57
      * @date 2026/6/1 16:57
      */
      */
-    List<CompanySuperviseSettlementReportDto> queryCumulativeAccountsReceivable(@Param("systemCode") String systemCode);
+    List<CompanySuperviseSettlementReportDto> queryCumulativeAccountsReceivable(@Param("systemCode") String systemCode,
+                                                                                @Param("agreementType") String agreementType);
 
 
     /**
     /**
      * 查询已开票金额
      * 查询已开票金额
@@ -223,7 +224,8 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
     List<CalRes> queryInvoicedAmount(@Param("systemCode") String systemCode,
     List<CalRes> queryInvoicedAmount(@Param("systemCode") String systemCode,
                                      @Param("invoiceType") List<Integer> invoiceType,
                                      @Param("invoiceType") List<Integer> invoiceType,
                                      @Param("invoiceStartDate") String invoiceStartDate,
                                      @Param("invoiceStartDate") String invoiceStartDate,
-                                     @Param("invoiceEndDate") String invoiceEndDate);
+                                     @Param("invoiceEndDate") String invoiceEndDate,
+                                     @Param("agreementType") String agreementType);
 
 
     /**
     /**
      * 查询已结算金额
      * 查询已结算金额
@@ -232,8 +234,9 @@ public interface ReceivableMapper extends BaseMapper<InsPlyIncome> {
      * @return List<CalRes>
      * @return List<CalRes>
      */
      */
     List<CalRes> querySettledAmount(@Param("systemCode") String systemCode,
     List<CalRes> querySettledAmount(@Param("systemCode") String systemCode,
-                                               @Param("settledStartDate") String settledStartDate,
-                                               @Param("settledEndDate") String settledEndDate);
+                                    @Param("settledStartDate") String settledStartDate,
+                                    @Param("settledEndDate") String settledEndDate,
+                                    @Param("agreementType") String agreementType);
 
 
     /**
     /**
      * 查询
      * 查询

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

@@ -2796,7 +2796,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public void exportSuperviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
+    public void exportSuperviseSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
+        verifyUploadPath();
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.superviseSettlementExcelDtos(page, settlementQueryVo);
         // 补充、转换列表的数据
         // 补充、转换列表的数据
         supplementaryListData(exportSuperviseSettlementExcelDtos);
         supplementaryListData(exportSuperviseSettlementExcelDtos);
@@ -2811,7 +2812,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public void exportPlatformSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) {
+    public void exportPlatformSettlementExcel(Page page, SettlementQueryVo settlementQueryVo) throws IOException {
+        verifyUploadPath();
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.platformSettlementExcelDtos(page, settlementQueryVo);
         Page<ExportSuperviseSettlementExcelDto> exportSuperviseSettlementExcelDtos = baseMapper.platformSettlementExcelDtos(page, settlementQueryVo);
         // 补充、转换列表的数据
         // 补充、转换列表的数据
         supplementaryListData(exportSuperviseSettlementExcelDtos);
         supplementaryListData(exportSuperviseSettlementExcelDtos);
@@ -3104,7 +3106,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         log.info("保险公司结算报表查询-区分租户并且按照日期进行过滤:systemCode=[{}],queryVo=[{}]", systemCode, JSONUtil.toJsonStr(queryVo));
         log.info("保险公司结算报表查询-区分租户并且按照日期进行过滤:systemCode=[{}],queryVo=[{}]", systemCode, JSONUtil.toJsonStr(queryVo));
         // 1. 先将有数据的保险公司进行汇总
         // 1. 先将有数据的保险公司进行汇总
         // 累计应收金额, 应收手续费(手续费), 应收手续费(手续费)
         // 累计应收金额, 应收手续费(手续费), 应收手续费(手续费)
-        List<CompanySuperviseSettlementReportDto> allCompaniesIncomeDatas = baseMapper.queryCumulativeAccountsReceivable(systemCode);
+        List<CompanySuperviseSettlementReportDto> allCompaniesIncomeDatas = baseMapper.queryCumulativeAccountsReceivable(systemCode, queryVo.getAgreementType());
         allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().peek(action-> action.setId(action.getCompanyId())).toList();
         allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().peek(action-> action.setId(action.getCompanyId())).toList();
         // for test, 查看一家公司的数据,将不可变对象变成 可变对象
         // for test, 查看一家公司的数据,将不可变对象变成 可变对象
 //        allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().filter(action-> "1738811735599338932".equals(action.getCompanyId())).toList();
 //        allCompaniesIncomeDatas = allCompaniesIncomeDatas.stream().filter(action-> "1738811735599338932".equals(action.getCompanyId())).toList();
@@ -3163,15 +3165,15 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         // 已开票(跟单费)
         // 已开票(跟单费)
 
 
         List<CalRes> calRes;
         List<CalRes> calRes;
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(1, 3), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(1, 3), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> sxfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
         Map<String, BigDecimal> sxfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(2, 4), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(2, 4), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> gdfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
         Map<String, BigDecimal> gdfInvoicedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
-        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(4, 6), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.queryInvoicedAmount(systemCode, List.of(4, 6), queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> ptInvoicedAmountMap =calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
         Map<String, BigDecimal> ptInvoicedAmountMap =calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getAmount, (o1,o2)->o1));
 
 
         // 结算费用 
         // 结算费用 
-        calRes = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime());
+        calRes = baseMapper.querySettledAmount(systemCode, queryVo.getInvoiceStartTime(), queryVo.getInvoiceEndTime(), queryVo.getAgreementType());
         Map<String, BigDecimal> sxfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getSxfSettlement, (o1,o2)->o1));
         Map<String, BigDecimal> sxfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getSxfSettlement, (o1,o2)->o1));
         Map<String, BigDecimal> gdfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getGdfSettlement, (o1,o2)->o1));
         Map<String, BigDecimal> gdfSettledAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getGdfSettlement, (o1,o2)->o1));
 
 

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

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