feat:用户流程修改

hangao
wangxy 1 week ago
parent 09aaecec54
commit 3c24f1cc78

@ -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,7 +72,7 @@ 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);
}
@ -81,15 +93,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));
}
}

@ -53,7 +53,7 @@ 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);
}

@ -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>

@ -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>
@ -191,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>

@ -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>
@ -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"]');

@ -53,7 +53,7 @@
},
{
field: 'examine',
title: '状态',
title: '审核状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(examineState, value);
}
@ -63,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('');
}
}]
@ -72,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('');
}
}]

@ -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