@@ -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; | |||||
} |
@@ -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; | ||||
@@ -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); | |||||
} | } | ||||
} | } | ||||
@@ -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); | ||||
}); | }); | ||||