Переглянути джерело

修改专家库列表查询

tags/24080901
WendyYang 1 рік тому
джерело
коміт
6699cb2eb5
3 змінених файлів з 34 додано та 14 видалено
  1. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java
  2. +29
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java
  3. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java Переглянути файл

@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* @author liuxinxin
@@ -76,8 +75,6 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper {
resultBoList.add(regionContainsBO);
}
}
} else {
resultBoList.add(queryRegionContainBo);
}
return resultBoList;
} else {


+ 29
- 11
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java Переглянути файл

@@ -9,6 +9,7 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum;
import com.ningdatech.pmapi.common.helper.RegionLimitHelper;
import com.ningdatech.pmapi.common.model.CommonPage;
import com.ningdatech.pmapi.common.util.StrUtils;
import com.ningdatech.pmapi.expert.assembler.ExpertAdminExpertManageAssembler;
import com.ningdatech.pmapi.expert.assembler.ExpertInfoCmdAssembler;
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum;
@@ -49,10 +50,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.*;

/**
* @author liuxinxin
@@ -82,6 +80,9 @@ public class ExpertAdminManage {
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) {
Long userId = LoginUserUtil.getUserId();
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(query, userId);
if (queryCmd.isHasNonData()) {
return PageVo.empty();
}
CommonPage<ExpertAdminExpertManageListDTO> pageResult = expertAdminManageService.getExpertLibraryList(queryCmd);

PageVo<ExpertAdminExpertManageListVO> pageVo = new PageVo<>();
@@ -95,10 +96,10 @@ public class ExpertAdminManage {
ExpertAdminExpertManageQueryCmd queryCmd = new ExpertAdminExpertManageQueryCmd();
queryCmd.setPageNumber(query.getPageNumber());
queryCmd.setPageSize(query.getPageSize());
if (StringUtils.isNotBlank(query.getExpertName())) {
if (StrUtils.isNotBlank(query.getExpertName())) {
queryCmd.setExpertName(query.getExpertName());
}
if (StringUtils.isNotBlank(query.getCompany())) {
if (StrUtils.isNotBlank(query.getCompany())) {
queryCmd.setCompany(query.getCompany());
}
List<ExpertDictionaryQuery> expertDictQueryList = new ArrayList<>();
@@ -134,8 +135,8 @@ public class ExpertAdminManage {
expertTagQueryList.add(expertTagQuery);
}
if (StringUtils.isNotBlank(query.getExpertAccountStatus())) {
QueryExpertAccountStatusEnum queryExpertAccountStatusEnum = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus());
switch (queryExpertAccountStatusEnum) {
QueryExpertAccountStatusEnum queryExpertAccountStatus = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus());
switch (queryExpertAccountStatus) {
case NORMAL:
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE));
break;
@@ -151,7 +152,8 @@ public class ExpertAdminManage {

List<RegionContainsBO> expertAdminContainsRegionList;
// 如果为超级管理员,可以查看所有的专家,包括没有层级的专家
if (!permissionCheckHelper.isSuperAdmin()) {
boolean isSuperAdmin;
if (!(isSuperAdmin = permissionCheckHelper.isSuperAdmin())) {
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId);
} else {
expertAdminContainsRegionList = Collections.emptyList();
@@ -161,7 +163,15 @@ public class ExpertAdminManage {
if (Objects.nonNull(query.getExpertRegionInfo())) {
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel()
, query.getExpertRegionInfo().getRegionCode());
containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList);
if (isSuperAdmin) {
containsRegion = Collections.singletonList(containsRegionBo);
} else {
containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList);
if (containsRegion.isEmpty()) {
queryCmd.setHasNonData(true);
return queryCmd;
}
}
}

List<RegionContainsBO> intentionRegions = null;
@@ -169,7 +179,15 @@ public class ExpertAdminManage {
ExpertRegionInfo intentionRegionInfo = query.getIntentionRegionInfo();
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(intentionRegionInfo.getRegionLevel()
, intentionRegionInfo.getRegionCode());
intentionRegions = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList);
if (isSuperAdmin) {
intentionRegions = Collections.singletonList(containsRegionBo);
} else {
intentionRegions = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList);
if (intentionRegions.isEmpty()) {
queryCmd.setHasNonData(true);
return queryCmd;
}
}
}
if (containsRegion == null && intentionRegions == null) {
containsRegion = expertAdminContainsRegionList;


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java Переглянути файл

@@ -64,4 +64,9 @@ public class ExpertAdminExpertManageQueryCmd extends CommonPageReq {
*/
private Boolean isDingUser;

/**
* 无数据可供查询
*/
private transient boolean hasNonData = false;

}

Завантаження…
Відмінити
Зберегти