diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/leave/manage/LeaveManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/leave/manage/LeaveManage.java index aaae8c4..64d0c2b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/leave/manage/LeaveManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/leave/manage/LeaveManage.java @@ -41,12 +41,10 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; -import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meeting.service.IMeetingService; -import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; +import com.ningdatech.pmapi.meeting.task.ExpertRandomInviteTask; import com.ningdatech.pmapi.sms.utils.DateUtil; -import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.AllArgsConstructor; import org.springframework.aop.framework.AopContext; @@ -71,7 +69,7 @@ import java.util.stream.Collectors; @AllArgsConstructor public class LeaveManage { - private final ExpertInviteTask inviteTask; + private final ExpertRandomInviteTask inviteTask; private final IMeetingService meetingService; private final IMeetingExpertService meetingExpertService; private final IExpertLeaveService leaveService; @@ -79,8 +77,6 @@ public class LeaveManage { private final IExpertMetaApplyService metaApplyService; private final FileService fileService; private final IExpertUserFullInfoService userFullInfoService; - private final YxtCallOrSmsHelper yxtCallOrSmsHelper; - private final IUserInfoService userInfoService; private static final int HOURS_BEFORE_MEETING = 2; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingCallOrMsgHelper.java similarity index 86% rename from pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java rename to pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingCallOrMsgHelper.java index 27ffb72..0955e82 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingCallOrMsgHelper.java @@ -1,6 +1,5 @@ package com.ningdatech.pmapi.meeting.helper; -import cn.hutool.core.date.DatePattern; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -13,6 +12,8 @@ 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.sms.constant.VoiceSmsTemplateConst; +import com.ningdatech.pmapi.sms.utils.DateUtil; import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService; import com.ningdatech.pmapi.sys.model.entity.Notify; @@ -21,6 +22,7 @@ import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.yxt.model.cmd.SendSmsCmd.SendSmsContext; +import com.ningdatech.yxt.model.cmd.SubmitTaskCallCmd.SubmitTaskCallContext; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -42,7 +44,7 @@ import java.util.stream.Collectors; **/ @Component @AllArgsConstructor -public class MeetingMsgHelper { +public class MeetingCallOrMsgHelper { private final IUserInfoService userInfoService; private final YxtCallOrSmsHelper yxtCallOrSmsHelper; @@ -52,7 +54,7 @@ public class MeetingMsgHelper { private final INotifyService notifyService; private static String officialTime(LocalDateTime time) { - return time.format(DatePattern.NORM_DATETIME_MINUTE_FORMATTER); + return time.format(DateUtil.DTF_YMD_HM); } private Notify getNotify(Long userId, String msg, MsgTypeEnum type, Map extraPara) { @@ -164,4 +166,25 @@ public class MeetingMsgHelper { yxtCallOrSmsHelper.sendSms(contexts); } + /** + * 提交专家通知音信通任务 + * + * @param meeting 会议信息 + * @param experts 待通知专家 + * @author WendyYang + **/ + public void callExpertByMeeting(Meeting meeting, List experts) { + String voiceContent = String.format(VoiceSmsTemplateConst.OFFLINE_TEMPLATE, + meeting.getHoldOrg(), meeting.getName(), officialTime(meeting.getStartTime()), + meeting.getMeetingAddress()); + List callContexts = CollUtils.convert(experts, w -> { + SubmitTaskCallContext context = new SubmitTaskCallContext(); + context.setContent(voiceContent); + context.setReceiveNumber(w.getMobile()); + return context; + }); + String submitKey = yxtCallOrSmsHelper.submitCallTask(callContexts); + experts.forEach(w -> w.setSubmitKey(submitKey)); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/YxtCallOrSmsHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/YxtCallOrSmsHelper.java index 3a1f4b0..ce511c7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/YxtCallOrSmsHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/YxtCallOrSmsHelper.java @@ -1,10 +1,5 @@ package com.ningdatech.pmapi.meeting.helper; -import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.pmapi.meeting.entity.domain.Meeting; -import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; -import com.ningdatech.pmapi.sms.constant.VoiceSmsTemplateConst; -import com.ningdatech.pmapi.sms.utils.DateUtil; import com.ningdatech.yxt.client.YxtClient; import com.ningdatech.yxt.constants.YxtSmsSignEnum; import com.ningdatech.yxt.model.cmd.SendSmsCmd; @@ -33,18 +28,9 @@ public class YxtCallOrSmsHelper { private final YxtClient yxtClient; - public void callByMeetingExperts(Meeting meeting, List experts) { - String callContent = String.format(VoiceSmsTemplateConst.OFFLINE_TEMPLATE, - meeting.getHoldOrg(), meeting.getName(), - meeting.getStartTime().format(DateUtil.DTF_YMD_HM), meeting.getMeetingAddress()); - List callContexts = CollUtils.convert(experts, w -> { - SubmitTaskCallContext context = new SubmitTaskCallContext(); - context.setContent(callContent); - context.setReceiveNumber(w.getMobile()); - return context; - }); + public String submitCallTask(List callContexts) { SubmitTaskCallResponse callResponse = yxtClient.submitTaskCall(of(callContexts)); - experts.forEach(w -> w.setSubmitKey(callResponse.getSubmitKey())); + return callResponse.getSubmitKey(); } public void sendSms(List smsList) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java index 69134e4..0b575c3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java @@ -19,7 +19,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import com.ningdatech.pmapi.meeting.entity.dto.*; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; -import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; +import com.ningdatech.pmapi.meeting.helper.MeetingCallOrMsgHelper; import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService; import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.meeting.service.IMeetingService; @@ -65,7 +65,7 @@ public class ExpertInviteManage { private final IExpertUserFullInfoService expertUserFullInfoService; private final IMeetingService meetingService; private final IExpertAvoidCompanyService expertAvoidCompanyService; - private final YxtCallOrSmsHelper yxtCallOrSmsHelper; + private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; @Value("#{randomInviteProperties.recentMeetingCount}") private Integer recentMeetingCount; @@ -547,7 +547,7 @@ public class ExpertInviteManage { expertInserts.add(expert); }); } - yxtCallOrSmsHelper.callByMeetingExperts(meeting, expertInserts); + meetingCallOrMsgHelper.callExpertByMeeting(meeting, expertInserts); } meetingExpertService.saveBatch(expertInserts); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index aa8f9be..434460f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -36,10 +36,10 @@ import com.ningdatech.pmapi.meeting.entity.req.*; import com.ningdatech.pmapi.meeting.entity.vo.*; import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper; import com.ningdatech.pmapi.meeting.helper.MeetingManageHelper; -import com.ningdatech.pmapi.meeting.helper.MeetingMsgHelper; +import com.ningdatech.pmapi.meeting.helper.MeetingCallOrMsgHelper; import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; import com.ningdatech.pmapi.meeting.service.*; -import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; +import com.ningdatech.pmapi.meeting.task.ExpertRandomInviteTask; import com.ningdatech.pmapi.meta.helper.DictionaryCache; import com.ningdatech.pmapi.meta.helper.TagCache; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; @@ -85,7 +85,7 @@ public class MeetingManage { private final DictionaryCache dictionaryCache; private final IMeetingExpertService meetingExpertService; private final ExpertInviteManage expertInviteManage; - private final ExpertInviteTask expertInviteTask; + private final ExpertRandomInviteTask expertRandomInviteTask; private final MeetingManageHelper meetingManageHelper; private final YxtCallOrSmsHelper yxtCallOrSmsHelper; private final DistributedLock distributedLock; @@ -97,7 +97,7 @@ public class MeetingManage { private final IDingOrganizationService dingOrganizationService; private final IExpertReviewService expertReviewService; private final ExpertInviteHelper expertInviteHelper; - private final MeetingMsgHelper meetingMsgHelper; + private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; @@ -183,7 +183,7 @@ public class MeetingManage { if (!invitedContinue) { throw BizException.wrap("抽取人员数量已满足抽取规则"); } - expertInviteTask.notifyInviteTask(meetingId); + expertRandomInviteTask.notifyInviteTask(meetingId); } finally { distributedLock.releaseLock(key); } @@ -200,7 +200,7 @@ public class MeetingManage { if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) { throw BizException.wrap("转换失败,请刷新后重试"); } - expertInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingId(meetingId); LambdaUpdateWrapper meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) .set(Meeting::getInviteType, APPOINT.getCode()) .eq(Meeting::getId, meetingId); @@ -241,7 +241,7 @@ public class MeetingManage { // 随机抽取的话则需进行抽取数量校验 LocalDateTime now = LocalDateTime.now(); expertInviteManage.expertInviteByMeetingCreate(meeting, randomRules, avoidInfo); - expertInviteTask.addInviteTaskByMeetingCreate(meeting.getId(), now); + expertRandomInviteTask.addInviteTaskByMeetingCreate(meeting.getId(), now); LambdaUpdateWrapper mUpdate = Wrappers.lambdaUpdate(Meeting.class) .set(Meeting::getInviteStatus, false) .eq(Meeting::getId, meeting.getId()); @@ -638,7 +638,7 @@ public class MeetingManage { } public void stopRandomInvite(Long meetingId) { - expertInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingId(meetingId); } @Transactional(rollbackFor = Exception.class) @@ -660,11 +660,11 @@ public class MeetingManage { .set(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()) .eq(Meeting::getId, meetingId); meetingService.update(meetingUpdate); - expertInviteTask.cancelByMeetingId(meetingId); + expertRandomInviteTask.cancelByMeetingId(meetingId); // 发送通知给专家 List experts = meetingExpertService.listAgreedExperts(meetingId); if (!experts.isEmpty()) { - meetingMsgHelper.sendCancelMeetingMsg(experts, meeting); + meetingCallOrMsgHelper.sendCancelMeetingMsg(experts, meeting); } } finally { distributedLock.releaseLock(key); @@ -824,7 +824,7 @@ public class MeetingManage { .in(MeetingExpert::getId, currConfirmedMeIds) .set(MeetingExpert::getConfirmedRoster, Boolean.TRUE); meetingExpertService.update(meUpdate); - meetingMsgHelper.sendConfirmedRosterMsg(expertNoticing, meeting); + meetingCallOrMsgHelper.sendConfirmedRosterMsg(expertNoticing, meeting); } finally { distributedLock.releaseLock(key); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java similarity index 95% rename from pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java rename to pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java index 6fd806c..de14ae1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java @@ -16,8 +16,7 @@ import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO; import com.ningdatech.pmapi.meeting.entity.dto.InviteCacheDTO; import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO; import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; -import com.ningdatech.pmapi.meeting.helper.MeetingMsgHelper; -import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; +import com.ningdatech.pmapi.meeting.helper.MeetingCallOrMsgHelper; import com.ningdatech.pmapi.meeting.manage.ExpertInviteManage; import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService; import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService; @@ -50,7 +49,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** *

- * ExpertInviteTask + * 专家随机邀请任务 *

* * @author WendyYang @@ -59,7 +58,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Slf4j @Component @AllArgsConstructor -public class ExpertInviteTask { +public class ExpertRandomInviteTask { private final RandomInviteProperties properties; private static final String MEETING_ID_INVITE_RANDOM = "MEETING_ID_INVITE_RANDOM"; @@ -74,16 +73,15 @@ public class ExpertInviteTask { private final IMeetingService meetingService; private final ExpertInviteManage expertInviteManage; private final IExpertInviteAvoidRuleService inviteAvoidRuleService; - private final YxtCallOrSmsHelper yxtCallOrSmsHelper; - private final MeetingMsgHelper meetingMsgHelper; + private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; /** * 用来存入线程执行句柄, 停止定时任务时使用 */ private static final ConcurrentMap> INVITE_TASK_MAP = new ConcurrentHashMap<>(); - private ExpertInviteTask currProxy() { - return (ExpertInviteTask) AopContext.currentProxy(); + private ExpertRandomInviteTask currProxy() { + return (ExpertRandomInviteTask) AopContext.currentProxy(); } private CacheHashKey getCacheKey(Long meetingId) { @@ -190,7 +188,7 @@ public class ExpertInviteTask { } Instant startTime = LocalDateTime.now().plusMinutes(delayTime).atZone(ZoneId.systemDefault()).toInstant(); ScheduledFuture future = scheduler.scheduleAtFixedRate(() -> { - ExpertInviteTask bean = SpringContextHolder.getBean(ExpertInviteTask.class); + ExpertRandomInviteTask bean = SpringContextHolder.getBean(ExpertRandomInviteTask.class); try { bean.invite(meetingId, reInvite, tsTime); } catch (Exception e) { @@ -264,7 +262,7 @@ public class ExpertInviteTask { expert.setStatus(ExpertAttendStatusEnum.NOTICING.getCode()); return expert; }); - yxtCallOrSmsHelper.callByMeetingExperts(meeting, expertMeetings); + meetingCallOrMsgHelper.callExpertByMeeting(meeting, expertMeetings); log.info("会议:{} 后台抽取专家:{}名", meetingId, expertMeetings.size()); meetingExpertService.saveBatch(expertMeetings); } else { @@ -275,7 +273,7 @@ public class ExpertInviteTask { if (notIgnoreCnt.get() == 0 || notIgnoreCnt.get() == notSupportCnt.get()) { log.info("停止会议随机邀请:{} 未完成抽取规则数量 {} 无可抽取专家规则数量 {}", meetingId, notIgnoreCnt, notSupportCnt); currProxy().cancelByMeetingId(meetingId); - meetingMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); + meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java index 8f96faf..4a5227b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java @@ -63,28 +63,23 @@ public class ProjectVersionUtil { } // 获取之前版本的项目 - int index = projectList.size() - 1; - ProcessProgressVo instanceDetail = null; - while (index > 0){ - index = index - 1; - Project preProject = projectList.get(index); + for (Project preProject : projectList) { // 从项目流程实例关联表中查出实例详情 - List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) - .eq(ProjectInst::getProjectId, preProject.getId()) - .eq(ProjectInst::getInstType,instTypeEnum.getCode())); + List projectInstList = projectInstService + .list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, preProject.getId()) + .eq(ProjectInst::getInstType, instTypeEnum.getCode())); if (CollUtil.isNotEmpty(projectInstList)) { List processProgressVoList = projectInstList.stream() - .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) - .collect(Collectors.toList()); + .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) + .collect(Collectors.toList()); // 筛选出上个版本该类型审核流程通过的流程详情 List instanceDetailList = processProgressVoList.stream() - .filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus())) - .collect(Collectors.toList()); - if (CollUtil.isEmpty(instanceDetailList)){ - continue; + .filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(instanceDetailList)) { + // 获取最后一个流程详情 + return instanceDetailList.get(instanceDetailList.size() - 1); } - // 获取最后一个流程详情 - return instanceDetailList.get(instanceDetailList.size() - 1); } } return null; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 49c6e3e..5e95e1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -3,13 +3,12 @@ package com.ningdatech.pmapi.todocenter.manage; import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.*; import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; +import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.nullness.qual.Nullable; import org.flowable.engine.HistoryService; import org.flowable.engine.RuntimeService; import org.flowable.engine.TaskService; @@ -89,17 +88,28 @@ public class HandlerManage { // 获取流程通过后当前流程详情 ProcessProgressVo newInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId()); // 获取流程通过后当前审核人信息,向其发送工作通知 + // 会签/或签会有多个审核人 + List currentEmployeeCodeList = Lists.newArrayList(); List newProgressInfo = newInstanceDetail.getProgressInfo(); ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1); - String currentEmployeeCode; + // 说明当前节点是子流程节点 if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) { List children = currentNode.getChildren(); // 获取子流程当前审核人节点 ProgressNode subCurrentNode = children.get(children.size() - 1); - currentEmployeeCode = subCurrentNode.getUserId(); + // 获取节点ID相同地审核节点 + List nodeList = children.stream() + .filter(c -> subCurrentNode.getNodeId().equals(c.getNodeId())) + .collect(Collectors.toList()); + List userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList()); + currentEmployeeCodeList.addAll(userIdList); } else { - currentEmployeeCode = currentNode.getUserId(); + List nodeList = newProgressInfo.stream() + .filter(c -> currentNode.getNodeId().equals(c.getNodeId())) + .collect(Collectors.toList()); + List userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList()); + currentEmployeeCodeList.addAll(userIdList); } // 流程通过后,判断当前登录用户是不是最后一个审核人 @@ -131,15 +141,17 @@ public class HandlerManage { noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2,MsgTypeEnum.PROJECT_REVIEW_PASS); } else { - // 若有下一个审核人(当前节点的用户), + // 若有下一个审核人(当前节点的用户),会签/或签会有多个 // 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 // 获取发送浙政钉工作通知必要信息 - if (Objects.isNull(currentEmployeeCode)) { - throw new BizException("审核人信息不存在!"); + for (String currentEmployeeCode : currentEmployeeCodeList) { + if (Objects.isNull(currentEmployeeCode)) { + throw new BizException("审核人信息不存在!"); + } + //发送消息 + noticeManage.sendNotice(currentEmployeeCode,userId,declaredProject,instance.getProcessDefinitionName(), + PASS_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW); } - //发送消息 - noticeManage.sendNotice(currentEmployeeCode,userId,declaredProject,instance.getProcessDefinitionName(), - PASS_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW); } }