Browse Source

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

tags/24080901
WendyYang 1 year ago
parent
commit
b1520c2d99
4 changed files with 31 additions and 11 deletions
  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 View File

@@ -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 View File

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


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


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

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


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


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -123,9 +123,11 @@ public class ExpertInviteManage {
* @param rule 随机邀请规则 * @param rule 随机邀请规则
*/ */
private static void addRegionLimit(LambdaQueryWrapper<ExpertUserFullInfo> query, RandomInviteRuleDTO 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 View File

@@ -586,9 +586,10 @@ public class MeetingManage {
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel());
randomRule.setIntentionRegions(intentionRegions); 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); result.getRandomRules().add(randomRule);
}); });


Loading…
Cancel
Save