|
|
@@ -12,9 +12,11 @@ import com.zhongshu.card.client.model.orgModel.ProjectBindOrgsParam;
|
|
|
import com.zhongshu.card.client.type.OrganizationRelationType;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationRelationDao;
|
|
|
+import com.zhongshu.card.server.core.dao.org.OrganizationUserDao;
|
|
|
import com.zhongshu.card.server.core.dao.projectAbout.PayShareListDao;
|
|
|
import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.domain.org.OrganizationRelation;
|
|
|
+import com.zhongshu.card.server.core.domain.org.OrganizationUser;
|
|
|
import com.zhongshu.card.server.core.domain.paySetting.PayShareList;
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
import com.zhongshu.card.server.core.service.projectAbout.PayShareListService;
|
|
|
@@ -62,6 +64,9 @@ public class ProjectBindOrgServiceImpl extends SuperService {
|
|
|
@Autowired
|
|
|
private PayShareListService payShareListService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OrganizationUserDao organizationUserDao;
|
|
|
+
|
|
|
/**
|
|
|
* 项目绑定机构信息
|
|
|
*
|
|
|
@@ -218,6 +223,12 @@ public class ProjectBindOrgServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isEmpty(relation)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, id));
|
|
|
}
|
|
|
+ // 判断是否可以删除
|
|
|
+ Organization organization = relation.getRelOrganization();
|
|
|
+ long count = organizationUserDao.countByOrganization(organization);
|
|
|
+ if (count > 0) {
|
|
|
+ return ResultContent.buildFail(String.format("%s已绑定用户,不能删除", organization.getName()));
|
|
|
+ }
|
|
|
organizationRelationDao.delete(relation);
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|