|
|
@@ -282,13 +282,13 @@ public class ExpertInviteManage { |
|
|
|
* |
|
|
|
* @param avoidRule 回避信息 |
|
|
|
* @param randomRule 抽取规则 |
|
|
|
* @param appointExpertIds 指定抽取专家ID |
|
|
|
* @param invitedExpertIds 指定抽取专家ID |
|
|
|
* @return 满足抽取条件的专家 |
|
|
|
* @author WendyYang |
|
|
|
**/ |
|
|
|
public ExpertChooseDTO expertInviteByRandomRule(AvoidRuleDTO avoidRule, |
|
|
|
RandomInviteRuleDTO randomRule, |
|
|
|
List<Long> appointExpertIds, |
|
|
|
List<Long> invitedExpertIds, |
|
|
|
LocalDateTime sTime, |
|
|
|
LocalDateTime eTime) { |
|
|
|
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); |
|
|
@@ -298,13 +298,17 @@ public class ExpertInviteManage { |
|
|
|
} |
|
|
|
boolean avoidExpert = CollUtil.isNotEmpty(avoidRule.getExpertIds()); |
|
|
|
boolean avoidCompany = CollUtil.isNotEmpty(avoidRule.getAvoidUnitIdList()); |
|
|
|
Set<String> tmpAvoidCompany = new HashSet<>(); |
|
|
|
Set<String> avoidCompanyUniqCodes = new HashSet<>(); |
|
|
|
if (avoidCompany) { |
|
|
|
tmpAvoidCompany.addAll(avoidRule.getAvoidUnitIdList()); |
|
|
|
avoidCompanyUniqCodes.addAll(avoidRule.getAvoidUnitIdList()); |
|
|
|
} |
|
|
|
if (CollUtil.isNotEmpty(invitedExpertIds)) { |
|
|
|
List<String> tmpCompanyUniqCodes = expertUserFullInfoService.listCompanyUniqCodeByUserIds(invitedExpertIds); |
|
|
|
avoidCompanyUniqCodes.addAll(tmpCompanyUniqCodes); |
|
|
|
} |
|
|
|
// 回避信息 |
|
|
|
LambdaQueryWrapper<ExpertUserFullInfo> query = buildBaseExpertQuery(); |
|
|
|
query.notIn(!tmpAvoidCompany.isEmpty(), ExpertUserFullInfo::getCompanyUniqCode, tmpAvoidCompany); |
|
|
|
query.notIn(!avoidCompanyUniqCodes.isEmpty(), ExpertUserFullInfo::getCompanyUniqCode, avoidCompanyUniqCodes); |
|
|
|
// 处理回避单位与回避条线 |
|
|
|
buildAvoidCompanyAndBusinessStrip(query, avoidRule.getAvoidUnitIdList(), avoidRule.getAvoidOrgIdList()); |
|
|
|
Set<Long> expertIdsIn = new HashSet<>(); |
|
|
@@ -330,8 +334,8 @@ public class ExpertInviteManage { |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
if (CollUtil.isNotEmpty(appointExpertIds)) { |
|
|
|
expertIdsIn.removeIf(appointExpertIds::contains); |
|
|
|
if (CollUtil.isNotEmpty(invitedExpertIds)) { |
|
|
|
expertIdsIn.removeIf(invitedExpertIds::contains); |
|
|
|
if (expertIdsIn.isEmpty()) { |
|
|
|
return result; |
|
|
|
} |
|
|
@@ -342,8 +346,8 @@ public class ExpertInviteManage { |
|
|
|
if (expertIdsIn.isEmpty()) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
} else if (avoidExpert || CollUtil.isNotEmpty(appointExpertIds)) { |
|
|
|
Set<Long> tmpExpert = expertInviteHelper.getAvoidExpert(appointExpertIds, avoidRule, sTime, eTime); |
|
|
|
} else if (avoidExpert || CollUtil.isNotEmpty(invitedExpertIds)) { |
|
|
|
Set<Long> tmpExpert = expertInviteHelper.getAvoidExpert(invitedExpertIds, avoidRule, sTime, eTime); |
|
|
|
expertIdsNotIn.addAll(tmpExpert); |
|
|
|
} else { |
|
|
|
Set<Long> tmpNotInUserIds = expertInviteHelper.listExpertLeaveOrInvited(sTime, eTime); |
|
|
|