|
@@ -151,13 +151,13 @@ public class SaasRoleController {
|
|
|
// 验证集团信息是否存在
|
|
|
SaasGroup saasGroup = this.saasGroupService.getOne(createVO.getGroupCode());
|
|
|
if (saasGroup == null) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "集团信息不存在");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "集团信息不存在");
|
|
|
}
|
|
|
}
|
|
|
// 角色名称集团下唯一
|
|
|
- boolean result = this.saasRoleService.validRoleName(createVO.getGroupCode(), createVO.getRoleName(), null);
|
|
|
+ boolean result = this.saasRoleService.validRoleName(createVO.getGroupCode(), createVO.getRoleName(), createVO.getRoleType(), null);
|
|
|
if (!result) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "角色名称已存在");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "名称已存在");
|
|
|
}
|
|
|
SaasRole saasRole = new SaasRole();
|
|
|
BeanUtils.copyProperties(createVO, saasRole);
|
|
@@ -175,7 +175,7 @@ public class SaasRoleController {
|
|
|
@RequestMapping(value = "updateSaasRole")
|
|
|
public ResponseResult updateSaasRole(@RequestBody @Validated SaasRoleCreateVO createVO) {
|
|
|
if (StringUtil.isBlank(createVO.getId())) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.A0400.getCode(), "角色ID不可为空");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.A0400.getCode(), "ID不可为空");
|
|
|
}
|
|
|
if (!SaasCommonConstant.STR_STATUS_0.equals(createVO.getRoleType())) {
|
|
|
// 非系统角色,一定存在集团编码
|
|
@@ -185,18 +185,18 @@ public class SaasRoleController {
|
|
|
// 验证集团信息是否存在
|
|
|
SaasGroup saasGroup = this.saasGroupService.getOne(createVO.getGroupCode());
|
|
|
if (saasGroup == null) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "集团信息不存在");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "集团信息不存在");
|
|
|
}
|
|
|
}
|
|
|
// 角色名称集团下唯一
|
|
|
- boolean result = this.saasRoleService.validRoleName(createVO.getGroupCode(), createVO.getRoleName(), createVO.getId());
|
|
|
+ boolean result = this.saasRoleService.validRoleName(createVO.getGroupCode(), createVO.getRoleName(), createVO.getRoleType(), createVO.getId());
|
|
|
if (!result) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "角色名称已存在");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "名称已存在");
|
|
|
}
|
|
|
// 验证数据是否存在
|
|
|
SaasRole role = this.saasRoleService.getOne(createVO.getId());
|
|
|
if (role == null) {
|
|
|
- return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "角色信息不存在");
|
|
|
+ return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "数据不存在");
|
|
|
}
|
|
|
SaasRole saasRole = new SaasRole();
|
|
|
BeanUtils.copyProperties(createVO, saasRole);
|