feat:人员管理修改

new-rd20250506
wangxy 4 months ago
parent 069641def4
commit 9028d9dc54

@ -80,7 +80,7 @@ public class SysUsernumController extends BaseController {
List<SysDept> sysDepts = deptService.selectDeptList(dept);
for (SysDept sysDept : sysDepts) {
for (SysUser user1 : list) {
if (sysDept.getDeptName().equals(user1.getDept().getDeptName())) {
if (sysDept.getDeptId().equals(user1.getDept().getDeptId())) {
sysuser.add(user1);
}
}
@ -111,7 +111,7 @@ public class SysUsernumController extends BaseController {
@GetMapping("/print/{deptId}")
public String print(@PathVariable("deptId") Long deptId, SysUser user, ModelMap mmap) {
List<SysUser> list = userService.lambdaQuery().eq(SysUser::getDeptId, deptId)
.eq(SysUser::getDelFlag, 0)
.eq(SysUser::getDelFlag, '0')
.ne(SysUser::getUserId, 1)
.list();
list.forEach(sysuser -> {
@ -130,7 +130,7 @@ public class SysUsernumController extends BaseController {
}
private List<String> sharType = Arrays.asList("已登记", "已申报", "已审核", "已离职","已离岗");
private List<String> sharType = Arrays.asList("已登记", "已审查", "已定岗", "已离职","已离岗");
private List<String> smType = Arrays.asList("一般涉密人员", "重要涉密人员", "核心涉密人员");
@ -172,10 +172,10 @@ public class SysUsernumController extends BaseController {
AtomicReference<Object> value = new AtomicReference<>(0L);
if("已登记".equals(name)){
value.set(userCountDTO.getYdj());
}else if("已申报".equals(name)){
value.set(userCountDTO.getYsb());
}else if("已审核".equals(name)){
value.set(userCountDTO.getYsh());
}else if("已审查".equals(name)){
value.set(userCountDTO.getYsc());
}else if("已定岗".equals(name)){
value.set(userCountDTO.getYdg());
}else if("已离职".equals(name)){
value.set(userCountDTO.getYlz());
}else{
@ -214,8 +214,8 @@ public class SysUsernumController extends BaseController {
Integer count = new LambdaQueryChainWrapper<>(userService.getBaseMapper())
.ge(SysUser::getCreateTime, minDayTime)
.le(SysUser::getCreateTime, maxDayTime)
.eq(SysUser::getExamine,2)
.eq(SysUser::getDelFlag,0)
.eq(SysUser::getExamine,'2')
.eq(SysUser::getDelFlag,'0')
.count();
if(Objects.isNull(count)){
count = 0;

@ -1,17 +1,26 @@
package com.ruoyi.web.controller.system.system;
import cn.hutool.core.convert.Convert;
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.domain.entity.SysUserVo;
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.domain.record.SysUserAfter;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.controller.manager.UserRecordManager;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -39,6 +48,9 @@ public class SysUserApplyController extends BaseController {
@Autowired
private ISysPostService postService;
@Autowired
private UserRecordManager userRecordManager;
private String prefix = "system/user/userApply";
@ -60,9 +72,11 @@ public class SysUserApplyController extends BaseController {
@ResponseBody
public TableDataInfo list(SysUser user) {
startPage();
user.setExamine("2");
user.setExamine("0");
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
List<SysUser> userList = list.stream()
.filter(u -> !"admin".equals(u.getLoginName())).collect(Collectors.toList());
return getDataTable(userList);
}
@ -81,15 +95,27 @@ public class SysUserApplyController extends BaseController {
}
@GetMapping("/submit/{userId}")
@GetMapping("/submit2/{userId}")
@ResponseBody
public AjaxResult submit(@PathVariable("userId") Long userId) {
public AjaxResult submit2(@PathVariable("userId") Long userId) {
boolean update = userService.lambdaUpdate()
.eq(SysUser::getUserId, userId)
.set(SysUser::getExamine, "3").update();
return toAjax(update);
}
/**
*
*/
@Log(title = "用户定岗", businessType = BusinessType.UPDATE)
@PostMapping("/submit")
@ResponseBody
public AjaxResult submit(@Validated SysUserVo userVo) {
SysUser user = Convert.convert(SysUser.class, userVo);
user.setExamine("3");
userRecordManager.saveOrUpdate(user);
return toAjax(userService.updateUser(user));
}
}

@ -364,8 +364,11 @@ public class SysUserController extends BaseController {
@PostMapping("/userList")
@ResponseBody
public AjaxResult userList() {
return AjaxResult.success(userService.lambdaQuery().
select(SysUser::getUserId,SysUser::getUserName).list());
List<SysUser> list = userService.lambdaQuery().
select(SysUser::getUserId, SysUser::getUserName).list();
List<SysUser> userList = list.stream()
.filter(u -> !"admin".equals(u.getUserName())).collect(Collectors.toList());
return AjaxResult.success(userList);
}

@ -53,9 +53,11 @@ public class SysUserExamineController extends BaseController {
public TableDataInfo list(SysUser user)
{
startPage();
user.setExamine("3");
user.setExamine("2");
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
List<SysUser> userList = list.stream()
.filter(u -> !"admin".equals(u.getLoginName())).collect(Collectors.toList());
return getDataTable(userList);
}
/**
@ -70,7 +72,9 @@ public class SysUserExamineController extends BaseController {
startPage();
user.setExamine("0");
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
List<SysUser> userList = list.stream()
.filter(u -> !"admin".equals(u.getLoginName())).collect(Collectors.toList());
return getDataTable(userList);
}
/**

@ -176,4 +176,17 @@ public class TdLeaveController extends BaseController
mmap.put("posts", postService.selectPostsByUserIds(userId));
return prefix + "/leaveprint";
}
/**
*
* @param userId
* @return
*/
public Boolean userUpdate(Long userId) {
return userService.lambdaUpdate()
.eq(SysUser::getUserId, userId)
.set(SysUser::getStatus, "1")
.update();
}
}

@ -6,14 +6,14 @@
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-leave-add" th:object="${addleave}">
<input name="userId" type="hidden" th:value="*{userId}" id="userId"/>
<input name="deptId" type="hidden" id="treeId"/>
<div class="form-group">
<label class="col-sm-3 control-label is-required">人员姓名:</label>
<div class="col-sm-8">
<input name="userName" id="username" class="form-control" placeholder="请输入人员姓名" type="text">
<input name="userName" id="username" class="form-control" placeholder="请输入人员姓名" th:value="*{userName}" type="text">
</div>
</div>
<div class="form-group">
@ -59,11 +59,11 @@
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/leave"
$("#form-leave-add").validate({
focusCleanup: true
@ -112,6 +112,6 @@
$("#treeName").val(deptName);
});
</script>
</script>
</body>
</html>

@ -7,7 +7,7 @@
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body>
<div class="main-content">
<div class="main-content">
<form id="form-user-add" class="form-horizontal">
<input name="deptId" type="hidden" id="treeId"/>
<h4 class="form-header h4">基本信息</h4>
@ -79,9 +79,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">岗位:</label>
<label class="col-sm-4 control-label">岗位:</label>
<div class="col-sm-8">
<select id="post" class="form-control select2-multiple" required multiple>
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
</select>
</div>
@ -196,9 +196,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">涉密程度:</label>
<label class="col-sm-4 control-label">涉密程度:</label>
<div class="col-sm-8">
<select name="shemichengdu" required class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<select name="shemichengdu" class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<option value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
@ -271,19 +271,19 @@
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script>
var prefix = ctx + "system/user";
$("#form-user-add").validate({
@ -450,7 +450,7 @@
}
});
});
</script>
</script>
</body>
</html>

@ -7,7 +7,7 @@
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body>
<div class="main-content">
<div class="main-content">
<form class="form-horizontal" id="form-user-edit" th:object="${user}">
<input name="userId" type="hidden" th:field="*{userId}" />
<input name="deptId" type="hidden" th:field="*{deptId}" id="treeId"/>
@ -55,9 +55,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">岗位:</label>
<label class="col-sm-4 control-label">岗位:</label>
<div class="col-sm-8">
<select id="post" required class="form-control select2-multiple" multiple>
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
</select>
</div>
@ -82,7 +82,6 @@
<div class="col-sm-8">
<label th:each="role:${roles}" required class="check-box">
<input name="role" type="radio" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
</label>
</div>
</div>
@ -192,9 +191,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">涉密程度:</label>
<label class="col-sm-4 control-label">涉密程度:</label>
<div class="col-sm-8">
<select name="shemichengdu" required class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<select name="shemichengdu" class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<option value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option>
</select>
@ -241,18 +240,18 @@
</div>
</div>
</form>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script type="text/javascript">
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script type="text/javascript">
var prefix = ctx + "system/user";
$("#form-user-edit").validate({
@ -380,6 +379,6 @@
});
});
</script>
</script>
</body>
</html>

@ -93,9 +93,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">岗位:</label>
<label class="col-sm-4 control-label is-required">岗位:</label>
<div class="col-sm-8">
<select id="post" disabled class="form-control select2-multiple" multiple>
<select id="post" required class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
</select>
</div>
@ -118,7 +118,7 @@
<label class="col-sm-4 control-label">角色:</label>
<div class="col-sm-8">
<label th:each="role:${roles}" class="check-box">
<input name="role" disabled type="radio" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}">
<input name="role" type="radio" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}">
</label>
</div>
</div>
@ -202,10 +202,11 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">涉密程度:</label>
<label class="col-sm-4 control-label is-required">涉密程度:</label>
<div class="col-sm-8">
<select name="shemichengdu" disabled class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<select name="shemichengdu" required class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<option value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option>
</select>
</div>
</div>
@ -263,20 +264,20 @@
window.location.href = ctx + "common/download/resource?resource=" + encodeURI(fileUrl) ;
}
var prefix = ctx + "system/userApply";
function pass(){
let id = $("input[name='userId']").val()
$.ajax({
type : "GET",
url : prefix + '/submit/' + id,
async : false,
beforeSend: function () {
$.modal.loading("正在处理中,请稍候...");
},
success: function(result) {
$.operate.successTabCallback(result);
function pass() {
if ($.validate.form()) {
var data = $("#form-user-edit").serializeArray();
/*var status = $("input[id='status']").is(':checked') == true ? 0 : 1;*/
var roleIds = $.form.radioCheckeds("role");
var postIds = $.form.selectSelects("post");
/*data.push({"name": "status", "value": status});*/
data.push({"name": "roleIds", "value": roleIds});
data.push({"name": "postIds", "value": postIds});
$.operate.saveTab(prefix + "/submit", data);
}
});
}
document.addEventListener('DOMContentLoaded', function () {
// 获取所有name为role的radio按钮
var radios = document.querySelectorAll('input[type="radio"]');

@ -30,9 +30,7 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var examineFlag = [[${@permission.hasPermi('system:userApply:apply')}]];
var downloadFlag = [[${@permission.hasPermi('system:userexamine:examine')}]];
var userStatus = [[${@dict.getType('sys_normal_disable')}]];
var userPolitics = [[${@dict.getType('sys_user_politics')}]];
var examineState = [[${@dict.getType('sys_user_examine')}]];
var prefix = ctx + "system/userApply";
@ -55,7 +53,7 @@
},
{
field: 'examine',
title: '状态',
title: '审核状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(examineState, value);
}
@ -65,7 +63,7 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + examineFlag + '" href="javascript:void(0)" onclick="examinedetail(\'' + row.userId + '\')"><i class="fa fa-edit"></i>申报</a> ');
actions.push('<a class="btn btn-success btn-xs ' + examineFlag + '" href="javascript:void(0)" onclick="examinedetail(\'' + row.userId + '\')"><i class="fa fa-edit"></i>定岗</a> ');
return actions.join('');
}
}]
@ -74,7 +72,7 @@
});
function examinedetail(id) {
var url =prefix + '/apply/' + id;
$.modal.openTab("涉密人员申请", url);
$.modal.openTab("涉密人员定岗", url);
}
</script>
</body>

@ -205,7 +205,8 @@
<label class="col-sm-4 control-label">涉密程度:</label>
<div class="col-sm-8">
<select name="shemichengdu" disabled class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<option value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option>
</select>
</div>
</div>

@ -24,7 +24,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" id="toggleButton" @click="changeExamine()">
<i class="fa fa-exchange"></i> 待审核/已审核
<i class="fa fa-exchange"></i> 待审查/已审查
</a>
</div>
<div class="col-sm-12 select-table table-striped">
@ -101,7 +101,7 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + examineFlag + '" href="javascript:void(0)" onclick="examinedetail(\'' + row.userId + '\')"><i class="fa fa-edit"></i></a> ');
actions.push('<a class="btn btn-success btn-xs ' + examineFlag + '" href="javascript:void(0)" onclick="examinedetail(\'' + row.userId + '\')"><i class="fa fa-edit"></i></a> ');
return actions.join('');
}
}]

@ -24,7 +24,7 @@
}
</style>
<body class="gray-bg">
<div class="ui-layout-center" id="app">
<div class="ui-layout-center" id="app">
<div class="container-div">
<div class="row">
<div class="echart">
@ -32,10 +32,10 @@
<div id="leftMain" style="width: 420px;height:330px"></div>
</div>
<div class="children_echarts center_echarts">
<div id="centerMain" style="width: 650px;height:330px"></div>
<div id="centerMain" style="width: 630px;height:330px"></div>
</div>
<div class="children_echarts right_echarts">
<div id="rightMain" style="width: 400px;height:330px"></div>
<div id="rightMain" style="width: 430px;height:330px"></div>
</div>
</div>
<div class="col-sm-12 search-collapse">
@ -79,13 +79,13 @@
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('system:usernum:detail')}]];
var politics = [[${@dict.getType('sys_user_politics')}]];
var shemichengdu = [[${@dict.getType('sys_user_shemi')}]];
@ -197,7 +197,7 @@
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data.filter(obj => obj.id === '36625')
this.CityList = res.data
}) ,
});
},
@ -300,17 +300,20 @@
legend: {
orient: 'vertical',
x: 'right',
data: ['已登记', '已申报', '已审核', '已离职', '已离岗']
data: ['已登记', '已审查', '已定岗', '已离职', '已离岗'],
top: '60%',
left: '81%'
},
series: [
{
type: 'pie',
data: response.data.data
data: response.data.data,
center: ['43%', '55%']
}
]
});
}
})
</script>
</script>
</body>
</html>

@ -0,0 +1,47 @@
package com.ruoyi.common.core.domain.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* sys_user
*
* @author ruoyi
*/
@Data
public class SysUserVo implements Serializable {
private static final long serialVersionUID = 1L;
/** 用户ID */
private Long userId;
/** 涉密程度 */
@NotBlank(message = "涉密程度不能为空")
private String shemichengdu;
/** 帐号状态0正常 1停用 */
private String status;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 审核状态 */
private String examine;
/** 角色组 */
@TableField(exist=false)
private Long[] roleIds;
/** 岗位组 */
@NotNull(message = "岗位不能为空")
@TableField(exist=false)
private Long[] postIds;
}

@ -22,11 +22,11 @@ public class UserCountDTO implements Serializable {
@ApiModelProperty(value = "已登记")
private Integer ydj;
@ApiModelProperty(value = "已申报")
private Integer ysb;
@ApiModelProperty(value = "已审查")
private Integer ysc;
@ApiModelProperty(value = "已审核")
private Integer ysh;
@ApiModelProperty(value = "已定岗")
private Integer ydg;
@ApiModelProperty(value = "已离职")
private Integer ylz;

@ -314,15 +314,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</insert>
<select id="selectCountUser" resultType="com.ruoyi.system.domain.count.UserCountDTO">
SELECT
SUM (CASE WHEN examine = 2 THEN 1 ELSE 0 END) AS ydj,
SUM (CASE WHEN examine = 3 THEN 1 ELSE 0 END) AS ysb,
SUM (CASE WHEN examine = 0 THEN 1 ELSE 0 END) AS ysh,
(SELECT SUM (CASE WHEN leavestate = 1 THEN 1 ELSE 0 END)
SUM (CASE WHEN examine = '2' THEN 1 ELSE 0 END) AS ydj,
SUM (CASE WHEN examine = '3' THEN 1 ELSE 0 END) AS ydg,
SUM (CASE WHEN examine = '0' THEN 1 ELSE 0 END) AS ysc,
(SELECT SUM (CASE WHEN leavestate = '1' THEN 1 ELSE 0 END)
FROM td_leave t) as ylz,
(SELECT SUM (CASE WHEN leavestate = 2 THEN 1 ELSE 0 END)
(SELECT SUM (CASE WHEN leavestate = '2' THEN 1 ELSE 0 END)
FROM td_leave t) as ylg
FROM ${prefix}sys_user s
</select>

Loading…
Cancel
Save