Browse Source

增加业务条线限制

tags/24080901
WendyYang 1 year ago
parent
commit
82bf849c82
3 changed files with 22 additions and 7 deletions
  1. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java
  2. +17
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertCallResultRewriteTask.java

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java View File

@@ -105,4 +105,8 @@ public class BizUtils {
})));
}

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

}

+ 17
- 6
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -83,6 +83,19 @@ public class ExpertInviteManage {
.eq(ExpertUserFullInfo::getExpertAccountStatus, ExpertAccountStatusEnum.AVAILABLE.getKey());
}

private void buildAvoidCompanyAndBusinessStrip(LambdaQueryWrapper<ExpertUserFullInfo> query, List<String> units, List<String> strips) {
if (CollUtil.isNotEmpty(units)) {
String unitStr = BizUtils.inSqlJoin(units);
query.notExists("select 1 from expert_avoid_company eac where eac.user_id = nd_expert_user_full_info.user_id" +
" and company_uniq_code in " + unitStr);
}
if (CollUtil.isNotEmpty(strips)) {
String orgStr = BizUtils.inSqlJoin(strips);
query.notExists("select 1 from expert_gov_business_strip egbs where egbs.expert_user_id = nd_expert_user_full_info.user_id" +
" and business_strip_code in " + orgStr);
}
}

/**
* 增加专家层级限制
*
@@ -272,10 +285,8 @@ public class ExpertInviteManage {
// 回避信息
LambdaQueryWrapper<ExpertUserFullInfo> query = buildBaseExpertQuery();
query.notIn(!tmpAvoidCompany.isEmpty(), ExpertUserFullInfo::getCompanyUniqCode, tmpAvoidCompany);
if (avoidCompany) {
query.notExists("select 1 from expert_avoid_company eac where eac.user_id = nd_expert_user_full_info.user_id" +
" and company_uniq_code in ({0})", CollUtils.joinByComma(avoidRule.getAvoidUnitIdList()));
}
// 处理回避单位与回避条线
buildAvoidCompanyAndBusinessStrip(query, avoidRule.getAvoidUnitIdList(), avoidRule.getAvoidOrgIdList());
Set<Long> expertIdsIn = new HashSet<>();
Set<Long> expertIdsNotIn = new HashSet<>();
if (CollUtil.isNotEmpty(merge.getExpertIdsIn())) {
@@ -365,8 +376,8 @@ public class ExpertInviteManage {
LambdaQueryWrapper<ExpertUserFullInfo> query = buildBaseExpertQuery();
// 设置回避单位
Set<String> notInCompanyUniqCodeList = new HashSet<>(avoidRule.getAvoidUnitIdList());
query.notExists("select 1 from expert_avoid_company eac where eac.user_id = nd_expert_user_full_info.user_id" +
" and company_uniq_code in ({0})", CollUtils.joinByComma(avoidRule.getAvoidUnitIdList()));
// 处理回避单位与回避条线
buildAvoidCompanyAndBusinessStrip(query, avoidRule.getAvoidUnitIdList(), avoidRule.getAvoidOrgIdList());
// 处理专家层级
addRegionLimit(query, randomRule);



+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertCallResultRewriteTask.java View File

@@ -207,7 +207,7 @@ public class ExpertCallResultRewriteTask {
status = REFUSED;
}
} catch (Exception e) {
log.error("获取电话回调结果异常", e);
log.error("获取电话回调结果异常{}", mrd, e);
status = UNANSWERED;
}
} else {


Loading…
Cancel
Save