瀏覽代碼

修改专家抽取

tags/24080901
WendyYang 7 月之前
父節點
當前提交
5f8f63ad7f
共有 3 個檔案被更改,包括 8 行新增8 行删除
  1. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java
  2. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/ExpertRandomInviteAlgorithm.java
  3. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/util/BizUtils.java 查看文件

@@ -101,7 +101,7 @@ public class BizUtils {
})));
}

public static String inSqlJoin(List<String> strings) {
public static String inSqlJoin(Collection<String> strings) {
return strings.stream().map(w -> "'" + w + "'").collect(Collectors.joining(StrPool.COMMA, StrPool.LEFT_BRACKET, StrPool.RIGHT_BRACKET));
}



+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/ExpertRandomInviteAlgorithm.java 查看文件

@@ -157,9 +157,9 @@ public class ExpertRandomInviteAlgorithm {
* @return 抽取到的专家信息
* @author WendyYang
**/
public static List<ExpertUserFullInfo> inviteWithoutCompany(List<ExpertUserFullInfo> userFullInfos,
List<List<MeetingExpert>> expertsByRecentMeeting,
Integer count) {
public static List<ExpertUserFullInfo> inviteRandom(List<ExpertUserFullInfo> userFullInfos,
List<List<MeetingExpert>> expertsByRecentMeeting,
Integer count) {
List<ExpertUserFullInfo> result;
if (expertsByRecentMeeting.isEmpty()) {
result = RandomUtil.randomEleList(userFullInfos, count);


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java 查看文件

@@ -372,7 +372,7 @@ public class ExpertInviteManage {
AvoidTypeEnum avoidType = avoidRule.getAvoidType() == null ? AvoidTypeEnum.CURR_UNIT : AvoidTypeEnum.getByCode(avoidRule.getAvoidType());
switch (avoidType) {
case NONE:
result.setExperts(inviteWithoutCompany(userInfoList, expertsByRecentMeeting(), randomRule.getCount()));
result.setExperts(inviteRandom(userInfoList, expertsByRecentMeeting(), randomRule.getCount()));
result.setTotal(userInfoList.size());
break;
case CURR_UNIT:
@@ -475,12 +475,12 @@ public class ExpertInviteManage {
expertIdsNotIn.addAll(agreeOrNoticingExpertIds);
if (AvoidTypeEnum.CURR_UNIT.equals(avoidType)) {
List<ExpertUserFullInfo> agreeOrNoticingUserInfos = expertUserFullInfoService.listByUserIds(agreeOrNoticingExpertIds);
List<String> tmpUniqCompanyCodes = CollUtils.fieldList(agreeOrNoticingUserInfos, ExpertUserFullInfo::getCompanyUniqCode);
Set<String> tmpUniqCompanyCodes = CollUtils.fieldSet(agreeOrNoticingUserInfos, ExpertUserFullInfo::getCompanyUniqCode);
notInCompanyUniqCodeList.addAll(tmpUniqCompanyCodes);
} else if (AvoidTypeEnum.CURR_STRIP.equals(avoidType)) {
List<ExpertGovBusinessStrip> expertStrips = expertGovBusinessStripService.listByUserIds(agreeOrNoticingExpertIds);
if (CollUtil.isNotEmpty(expertStrips)) {
List<String> businessStripCodes = CollUtils.fieldList(expertStrips, ExpertGovBusinessStrip::getBusinessStripCode);
Set<String> businessStripCodes = CollUtils.fieldSet(expertStrips, ExpertGovBusinessStrip::getBusinessStripCode);
query.notExists("select 1 from expert_gov_business_strip egbs " +
"where egbs.expertUserId = nd_expert_user_full_info.user_id " +
"and egbs.business_strip_code in " + BizUtils.inSqlJoin(businessStripCodes));
@@ -526,7 +526,7 @@ public class ExpertInviteManage {
}
switch (avoidType) {
case NONE:
result.setExperts(inviteWithoutCompany(userFullInfos, expertsByRecentMeeting(), count));
result.setExperts(inviteRandom(userFullInfos, expertsByRecentMeeting(), count));
result.setTotal(userFullInfos.size());
break;
case CURR_UNIT:


Loading…
取消
儲存