From c01422a9c7ee46d5cd36331b1b504f3b0fadfbe5 Mon Sep 17 00:00:00 2001 From: 20918 <2091823062@qq.com> Date: Mon, 15 Apr 2024 15:38:04 +0800 Subject: [PATCH] userexamine --- .../system/SysUserExamineController.java | 80 ++++++++++++++++++- .../system/user/userexamine/userexamine.html | 4 +- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java index 24b3cf7..900d653 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserExamineController.java @@ -1,11 +1,87 @@ package com.ruoyi.web.controller.system; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.shiro.util.AuthorizationUtils; +import com.ruoyi.system.service.ISysPostService; +import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.ISysUserService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.stream.Collectors; @Controller -@RequestMapping("/system/userExamine") +@RequestMapping("/system/userexamine") public class SysUserExamineController extends BaseController { + private String prefix = "system/user/userexamine"; + @Autowired + private ISysUserService userService; + @RequiresPermissions("system:userexamine:view") + @GetMapping() + public String user() + { + return prefix + "/userexamine"; + } + + /** + * 人员信息列表 + * @param user + * @return + */ + @RequiresPermissions("system:userexamine:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysUser user) + { + startPage(); + List list = userService.selectUserList(user); + return getDataTable(list); + } + + /** + * 人员审核 + */ + @RequiresPermissions("system:userexamine:examine") + @GetMapping("/examine/{userId}") + public String userExamine(@PathVariable("userId") Long userId, ModelMap mmap) + { + mmap.put("user", userService.selectUserById(userId)); + return prefix + "/examinedetail"; + } + + /** + * 审核保存 + * @param user + * @return + */ + @RequiresPermissions("system:userexamine:examine") + @Log(title = "用户审核", businessType = BusinessType.EXAMINE) + @PostMapping("/saveexamine") + @ResponseBody + public AjaxResult editSave(@Validated SysUser user) + { + userService.checkUserAllowed(user); + userService.checkUserDataScope(user.getUserId()); + user.setUpdateBy(getLoginName()); + AuthorizationUtils.clearAllCachedAuthorizationInfo(); + return toAjax(userService.updateUser(user)); + } + + + + + } diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/userexamine.html b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/userexamine.html index 566549b..2227d8c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/userexamine.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/userexamine.html @@ -2,7 +2,9 @@ - Title + + Title +