feat:用户流程修改

hangao
wangxy 1 week ago
parent 09aaecec54
commit 3c24f1cc78

@ -1,17 +1,26 @@
package com.ruoyi.web.controller.system.system; 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.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; 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.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.ISysPostService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.controller.manager.UserRecordManager;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -39,6 +48,9 @@ public class SysUserApplyController extends BaseController {
@Autowired @Autowired
private ISysPostService postService; private ISysPostService postService;
@Autowired
private UserRecordManager userRecordManager;
private String prefix = "system/user/userApply"; private String prefix = "system/user/userApply";
@ -60,7 +72,7 @@ public class SysUserApplyController extends BaseController {
@ResponseBody @ResponseBody
public TableDataInfo list(SysUser user) { public TableDataInfo list(SysUser user) {
startPage(); startPage();
user.setExamine("2"); user.setExamine("0");
List<SysUser> list = userService.selectUserList(user); List<SysUser> list = userService.selectUserList(user);
return getDataTable(list); return getDataTable(list);
} }
@ -81,15 +93,27 @@ public class SysUserApplyController extends BaseController {
} }
@GetMapping("/submit/{userId}") @GetMapping("/submit2/{userId}")
@ResponseBody @ResponseBody
public AjaxResult submit(@PathVariable("userId") Long userId) { public AjaxResult submit2(@PathVariable("userId") Long userId) {
boolean update = userService.lambdaUpdate() boolean update = userService.lambdaUpdate()
.eq(SysUser::getUserId, userId) .eq(SysUser::getUserId, userId)
.set(SysUser::getExamine, "3").update(); .set(SysUser::getExamine, "3").update();
return toAjax(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));
}
} }

@ -53,7 +53,7 @@ public class SysUserExamineController extends BaseController {
public TableDataInfo list(SysUser user) public TableDataInfo list(SysUser user)
{ {
startPage(); startPage();
user.setExamine("3"); user.setExamine("2");
List<SysUser> list = userService.selectUserList(user); List<SysUser> list = userService.selectUserList(user);
return getDataTable(list); return getDataTable(list);
} }

@ -79,9 +79,9 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <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"> <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> <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
</select> </select>
</div> </div>
@ -196,9 +196,9 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <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"> <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 value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>

@ -55,9 +55,9 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <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"> <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> <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
</select> </select>
</div> </div>
@ -191,9 +191,9 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <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"> <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 value="">---请选择---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option>
</select> </select>

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

@ -53,7 +53,7 @@
}, },
{ {
field: 'examine', field: 'examine',
title: '状态', title: '审核状态',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(examineState, value); return $.table.selectDictLabel(examineState, value);
} }
@ -63,7 +63,7 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; 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(''); return actions.join('');
} }
}] }]
@ -72,7 +72,7 @@
}); });
function examinedetail(id) { function examinedetail(id) {
var url =prefix + '/apply/' + id; var url =prefix + '/apply/' + id;
$.modal.openTab("涉密人员申请", url); $.modal.openTab("涉密人员定岗", url);
} }
</script> </script>
</body> </body>

@ -205,7 +205,8 @@
<label class="col-sm-4 control-label">涉密程度:</label> <label class="col-sm-4 control-label">涉密程度:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="shemichengdu" disabled class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}"> <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> </select>
</div> </div>
</div> </div>

@ -24,7 +24,7 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" id="toggleButton" @click="changeExamine()"> <a class="btn btn-success" id="toggleButton" @click="changeExamine()">
<i class="fa fa-exchange"></i> 待审核/已审核 <i class="fa fa-exchange"></i> 待审查/已审查
</a> </a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
@ -101,7 +101,7 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; 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(''); return actions.join('');
} }
}] }]

@ -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;
}
Loading…
Cancel
Save