Commit 458cb84d by 李小龙

fixbug:28986 平台端-人员管理-组织管理-编辑:改变组织类型时,需要同步更改空间的属性

parent 9114b029
......@@ -13,6 +13,7 @@ import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatRole;
import com.makeit.entity.platform.auth.PlatRoleOrg;
import com.makeit.entity.platform.auth.PlatUserRole;
import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.id.TreeConst;
......@@ -25,6 +26,7 @@ import com.makeit.service.platform.auth.PlatRoleOrgService;
import com.makeit.service.platform.auth.PlatRoleService;
import com.makeit.service.platform.auth.PlatUserRoleService;
import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.utils.data.convert.PageUtil;
import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.user.plat.PlatUserUtil;
......@@ -70,6 +72,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
@Autowired
private PlatAlarmConfigService platAlarmConfigService;
@Autowired
private PlatSpaceService platSpaceService;
@Override
public List<PlatOrg> filter(List<PlatOrg> deptList, PlatOrgQueryDTO dto) {
......@@ -299,12 +303,22 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
@Override
public void edit(PlatOrg dto) {
check(dto);
PlatOrg platOrg = this.getById(dto.getId());
if (StringUtils.isBlank(dto.getParentId())||StringUtils.equals(dto.getParentId(),"1")) {
} else {
PlatOrg parent = getById(dto.getParentId());
dto.setPath(parent.getPath() + "," + parent.getId());
}
if(!StringUtils.equals(dto.getType(),platOrg.getType())){
LambdaUpdateWrapper<PlatSpace> platSpaceLambdaUpdateWrapper = Wrappers.lambdaUpdate(PlatSpace.class)
.set(PlatSpace::getAttribute, dto.getType())
.eq(PlatSpace::getOrgId, dto.getId());
platSpaceService.update(platSpaceLambdaUpdateWrapper);
}
updateById(dto);
}
......
......@@ -387,11 +387,6 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_AUTH_USER_PASSWORD);
}
/**
* 校验机场
*/
//checkUserOrg(platUser);
PlatUserLoginVO userLoginVO = BeanDtoVoUtils.convert(platUser, PlatUserLoginVO.class);
String token = IdGen.getUUID();
......@@ -404,14 +399,14 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
return userLoginVO;
}
@Override
public void checkTenantOrgStatus(PlatUser platUser) {
PlatTenant platTenant = platTenantService.getById(platUser.getTenantId());
if(platTenant == null || StringUtils.equals(platTenant.getStatus(),CommonEnum.NO.getValue())){
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_TENANT_FORBIDDEN);
}
PlatOrg platOrg = platOrgService.getById(platUser.getOrgId());
if(platOrg == null || StringUtils.equals(platOrg.getStatus(),CommonEnum.NO.getValue())){
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_ORG_FORBIDDEN);
if(StringUtils.equals(platUser.getIsTenant(),CommonEnum.NO.getValue())) {
checkUserOrg(platUser);
}
}
......@@ -434,7 +429,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
.eq(PlatOrg::getStatus, CommonEnum.NO.getValue());
long count = platOrgService.count(platOrgLambdaQueryWrapper);
if (count > 0) {
throw new BusinessException("禁用的子公司其下属账号无法登录");
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_ORG_FORBIDDEN);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment