|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.sckw.core.common.enums.enums.DictEnum;
|
|
import com.sckw.core.common.enums.enums.DictEnum;
|
|
|
|
|
+import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.exception.SystemException;
|
|
import com.sckw.core.exception.SystemException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.enums.ApprovalEnum;
|
|
import com.sckw.core.model.enums.ApprovalEnum;
|
|
@@ -233,6 +234,7 @@ public class KwsUserService {
|
|
|
editRoleReqVo.setMenuIds(String.join(Global.COMMA, kwsMenus.stream().map(KwsMenu::getId).map(String::valueOf).toList()));
|
|
editRoleReqVo.setMenuIds(String.join(Global.COMMA, kwsMenus.stream().map(KwsMenu::getId).map(String::valueOf).toList()));
|
|
|
editRoleReqVo.setVisiblePersonal(false);
|
|
editRoleReqVo.setVisiblePersonal(false);
|
|
|
editRoleReqVo.setIsManage(true);
|
|
editRoleReqVo.setIsManage(true);
|
|
|
|
|
+ editRoleReqVo.setAdminFlag(1);
|
|
|
kwsRoleService.add(editRoleReqVo);
|
|
kwsRoleService.add(editRoleReqVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -309,6 +311,11 @@ public class KwsUserService {
|
|
|
}
|
|
}
|
|
|
KwsUser kwsUser = kwsUserDao.selectByKey(Long.parseLong(id));
|
|
KwsUser kwsUser = kwsUserDao.selectByKey(Long.parseLong(id));
|
|
|
if (null != kwsUser) {
|
|
if (null != kwsUser) {
|
|
|
|
|
+ if (!LoginUserHolder.isManager()) {
|
|
|
|
|
+ if (Objects.equals(kwsUser.getIsMain(), 1)) {//企业管理员用户,默认用户不允许删除
|
|
|
|
|
+ throw new BusinessException(String.format("默认企业管理员账号[%s]不允许删除", kwsUser.getName()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
kwsUser.setDelFlag(Global.YES);
|
|
kwsUser.setDelFlag(Global.YES);
|
|
|
if (kwsUserDao.updateById(kwsUser) <= 0) {
|
|
if (kwsUserDao.updateById(kwsUser) <= 0) {
|
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
|
|
throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
|
|
@@ -329,6 +336,14 @@ public class KwsUserService {
|
|
|
if (Objects.isNull(kwsUser)) {
|
|
if (Objects.isNull(kwsUser)) {
|
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ACCOUNT_NOT_EXISTS);
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ACCOUNT_NOT_EXISTS);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!LoginUserHolder.isManager()) {
|
|
|
|
|
+ if (Objects.equals(kwsUser.getIsMain(), 1)) {//企业管理员用户,只修改名称和备注,归属企业和角色都不允许修改。
|
|
|
|
|
+ kwsUser.setRemark(params.getRemark());
|
|
|
|
|
+ kwsUser.setName(params.getName());
|
|
|
|
|
+ kwsUserDao.updateById(kwsUser);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//更换账号后账号唯一性校验
|
|
//更换账号后账号唯一性校验
|
|
|
// if (StringUtils.isNotBlank(params.getAccount())) {
|
|
// if (StringUtils.isNotBlank(params.getAccount())) {
|
|
|
// //用户信息
|
|
// //用户信息
|
|
@@ -367,7 +382,7 @@ public class KwsUserService {
|
|
|
fillUserRole(params.getRoleIds(), kwsUser.getId(), kwsUser.getSystemType());
|
|
fillUserRole(params.getRoleIds(), kwsUser.getId(), kwsUser.getSystemType());
|
|
|
|
|
|
|
|
/*用户机构关系*/
|
|
/*用户机构关系*/
|
|
|
- fillUserDept(kwsUser.getId(), params.getDeptId());
|
|
|
|
|
|
|
+// fillUserDept(kwsUser.getId(), params.getDeptId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|