|
@@ -26,20 +26,41 @@ import com.ningdatech.pmapi.gov.model.req.ProjectBaseInfoReq; |
|
|
import com.ningdatech.pmapi.gov.model.req.ProjectPushReq; |
|
|
import com.ningdatech.pmapi.gov.model.req.ProjectPushReq; |
|
|
import com.ningdatech.pmapi.gov.model.vo.*; |
|
|
import com.ningdatech.pmapi.gov.model.vo.*; |
|
|
import com.ningdatech.pmapi.gov.service.*; |
|
|
import com.ningdatech.pmapi.gov.service.*; |
|
|
|
|
|
import com.ningdatech.pmapi.portrait.model.entity.ProjectTag; |
|
|
|
|
|
import com.ningdatech.pmapi.portrait.service.IProjectTagService; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.entity.Operation; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.service.IOperationService; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; |
|
|
|
|
|
import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService; |
|
|
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; |
|
|
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.*; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.service.*; |
|
|
import com.ningdatech.pmapi.provincial.manage.ProvincialManage; |
|
|
import com.ningdatech.pmapi.provincial.manage.ProvincialManage; |
|
|
|
|
|
import com.ningdatech.pmapi.safety.model.entity.PersonSafetyInfo; |
|
|
|
|
|
import com.ningdatech.pmapi.safety.model.entity.SupplierSafetyQualification; |
|
|
|
|
|
import com.ningdatech.pmapi.safety.service.IPersonSafetyInfoService; |
|
|
|
|
|
import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; |
|
|
|
|
|
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging; |
|
|
|
|
|
import com.ningdatech.pmapi.staging.service.IProjectStagingService; |
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; |
|
|
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.wps.manage.WpsConvertManage; |
|
|
import com.ningdatech.pmapi.wps.manage.WpsConvertManage; |
|
|
|
|
|
import com.wflow.bean.entity.WflowCcTasks; |
|
|
|
|
|
import com.wflow.service.WflowCcTasksService; |
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.flowable.engine.HistoryService; |
|
|
|
|
|
import org.flowable.engine.RuntimeService; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.http.HttpEntity; |
|
|
import org.springframework.http.HttpEntity; |
|
|
import org.springframework.http.HttpHeaders; |
|
|
import org.springframework.http.HttpHeaders; |
|
@@ -114,6 +135,33 @@ public class GovProjectCollectionManage { |
|
|
|
|
|
|
|
|
private final RegionCacheHelper regionCacheHelper; |
|
|
private final RegionCacheHelper regionCacheHelper; |
|
|
|
|
|
|
|
|
|
|
|
private final IProjectService projectService; |
|
|
|
|
|
private final IProjectApplicationService applicationService; |
|
|
|
|
|
|
|
|
|
|
|
private final IProjectInstService projectInstService; |
|
|
|
|
|
|
|
|
|
|
|
private final RuntimeService runtimeService; |
|
|
|
|
|
|
|
|
|
|
|
private final HistoryService historyService; |
|
|
|
|
|
|
|
|
|
|
|
private final WflowCcTasksService ccTasksService; |
|
|
|
|
|
|
|
|
|
|
|
private final IOperationService operationService; |
|
|
|
|
|
|
|
|
|
|
|
private final IProjectRenewalFundDeclarationService renewalFundDeclarationService; |
|
|
|
|
|
|
|
|
|
|
|
private final IProjectStagingService stagingService; |
|
|
|
|
|
|
|
|
|
|
|
private final INdProjectStatusChangeService statusChangeService; |
|
|
|
|
|
|
|
|
|
|
|
private final IPurchaseService purchaseService; |
|
|
|
|
|
|
|
|
|
|
|
private final IProjectTagService projectTagService; |
|
|
|
|
|
|
|
|
|
|
|
private final ISupplierSafetyQualificationService supplierSafetyQualificationService; |
|
|
|
|
|
private final IPreInsAcceptancePersonService preInsAcceptancePersonService; |
|
|
|
|
|
private final IPersonSafetyInfoService personService; |
|
|
|
|
|
|
|
|
public List<GovProjectDictionaryVO> dictionary(String type) { |
|
|
public List<GovProjectDictionaryVO> dictionary(String type) { |
|
|
|
|
|
|
|
|
List<GovProjectDictionary> dictionaries = dictionaryService.list(Wrappers.lambdaQuery(GovProjectDictionary.class) |
|
|
List<GovProjectDictionary> dictionaries = dictionaryService.list(Wrappers.lambdaQuery(GovProjectDictionary.class) |
|
@@ -1759,4 +1807,85 @@ public class GovProjectCollectionManage { |
|
|
} |
|
|
} |
|
|
return "运行成功 重新生成" + baseProjIds.size() + "个项目编号"; |
|
|
return "运行成功 重新生成" + baseProjIds.size() + "个项目编号"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String removeProject(List<String> projectCodes) { |
|
|
|
|
|
if(CollUtil.isEmpty(projectCodes)){ |
|
|
|
|
|
throw new BizException("项目编号不能为空!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(String projectCode : projectCodes){ |
|
|
|
|
|
//项目 |
|
|
|
|
|
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
|
|
.eq(Project::getProjectCode, projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> projectIds = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
//1.删除应用 |
|
|
|
|
|
applicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
|
|
.eq(ProjectApplication::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//2.删除相关流程 |
|
|
|
|
|
List<ProjectInst> projectInsts = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
|
|
.in(ProjectInst::getProjectId, projectIds)); |
|
|
|
|
|
for(ProjectInst projectInst : projectInsts){ |
|
|
|
|
|
//实例 |
|
|
|
|
|
try{ |
|
|
|
|
|
runtimeService.deleteProcessInstance(projectInst.getInstCode(),"删除"); |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
try{ |
|
|
|
|
|
historyService.deleteHistoricProcessInstance(projectInst.getInstCode()); |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
//抄送 |
|
|
|
|
|
ccTasksService.remove(Wrappers.lambdaQuery(WflowCcTasks.class) |
|
|
|
|
|
.eq(WflowCcTasks::getInstanceId,projectInst.getInstCode())); |
|
|
|
|
|
} |
|
|
|
|
|
projectInstService.removeByIds(projectInsts.stream().map(ProjectInst::getId).collect(Collectors.toList())); |
|
|
|
|
|
|
|
|
|
|
|
//3.删除实施表 |
|
|
|
|
|
operationService.remove(Wrappers.lambdaQuery(Operation.class) |
|
|
|
|
|
.eq(Operation::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//4.删除续建项目资金表 |
|
|
|
|
|
renewalFundDeclarationService.remove(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) |
|
|
|
|
|
.eq(ProjectRenewalFundDeclaration::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//5.暂存表 |
|
|
|
|
|
stagingService.remove(Wrappers.lambdaQuery(ProjectStaging.class) |
|
|
|
|
|
.in(ProjectStaging::getProjectId,projectIds)); |
|
|
|
|
|
|
|
|
|
|
|
//6.状态变更表 |
|
|
|
|
|
statusChangeService.remove(Wrappers.lambdaQuery(ProjectStatusChange.class) |
|
|
|
|
|
.in(ProjectStatusChange::getProjectId,projectIds)); |
|
|
|
|
|
|
|
|
|
|
|
//7.采购表 |
|
|
|
|
|
purchaseService.remove(Wrappers.lambdaQuery(Purchase.class) |
|
|
|
|
|
.in(Purchase::getProjectId,projectIds)); |
|
|
|
|
|
|
|
|
|
|
|
//8.标签 |
|
|
|
|
|
projectTagService.remove(Wrappers.lambdaQuery(ProjectTag.class) |
|
|
|
|
|
.eq(ProjectTag::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//9.初验人员 |
|
|
|
|
|
preInsAcceptancePersonService.remove(Wrappers.lambdaQuery(PreInsAcceptancePerson.class) |
|
|
|
|
|
.in(PreInsAcceptancePerson::getProjectId,projectIds)); |
|
|
|
|
|
|
|
|
|
|
|
//10.供应商安全质量 |
|
|
|
|
|
supplierSafetyQualificationService.remove(Wrappers.lambdaQuery(SupplierSafetyQualification.class) |
|
|
|
|
|
.eq(SupplierSafetyQualification::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//11.安全人员 |
|
|
|
|
|
personService.remove(Wrappers.lambdaQuery(PersonSafetyInfo.class) |
|
|
|
|
|
.eq(PersonSafetyInfo::getProjectCode,projectCode)); |
|
|
|
|
|
|
|
|
|
|
|
//12.最后删除项目 |
|
|
|
|
|
projectService.remove(Wrappers.lambdaQuery(Project.class) |
|
|
|
|
|
.eq(Project::getProjectCode, projectCode)); |
|
|
|
|
|
} |
|
|
|
|
|
return "删除成功"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |