|
|
@ -41,10 +41,12 @@ import com.epmet.dto.result.*; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.entity.IcCommunitySelfOrganizationEntity; |
|
|
|
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; |
|
|
|
import com.epmet.entity.IcPartyUnitEntity; |
|
|
|
import com.epmet.excel.CommunitySelfOrgImportExcel; |
|
|
|
import com.epmet.excel.ImportCommunitySelfOrganization; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.feign.OssFeignClient; |
|
|
|
import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; |
|
|
|
import com.epmet.service.IcCommunitySelfOrganizationService; |
|
|
@ -66,6 +68,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartFile; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
@ -97,6 +100,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
@Resource |
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcCommunitySelfOrganizationDTO> page(Map<String, Object> params) { |
|
|
@ -374,8 +379,29 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
if (icUserDemandRecDao.selectCountByServerId(formDTO.getOrgId()) > NumConstant.ZERO) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); |
|
|
|
} |
|
|
|
baseDao.deleteById(formDTO.getOrgId()); |
|
|
|
personnelService.deleteByOrgId(formDTO.getOrgId()); |
|
|
|
//校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【社会自组织被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】
|
|
|
|
boolean bl = true; |
|
|
|
IcCommunitySelfOrganizationEntity entity = baseDao.selectById(formDTO.getOrgId()); |
|
|
|
if (null != entity && "sync".equals(entity.getSyncType())) { |
|
|
|
CheckStaffInfoFormDTO dto = new CheckStaffInfoFormDTO(); |
|
|
|
dto.setId(formDTO.getOrgId()); |
|
|
|
dto.setDeptId(entity.getDeptId()); |
|
|
|
dto.setDeptType("community_org"); |
|
|
|
dto.setDeptStaffId(entity.getDeptStaffId()); |
|
|
|
Result<CheckStaffInfoResultDTO> result = govOrgOpenFeignClient.notSyncDept(dto); |
|
|
|
if (!result.success()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社会自组织删除,取消同步到通讯录数据失败", "社会自组织删除,取消同步到通讯录数据失败"); |
|
|
|
} |
|
|
|
if (!result.getData().getType()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), result.getData().getMsg(), result.getData().getMsg()); |
|
|
|
} |
|
|
|
bl = result.getData().getType(); |
|
|
|
} |
|
|
|
if (bl) { |
|
|
|
baseDao.deleteById(formDTO.getOrgId()); |
|
|
|
personnelService.deleteByOrgId(formDTO.getOrgId()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|