|
|
@@ -146,6 +146,7 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
return ResultContent.buildFail("项目负责人不能为空");
|
|
|
}
|
|
|
String currentOid = getCurrentOid();
|
|
|
+ // 管理员
|
|
|
List<UserAccount> userAccounts = userAccountService.getUserAccounts(param.getManagerUserIds());
|
|
|
if (userAccounts.size() != param.getManagerUserIds().size()) {
|
|
|
return ResultContent.buildFail("managerUserIds错误");
|
|
|
@@ -161,9 +162,17 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
if (ObjectUtils.isNotEmpty(nameOrganization) && !nameOrganization.getId().equals(organization.getId())) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIST, param.getName()));
|
|
|
}
|
|
|
- BeanUtils.copyProperties(param, organization, "code");
|
|
|
+ // 项目修改更新特定的字段
|
|
|
+ organization.setName(param.getName());
|
|
|
+ organization.setDataAuthType(param.getDataAuthType());
|
|
|
+ organization.setState(param.getState());
|
|
|
+ organization.setManagerUserIds(param.getManagerUserIds());
|
|
|
+ organization.setRemark(param.getRemark());
|
|
|
+
|
|
|
initUpdateEntity(organization);
|
|
|
organizationDao.save(organization);
|
|
|
+
|
|
|
+ authCenterUpdateOrgInfo(organization.getProjectOid(), organization.getName(), organization.getAuthType(), organization.getRemark());
|
|
|
} else {
|
|
|
if (ObjectUtils.isNotEmpty(nameOrganization)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIST, param.getName()));
|
|
|
@@ -300,6 +309,27 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
return ResultContent.buildSuccess(oid);
|
|
|
}
|
|
|
|
|
|
+ public ResultContent<String> authCenterUpdateOrgInfo(String id, String name, AuthType authType, String remark) {
|
|
|
+ String oid = "";
|
|
|
+ com.github.microservice.auth.client.model.OrganizationModel organizationModel = new com.github.microservice.auth.client.model.OrganizationModel();
|
|
|
+ organizationModel.setName(name);
|
|
|
+ organizationModel.setAuthType(authType);
|
|
|
+ organizationModel.setRemark(remark);
|
|
|
+ com.github.microservice.auth.client.content.ResultContent<String> resultContent = organizationService.add(organizationModel);
|
|
|
+ if (resultContent.getState() == ResultState.Success) {
|
|
|
+ log.info("平台初始成功: {}", resultContent.getContent());
|
|
|
+ oid = resultContent.getContent();
|
|
|
+ } else {
|
|
|
+ String msg = resultContent.getMsg();
|
|
|
+ if (StringUtils.isEmpty(msg) && resultContent.getException() != null) {
|
|
|
+ msg = resultContent.getException().getMessage();
|
|
|
+ }
|
|
|
+ log.info("initSuperOrganization {}", msg);
|
|
|
+ return ResultContent.buildFail(msg);
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess(oid);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 添加机构 (只是添加、没得编辑)
|
|
|
*
|