|
|
@@ -358,42 +358,44 @@ public class MeetingManage { |
|
|
|
if (experts.isEmpty()) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
List<MeetingExpert> randomList = new ArrayList<>(); |
|
|
|
List<MeetingExpert> appointList = new ArrayList<>(); |
|
|
|
List<MeetingExpert> attendList = new ArrayList<>(); |
|
|
|
List<Long> expertIds = new ArrayList<>(); |
|
|
|
experts.forEach(w -> { |
|
|
|
boolean randomInvite = w.getInviteType().equals(ExpertInviteTypeEnum.RANDOM.getCode()); |
|
|
|
if (randomInvite) { |
|
|
|
randomList.add(w); |
|
|
|
} else { |
|
|
|
appointList.add(w); |
|
|
|
} |
|
|
|
if (w.getStatus().equals(ExpertAttendStatusEnum.AGREED.getCode())) { |
|
|
|
attendList.add(w); |
|
|
|
if (randomInvite) { |
|
|
|
} else { |
|
|
|
} |
|
|
|
} |
|
|
|
expertIds.add(w.getExpertId()); |
|
|
|
}); |
|
|
|
Map<Long, ExpertBasicInfoVO> expertBasicInfoVoMap = meetingManageHelper.getExpertBasicInfo(expertIds); |
|
|
|
Function<MeetingExpert, RandomInviteListItemVO> mapping = sme -> { |
|
|
|
ExpertBasicInfoVO basicInfoVo = expertBasicInfoVoMap.get(sme.getExpertId()); |
|
|
|
RandomInviteListItemVO item = BeanUtil.copyProperties(basicInfoVo, RandomInviteListItemVO.class); |
|
|
|
item.setStatus(sme.getStatus()); |
|
|
|
item.setMeetingId(sme.getMeetingId()); |
|
|
|
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); |
|
|
|
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); |
|
|
|
Function<MeetingExpert, InviteExpertListItemVO> mapping = sme -> { |
|
|
|
ExpertBasicInfoVO expert = expertMap.get(sme.getExpertId()); |
|
|
|
InviteExpertListItemVO item = BeanUtil.copyProperties(expert, InviteExpertListItemVO.class); |
|
|
|
item.setExpertMeetingId(sme.getId()); |
|
|
|
ExpertAttendStatusEnum status = ExpertAttendStatusEnum.getByCode(sme.getStatus()); |
|
|
|
if (status.equals(ExpertAttendStatusEnum.NOTICING)) { |
|
|
|
item.setNoticeStatus(status.getValue()); |
|
|
|
item.setConfirmResult(StrUtil.EMPTY); |
|
|
|
item.setMeetingId(sme.getMeetingId()); |
|
|
|
item.setStatus(sme.getStatus()); |
|
|
|
item.setNoticeTime(sme.getCreateOn()); |
|
|
|
item.setRuleId(sme.getRuleId()); |
|
|
|
if (ExpertAttendStatusEnum.NOTICING.eq(sme.getStatus())) { |
|
|
|
item.setNoticeStatus("通知中"); |
|
|
|
} else { |
|
|
|
item.setNoticeStatus("已通知"); |
|
|
|
item.setConfirmResult(status.getValue()); |
|
|
|
} |
|
|
|
return item; |
|
|
|
}; |
|
|
|
boolean isRandom = ExpertInviteTypeEnum.RANDOM.eq(meeting.getInviteType()); |
|
|
|
if (!isRandom) { |
|
|
|
result.setInviteStatistics(new ArrayList<>()); |
|
|
|
Map<Long, List<MeetingExpert>> groupByRule = CollUtils.group(experts, MeetingExpert::getRuleId); |
|
|
|
List<ExpertInviteRule> inviteRules = inviteRuleService.listByIds(groupByRule.keySet()); |
|
|
|
Map<Long, ExpertInviteRule> ruleMap = CollUtils.listToMap(inviteRules, ExpertInviteRule::getId); |
|
|
|
groupByRule.forEach((ruleId, expertList) -> { |
|
|
|
InviteStatisticsByRuleVO statistics = InviteStatisticsByRuleVO.init(ruleId); |
|
|
|
expertList.forEach((expert) -> { |
|
|
|
Integer status = expert.getStatus(); |
|
|
|
if (ExpertAttendStatusEnum.AGREED.eq(status)) { |
|
|
|
statistics.incrAgreeCnt(); |
|
|
|
} |
|
|
|
statistics.setInviteCnt(ruleMap.get(ruleId).getInviteCount()); |
|
|
|
statistics.incrNoticedCnt(); |
|
|
|
}); |
|
|
|
result.getInviteStatistics().add(statistics); |
|
|
|
}); |
|
|
|
} |
|
|
|
List<InviteExpertListItemVO> converts = CollUtils.convert(experts, mapping); |
|
|
|
result.setInviteExpertList(converts); |
|
|
|
// 确定参加列表 |
|
|
|
return result; |
|
|
|
} |
|
|
|