|
@@ -596,22 +596,28 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
|
|
|
return ResultContent.buildSuccess(model);
|
|
return ResultContent.buildSuccess(model);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除项目
|
|
|
|
|
+ * @param projectOid
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
public ResultContent deleteProject(String projectOid) {
|
|
public ResultContent deleteProject(String projectOid) {
|
|
|
- Organization organization = organizationDao.findTopByOid(projectOid);
|
|
|
|
|
- if (ObjectUtils.isEmpty(organization)) {
|
|
|
|
|
|
|
+ Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(projectInfo)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, projectOid));
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, projectOid));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断项目是否可以删除
|
|
// 判断项目是否可以删除
|
|
|
long count = projectBindOrgServiceImpl.countProjectBindNumber(projectOid);
|
|
long count = projectBindOrgServiceImpl.countProjectBindNumber(projectOid);
|
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
|
- return ResultContent.buildFail(String.format("%s 项目下包含机构,不能删除", organization.getName()));
|
|
|
|
|
|
|
+ return ResultContent.buildFail(String.format("%s 项目下包含机构,不能删除", projectInfo.getName()));
|
|
|
}
|
|
}
|
|
|
// 删除项目信息
|
|
// 删除项目信息
|
|
|
- organizationDao.delete(organization);
|
|
|
|
|
|
|
+ organizationDao.delete(projectInfo);
|
|
|
|
|
|
|
|
// 删除项目关联的信息
|
|
// 删除项目关联的信息
|
|
|
|
|
+ organizationUserDao.deleteByProjectOid(projectOid);
|
|
|
|
|
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|