From 1d53dd8f501a98ddcce8146443b51b357ef5f9b1 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 29 十二月 2022 16:55:46 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/sys/ArgsController.java |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/sys/ArgsController.java b/src/main/java/com/lf/server/controller/sys/ArgsController.java
index f4e2207..b8e6e64 100644
--- a/src/main/java/com/lf/server/controller/sys/ArgsController.java
+++ b/src/main/java/com/lf/server/controller/sys/ArgsController.java
@@ -1,6 +1,6 @@
 package com.lf.server.controller.sys;
 
-import com.lf.server.aspect.SysLog;
+import com.lf.server.annotation.SysLog;
 import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.sys.ArgsEntity;
@@ -123,8 +123,8 @@
         }
     }
 
-    @SysLog()
-    @ApiOperation(value = "娣诲姞鏁版嵁")
+    /*@SysLog()
+    @ApiOperation(value = "鎻掑叆涓�鏉�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body")
     })
@@ -145,7 +145,7 @@
     }
 
     @SysLog()
-    @ApiOperation(value = "鎵归噺娣诲姞")
+    @ApiOperation(value = "鎻掑叆澶氭潯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body")
     })
@@ -168,7 +168,7 @@
     }
 
     @SysLog()
-    @ApiOperation(value = "鍒櫎鏁版嵁")
+    @ApiOperation(value = "鍒犻櫎涓�鏉�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
     })
@@ -184,7 +184,7 @@
     }
 
     @SysLog()
-    @ApiOperation(value = "鎵归噺鍒犻櫎")
+    @ApiOperation(value = "鍒犻櫎澶氭潯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "1,2")
     })
@@ -201,10 +201,10 @@
         } catch (Exception ex) {
             return fail(ex.getMessage(), -1);
         }
-    }
+    }*/
 
     @SysLog()
-    @ApiOperation(value = "淇敼鏁版嵁")
+    @ApiOperation(value = "鏇存柊涓�鏉�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body")
     })
@@ -212,12 +212,24 @@
     @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
     public ResponseMsg<Integer> update(@RequestBody ArgsEntity entity, HttpServletRequest req) {
         try {
+            ArgsEntity ae = argsService.selectById(entity.getId());
+            if (ae == null) {
+                return fail("鎵句笉鍒板緟鏇存柊鐨勫疄浣�", -1);
+            }
+            if (entity.getCvalue() > ae.getMaxValue() || entity.getCvalue() < ae.getMinValue()) {
+                return fail("寰呮洿鏂扮殑鍊间笉鍦ㄦ湁鏁堣寖鍥村唴", -1);
+            }
+            ae.setCvalue(entity.getCvalue());
+
             UserEntity ue = tokenService.getCurrentUser(req);
             if (ue != null) {
-                entity.setUpdateUser(ue.getId());
+                ae.setUpdateUser(ue.getId());
             }
 
-            int count = argsService.update(entity);
+            int count = argsService.updateForValue(ae);
+            if (count > 0) {
+                argsService.updateSettingData(ae);
+            }
 
             return success(count);
         } catch (Exception ex) {
@@ -225,8 +237,8 @@
         }
     }
 
-    @SysLog()
-    @ApiOperation(value = "鎵归噺淇敼")
+    /*@SysLog()
+    @ApiOperation(value = "鏇存柊澶氭潯")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body")
     })
@@ -247,5 +259,5 @@
         } catch (Exception ex) {
             return fail(ex.getMessage(), -1);
         }
-    }
+    }*/
 }

--
Gitblit v1.9.3