diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java index 60659b6..19c92be 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/CcTaskListener.java @@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.cache.model.cache.CacheKey; import com.ningdatech.cache.repository.CachePlusOps; import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; import com.ningdatech.pmapi.sys.manage.NoticeManage; +import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; import com.wflow.bean.entity.WflowCcTasks; import com.wflow.service.WflowCcTasksService; import com.wflow.workflow.notify.event.CcTaskEvent; @@ -47,6 +49,8 @@ public class CcTaskListener { private final CachePlusOps cachePlusOps; + private final UserInfoHelper userInfoHelper; + private static final String DUP_KEY = "ccTasks"; private static final String NODE = "node:"; @@ -80,22 +84,33 @@ public class CcTaskListener { return; } + log.info("tasks :{}",tasks.size()); + tasks.stream().forEach(task -> { + log.info("cc tasks :{}",JSON.toJSONString(tasks)); + HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() .processInstanceId(instCode) .singleResult(); + log.info("instance :{}",JSON.toJSONString(instance)); + ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .eq(ProjectInst::getInstCode, instCode) .last(BizConst.LIMIT_1)); + + log.info("projectInst :{}",JSON.toJSONString(projectInst)); + if(Objects.isNull(projectInst) || Objects.isNull(instance)){ return; } Long projectId = projectInst.getProjectId(); Project project = projectService.getNewProject(projectId); + UserFullInfoDTO user = userInfoHelper.getUserFullInfoByEmployeeCode(task.getUserId()); + //发送消息 - noticeManage.sendNotice(task.getUserId(),93L,project,instance.getProcessDefinitionName(), + noticeManage.sendNotice(task.getUserId(),Objects.nonNull(user)? user.getUserId() : 93L,project,instance.getProcessDefinitionName(), CC_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_CC); }); }