|
|
@@ -12,7 +12,11 @@ import com.hz.pm.api.external.todo.MHTodoClient; |
|
|
|
import com.hz.pm.api.external.todo.dto.MhTodoExtraParamDTO; |
|
|
|
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; |
|
|
|
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; |
|
|
|
import com.hz.pm.api.projectdeclared.model.entity.Xinchuang; |
|
|
|
import com.hz.pm.api.projectdeclared.model.entity.XinchuangInst; |
|
|
|
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; |
|
|
|
import com.hz.pm.api.projectdeclared.service.IXinchuangInstService; |
|
|
|
import com.hz.pm.api.projectdeclared.service.IXinchuangService; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.ProjectInst; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectInstService; |
|
|
@@ -56,6 +60,8 @@ public class TaskCreatedListener implements FlowableEventListener { |
|
|
|
private final MhApiClient mhApiClient; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
private final IPurchaseInstService purchaseInstService; |
|
|
|
private final IXinchuangInstService xinchuangInstService; |
|
|
|
private final IXinchuangService xinchuangService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onEvent(FlowableEvent event) { |
|
|
@@ -75,11 +81,6 @@ public class TaskCreatedListener implements FlowableEventListener { |
|
|
|
if (assignee == null || StrUtil.isBlank(assignee.getMhUserId())) { |
|
|
|
return; |
|
|
|
} |
|
|
|
ProjectInst projectInst = projectInstService.getByInstCode(procInstId); |
|
|
|
if (projectInst == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Project project = projectService.getById(projectInst.getProjectId()); |
|
|
|
switch (procType) { |
|
|
|
case XC_APPROVAL_PROCESS: |
|
|
|
case PROJECT_RECORD_APPROVAL_PROCESS: |
|
|
@@ -93,10 +94,7 @@ public class TaskCreatedListener implements FlowableEventListener { |
|
|
|
case PROJECT_REVIEW: |
|
|
|
// 发送信产平台待办 |
|
|
|
MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType); |
|
|
|
String content = String.format("【%s】的【%s】需要您审核,请及时处理。", |
|
|
|
project.getProjectName(), procType.getDesc()); |
|
|
|
MhTodoExtraParamDTO paramObj = MhTodoExtraParamDTO.builder() |
|
|
|
.projectId(project.getId()) |
|
|
|
.taskId(taskEntity.getId()) |
|
|
|
.instanceId(taskEntity.getProcessInstanceId()) |
|
|
|
.nodeId(taskEntity.getTaskDefinitionId()) |
|
|
@@ -105,13 +103,32 @@ public class TaskCreatedListener implements FlowableEventListener { |
|
|
|
.path("/toDoCenter/handleDuringExamine") |
|
|
|
.build(); |
|
|
|
if (procType.equals(ProjectProcessType.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS) |
|
|
|
|| procType.equals(ProjectProcessType.XC_APPROVAL_PROCESS)) { |
|
|
|
|| procType.equals(ProjectProcessType.ADAPTION) |
|
|
|
|| procType.equals(ProjectProcessType.XC_APPROVAL_PROCESS) |
|
|
|
|| procType.equals(ProjectProcessType.TEST_VALID) |
|
|
|
|| procType.equals(ProjectProcessType.SELF_TEST)) { |
|
|
|
PurchaseInst purchaseInst = purchaseInstService.getByProjectIdAndInstCode(paramObj.getProjectId(), procInstId); |
|
|
|
if (purchaseInst == null) { |
|
|
|
paramObj.setBidId(purchaseInst.getBidId()); |
|
|
|
} |
|
|
|
String projectName; |
|
|
|
// 上边查不到ID的时候说明是手动新增的信创项目 |
|
|
|
if (paramObj.getBidId() == null) { |
|
|
|
XinchuangInst xinchuangInst = xinchuangInstService.getByInstCode(procInstId); |
|
|
|
if (xinchuangInst == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
paramObj.setBidId(purchaseInst.getBidId()); |
|
|
|
Xinchuang xinchuang = xinchuangService.getById(xinchuangInst.getXinchuangId()); |
|
|
|
paramObj.setXinchuangId(xinchuangInst.getId()); |
|
|
|
projectName = xinchuang.getProjectName(); |
|
|
|
} else { |
|
|
|
ProjectInst projectInst = projectInstService.getByInstCode(procInstId); |
|
|
|
Project project = projectService.getById(projectInst.getProjectId()); |
|
|
|
projectName = project.getProjectName(); |
|
|
|
paramObj.setProjectId(project.getId()); |
|
|
|
paramObj.setProjectCode(project.getProjectCode()); |
|
|
|
} |
|
|
|
String content = String.format("【%s】的【%s】需要您审核,请及时处理。", |
|
|
|
projectName, procType.getDesc()); |
|
|
|
mhTodoClient.addTodo(paramObj, assignee, todoType, taskEntity.getId(), content); |
|
|
|
// 发送浙政钉工作通知 |
|
|
|
if (assignee.getAccountId() != null) { |
|
|
|