Jelajahi Sumber

修改bug:
私有应收,保险公司报表这里加个虚增金额合计数

jiakai 3 bulan lalu
induk
melakukan
9cd701a8d7

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/finance/dto/CompanySuperviseSettlementReportDto.java

@@ -69,6 +69,8 @@ public class CompanySuperviseSettlementReportDto implements Serializable {
     private String gdfSettledAmount;
     @Schema(description = "跟单费未结算金额")
     private String gdfUnSettledAmount;
+    @Schema(description = "虚增金额合计")
+    private String totalOverinflatedAmount;
 
     @Schema(description = "子保险公司数据")
     private List<CompanySuperviseSettlementReportDto> children;

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

@@ -54,4 +54,10 @@ public class SettlementReportQueryVo extends PageRequest {
 
     @Schema(description = "租户代码")
     private String systemCode;
+
+    @Schema(description = "签单开始时间")
+    private String signingStartTime;
+
+    @Schema(description = "签单结束时间")
+    private String signingEndTime;
 }

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/entity/dto/CalRes.java

@@ -25,5 +25,8 @@ public class CalRes implements Serializable {
     @Schema(description = "结算金额")
     private BigDecimal settlement;
 
+    @Schema(description = "虚增金额")
+    private BigDecimal overinflatedAmount;
+
 
 }

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

@@ -3630,6 +3630,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         List<CalRes> calRes;
         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> sxfOverinflatedAmountMap = calRes.stream().collect(Collectors.toMap(CalRes::getCompanyId, CalRes::getOverinflatedAmount, (o1,o2)->o1));
         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));
 
@@ -3645,6 +3646,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             CompanySuperviseSettlementReportDto companySuperviseSettlementReportDto = companyMap.get(companyId);
             BigDecimal sxf = sxfInvoicedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setSxfInvoicedAmount(Objects.toString(sxf,BigDecimal.ZERO+""));
+            BigDecimal sxfOverinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
+            companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(sxfOverinflatedAmount,BigDecimal.ZERO+""));
             BigDecimal gdf = gdfInvoicedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setGdfInvoicedAmount(Objects.toString(gdf,BigDecimal.ZERO+""));
             // 平台就没有未结算的,只要结算就是已结算的
@@ -3658,8 +3661,10 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
 
             BigDecimal sxfS = sxfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             BigDecimal gdfS = gdfSettledAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
+            BigDecimal overinflatedAmount = sxfOverinflatedAmountMap.getOrDefault(companyId, BigDecimal.ZERO);
             companySuperviseSettlementReportDto.setSxfSettledAmount(Objects.toString(sxfS, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setSxfUnSettledAmount(BigDecimalUtil.subtract(sxf,sxfS).toString());
+            companySuperviseSettlementReportDto.setTotalOverinflatedAmount(Objects.toString(overinflatedAmount, BigDecimal.ZERO+""));
 
             companySuperviseSettlementReportDto.setGdfSettledAmount(Objects.toString(gdfS, BigDecimal.ZERO+""));
             companySuperviseSettlementReportDto.setGdfUnSettledAmount(BigDecimalUtil.subtract(gdf,gdfS).toString());
@@ -3781,6 +3786,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             tree.putExtra("sxfUnSettledAmount",dto.getSxfUnSettledAmount());
             tree.putExtra("gdfSettledAmount",dto.getGdfSettledAmount());
             tree.putExtra("gdfUnSettledAmount",dto.getGdfUnSettledAmount());
+            tree.putExtra("totalOverinflatedAmount",dto.getTotalOverinflatedAmount());
         });
         log.info("树形结构构建:一级数据[{}]个", CollUtil.size(build));
         return build;

+ 10 - 2
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -1693,6 +1693,12 @@
             <if test="vo.agreementType != null and vo.agreementType != ''">
                 AND ipi.agreement_type = #{vo.agreementType}
             </if>
+            <if test="vo.signingStartTime != null and vo.signingStartTime != '' and vo.signingEndTime != null and vo.signingEndTime != ''">
+                AND DATE(ipi.signing_time) between #{vo.signingStartTime} and #{vo.signingEndTime}
+            </if>
+            <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
+                AND DATE(ipi.create_time) between #{vo.startTime} and #{vo.endTime}
+            </if>
         </where>
         group by
         eic.parent_id,
@@ -1704,12 +1710,14 @@
     <select id="queryInvoicedAmount" resultType="com.jzg.organization.entity.dto.CalRes">
         select
         a.company_id as companyId,
-        sum(a.amount) as amount
+        sum(a.amount) as amount,
+        sum(a.overinflatedAmount) as overinflatedAmount
         from
         (
         select
         ipii.company_id,
-        COALESCE(ipii.receivable_supervise_premium) as amount
+        COALESCE(ipii.receivable_supervise_premium) as amount,
+        COALESCE(ipii.overinflated_amount) as overinflatedAmount
         from
         ins_ply_income_invoice ipii
         where