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

修改bug:
私有应收-跟单/手续费 车险的应收金额应该不加非车,只有交强和商业的金额

jiakai 2 месяцев назад
Родитель
Сommit
b29d6c4883

+ 20 - 0
commons/src/main/java/com/jzg/commons/entity/finance/po/InsPlyIncome.java

@@ -199,6 +199,26 @@ public class InsPlyIncome extends BaseModel {
     @ExcelProperty("总应收金额")
     private String receivableAmount;
 
+    @TableField(exist = false)
+    @Schema(description = "车险应收手续费")
+    @ExcelProperty("车险应收手续费")
+    private String carInsuranceSuperviseCostsPremiums;
+
+    @TableField(exist = false)
+    @Schema(description = "非车险应收手续费")
+    @ExcelProperty("非车险应收手续费")
+    private String nonCarInsuranceSuperviseCostsPremiums;
+
+    @TableField(exist = false)
+    @Schema(description = "车险应收跟单费")
+    @ExcelProperty("车险应收跟单费")
+    private String carInsuranceOtherCostsPremiums;
+
+    @TableField(exist = false)
+    @Schema(description = "非车险应收跟单费")
+    @ExcelProperty("非车险应收跟单费")
+    private String nonCarInsuranceOtherCostsPremiums;
+
     @Schema(description = "手续费是否已经结算")
     @ExcelIgnore
     private String superviseSettlement;

+ 8 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -330,10 +330,16 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         BigDecimal totalAmount = BigDecimal.ZERO;
         if ("3".equals(receivableQueryVo.getInvoiceType())){
             totalAmount = page.getRecords().stream()
-                    .map(action -> new BigDecimal(Objects.toString(action.getJySuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    .map(action -> new BigDecimal(Objects.toString(action.getNonCarInsuranceSuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
         } else if ("4".equals(receivableQueryVo.getInvoiceType())){
             totalAmount = page.getRecords().stream()
-                    .map(action -> new BigDecimal(Objects.toString(action.getJyOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    .map(action -> new BigDecimal(Objects.toString(action.getNonCarInsuranceOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        }else if ("1".equals(receivableQueryVo.getInvoiceType())){
+            totalAmount = page.getRecords().stream()
+                    .map(action -> new BigDecimal(Objects.toString(action.getCarInsuranceSuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
+        }else if ("2".equals(receivableQueryVo.getInvoiceType())){
+            totalAmount = page.getRecords().stream()
+                    .map(action -> new BigDecimal(Objects.toString(action.getCarInsuranceOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
         }else{
             totalAmount = page.getRecords().stream()
                     .map(action -> new BigDecimal(Objects.toString(action.getReceivableAmount(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);

+ 4 - 0
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -230,6 +230,10 @@
         (COALESCE(ipi.jq_supervise_costs_premiums, 0) + COALESCE(ipi.sy_supervise_costs_premiums, 0) + COALESCE(ipi.jy_supervise_costs_premiums, 0)) AS superviseCostsPremiums,
         -- 3. 总应收跟单费 (修复了括号位置错误,并为最后一个字段补充了默认值 0)
         (COALESCE(ipi.jq_other_costs_premiums, 0) + COALESCE(ipi.sy_other_costs_premiums, 0) + COALESCE(ipi.jy_other_costs_premiums, 0)) AS otherCostsPremiums,
+        (COALESCE(ipi.jq_supervise_costs_premiums, 0) + COALESCE(ipi.sy_supervise_costs_premiums, 0)) AS carInsuranceSuperviseCostsPremiums,
+        COALESCE(ipi.jy_supervise_costs_premiums, 0) AS nonCarInsuranceSuperviseCostsPremiums,
+        (COALESCE(ipi.jq_other_costs_premiums, 0) + COALESCE(ipi.sy_other_costs_premiums, 0)) AS carInsuranceOtherCostsPremiums,
+        COALESCE(ipi.jy_other_costs_premiums, 0) AS nonCarInsuranceOtherCostsPremiums,
         (COALESCE(ipi.jq_supervise_costs_proportion, 0) + COALESCE(ipi.jq_other_costs_proportion, 0)) AS jqTotalProportion,
         (COALESCE(ipi.sy_supervise_costs_proportion, 0) + COALESCE(ipi.sy_other_costs_proportion, 0)) AS syTotalProportion,
         (COALESCE(ipi.jy_supervise_costs_proportion, 0) + COALESCE(ipi.jy_other_costs_proportion, 0)) AS jyTotalProportion,