From b7140393f4e354ae4b5198f3298c15491ccd8dde Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期三, 08 五月 2024 10:09:10 +0800
Subject: [PATCH] 权限验证方法修改;保存用户去掉默认不禁用

---
 pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java
index 88000f3..011ac5b 100644
--- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java
+++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java
@@ -7,6 +7,7 @@
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pmsGlobal.aop.Log;
+import com.dy.pmsGlobal.pojoBa.BaRole;
 import com.dy.pmsGlobal.pojoBa.BaUser;
 import com.dy.pmsGlobal.util.Constant;
 import com.mysql.cj.util.StringUtils;
@@ -108,7 +109,7 @@
         Long id;
         try {
             po.supperAdmin = Constant.no.byteValue() ;
-            po.disabled = false ;//榛樿涓嶇鐢�
+//            po.disabled = false ;//榛樿涓嶇鐢�
             po.deleted = false;//榛樿涓嶅垹闄�
             if (!StringUtils.isNullOrEmpty(po.password)) {
                 /*
@@ -166,6 +167,49 @@
     }
 
     /**
+     * 绂佺敤鎴栧惎鐢ㄧ敤鎴蜂俊鎭�
+     * @param po
+     * @return
+     */
+    @PostMapping(path="disabled")
+    @SsoPowerAop(power = "10100011")
+    @Log("绂佺敤鎴栧惎鐢ㄧ敤鎴蜂俊鎭�")
+    public BaseResponse<BaRole> disabled(@RequestBody BaUser po){
+        try {
+            return BaseResponseUtils.buildSuccess(sv.disabled(po.id,po.disabled));
+        }catch (Exception e){
+            log.error("绂佺敤鎴栧惎鐢ㄧ敤鎴蜂俊鎭紓甯�", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+    }
+
+    /**
+     * 鍒犻櫎鐢ㄦ埛淇℃伅
+     * @param id
+     * @return
+     */
+    @GetMapping(path = "delete")
+    @SsoPowerAop(power = "10100011") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇�
+    @Log("鍒犻櫎鐢ㄦ埛")
+    public BaseResponse<Boolean> delete(Long id) {
+        int count;
+        try {
+            BaUser po = new BaUser();
+            po.id = id;
+            po.deleted = true;
+            count = this.sv.update(po);
+        } catch (Exception e) {
+            log.error("鍒犻櫎鐢ㄦ埛寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
+
+    /**
      * 淇敼瀵嗙爜
      * @param id 鐢ㄦ埛ID
      * @return 鏄惁鎴愬姛

--
Gitblit v1.8.0