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

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

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

+ 50 - 0
commons/src/main/java/com/jzg/commons/constants/InvoiceTypeEnum.java

@@ -0,0 +1,50 @@
+package com.jzg.commons.constants;
+
+/**
+ * 费用类型枚举
+ */
+public enum InvoiceTypeEnum {
+
+    /** 1、手续费 */
+    FEE_1("1", "手续费"),
+    /** 2、跟单费 */
+    FEE_2("2", "跟单费"),
+    /** 3、驾意险手续费 */
+    FEE_3("3", "驾意险手续费"),
+    /** 4、驾意险跟单费 */
+    FEE_4("4", "驾意险跟单费"),
+    /** 5、平台应收-车险 */
+    FEE_5("5", "平台应收-车险"),
+    /** 6、平台应收-非车险 */
+    FEE_6("6", "平台应收-非车险");
+
+    // 编码(String类型)
+    private final String code;
+    // 名称(String类型)
+    private final String desc;
+
+    InvoiceTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * 根据code获取枚举
+     */
+    public static InvoiceTypeEnum getByCode(String code) {
+        for (InvoiceTypeEnum value : values()) {
+            if (value.getCode().equals(code)) {
+                return value;
+            }
+        }
+        return null;
+    }
+}

+ 5 - 4
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jzg.commons.constants.InvoiceTypeEnum;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.core.base.BaseController;
@@ -328,16 +329,16 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         List<InsPlyIncomeOrder> res = page.getRecords().stream()
                 .map(action -> new InsPlyIncomeOrder(action.getId(), action.getOrderNo())).toList();
         BigDecimal totalAmount = BigDecimal.ZERO;
-        if ("3".equals(receivableQueryVo.getInvoiceType())){
+        if (InvoiceTypeEnum.FEE_3.getCode().equals(receivableQueryVo.getInvoiceType())){
             totalAmount = page.getRecords().stream()
                     .map(action -> new BigDecimal(Objects.toString(action.getNonCarInsuranceSuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
-        } else if ("4".equals(receivableQueryVo.getInvoiceType())){
+        } else if (InvoiceTypeEnum.FEE_4.getCode().equals(receivableQueryVo.getInvoiceType())){
             totalAmount = page.getRecords().stream()
                     .map(action -> new BigDecimal(Objects.toString(action.getNonCarInsuranceOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
-        }else if ("1".equals(receivableQueryVo.getInvoiceType())){
+        }else if (InvoiceTypeEnum.FEE_1.getCode().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())){
+        }else if (InvoiceTypeEnum.FEE_2.getCode().equals(receivableQueryVo.getInvoiceType())){
             totalAmount = page.getRecords().stream()
                     .map(action -> new BigDecimal(Objects.toString(action.getCarInsuranceOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
         }else{