Bläddra i källkod

fix:"优化结算方式切换功能"

soobin 4 månader sedan
förälder
incheckning
dc4143ee1b
1 ändrade filer med 28 tillägg och 31 borttagningar
  1. 28 31
      src/main/java/com/szwl/service/impl/THuifuMchServiceImpl.java

+ 28 - 31
src/main/java/com/szwl/service/impl/THuifuMchServiceImpl.java

@@ -257,20 +257,19 @@ public class THuifuMchServiceImpl extends ServiceImpl<THuifuMchMapper, THuifuMch
         Integer settType = tHuifuMchCheck.getSettType();
         settleConfig.put("settle_cycle", "T1");
         JSONArray cashConfig = new JSONArray();
-        if (settType == 1) {
-            // 自动结算
-            settleConfig.put("settle_status", "1");
+        if (settType!= null && settType == 2) {
+            // 手动提现
+            settleConfig.put("settle_status", "0");
             JSONObject cashConfigValue = new JSONObject();
-            cashConfigValue.put("switch_state", "0");
+            cashConfigValue.put("switch_state", "1");
             cashConfigValue.put("cash_type", "T1");
             cashConfigValue.put("fee_rate", "0.00");
             cashConfig.add(cashConfigValue);
-        }
-        if (settType == 2) {
-            // 手动提现
-            settleConfig.put("settle_status", "0");
+        } else {
+            // 自动结算
+            settleConfig.put("settle_status", "1");
             JSONObject cashConfigValue = new JSONObject();
-            cashConfigValue.put("switch_state", "1");
+            cashConfigValue.put("switch_state", "0");
             cashConfigValue.put("cash_type", "T1");
             cashConfigValue.put("fee_rate", "0.00");
             cashConfig.add(cashConfigValue);
@@ -614,21 +613,20 @@ public class THuifuMchServiceImpl extends ServiceImpl<THuifuMchMapper, THuifuMch
         JSONObject settleConfig = new JSONObject();
         Integer settType = tHuifuMchCheck.getSettType();
         JSONArray cashConfig = new JSONArray();
-        if (settType == 1) {
-            // 自动结算
-            settleConfig.put("settle_status", 1);
-            settleConfig.put("settle_cycle", "T1");
+        if (settType!= null && settType == 2) {
+            // 手动提现
+            settleConfig.put("settle_status", "0");
             JSONObject cashConfigValue = new JSONObject();
-            cashConfigValue.put("switch_state", "0");
+            cashConfigValue.put("switch_state", "1");
+            cashConfigValue.put("cash_type", "T1");
             cashConfigValue.put("fee_rate", "0.00");
             cashConfig.add(cashConfigValue);
-        }
-        if (settType == 2) {
-            // 手动提现
-            settleConfig.put("settle_status", 0);
-            settleConfig.put("settle_cycle", "T1");
+        } else {
+            // 自动结算
+            settleConfig.put("settle_status", "1");
             JSONObject cashConfigValue = new JSONObject();
-            cashConfigValue.put("switch_state", "1");
+            cashConfigValue.put("switch_state", "0");
+            cashConfigValue.put("cash_type", "T1");
             cashConfigValue.put("fee_rate", "0.00");
             cashConfig.add(cashConfigValue);
         }
@@ -758,21 +756,20 @@ public class THuifuMchServiceImpl extends ServiceImpl<THuifuMchMapper, THuifuMch
         JSONObject settleConfig = new JSONObject();
         Integer settType = huifuMchCheck.getSettType();
         JSONArray cashConfig = new JSONArray();
-        if (settType == 1) {
-            // 自动结算
-            settleConfig.put("settle_status", "1");
-            settleConfig.put("settle_cycle", "T1");
-            JSONObject cashConfigValue = new JSONObject();
-            cashConfigValue.put("switch_state", "0");
-            cashConfigValue.put("fee_rate", "0.00");
-            cashConfig.add(cashConfigValue);
-        }
-        if (settType == 2) {
+        if (settType!= null && settType == 2) {
             // 手动提现
             settleConfig.put("settle_status", "0");
-            settleConfig.put("settle_cycle", "T1");
             JSONObject cashConfigValue = new JSONObject();
             cashConfigValue.put("switch_state", "1");
+            cashConfigValue.put("cash_type", "T1");
+            cashConfigValue.put("fee_rate", "0.00");
+            cashConfig.add(cashConfigValue);
+        } else {
+            // 自动结算
+            settleConfig.put("settle_status", "1");
+            JSONObject cashConfigValue = new JSONObject();
+            cashConfigValue.put("switch_state", "0");
+            cashConfigValue.put("cash_type", "T1");
             cashConfigValue.put("fee_rate", "0.00");
             cashConfig.add(cashConfigValue);
         }