|
|
@@ -56,7 +56,7 @@ import org.springframework.util.Assert; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.function.BiFunction; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.*; |
|
|
@@ -238,7 +238,7 @@ public class MeetingManage { |
|
|
|
// 随机抽取的话则需进行抽取数量校验 |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
expertInviteManage.expertInviteByMeetingCreate(meeting, randomRules, avoidInfo); |
|
|
|
expertInviteTask.addInviteTaskByMeetingCreate(meeting.getId(), 5, now); |
|
|
|
expertInviteTask.addInviteTaskByMeetingCreate(meeting.getId(), now); |
|
|
|
LambdaUpdateWrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class) |
|
|
|
.set(Meeting::getInviteStatus, false) |
|
|
|
.eq(Meeting::getId, meeting.getId()); |
|
|
@@ -470,7 +470,7 @@ public class MeetingManage { |
|
|
|
} |
|
|
|
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); |
|
|
|
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); |
|
|
|
Function<MeetingExpert, InviteExpertListItemVO> mapping = me -> { |
|
|
|
BiFunction<MeetingExpert, Map<Long, ExpertInviteRule>, InviteExpertListItemVO> mapping = (me, ruleMap) -> { |
|
|
|
ExpertBasicInfoVO expert = expertMap.get(me.getExpertId()); |
|
|
|
InviteExpertListItemVO item = BeanUtil.copyProperties(expert, InviteExpertListItemVO.class); |
|
|
|
item.setExpertMeetingId(me.getId()); |
|
|
@@ -480,6 +480,8 @@ public class MeetingManage { |
|
|
|
item.setNoticeTime(me.getCreateOn()); |
|
|
|
item.setRuleId(me.getRuleId()); |
|
|
|
item.setIsHeadman(me.getIsHeadman()); |
|
|
|
ExpertInviteRule rule = ruleMap.get(me.getRuleId()); |
|
|
|
item.setInviteType(rule == null ? ExpertInviteTypeEnum.APPOINT.getCode() : rule.getInviteType()); |
|
|
|
if (NOTICING.eq(me.getStatus())) { |
|
|
|
item.setNoticeStatus("通知中"); |
|
|
|
} else { |
|
|
@@ -487,12 +489,12 @@ public class MeetingManage { |
|
|
|
} |
|
|
|
return item; |
|
|
|
}; |
|
|
|
List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId); |
|
|
|
Map<Long, ExpertInviteRule> ruleMap = CollUtils.listToMap(inviteRules, ExpertInviteRule::getId); |
|
|
|
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.listByMeetingId(meetingId); |
|
|
|
Map<Long, ExpertInviteRule> ruleMap = CollUtils.listToMap(inviteRules, ExpertInviteRule::getId); |
|
|
|
ruleMap.forEach((k, v) -> { |
|
|
|
InviteStatisticsByRuleVO statistics = InviteStatisticsByRuleVO.init(k); |
|
|
|
statistics.setInviteCnt(v.getInviteCount()); |
|
|
@@ -508,7 +510,7 @@ public class MeetingManage { |
|
|
|
result.getInviteStatistics().add(statistics); |
|
|
|
}); |
|
|
|
} |
|
|
|
List<InviteExpertListItemVO> converts = CollUtils.convert(experts, mapping); |
|
|
|
List<InviteExpertListItemVO> converts = CollUtils.convert(experts, me -> mapping.apply(me, ruleMap)); |
|
|
|
result.setInviteExpertList(converts); |
|
|
|
// 确定参加列表 |
|
|
|
return result; |
|
|
|