|
|
@@ -20,6 +20,7 @@ import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
@@ -201,24 +202,9 @@ public class HandlerManage { |
|
|
|
// 更新项目状态为待申报 |
|
|
|
updateWithdrawProjectStatus(userId, declaredProject); |
|
|
|
// 保存到草稿箱中 |
|
|
|
ProjectDraftSaveDTO draftSaveDto = new ProjectDraftSaveDTO(); |
|
|
|
ProjectDTO projectInfo = new ProjectDTO(); |
|
|
|
BeanUtils.copyProperties(declaredProject,projectInfo); |
|
|
|
// 查询出项目关联的应用信息 |
|
|
|
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectId, declaredProject.getId())); |
|
|
|
List<ProjectApplicationDTO> applicationDTOList = applicationList.stream().map(a -> { |
|
|
|
ProjectApplicationDTO applicationDTO = new ProjectApplicationDTO(); |
|
|
|
BeanUtils.copyProperties(a, applicationDTO); |
|
|
|
return applicationDTO; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectInfo.setApplicationList(applicationDTOList); |
|
|
|
HashMap<String,Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class); |
|
|
|
projectInfo.setDynamicForm(dynamicMap); |
|
|
|
draftSaveDto.setProjectInfo(projectInfo); |
|
|
|
declaredProjectManage.saveToDraft(draftSaveDto); |
|
|
|
// 并删除项目库中该项目信息 |
|
|
|
projectService.removeById(declaredProject); |
|
|
|
saveToDraft(declaredProject); |
|
|
|
//删除所有项目相关的信息 |
|
|
|
deleteProjectRelated(declaredProject); |
|
|
|
break; |
|
|
|
// 当前项目状态是预审中 |
|
|
|
case PRE_APPLYING: |
|
|
@@ -235,6 +221,44 @@ public class HandlerManage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 保存到草稿箱中 |
|
|
|
private void saveToDraft(Project declaredProject) { |
|
|
|
ProjectDraftSaveDTO draftSaveDto = new ProjectDraftSaveDTO(); |
|
|
|
ProjectDTO projectInfo = new ProjectDTO(); |
|
|
|
BeanUtils.copyProperties(declaredProject,projectInfo); |
|
|
|
// 查询出项目关联的应用信息 |
|
|
|
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectId, declaredProject.getId())); |
|
|
|
List<ProjectApplicationDTO> applicationDTOList = applicationList.stream().map(a -> { |
|
|
|
ProjectApplicationDTO applicationDTO = new ProjectApplicationDTO(); |
|
|
|
BeanUtils.copyProperties(a, applicationDTO); |
|
|
|
return applicationDTO; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectInfo.setApplicationList(applicationDTOList); |
|
|
|
HashMap<String,Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class); |
|
|
|
projectInfo.setDynamicForm(dynamicMap); |
|
|
|
draftSaveDto.setProjectInfo(projectInfo); |
|
|
|
declaredProjectManage.saveToDraft(draftSaveDto); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除项目的所有信息 |
|
|
|
* @param declaredProject |
|
|
|
*/ |
|
|
|
public void deleteProjectRelated(Project declaredProject) { |
|
|
|
//删除项目库中该项目信息 |
|
|
|
projectService.removeById(declaredProject); |
|
|
|
//删除app信息 |
|
|
|
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectId,declaredProject.getId())); |
|
|
|
// 删除关联表信息 |
|
|
|
projectInstService.remove(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.eq(ProjectInst::getProjectId,declaredProject.getId()) |
|
|
|
.eq(ProjectInst::getInstCode,declaredProject.getInstCode())); |
|
|
|
//删除项目的实例信息 |
|
|
|
historyService.deleteHistoricProcessInstance(declaredProject.getInstCode()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 退回审核后 所处理的逻辑 |
|
|
|
* @param declaredProject |
|
|
|