|
|
@@ -17,25 +17,32 @@ import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; |
|
|
|
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.req.ProjectListReq; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; |
|
|
|
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; |
|
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ProcessDetailReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; |
|
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
|
import com.wflow.exception.BusinessException; |
|
|
|
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; |
|
|
|
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; |
|
|
|
import com.wflow.workflow.bean.process.ProgressNode; |
|
|
@@ -43,6 +50,7 @@ import com.wflow.workflow.bean.process.enums.NodeTypeEnum; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessProgressVo; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
|
import com.wflow.workflow.enums.ProcessHandlerEnum; |
|
|
|
import com.wflow.workflow.enums.ProcessStatusEnum; |
|
|
|
import com.wflow.workflow.service.ProcessInstanceService; |
|
|
|
import com.wflow.workflow.service.ProcessTaskService; |
|
|
@@ -55,6 +63,7 @@ import org.flowable.engine.history.HistoricProcessInstance; |
|
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.time.LocalDateTime; |
|
|
@@ -85,6 +94,8 @@ public class TodoCenterManage { |
|
|
|
private final IDingOrganizationService dingOrganizationService; |
|
|
|
private final ProcessInstanceService processInstanceService; |
|
|
|
private final INdWorkNoticeStagingService workNoticeStagingService; |
|
|
|
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; |
|
|
|
private final IProjectApplicationService projectApplicationService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@@ -617,7 +628,9 @@ public class TodoCenterManage { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<String> instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery() |
|
|
|
.list(); |
|
|
|
Map<String, HistoricProcessInstance> instanceMap = CollUtils.listToMap(instances, HistoricProcessInstance::getId); |
|
|
|
|
|
|
|
// 分页查询项目信息 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -632,7 +645,7 @@ public class TodoCenterManage { |
|
|
|
ResToBeProcessedVO res = new ResToBeProcessedVO(); |
|
|
|
BeanUtils.copyProperties(d, res); |
|
|
|
res.setProjectId(d.getId()); |
|
|
|
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); |
|
|
|
res.setProcessStatusName(processInstanceService.buildProcessStatusStr(instanceMap.get(d.getInstCode()))); |
|
|
|
res.setProcessLaunchTime(d.getCreateOn()); |
|
|
|
res.setProcessHandleTime(d.getUpdateOn()); |
|
|
|
return res; |
|
|
@@ -886,4 +899,61 @@ public class TodoCenterManage { |
|
|
|
ExcelDownUtil.excelExportFile(response, excelExportWriter); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 被退回项目内容调整并重新通过 |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public String adjustment(AdjustHandleDTO dto) { |
|
|
|
ProjectDTO projectDto = dto.getProjectInfo(); |
|
|
|
Project projectInfo = projectService.getById(projectDto.getId()); |
|
|
|
|
|
|
|
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!"); |
|
|
|
|
|
|
|
//项目名称去重 |
|
|
|
defaultDeclaredProjectManage.checkDuplication(projectDto); |
|
|
|
|
|
|
|
//修改项目内容 |
|
|
|
if(!modifyProject(projectDto)){ |
|
|
|
throw new BusinessException("调整项目失败!"); |
|
|
|
} |
|
|
|
|
|
|
|
//最后去审批(通过)当前退回节点的审核任务 |
|
|
|
ReqProcessHandlerDTO handlerDTO = new ReqProcessHandlerDTO(); |
|
|
|
handlerDTO.setProjectId(dto.getProjectId()); |
|
|
|
handlerDTO.setInstanceId(dto.getInstanceId()); |
|
|
|
handlerDTO.setTaskId(dto.getTaskId()); |
|
|
|
handlerDTO.setAction(ProcessHandlerEnum.PASS); |
|
|
|
handlerDTO.setAuditInfo(dto.getAuditInfo()); |
|
|
|
handler(handlerDTO); |
|
|
|
return dto.getInstanceId(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private Boolean modifyProject(ProjectDTO projectDto) { |
|
|
|
//先修改项目信息 |
|
|
|
Project project = new Project(); |
|
|
|
BeanUtils.copyProperties(projectDto,project); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
if(!projectService.updateById(project)){ |
|
|
|
throw new BusinessException("项目调整失败"); |
|
|
|
} |
|
|
|
//再修改应用信息 |
|
|
|
if(CollUtil.isNotEmpty(projectDto.getApplicationList())){ |
|
|
|
//采取批量删除 批量添加的方式 |
|
|
|
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectId,project.getId())); |
|
|
|
//批量添加 |
|
|
|
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { |
|
|
|
ProjectApplication projectApplication = new ProjectApplication(); |
|
|
|
BeanUtils.copyProperties(application, projectApplication); |
|
|
|
projectApplication.setProjectId(project.getId()); |
|
|
|
return projectApplication; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectApplicationService.saveBatch(applications); |
|
|
|
} |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|
} |