浏览代码

问题处理

yzc 1 年之前
父节点
当前提交
bd1db74138

+ 8 - 8
hx-account/src/main/java/com/fjhx/account/entity/account/enums/PaymentTypeEnum.java

@@ -7,16 +7,16 @@ import java.util.Map;
 
 //打款类型
 public enum PaymentTypeEnum {
-    UNDER_REVIEW(10, "请款"),
-    REJECT(20, "采购付款"),
-    RECEIVE(30, "退货到款登记"),
+    UNDER_REVIEW("10", "请款"),
+    REJECT("20", "采购付款"),
+    RECEIVE("30", "退货到款登记"),
     ;
-    private static Map<Integer, String> map = new LinkedHashMap<>();
+    private static Map<String, String> map = new LinkedHashMap<>();
 
     private String value;
-    private Integer key;
+    private String key;
 
-    PaymentTypeEnum(Integer key, String value) {
+    PaymentTypeEnum(String key, String value) {
         this.key = key;
         this.value = value;
     }
@@ -26,7 +26,7 @@ public enum PaymentTypeEnum {
      *
      * @return
      */
-    public static Map<Integer, String> getMap() {
+    public static Map<String, String> getMap() {
         if (MapUtils.isNotEmpty(map)) {
             return map;
         }
@@ -36,7 +36,7 @@ public enum PaymentTypeEnum {
         return map;
     }
 
-    public Integer getKey() {
+    public String getKey() {
         return key;
     }
 

+ 1 - 1
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountPayment.java

@@ -69,7 +69,7 @@ public class AccountPayment extends BasePo {
     /**
      * 付款类型(10:请款  20 采购付款) 字典payment_type
      */
-    private Integer type;
+    private String type;
 
     /**
      * 摘要

+ 1 - 1
hx-account/src/main/java/com/fjhx/account/entity/account/po/AccountRequestFunds.java

@@ -55,7 +55,7 @@ public class AccountRequestFunds extends BasePo {
     /**
      * 请款类型(字典funds_type)
      */
-    private Integer type;
+    private String type;
 
     /**
      * 请款总额

+ 4 - 3
hx-sale/src/main/java/com/fjhx/sale/flow/AfterSalesFlow.java

@@ -92,7 +92,7 @@ public class AfterSalesFlow extends FlowDelegate {
         BigDecimal multiply = contractProduct.getPrice().multiply(afterSales.getQuantity());
 
         //如果售后类型=仅退款30/退货退款40。审批通过后生成打款数据
-        if (ObjectUtil.equals(afterSales, 30) || ObjectUtil.equals(afterSales, 40)) {
+        if (ObjectUtil.equals(afterSales.getType(), "30") || ObjectUtil.equals(afterSales.getType(), "40")) {
             // 添加一条付款流水
             AccountPayment accountPayment = new AccountPayment();
 
@@ -105,7 +105,7 @@ public class AfterSalesFlow extends FlowDelegate {
             accountPayment.setPaymentTime(new Date());
             accountPayment.setCurrency("CNY");
             accountPayment.setStatus(PaymentStatusEnum.UNDER_REVIEW.getKey());
-            accountPayment.setType(40);//售后
+            accountPayment.setType("40");//售后
             accountPayment.setPaymentRemark(afterSales.getRemark());
             accountPayment.setIncomeAmount(multiply);
             accountPayment.setName(afterSales.getAccountName());
@@ -118,11 +118,12 @@ public class AfterSalesFlow extends FlowDelegate {
             accountPaymentService.save(accountPayment);
         }
         //如果售后类型=补发10/换货20。审批通过后,生成一条销售订单,与原销售订单信息基本一致:商品清单只有这一条,数量=售后数量,价格=0。默认审批通过
-        if (ObjectUtil.equals(afterSales, 30) || ObjectUtil.equals(afterSales, 40)) {
+        if (ObjectUtil.equals(afterSales.getType(), "10") || ObjectUtil.equals(afterSales.getType(), "20")) {
             Contract contract = contractService.getById(contractProduct.getContractId());
             Assert.notEmpty(contract, "查询不到合同信息!");
             contract.setId(null);
             contract.setAmount(BigDecimal.ZERO);
+            contract.setCode(codingRuleService.createCode(CodingRuleEnum.CONTRACT.getKey(), contract.getBuyCorporationId()));
             contractService.save(contract);
 
             ContractProduct contractProduct1 = contractProductService.getById(contractProductId);