Преглед изворни кода

修改专家抽取专家层级支持多选

master
WendyYang пре 1 година
родитељ
комит
b1520c2d99
4 измењених фајлова са 31 додато и 11 уклоњено
  1. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java
  2. +2
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java
  3. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  4. +4
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java Прегледај датотеку

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.common.model;

import lombok.Data;

/**
* <p>
* ReqRegionDTO
* </p>
*
* @author WendyYang
* @since 2023/8/4
**/
@Data
public class ReqRegionDTO {

private String regionCode;

private Integer regionLevel;

}

+ 2
- 5
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java Прегледај датотеку

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.meeting.entity.dto;

import com.ningdatech.pmapi.common.model.ReqRegionDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -30,11 +31,7 @@ public class RandomInviteRuleDTO extends AbstractInviteRule {
@ApiModelProperty("履职意向地层级")
private Integer intentionRegionLevel;

@ApiModelProperty("专家层级编码")
private String expertRegionCode;

@ApiModelProperty("专家层级级别")
private Integer expertRegionLevel;
private List<ReqRegionDTO> expertRegionList;

@ApiModelProperty("专家标签")
private List<ExpertTagChooseDTO> expertTags;


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java Прегледај датотеку

@@ -123,9 +123,11 @@ public class ExpertInviteManage {
* @param rule 随机邀请规则
*/
private static void addRegionLimit(LambdaQueryWrapper<ExpertUserFullInfo> query, RandomInviteRuleDTO rule) {
if (ObjectUtils.allNotNull(rule.getExpertRegionCode(), rule.getExpertRegionLevel())) {
query.eq(ExpertUserFullInfo::getRegionCode, rule.getExpertRegionCode());
query.eq(ExpertUserFullInfo::getRegionLevel, rule.getExpertRegionLevel());
if (CollUtil.isNotEmpty(rule.getExpertRegionList())) {
String inSqlParam = rule.getExpertRegionList().stream()
.map(w -> "('" + w.getRegionCode() + "'," + w.getRegionLevel() + ")")
.collect(Collectors.joining(",", "(", ")"));
query.apply("(region_code, region_level) in " + inSqlParam);
}
}



+ 4
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java Прегледај датотеку

@@ -586,9 +586,10 @@ public class MeetingManage {
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel());
randomRule.setIntentionRegions(intentionRegions);
}
if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) {
List<RegionDTO> expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel());
randomRule.setExpertRegions(expertRegions);
if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) {
List<RegionDTO> regions = CollUtils.convert(randomRule.getExpertRegions(),
w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel()));
randomRule.setExpertRegions(regions);
}
result.getRandomRules().add(randomRule);
});


Loading…
Откажи
Сачувај