Browse Source

modify:

1. 待办类型跳转参数修改;
tags/24090601
WendyYang 2 months ago
parent
commit
9cb0807b13
4 changed files with 40 additions and 12 deletions
  1. +2
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/todo/dto/MhTodoExtraParamDTO.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/external/todo/enumerization/MHTodoTypeEnum.java
  3. +9
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IXinchuangInstService.java
  4. +28
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java

+ 2
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/todo/dto/MhTodoExtraParamDTO.java View File

@@ -56,4 +56,6 @@ public class MhTodoExtraParamDTO {


private Integer status; private Integer status;


private Long xinchuangId;

} }

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/external/todo/enumerization/MHTodoTypeEnum.java View File

@@ -23,7 +23,7 @@ public enum MHTodoTypeEnum {
PROJECT_STOPPED_AUDIT("项目终止审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"), PROJECT_STOPPED_AUDIT("项目终止审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"),
PROJECT_CHANGE_AUDIT("项目变更审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"), PROJECT_CHANGE_AUDIT("项目变更审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"),
FINAL_INSPECT_AUDIT("终验审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"), FINAL_INSPECT_AUDIT("终验审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"),
XCFHX_INSPECT_AUDIT("信创符合性审查审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"),
XCFHX_INSPECT_AUDIT("信创符合性审查审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}&xinchuangId={xinchuangId}"),
DECLARED_RECORD_APPLY("立项备案申请", "mhProjectId=${mhProjectId}&status=${status}&projectCode=${projectCode}&projectId=${projectId}&userId=${userId}&userName=${userName}&path=${path}"), DECLARED_RECORD_APPLY("立项备案申请", "mhProjectId=${mhProjectId}&status=${status}&projectCode=${projectCode}&projectId=${projectId}&userId=${userId}&userName=${userName}&path=${path}"),
DECLARED_RECORD_AUDIT("立项备案审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}"); DECLARED_RECORD_AUDIT("立项备案审批", "instanceId=${instanceId}&projectId=${projectId}&nodeId=${nodeId}&taskId=${taskId}&bidId=${bizId}&userId=${userId}&userName=${userName}&path=${path}");




+ 9
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/service/IXinchuangInstService.java View File

@@ -1,5 +1,7 @@
package com.hz.pm.api.projectdeclared.service; package com.hz.pm.api.projectdeclared.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectdeclared.model.entity.XinchuangInst; import com.hz.pm.api.projectdeclared.model.entity.XinchuangInst;


@@ -17,4 +19,11 @@ public interface IXinchuangInstService extends IService<XinchuangInst> {




List<XinchuangInst> listByXinchuangIds(List<Long> xinchuangIds); List<XinchuangInst> listByXinchuangIds(List<Long> xinchuangIds);

default XinchuangInst getByInstCode(String instCode) {
LambdaQueryWrapper<XinchuangInst> wrapper = Wrappers.lambdaQuery(XinchuangInst.class)
.eq(XinchuangInst::getInstCode, instCode);
return getOne(wrapper);
}

} }

+ 28
- 11
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/listener/TaskCreatedListener.java View File

@@ -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.dto.MhTodoExtraParamDTO;
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; 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.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.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.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst; import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.service.IProjectInstService; import com.hz.pm.api.projectlib.service.IProjectInstService;
@@ -56,6 +60,8 @@ public class TaskCreatedListener implements FlowableEventListener {
private final MhApiClient mhApiClient; private final MhApiClient mhApiClient;
private final UserInfoHelper userInfoHelper; private final UserInfoHelper userInfoHelper;
private final IPurchaseInstService purchaseInstService; private final IPurchaseInstService purchaseInstService;
private final IXinchuangInstService xinchuangInstService;
private final IXinchuangService xinchuangService;


@Override @Override
public void onEvent(FlowableEvent event) { public void onEvent(FlowableEvent event) {
@@ -75,11 +81,6 @@ public class TaskCreatedListener implements FlowableEventListener {
if (assignee == null || StrUtil.isBlank(assignee.getMhUserId())) { if (assignee == null || StrUtil.isBlank(assignee.getMhUserId())) {
return; return;
} }
ProjectInst projectInst = projectInstService.getByInstCode(procInstId);
if (projectInst == null) {
return;
}
Project project = projectService.getById(projectInst.getProjectId());
switch (procType) { switch (procType) {
case XC_APPROVAL_PROCESS: case XC_APPROVAL_PROCESS:
case PROJECT_RECORD_APPROVAL_PROCESS: case PROJECT_RECORD_APPROVAL_PROCESS:
@@ -93,10 +94,7 @@ public class TaskCreatedListener implements FlowableEventListener {
case PROJECT_REVIEW: case PROJECT_REVIEW:
// 发送信产平台待办 // 发送信产平台待办
MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType); MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType);
String content = String.format("【%s】的【%s】需要您审核,请及时处理。",
project.getProjectName(), procType.getDesc());
MhTodoExtraParamDTO paramObj = MhTodoExtraParamDTO.builder() MhTodoExtraParamDTO paramObj = MhTodoExtraParamDTO.builder()
.projectId(project.getId())
.taskId(taskEntity.getId()) .taskId(taskEntity.getId())
.instanceId(taskEntity.getProcessInstanceId()) .instanceId(taskEntity.getProcessInstanceId())
.nodeId(taskEntity.getTaskDefinitionId()) .nodeId(taskEntity.getTaskDefinitionId())
@@ -105,13 +103,32 @@ public class TaskCreatedListener implements FlowableEventListener {
.path("/toDoCenter/handleDuringExamine") .path("/toDoCenter/handleDuringExamine")
.build(); .build();
if (procType.equals(ProjectProcessType.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS) 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); 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; 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); mhTodoClient.addTodo(paramObj, assignee, todoType, taskEntity.getId(), content);
// 发送浙政钉工作通知 // 发送浙政钉工作通知
if (assignee.getAccountId() != null) { if (assignee.getAccountId() != null) {


Loading…
Cancel
Save