用户管理增加解冻用户功能提示
This commit is contained in:
@@ -269,19 +269,20 @@ public class EmpUserController extends BaseController {
|
|||||||
@RequiresPermissions("sys:empUser:updateStatus")
|
@RequiresPermissions("sys:empUser:updateStatus")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "disable")
|
@RequestMapping(value = "disable")
|
||||||
public String disable(EmpUser empUser) {
|
public String disable(EmpUser empUser, boolean freeze) {
|
||||||
if (User.isSuperAdmin(empUser.getUserCode())) {
|
if (User.isSuperAdmin(empUser.getUserCode())) {
|
||||||
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
||||||
}
|
}
|
||||||
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
|
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
|
||||||
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
||||||
}
|
}
|
||||||
|
String text = freeze ? "冻结" : "停用";
|
||||||
if (empUser.currentUser().getUserCode().equals(empUser.getUserCode())) {
|
if (empUser.currentUser().getUserCode().equals(empUser.getUserCode())) {
|
||||||
return renderResult(Global.FALSE, text("停用用户失败,不允许停用当前用户"));
|
return renderResult(Global.FALSE, text(text + "用户失败,不允许" + text + "当前用户"));
|
||||||
}
|
}
|
||||||
empUser.setStatus(User.STATUS_DISABLE);
|
empUser.setStatus(freeze ? User.STATUS_FREEZE : User.STATUS_DISABLE);
|
||||||
empUserService.updateStatus(empUser);
|
empUserService.updateStatus(empUser);
|
||||||
return renderResult(Global.TRUE, text("停用用户''{0}''成功", empUser.getUserName()));
|
return renderResult(Global.TRUE, text(text + "用户''{0}''成功", empUser.getUserName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,17 +293,18 @@ public class EmpUserController extends BaseController {
|
|||||||
@RequiresPermissions("sys:empUser:updateStatus")
|
@RequiresPermissions("sys:empUser:updateStatus")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "enable")
|
@RequestMapping(value = "enable")
|
||||||
public String enable(EmpUser empUser) {
|
public String enable(EmpUser empUser, boolean freeze) {
|
||||||
if (User.isSuperAdmin(empUser.getUserCode())) {
|
if (User.isSuperAdmin(empUser.getUserCode())) {
|
||||||
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
||||||
}
|
}
|
||||||
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
|
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
|
||||||
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
||||||
}
|
}
|
||||||
|
String text = freeze ? "解冻" : "启用";
|
||||||
empUser.setStatus(User.STATUS_NORMAL);
|
empUser.setStatus(User.STATUS_NORMAL);
|
||||||
empUserService.updateStatus(empUser);
|
empUserService.updateStatus(empUser);
|
||||||
AuthorizingRealm.isValidCodeLogin(empUser.getLoginCode(), empUser.getCorpCode_(), null, "success");
|
AuthorizingRealm.isValidCodeLogin(empUser.getLoginCode(), empUser.getCorpCode_(), null, "success");
|
||||||
return renderResult(Global.TRUE, text("启用用户''{0}''成功", empUser.getUserName()));
|
return renderResult(Global.TRUE, text(text + "用户''{0}''成功", empUser.getUserName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -147,8 +147,10 @@ $('#dataGrid').dataGrid({
|
|||||||
//# if(hasPermi('sys:empUser:updateStatus')){
|
//# if(hasPermi('sys:empUser:updateStatus')){
|
||||||
if (row.status == Global.STATUS_NORMAL){
|
if (row.status == Global.STATUS_NORMAL){
|
||||||
actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'" class="btnList" title="${text("停用用户")}" data-confirm="${text("确认要停用该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||||
}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_FREEZE || row.status == Global.STATUS_AUDIT){
|
}else if (row.status == Global.STATUS_DISABLE || row.status == Global.STATUS_AUDIT){
|
||||||
actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'" class="btnList" title="${text("启用用户")}" data-confirm="${text("确认要启用该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||||
|
}else if (row.status == Global.STATUS_FREEZE){
|
||||||
|
actions.push('<a href="${ctx}/sys/empUser/enable?userCode='+row.userCode+'&freeze=true" class="btnList" title="${text("解冻用户")}" data-confirm="${text("确认要解冻该用户吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||||
}
|
}
|
||||||
//# }
|
//# }
|
||||||
//# if(hasPermi('sys:empUser:edit')){
|
//# if(hasPermi('sys:empUser:edit')){
|
||||||
@@ -164,7 +166,12 @@ $('#dataGrid').dataGrid({
|
|||||||
actions.push('<a href="${ctx}/sys/empUser/formAuthDataScope?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配数据权限")}"><i class="fa fa-check-circle-o"></i> ${text("数据权限")}</a> ');
|
actions.push('<a href="${ctx}/sys/empUser/formAuthDataScope?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户分配数据权限")}"><i class="fa fa-check-circle-o"></i> ${text("数据权限")}</a> ');
|
||||||
//# }
|
//# }
|
||||||
//# if(hasPermi('sys:empUser:resetpwd')){
|
//# if(hasPermi('sys:empUser:resetpwd')){
|
||||||
actions.push('<a href="${ctx}/sys/empUser/resetpwd?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户密码重置")}" data-confirm="${text("确认要将该用户密码重置到初始状态吗?")}"><i class="fa fa-reply-all"></i> ${text("重置密码")}</a> ');
|
actions.push('<a href="${ctx}/sys/empUser/resetpwd?userCode='+row.userCode+'" class="btn btn-default btn-xs btnList" title="${text("用户密码重置")}" data-confirm="${text("确认要将该用户密码重置到初始状态吗?")}"><i class="fa fa-key"></i> ${text("重置密码")}</a> ');
|
||||||
|
//# }
|
||||||
|
//# if(hasPermi('sys:empUser:updateStatus')){
|
||||||
|
// if (row.status == Global.STATUS_NORMAL){
|
||||||
|
// actions.push('<a href="${ctx}/sys/empUser/disable?userCode='+row.userCode+'&freeze=true" class="btn btn-default btn-xs btnList" title="${text("冻结用户")}" data-confirm="${text("确认要冻结该用户吗?")}"><i class="glyphicon glyphicon-ban-circle"></i> ${text("冻结用户")}</a> ');
|
||||||
|
// }
|
||||||
//# }
|
//# }
|
||||||
actions.push('</div>');
|
actions.push('</div>');
|
||||||
//# }
|
//# }
|
||||||
|
|||||||
Reference in New Issue
Block a user