From 6159dc58f50d3e4680779b7989bbd4d49a76bad5 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 09 五月 2025 19:13:35 +0800
Subject: [PATCH] 添加日志

---
 src/main/java/com/taoke/autopay/controller/admin/AdminSettingsController.java |  125 +++++++++++++++++++++++++++++++++--------
 1 files changed, 99 insertions(+), 26 deletions(-)

diff --git a/src/main/java/com/taoke/autopay/controller/admin/AdminSettingsController.java b/src/main/java/com/taoke/autopay/controller/admin/AdminSettingsController.java
index 2dab2af..092497f 100644
--- a/src/main/java/com/taoke/autopay/controller/admin/AdminSettingsController.java
+++ b/src/main/java/com/taoke/autopay/controller/admin/AdminSettingsController.java
@@ -1,8 +1,12 @@
 package com.taoke.autopay.controller.admin;
 
+import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.taoke.autopay.dto.UserSubmitKeyLimitDto;
 import com.taoke.autopay.entity.SystemConfigKeyEnum;
 import com.taoke.autopay.service.SystemConfigService;
+import com.taoke.autopay.service.UserSettingService;
+import com.taoke.autopay.vo.admin.IgnoreAgentOrderSettingVO;
 import com.taoke.autopay.vo.admin.PayMoneySettingsVO;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
@@ -69,52 +73,121 @@
 
     @ResponseBody
     @RequestMapping("setPayMoneyAndTime")
-    public String setPayMoneyAndTime(String moneys, String startSubmitTime, String endSubmitTime) {
-        if(StringUtil.isNullOrEmpty(moneys)){
-            return JsonUtil.loadFalseResult("鏈笂浼犻噾棰�");
-        }
-        if(StringUtil.isNullOrEmpty(startSubmitTime)){
+    public String setPayMoneyAndTime(String startSubmitTime, String endSubmitTime) {
+        if (StringUtil.isNullOrEmpty(startSubmitTime)) {
             return JsonUtil.loadFalseResult("鏈笂浼犲紑濮嬫椂闂�");
         }
-        if(StringUtil.isNullOrEmpty(endSubmitTime)){
+        if (StringUtil.isNullOrEmpty(endSubmitTime)) {
             return JsonUtil.loadFalseResult("鏈笂浼犵粨鏉熸椂闂�");
         }
-        JSONArray moneyArrays =  JSONArray.fromObject(moneys);
-        JSONArray fa=new JSONArray();
-        for(int i=0;i<moneyArrays.size();i++){
-            // 缁熶竴淇濈暀2浣嶅皬鏁�
-            double money =  moneyArrays.optDouble(i);
-            fa.add(new BigDecimal(money).setScale(2, RoundingMode.HALF_UP).toString());
-        }
-        systemConfigService.setValue(SystemConfigKeyEnum.PAY_MONEY_LIST, fa.toString());
         // 璁剧疆鏃堕棿锛岀敤閫楀彿鍒嗛殧
-        systemConfigService.setValue(SystemConfigKeyEnum.KEY_SUBMIT_TIME_RANGE, startSubmitTime+","+endSubmitTime);
+        systemConfigService.setValue(SystemConfigKeyEnum.KEY_SUBMIT_TIME_RANGE, startSubmitTime + "," + endSubmitTime);
         systemConfigService.clearCache();
         return JsonUtil.loadTrueResult("");
     }
 
 
-
     @ResponseBody
     @RequestMapping("getPayMoneyAndTime")
     public String getPayMoneyAndTime() {
-        String value = systemConfigService.getValue(SystemConfigKeyEnum.PAY_MONEY_LIST);
-        PayMoneySettingsVO vo=new PayMoneySettingsVO();
-        if(StringUtil.isNullOrEmpty(value)){
-            vo.setMoneys(new ArrayList<>());
-        }else{
-            vo.setMoneys(JsonUtil.getSimpleGson().fromJson(value,new TypeToken<List<String>>(){}.getType() ));
-        }
+        PayMoneySettingsVO vo = new PayMoneySettingsVO();
+        vo.setMoneys(new ArrayList<>());
         // 璁剧疆鏃堕棿锛岀敤閫楀彿鍒嗛殧
-       value = systemConfigService.getValue(SystemConfigKeyEnum.KEY_SUBMIT_TIME_RANGE);
-        if(StringUtil.isNullOrEmpty(value)){
+        String value = systemConfigService.getValue(SystemConfigKeyEnum.KEY_SUBMIT_TIME_RANGE);
+        if (StringUtil.isNullOrEmpty(value)) {
             vo.setStartSubmitTime("");
             vo.setEndSubmitTime("");
-        }else{
+        } else {
             vo.setStartSubmitTime(value.split(",")[0]);
             vo.setEndSubmitTime(value.split(",")[1]);
         }
         return JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(vo));
     }
 
+    @Resource
+    private UserSettingService userSettingService;
+
+    @ResponseBody
+    @RequestMapping("getUserSubmitKeyCountSetting")
+    public String getUserSubmitKeyCountSetting() {
+        List<UserSubmitKeyLimitDto> list = userSettingService.getUserSubmitKeyCountList(false);
+        return JsonUtil.loadTrueResult(new Gson().toJson(list));
+    }
+
+
+    @ResponseBody
+    @RequestMapping("setUserSubmitKeyCount")
+    public String setUserSubmitKeyCount(String value) {
+        List<UserSubmitKeyLimitDto> list = new Gson().fromJson(value, new TypeToken<List<UserSubmitKeyLimitDto>>() {
+        }.getType());
+        userSettingService.setUserSubmitKeyCount(list);
+        return JsonUtil.loadTrueResult(new Gson().toJson(list));
+    }
+
+    @ResponseBody
+    @RequestMapping("getTimeoutPayDevices")
+    public String getTimeoutPayDevices() {
+        String value = systemConfigService.getValue(SystemConfigKeyEnum.RE_EXCUTE_PAY_CLIENTS);
+        JSONObject data = new JSONObject();
+        data.put("timeout_devices", value);
+        return JsonUtil.loadTrueResult(data);
+    }
+
+
+    @ResponseBody
+    @RequestMapping("setTimeoutPayDevices")
+    public String setTimeoutPayDevices(String timeout_devices) {
+        timeout_devices = timeout_devices.trim();
+        List<Long> idList = new ArrayList<>();
+        String[] sts = timeout_devices.split(",");
+        for (String st : sts) {
+            st = st.trim();
+            if (!StringUtil.isNullOrEmpty(st)) {
+                idList.add(Long.parseLong(st));
+            }
+        }
+        String st = StringUtil.concat(idList, ",");
+        systemConfigService.setValue(SystemConfigKeyEnum.RE_EXCUTE_PAY_CLIENTS, st);
+        return JsonUtil.loadTrueResult("");
+    }
+
+
+    @ResponseBody
+    @RequestMapping("getForbiddenSubmitCitys")
+    public String getForbiddenSubmitCitys() {
+        String value = systemConfigService.getValue(SystemConfigKeyEnum.FORBIDDEN_SUBMIT_CITYS);
+        JSONObject data = new JSONObject();
+        data.put("citys", value);
+        return JsonUtil.loadTrueResult(data);
+    }
+
+
+    @ResponseBody
+    @RequestMapping("setForbiddenSubmitCitys")
+    public String setForbiddenSubmitCitys(String citys) {
+        systemConfigService.setValue(SystemConfigKeyEnum.FORBIDDEN_SUBMIT_CITYS, citys);
+        return JsonUtil.loadTrueResult("");
+    }
+
+
+    @ResponseBody
+    @RequestMapping("getIgnoreAgentOrderSetting")
+    public String getIgnoreAgentOrderSetting() {
+        String value = systemConfigService.getValue(SystemConfigKeyEnum.IGNORE_AGENT_ORDER_SETTING);
+        IgnoreAgentOrderSettingVO vo = new IgnoreAgentOrderSettingVO();
+        if (!StringUtil.isNullOrEmpty(value)) {
+            vo = new Gson().fromJson(value, IgnoreAgentOrderSettingVO.class);
+        }
+        return JsonUtil.loadTrueResult(vo);
+    }
+
+
+    @ResponseBody
+    @RequestMapping("setIgnoreAgentOrderSetting")
+    public String setIgnoreAgentOrderSetting(IgnoreAgentOrderSettingVO vo) {
+        systemConfigService.setValue(SystemConfigKeyEnum.IGNORE_AGENT_ORDER_SETTING, new Gson().toJson(vo));
+        return JsonUtil.loadTrueResult("");
+    }
+
+
 }

--
Gitblit v1.8.0