From 055bc7d942a194990117924403c99d73a3676123 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Tue, 6 May 2025 17:17:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/system/SysUserController.java | 77 +-- .../src/main/resources/templates/index.html | 500 +++++++++--------- .../templates/system/user/resetUeky.html | 98 ++++ 3 files changed, 399 insertions(+), 276 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/user/resetUeky.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java index e4398553..33caadae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java @@ -5,11 +5,7 @@ import java.util.stream.Collectors; import cn.hutool.core.util.RandomUtil; import cn.hutool.extra.pinyin.PinyinUtil; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.system.domain.UserCheckDTO; -import com.ruoyi.system.service.*; import com.ruoyi.web.controller.manager.UserRecordManager; -import lombok.val; import org.apache.commons.lang3.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.slf4j.Logger; @@ -35,6 +31,10 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.shiro.service.SysPasswordService; import com.ruoyi.framework.shiro.util.AuthorizationUtils; +import com.ruoyi.system.service.ISysDeptService; +import com.ruoyi.system.service.ISysPostService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; /** * 用户信息 @@ -65,9 +65,6 @@ public class SysUserController extends BaseController { @Autowired private UserRecordManager userRecordManager; - @Autowired - private ISysDictDataService dictDataService; - @RequiresPermissions("system:user:view") @GetMapping() public String user() { @@ -137,15 +134,6 @@ public class SysUserController extends BaseController { } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在"); } - List smType = dictDataService.selectDictDataByType("sys_role_key"); - UserCheckDTO userCheckDTO = new UserCheckDTO(); - userCheckDTO.setDeptId(user.getDeptId()); - userCheckDTO.setRoleId(user.getRoleIds()[0]); - userCheckDTO.setRoleKey(smType.get(0).getDictValue()); - int total = userService.checkUser(userCheckDTO); - if(total>=1){ - return error("新增用户'" + user.getLoginName() + "'在当前部门该角色下账号已存在,不能重复新增"); - } user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); user.setCreateBy(getLoginName()); @@ -215,6 +203,38 @@ public class SysUserController extends BaseController { return error(); } + /** + * resetUeky绑定 + * @param userId + * @param mmap + * @return + */ + //@RequiresPermissions("system:user:resetUeky") + @GetMapping("/resetUeky/{userId}") + public String resetUeky(@PathVariable("userId") Long userId, ModelMap mmap) { + mmap.put("user", userService.selectUserById(userId)); + return prefix + "/resetUeky"; + } + /** + * resetUeky绑定 + * @param user + * @return + */ + //@RequiresPermissions("system:user:resetUeky") + @Log(title = "UKey绑定", businessType = BusinessType.RESET) + @PostMapping("/resetUekySave") + @ResponseBody + public AjaxResult resetUekySave(SysUser user) { + boolean update = userService.lambdaUpdate() + .eq(SysUser::getUserId, user.getUserId()) + .set(SysUser::getUkeyId, user.getUkeyId()) + .update(); + if (update) { + return success(); + } + return error(); + } + /** * 进入授权角色页 */ @@ -334,13 +354,13 @@ public class SysUserController extends BaseController { - /** - * - * 查询人员记录 - * @param userId - * @param mmap - * @return java.lang.String - */ + /** + * + * 查询人员记录 + * @param userId + * @param mmap + * @return java.lang.String + */ @GetMapping("/getChangeRecord/{userId}") public String getChangeRecord(@PathVariable("userId") Long userId, ModelMap mmap) { mmap.put("userRecordDTO", userRecordManager.getUserRecordDTO(userId)); @@ -348,12 +368,12 @@ public class SysUserController extends BaseController { } /** - * + * * 查询人员记录 * @param userId * @return com.ruoyi.common.core.domain.AjaxResult */ - + @GetMapping("/getUserRecordDTO") @ResponseBody public AjaxResult getUserRecordDTO(@RequestParam Long userId) { @@ -372,11 +392,4 @@ public class SysUserController extends BaseController { } - @PostMapping("/checkUser") - @ResponseBody - public AjaxResult checkUser(UserCheckDTO userCheckDTO) { - return success(userService.checkUser(userCheckDTO)); - } - - } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index c15a8ae5..21bb1467 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -1,81 +1,81 @@ - - - - 保密业务综合管理系统 - - - - - - - - - - + + + + 保密业务综合管理系统 + + + + + + + + + +
- - + - -
-
- +
+
+ + + + 刷新 +
- + -
- -
+
+ +
- -
- + +
+ @@ -269,111 +273,119 @@ diff --git a/ruoyi-admin/src/main/resources/templates/system/user/resetUeky.html b/ruoyi-admin/src/main/resources/templates/system/user/resetUeky.html new file mode 100644 index 00000000..89053f7c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/user/resetUeky.html @@ -0,0 +1,98 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + +