From 14ecea8537d5b29ca64c75aad4ff49265018415d Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 02 七月 2025 08:51:22 +0800
Subject: [PATCH] zjh20250702

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java |   38 ++++++++++++++++++++++++++------------
 1 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
index 6c1acc6..a6b3a10 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
@@ -20,6 +20,7 @@
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import jodd.util.StringUtil;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -85,7 +86,7 @@
     /**
      * 鑾峰彇鐢ㄦ埛鍒楄〃
      */
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
+//    @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     @ApiOperation("鑾峰彇鐢ㄦ埛")
     public TableDataInfo list(@ApiParam(value = "鐢ㄦ埛瀵硅薄") SysUser user) {
@@ -98,6 +99,7 @@
                     DictHosp dictHosp = hospService.getById(sysDept.getHospId());
                     if (null != dictHosp) {
                         sysUser.setHospName(dictHosp.getHospAreaName());
+                        sysUser.setHospId(dictHosp.getHospAreaId());
                     }
                 }
                 LambdaQueryWrapper<DictUserInfo> wq = new LambdaQueryWrapper<>();
@@ -133,8 +135,19 @@
         return getDataTable(list);
     }
 
+    @GetMapping("/userListByDeptId")
+    public AjaxResult userListByDeptId(@RequestParam(required = false) String deptId){
+
+        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
+        if(StringUtil.isNotBlank(deptId)){
+            List<Long> deptIds = deptService.getDeptTreeById(deptId);
+            wrapper.in(SysUser::getDeptId,deptIds);
+        }
+        return AjaxResult.success(userService.list(wrapper));
+    }
+
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:user:export')")
+//    @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysUser user) {
         List<SysUser> list = userService.selectUserList(user);
@@ -143,7 +156,7 @@
     }
 
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT)
-    @PreAuthorize("@ss.hasPermi('system:user:import')")
+//    @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
     public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
@@ -162,7 +175,7 @@
     /**
      * 鏍规嵁鐢ㄦ埛id鑾峰彇璇︾粏淇℃伅
      */
-    @PreAuthorize("@ss.hasPermi('system:user:query')")
+//    @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/{userId}")
     @ApiOperation("鏍规嵁鐢ㄦ埛id鑾峰彇璇︾粏淇℃伅")
     public AjaxResult getInfo(@PathVariable(value = "userId") @ApiParam(value = "鐢ㄦ埛id") @RequestParam Long userId) {
@@ -187,7 +200,7 @@
     /**
      * 鏂板鐢ㄦ埛
      */
-    @PreAuthorize("@ss.hasPermi('system:user:add')")
+//    @PreAuthorize("@ss.hasPermi('system:user:add')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "鏂板鐢ㄦ埛")
@@ -216,7 +229,7 @@
     /**
      * 淇敼鐢ㄦ埛
      */
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "淇敼鐢ㄦ埛")
@@ -261,7 +274,7 @@
     /**
      * 鍒犻櫎鐢ㄦ埛
      */
-    @PreAuthorize("@ss.hasPermi('system:user:remove')")
+//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     @ApiOperation("鍒犻櫎鐢ㄦ埛")
@@ -283,12 +296,13 @@
     /**
      * 閲嶇疆瀵嗙爜
      */
-    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
+//    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
     public AjaxResult resetPwd(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
+        System.out.println(user.getPassword());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
         user.setUpdateBy(getUsername());
         return toAjax(userService.resetPwd(user));
@@ -297,7 +311,7 @@
     /**
      * 鐘舵�佷慨鏀�
      */
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
     public AjaxResult changeStatus(@RequestBody SysUser user) {
@@ -310,7 +324,7 @@
     /**
      * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鎺堟潈瑙掕壊
      */
-    @PreAuthorize("@ss.hasPermi('system:user:query')")
+//    @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
     @ApiOperation(value = "鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鎺堟潈瑙掕壊")
     public AjaxResult authRole(@PathVariable("userId") Long userId) {
@@ -325,7 +339,7 @@
     /**
      * 鐢ㄦ埛鎺堟潈瑙掕壊
      */
-    @PreAuthorize("@ss.hasPermi('system:user:edit')")
+//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
     @ApiOperation(value = "鐢ㄦ埛鎺堟潈瑙掕壊")
@@ -338,7 +352,7 @@
     /**
      * 鑾峰彇閮ㄩ棬鏍戝垪琛�
      */
-    @PreAuthorize("@ss.hasPermi('system:user:list')")
+//    @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/deptTree")
     public AjaxResult deptTree(SysDept dept) {
         return success(deptService.selectDeptTreeList(dept));

--
Gitblit v1.8.0