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