|
|
@@ -584,33 +584,32 @@ public class MeetingManage { |
|
|
|
InviteRuleDetailVO result = new InviteRuleDetailVO(); |
|
|
|
List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId); |
|
|
|
result.setRandomRules(new ArrayList<>()); |
|
|
|
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); |
|
|
|
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, |
|
|
|
w -> ExpertInviteTypeEnum.getByCode(w.getInviteType())); |
|
|
|
List<ExpertInviteRule> randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM); |
|
|
|
if (CollUtil.isNotEmpty(randoms)) { |
|
|
|
randoms.forEach(random -> { |
|
|
|
RandomInviteRuleVO randomRule = JSON.parseObject(random.getInviteRule(), RandomInviteRuleVO.class); |
|
|
|
randomRule.setId(random.getId()); |
|
|
|
if (randomRule.getExpertTags() != null) { |
|
|
|
randomRule.getExpertTags().forEach(w -> { |
|
|
|
List<String> tagNames = CollUtils.convert(w.getTagCodes(), tagCode -> tagCache.getByTagCode(tagCode).getTagName()); |
|
|
|
w.setTagCodes(tagNames); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (randomRule.getExpertDicts() != null) { |
|
|
|
randomRule.getExpertDicts().forEach(w -> { |
|
|
|
List<String> dictNames = CollUtils.convert(w.getDictCodes(), this::getDictName); |
|
|
|
w.setDictCodes(dictNames); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (StrUtil.isNotEmpty(randomRule.getIntentionRegionCode())) { |
|
|
|
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); |
|
|
|
BizUtils.notEmpty(randomRule.getExpertTags(), tags -> tags.forEach(w -> { |
|
|
|
List<String> tagNames = CollUtils.convert(w.getTagCodes(), |
|
|
|
tagCode -> tagCache.getByTagCode(tagCode).getTagName()); |
|
|
|
w.setTagCodes(tagNames); |
|
|
|
})); |
|
|
|
BizUtils.notEmpty(randomRule.getExpertDicts(), dicts -> dicts.forEach(w -> { |
|
|
|
List<String> dictNames = CollUtils.convert(w.getDictCodes(), this::getDictName); |
|
|
|
w.setDictCodes(dictNames); |
|
|
|
})); |
|
|
|
Integer intentionRegionLevel = randomRule.getIntentionRegionLevel(); |
|
|
|
BizUtils.notBlank(randomRule.getIntentionRegionCode(), regionCode -> { |
|
|
|
List<RegionDTO> intentionRegions = regionCache.listParents(regionCode, intentionRegionLevel); |
|
|
|
randomRule.setIntentionRegions(intentionRegions); |
|
|
|
} |
|
|
|
if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) { |
|
|
|
List<RegionDTO> regions = CollUtils.convert(randomRule.getExpertRegionList(), |
|
|
|
}); |
|
|
|
BizUtils.notEmpty(randomRule.getExpertRegionList(), expertRegionList -> { |
|
|
|
List<RegionDTO> regions = CollUtils.convert(expertRegionList, |
|
|
|
w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel())); |
|
|
|
randomRule.setExpertRegions(regions); |
|
|
|
} |
|
|
|
}); |
|
|
|
result.getRandomRules().add(randomRule); |
|
|
|
}); |
|
|
|
AvoidRuleDTO avoidInfo = inviteAvoidRuleService.getAvoidInfo(meetingId); |
|
|
@@ -626,7 +625,7 @@ public class MeetingManage { |
|
|
|
vo.setAvoidUnits(dingOrganizationService.listNameByCodes(avoidInfo.getAvoidUnitIdList())); |
|
|
|
} |
|
|
|
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { |
|
|
|
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); |
|
|
|
vo.setExperts(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values()); |
|
|
|
} |
|
|
|
result.setAvoidInfo(vo); |
|
|
|
} else { |
|
|
@@ -637,7 +636,7 @@ public class MeetingManage { |
|
|
|
appointRule.setId(appoint.getId()); |
|
|
|
AppointRuleVO vo = new AppointRuleVO(); |
|
|
|
vo.setInviteDesc(appointRule.getInviteDesc()); |
|
|
|
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values())); |
|
|
|
vo.setExperts(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values()); |
|
|
|
result.setAppointRule(vo); |
|
|
|
} |
|
|
|
} |
|
|
|