@@ -11,16 +11,6 @@ import java.util.List; | |||||
*/ | */ | ||||
public interface RegionLimitHelper { | public interface RegionLimitHelper { | ||||
/** | |||||
* 管理员 是否包含 专家层级校验 | |||||
* | |||||
* @param expertUserId / | |||||
* @param expertAdminUserId / | |||||
* @return / | |||||
*/ | |||||
Boolean regionContainsCheck(Long expertUserId, Long expertAdminUserId); | |||||
/** | /** | ||||
* 校验层级包含关系 | * 校验层级包含关系 | ||||
* | * | ||||
@@ -49,11 +39,4 @@ public interface RegionLimitHelper { | |||||
*/ | */ | ||||
RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode); | RegionContainsBO getContainsRegionBo(Integer regionLevel, String regionCode); | ||||
/** | |||||
* 根据专家管理员用户id 获取专家管理员管辖区域列表 | |||||
* | |||||
* @param expertAdminUserId 专家管理员用户id | |||||
* @return / | |||||
*/ | |||||
List<RegionContainsBO> getExpertAdminContainsRegion(Long expertAdminUserId); | |||||
} | } |
@@ -3,7 +3,6 @@ package com.ningdatech.pmapi.common.helper.impl; | |||||
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | ||||
import com.ningdatech.pmapi.common.helper.basic.AbstractRegionLimitHelper; | import com.ningdatech.pmapi.common.helper.basic.AbstractRegionLimitHelper; | ||||
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; | ||||
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; | |||||
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; | import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
@@ -40,13 +39,6 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper { | |||||
} | } | ||||
@Override | @Override | ||||
public Boolean regionContainsCheck(Long expertUserId, Long expertAdminUserId) { | |||||
List<RegionContainsBO> expertAdminContainsRegion = getExpertAdminContainsRegion(expertAdminUserId); | |||||
ExpertRegionInfo expertRegionInfo = getExpertRegionInfo(expertUserId); | |||||
return regionContains(expertAdminContainsRegion, expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel()); | |||||
} | |||||
@Override | |||||
public Boolean regionContains(List<RegionContainsBO> regionContainsBOList, String regionCode, Integer regionLevel) { | public Boolean regionContains(List<RegionContainsBO> regionContainsBOList, String regionCode, Integer regionLevel) { | ||||
for (RegionContainsBO regionContainsBO : regionContainsBOList) { | for (RegionContainsBO regionContainsBO : regionContainsBOList) { | ||||
Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); | Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); | ||||
@@ -96,27 +88,5 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper { | |||||
return regionContains; | return regionContains; | ||||
} | } | ||||
@Override | |||||
public List<RegionContainsBO> getExpertAdminContainsRegion(Long expertAdminUserId) { | |||||
if (Objects.isNull(expertAdminUserId)) { | |||||
logger.error("getExpertAdminContainsRegion expertAdminUserId is null"); | |||||
return new ArrayList<>(); | |||||
} | |||||
// TODO | |||||
/*LambdaQueryWrapper<ExpertAdminRegion> expertAdminRegionEq = Wrappers.lambdaQuery(ExpertAdminRegion.class) | |||||
.eq(ExpertAdminRegion::getUserId, expertAdminUserId); | |||||
List<ExpertAdminRegion> expertAdminRegionList = iExpertAdminRegionService.list(expertAdminRegionEq); | |||||
List<RegionContainsBO> regionContainsBOList = new ArrayList<>(); | |||||
for (ExpertAdminRegion expertAdminRegion : expertAdminRegionList) { | |||||
List<String> regionCodes = regionCacheHelper | |||||
.getAllChildrenRegionCodeList(expertAdminRegion.getRegionCode(), expertAdminRegion.getRegionLevel()); | |||||
RegionContainsBO regionContainsBO = new RegionContainsBO(); | |||||
regionContainsBO.setContainsRegionCodeList(regionCodes); | |||||
regionContainsBO.setParentRegionTreeLevel(expertAdminRegion.getRegionLevel()); | |||||
regionContainsBOList.add(regionContainsBO); | |||||
}*/ | |||||
return new ArrayList<>(); | |||||
} | |||||
} | } |
@@ -25,16 +25,4 @@ public class RegionWrapperAssembler { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public static void expertMetaApplyRegionContainsWrapperAssembler(LambdaQueryWrapper<ExpertMetaApply> wrapperQuery, List<RegionContainsBO> containsRegionList) { | |||||
for (RegionContainsBO regionContainsBO : containsRegionList) { | |||||
List<String> containsRegionCodeList = regionContainsBO.getContainsRegionCodeList(); | |||||
Integer parentRegionTreeLevel = regionContainsBO.getParentRegionTreeLevel(); | |||||
if (CollectionUtils.isNotEmpty(containsRegionCodeList)) { | |||||
wrapperQuery.and(wrapper -> wrapper.in(ExpertMetaApply::getRegionCode, containsRegionCodeList) | |||||
.ge(ExpertMetaApply::getRegionLevel, parentRegionTreeLevel)); | |||||
} | |||||
} | |||||
wrapperQuery.orderByDesc(ExpertMetaApply::getUpdateOn); | |||||
} | |||||
} | } |
@@ -153,10 +153,6 @@ public class ExpertAdminManage { | |||||
List<RegionContainsBO> expertAdminContainsRegionList = new ArrayList<>(); | List<RegionContainsBO> expertAdminContainsRegionList = new ArrayList<>(); | ||||
// 如果为超级管理员,可以查看所有的专家,包括没有层级的专家 | |||||
if (!permissionCheckHelper.isSuperAdmin()) { | |||||
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId); | |||||
} | |||||
List<RegionContainsBO> containsRegion = new ArrayList<>(); | List<RegionContainsBO> containsRegion = new ArrayList<>(); | ||||
if (Objects.nonNull(query.getExpertRegionInfo())) { | if (Objects.nonNull(query.getExpertRegionInfo())) { | ||||
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel() | RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel() | ||||
@@ -86,9 +86,7 @@ public class ExpertMetaApplyManage { | |||||
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { | public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { | ||||
Long expertAdminUserId = LoginUserUtil.getUserId(); | Long expertAdminUserId = LoginUserUtil.getUserId(); | ||||
// 查找符合专家条件的用户id | // 查找符合专家条件的用户id | ||||
List<RegionContainsBO> viewRegions = regionLimitHelper.getExpertAdminContainsRegion(expertAdminUserId); | |||||
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions); | |||||
// TODO | |||||
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req); | |||||
List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); | List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); | ||||
// TODO 获取所有的专家审核列表 | // TODO 获取所有的专家审核列表 | ||||
if (CollUtil.isEmpty(filterExpertUserIdList)) { | if (CollUtil.isEmpty(filterExpertUserIdList)) { | ||||
@@ -96,9 +94,7 @@ public class ExpertMetaApplyManage { | |||||
} | } | ||||
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = | LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = | ||||
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList, viewRegions); | |||||
RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); | |||||
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList); | |||||
Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); | Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); | ||||
PageVo<ExpertApplyMetaVO> result = new PageVo<>(); | PageVo<ExpertApplyMetaVO> result = new PageVo<>(); | ||||
result.setTotal(pageResult.getTotal()); | result.setTotal(pageResult.getTotal()); | ||||
@@ -371,7 +367,7 @@ public class ExpertMetaApplyManage { | |||||
return applyTypeList; | return applyTypeList; | ||||
} | } | ||||
private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(MetaApplyListQuery query, List<RegionContainsBO> expertAdminContainsRegionList) { | |||||
private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(MetaApplyListQuery query) { | |||||
ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd(); | ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd(); | ||||
expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); | expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber()); | ||||
expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); | expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize()); | ||||
@@ -389,13 +385,11 @@ public class ExpertMetaApplyManage { | |||||
expertDictionaryQueryList.add(expertDictionaryQuery); | expertDictionaryQueryList.add(expertDictionaryQuery); | ||||
} | } | ||||
List<RegionContainsBO> containsRegion; | |||||
List<RegionContainsBO> containsRegion = null; | |||||
if (Objects.nonNull(query.getExpertRegion())) { | if (Objects.nonNull(query.getExpertRegion())) { | ||||
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegion().getRegionLevel() | RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegion().getRegionLevel() | ||||
, query.getExpertRegion().getRegionCode()); | , query.getExpertRegion().getRegionCode()); | ||||
containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList); | |||||
} else { | |||||
containsRegion = expertAdminContainsRegionList; | |||||
containsRegion = CollUtil.toList(containsRegionBo); | |||||
} | } | ||||
expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList); | expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList); | ||||
@@ -465,8 +459,7 @@ public class ExpertMetaApplyManage { | |||||
} | } | ||||
private LambdaQueryWrapper<ExpertMetaApply> buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq, | private LambdaQueryWrapper<ExpertMetaApply> buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq, | ||||
List<Long> expertIdList, | |||||
List<RegionContainsBO> viewRegions) { | |||||
List<Long> expertIdList) { | |||||
// 审核类型 | // 审核类型 | ||||
List<String> applyTypeList = new ArrayList<>(); | List<String> applyTypeList = new ArrayList<>(); | ||||
if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) { | if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) { | ||||
@@ -496,7 +489,6 @@ public class ExpertMetaApplyManage { | |||||
.ne(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.REVOKED.getKey()) | .ne(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.REVOKED.getKey()) | ||||
.orderByDesc(ExpertMetaApply::getCreateOn); | .orderByDesc(ExpertMetaApply::getCreateOn); | ||||
RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); | |||||
return expertMetaApplyListQuery; | return expertMetaApplyListQuery; | ||||
} | } | ||||
@@ -175,7 +175,7 @@ public class OrganizationManage { | |||||
keyTreeVO.setType("ORGANIZATION"); | keyTreeVO.setType("ORGANIZATION"); | ||||
return keyTreeVO; | return keyTreeVO; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
treeVOList(request.getNeedMember(), orgKeyTreeVOList,onlyUnit); | |||||
treeVOList(request.getNeedMember(), orgKeyTreeVOList, onlyUnit); | |||||
return orgKeyTreeVOList; | return orgKeyTreeVOList; | ||||
} | } | ||||