diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserApplyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserApplyController.java index 131b781..2103573 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserApplyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserApplyController.java @@ -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 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)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserExamineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserExamineController.java index 883a9be..ac64474 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserExamineController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserExamineController.java @@ -53,7 +53,7 @@ public class SysUserExamineController extends BaseController { public TableDataInfo list(SysUser user) { startPage(); - user.setExamine("3"); + user.setExamine("2"); List list = userService.selectUserList(user); return getDataTable(list); } diff --git a/ruoyi-admin/src/main/resources/templates/system/user/add.html b/ruoyi-admin/src/main/resources/templates/system/user/add.html index 63e373d..9dccc5b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/add.html @@ -79,9 +79,9 @@
- +
-
@@ -196,9 +196,9 @@
- +
- diff --git a/ruoyi-admin/src/main/resources/templates/system/user/edit.html b/ruoyi-admin/src/main/resources/templates/system/user/edit.html index ad67409..08679e9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/edit.html @@ -55,9 +55,9 @@
- +
-
@@ -191,9 +191,9 @@
- +
- diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html b/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html index 4a32fcf..aaee880 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html @@ -93,9 +93,9 @@
- +
-
@@ -202,10 +202,11 @@
- +
- + +
@@ -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"]'); diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userApply/userApply.html b/ruoyi-admin/src/main/resources/templates/system/user/userApply/userApply.html index b565f83..40729c0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/userApply/userApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/userApply/userApply.html @@ -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('申报 '); + actions.push('定岗 '); return actions.join(''); } }] @@ -72,7 +72,7 @@ }); function examinedetail(id) { var url =prefix + '/apply/' + id; - $.modal.openTab("涉密人员申请", url); + $.modal.openTab("涉密人员定岗", url); } diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html index fc3fee0..9e5a491 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html @@ -205,7 +205,8 @@
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 fcd7191..38237d4 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 @@ -24,7 +24,7 @@
@@ -101,7 +101,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('审核 '); + actions.push('审查 '); return actions.join(''); } }] diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserVo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserVo.java new file mode 100644 index 0000000..499b15a --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserVo.java @@ -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; + + +}