zhangqiankun 3 vuotta sitten
vanhempi
commit
3514c1aa5b

+ 2 - 2
saas-account/src/main/java/com/persagy/person/controller/SaasFunctionController.java

@@ -82,12 +82,12 @@ public class SaasFunctionController {
     @RequestMapping(value = "querySaasRoleFunctions")
     public ResponseResult querySaasRoleFunctions(@RequestBody @Validated SaasFunctionQueryVO queryVO) {
     	if (StringUtil.isBlank(queryVO.getRoleId())) {
-    		return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "角色ID不可为空");
+    		return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "ID不可为空");
 		}
     	// 验证角色是否存在
     	SaasRole saasRole = this.saasRoleService.getOne(queryVO.getRoleId());
     	if (saasRole == null) {
-    		return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "角色信息不存在");
+    		return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "数据不存在");
 		}
     	// 优先查询出存在功能点的信息集合
     	List<SaasFunction> functions = this.saasFunctionService.queryRoleFunctionList(queryVO.getGroupCode(), queryVO.getRoleId(), null);

+ 1 - 1
saas-account/src/main/java/com/persagy/person/controller/SaasProjectController.java

@@ -155,7 +155,7 @@ public class SaasProjectController {
 			groups = Lists.newArrayList(group);
 		}
     	if (CollectionUtil.isEmpty(groups)) {
-    		return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "集团信息不存在");
+    		return ResponseResultUtil.errorResult(ResponseCode.C0320.getCode(), "集团信息不存在");
 		}
     	for (SaasGroup saasGroup : groups) {
     		this.saasAreaProjectHandler.queryAreaProjectTree(saasGroup);

+ 8 - 8
saas-account/src/main/java/com/persagy/person/controller/SaasRoleController.java

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

+ 2 - 1
saas-account/src/main/java/com/persagy/person/service/ISaasRoleService.java

@@ -34,10 +34,11 @@ public interface ISaasRoleService extends ISuperService<SaasRole> {
 	 * 
 	 * @param groupCode
 	 * @param roleName
+	 * @param roleType
 	 * @param roleId
 	 * @return
 	 */
-	boolean validRoleName(String groupCode, String roleName, String roleId);
+	boolean validRoleName(String groupCode, String roleName, String roleType, String roleId);
 
 	/**
 	 * 生成一条默认的角色信息及角色,默认菜单的关联关系,这里的菜单先写死

+ 2 - 2
saas-account/src/main/java/com/persagy/person/service/impl/SaasRoleServiceImpl.java

@@ -51,9 +51,9 @@ public class SaasRoleServiceImpl extends SuperServiceImpl<SaasRoleMapper, SaasRo
 	}
 
 	@Override
-	public boolean validRoleName(String groupCode, String roleName, String roleId) {
+	public boolean validRoleName(String groupCode, String roleName, String roleType, String roleId) {
 		LambdaQueryWrapper<SaasRole> queryWrapper = new SaasRole.Builder().createQueryWrapper().idEq(roleId)
-				.groupCodeEq(groupCode).roleNameEq(roleName).builderQueryWrapper();
+				.groupCodeEq(groupCode).roleNameEq(roleName).roleTypeEq(roleType).builderQueryWrapper();
 		List<SaasRole> list = this.baseMapper.selectList(queryWrapper);
 		if (CollectionUtil.isEmpty(list)) {
 			return true;