|
|
|
@ -2,15 +2,20 @@ package com.ruoyi.web.controller.system.system;
|
|
|
|
|
|
|
|
|
|
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.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.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* packageName com.ruoyi.web.controller.system.system
|
|
|
|
@ -29,27 +34,31 @@ public class SysUserApplyController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysRoleService roleService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysPostService postService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String prefix = "system/user/userApply";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("system:userApply:view")
|
|
|
|
|
@GetMapping()
|
|
|
|
|
public String apply()
|
|
|
|
|
{
|
|
|
|
|
public String apply() {
|
|
|
|
|
return prefix + "/userApply";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 人员申请列表
|
|
|
|
|
*
|
|
|
|
|
* @param user
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("system:userApply:list")
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public TableDataInfo list(SysUser user)
|
|
|
|
|
{
|
|
|
|
|
public TableDataInfo list(SysUser user) {
|
|
|
|
|
startPage();
|
|
|
|
|
user.setExamine("2");
|
|
|
|
|
List<SysUser> list = userService.selectUserList(user);
|
|
|
|
@ -57,15 +66,29 @@ public class SysUserApplyController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 人员审核
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("system:userApply:apply")
|
|
|
|
|
@GetMapping("/apply/{userId}")
|
|
|
|
|
public AjaxResult userExamine(@PathVariable("userId") Long userId) {
|
|
|
|
|
boolean update= userService.lambdaUpdate()
|
|
|
|
|
public String apply(@PathVariable("userId") Long userId, ModelMap mmap) {
|
|
|
|
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
|
|
|
|
mmap.put("sysuser", getSysUser());
|
|
|
|
|
mmap.put("user", userService.selectUserById(userId));
|
|
|
|
|
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
|
|
|
|
mmap.put("posts", postService.selectPostsByUserId(userId));
|
|
|
|
|
return prefix + "/Applydetail";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/submit/{userId}")
|
|
|
|
|
public AjaxResult submit(@PathVariable("userId") Long userId) {
|
|
|
|
|
boolean update = userService.lambdaUpdate()
|
|
|
|
|
.eq(SysUser::getUserId, userId)
|
|
|
|
|
.set(SysUser::getExamine, "3").update();
|
|
|
|
|
return toAjax(update);
|
|
|
|
|
return toAjax(update);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|