|
@@ -36,6 +36,7 @@ import com.ningdatech.pmapi.expert.service.ExpertInfoService; |
|
|
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; |
|
|
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; |
|
|
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; |
|
|
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; |
|
|
|
|
|
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; |
|
|
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; |
|
|
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.zwdd.client.ZwddClient; |
|
|
import com.ningdatech.zwdd.client.ZwddClient; |
|
@@ -49,6 +50,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Collections; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
@@ -79,9 +81,8 @@ public class ExpertAdminManage { |
|
|
*/ |
|
|
*/ |
|
|
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) { |
|
|
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) { |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); |
|
|
|
|
|
CommonPage<ExpertAdminExpertManageListDTO> pageResult = |
|
|
|
|
|
expertAdminManageService.getExpertLibraryList(expertAdminExpertManageQueryCmd); |
|
|
|
|
|
|
|
|
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); |
|
|
|
|
|
CommonPage<ExpertAdminExpertManageListDTO> pageResult = expertAdminManageService.getExpertLibraryList(queryCmd); |
|
|
|
|
|
|
|
|
PageVo<ExpertAdminExpertManageListVO> pageVo = new PageVo<>(); |
|
|
PageVo<ExpertAdminExpertManageListVO> pageVo = new PageVo<>(); |
|
|
pageVo.setTotal(pageResult.getItemsTotal()); |
|
|
pageVo.setTotal(pageResult.getItemsTotal()); |
|
@@ -91,33 +92,33 @@ public class ExpertAdminManage { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(ExpertAdminExpertManageQuery query, Long userId) { |
|
|
private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(ExpertAdminExpertManageQuery query, Long userId) { |
|
|
ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd(); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); |
|
|
|
|
|
|
|
|
ExpertAdminExpertManageQueryCmd queryCmd = new ExpertAdminExpertManageQueryCmd(); |
|
|
|
|
|
queryCmd.setPageNumber(query.getPageNumber()); |
|
|
|
|
|
queryCmd.setPageSize(query.getPageSize()); |
|
|
if (StringUtils.isNotBlank(query.getExpertName())) { |
|
|
if (StringUtils.isNotBlank(query.getExpertName())) { |
|
|
expertAdminExpertManageQueryCmd.setExpertName(query.getExpertName()); |
|
|
|
|
|
|
|
|
queryCmd.setExpertName(query.getExpertName()); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getCompany())) { |
|
|
if (StringUtils.isNotBlank(query.getCompany())) { |
|
|
expertAdminExpertManageQueryCmd.setCompany(query.getCompany()); |
|
|
|
|
|
|
|
|
queryCmd.setCompany(query.getCompany()); |
|
|
} |
|
|
} |
|
|
List<ExpertDictionaryQuery> expertDictionaryQueryList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<ExpertDictionaryQuery> expertDictQueryList = new ArrayList<>(); |
|
|
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { |
|
|
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { |
|
|
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); |
|
|
|
|
|
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); |
|
|
|
|
|
expertDictionaryQueryList.add(expertDictionaryQuery); |
|
|
|
|
|
|
|
|
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); |
|
|
|
|
|
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); |
|
|
|
|
|
expertDictQueryList.add(expertDictQuery); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) { |
|
|
if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) { |
|
|
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()); |
|
|
|
|
|
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode())); |
|
|
|
|
|
expertDictionaryQueryList.add(expertDictionaryQuery); |
|
|
|
|
|
|
|
|
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()); |
|
|
|
|
|
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode())); |
|
|
|
|
|
expertDictQueryList.add(expertDictQuery); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) { |
|
|
if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) { |
|
|
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()); |
|
|
|
|
|
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode())); |
|
|
|
|
|
expertDictionaryQueryList.add(expertDictionaryQuery); |
|
|
|
|
|
|
|
|
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); |
|
|
|
|
|
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()); |
|
|
|
|
|
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode())); |
|
|
|
|
|
expertDictQueryList.add(expertDictQuery); |
|
|
} |
|
|
} |
|
|
List<ExpertTagQuery> expertTagQueryList = new ArrayList<>(); |
|
|
List<ExpertTagQuery> expertTagQueryList = new ArrayList<>(); |
|
|
if (StringUtils.isNotBlank(query.getExpertSourceTagCode())) { |
|
|
if (StringUtils.isNotBlank(query.getExpertSourceTagCode())) { |
|
@@ -136,42 +137,51 @@ public class ExpertAdminManage { |
|
|
QueryExpertAccountStatusEnum queryExpertAccountStatusEnum = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus()); |
|
|
QueryExpertAccountStatusEnum queryExpertAccountStatusEnum = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus()); |
|
|
switch (queryExpertAccountStatusEnum) { |
|
|
switch (queryExpertAccountStatusEnum) { |
|
|
case NORMAL: |
|
|
case NORMAL: |
|
|
expertAdminExpertManageQueryCmd |
|
|
|
|
|
.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE)); |
|
|
|
|
|
|
|
|
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE)); |
|
|
break; |
|
|
break; |
|
|
case FREEZING: |
|
|
case FREEZING: |
|
|
expertAdminExpertManageQueryCmd |
|
|
|
|
|
.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.FREEZE)); |
|
|
|
|
|
|
|
|
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.FREEZE)); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
expertAdminExpertManageQueryCmd |
|
|
|
|
|
.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE, ExpertAccountStatusEnum.FREEZE)); |
|
|
|
|
|
|
|
|
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE, ExpertAccountStatusEnum.FREEZE)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<RegionContainsBO> expertAdminContainsRegionList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<RegionContainsBO> expertAdminContainsRegionList; |
|
|
// 如果为超级管理员,可以查看所有的专家,包括没有层级的专家 |
|
|
// 如果为超级管理员,可以查看所有的专家,包括没有层级的专家 |
|
|
if (!permissionCheckHelper.isSuperAdmin()) { |
|
|
if (!permissionCheckHelper.isSuperAdmin()) { |
|
|
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId); |
|
|
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId); |
|
|
|
|
|
} else { |
|
|
|
|
|
expertAdminContainsRegionList = Collections.emptyList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<RegionContainsBO> containsRegion = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<RegionContainsBO> containsRegion = null; |
|
|
if (Objects.nonNull(query.getExpertRegionInfo())) { |
|
|
if (Objects.nonNull(query.getExpertRegionInfo())) { |
|
|
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel() |
|
|
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel() |
|
|
, query.getExpertRegionInfo().getRegionCode()); |
|
|
, query.getExpertRegionInfo().getRegionCode()); |
|
|
containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); |
|
|
containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); |
|
|
} else { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<RegionContainsBO> intentionRegions = null; |
|
|
|
|
|
if (query.getIntentionRegionInfo() != null) { |
|
|
|
|
|
ExpertRegionInfo intentionRegionInfo = query.getIntentionRegionInfo(); |
|
|
|
|
|
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(intentionRegionInfo.getRegionLevel() |
|
|
|
|
|
, intentionRegionInfo.getRegionCode()); |
|
|
|
|
|
intentionRegions = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); |
|
|
|
|
|
} |
|
|
|
|
|
if (containsRegion == null && intentionRegions == null) { |
|
|
containsRegion = expertAdminContainsRegionList; |
|
|
containsRegion = expertAdminContainsRegionList; |
|
|
} |
|
|
} |
|
|
expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setExpertTagQueryList(expertTagQueryList); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setIsDingUser(query.getIsDingUser()); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setRegionContainsList(containsRegion); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); |
|
|
|
|
|
expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); |
|
|
|
|
|
return expertAdminExpertManageQueryCmd; |
|
|
|
|
|
|
|
|
queryCmd.setExpertDictionaryQueryList(expertDictQueryList); |
|
|
|
|
|
queryCmd.setExpertTagQueryList(expertTagQueryList); |
|
|
|
|
|
queryCmd.setIsDingUser(query.getIsDingUser()); |
|
|
|
|
|
queryCmd.setRegionContainsList(containsRegion); |
|
|
|
|
|
queryCmd.setIntentionRegionList(intentionRegions); |
|
|
|
|
|
queryCmd.setPageSize(query.getPageSize()); |
|
|
|
|
|
queryCmd.setPageNumber(query.getPageNumber()); |
|
|
|
|
|
return queryCmd; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|