From d678a1f7064e0781cdd9e23b29bc60e087aa6afd Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 2 Mar 2023 11:43:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8D=95=E4=BD=8D=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/expert/manage/ExpertMetaApplyManage.java | 22 +++++--- .../pmapi/meta/helper/ExpertUserInfoHelper.java | 16 ++++++ .../meta/helper/ExpertUserInfoHelperImpl.java | 63 ++++++++++++++++++++++ pmapi/src/main/resources/application-dev.yml | 2 +- 4 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java index 2348321..81ccb68 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java @@ -10,6 +10,7 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; +import com.ningdatech.pmapi.common.helper.RegionCacheHelper; import com.ningdatech.pmapi.common.helper.RegionLimitHelper; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.util.BizUtils; @@ -35,11 +36,13 @@ import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; import com.ningdatech.pmapi.meta.helper.DictionaryCache; +import com.ningdatech.pmapi.meta.helper.ExpertUserInfoHelper; import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO; import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; @@ -66,6 +69,7 @@ public class ExpertMetaApplyManage { private final IExpertDictionaryService expertDictionaryService; // private final IExpertAdminManageService ExpertAdminManageService; + private final RegionCacheHelper regionCacheHelper; private final IExpertUserFullInfoService userFullInfoService; private final DictionaryCache dictionaryCache; @@ -75,6 +79,8 @@ public class ExpertMetaApplyManage { private final RegionLimitHelper regionLimitHelper; + private final ExpertUserInfoHelper expertUserInfoHelper; + public PageVo metaApplyListQuery(MetaApplyListQuery req) { Long expertAdminUserId = LoginUserUtil.getUserId(); @@ -130,17 +136,17 @@ public class ExpertMetaApplyManage { // 专家入库时,需要先审核专家入库,入库成功后,再履职意向审核,如果履职意向跟专家层级是同一层级的,就直接同意不需要审核 if (applyResult) { Long expertUserId = expertMetaApply.getUserId(); -// ExpertRegionInfo expertRegionInfo = expertUserInfoHelper.getExpertRegionInfo(expertUserId); -// Integer regionLevel = expertRegionInfo.getRegionLevel(); -// String regionCode = expertRegionInfo.getRegionCode(); + ExpertRegionInfo expertRegionInfo = expertUserInfoHelper.getExpertRegionInfo(expertUserId); + Integer regionLevel = expertRegionInfo.getRegionLevel(); + String regionCode = expertRegionInfo.getRegionCode(); List expertJoinApplyList = iMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) .eq(ExpertMetaApply::getUserId, expertUserId) .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) - .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name())); -// .eq(ExpertMetaApply::getRegionLevel, regionLevel) -// .eq(ExpertMetaApply::getRegionCode, regionCode)); + .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name()) + .eq(ExpertMetaApply::getRegionLevel, regionLevel) + .eq(ExpertMetaApply::getRegionCode, regionCode)); BizUtils.notEmpty(expertJoinApplyList, list -> list.forEach(r -> { MetaApplyResultRequest resultRequest = new MetaApplyResultRequest(); resultRequest.setApplyId(r.getId()); @@ -425,11 +431,11 @@ public class ExpertMetaApplyManage { } expertApplyMetaVO.setName(expertUserFullInfo.getExpertName()); -// RegionDTO regionDTO = regionCache.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel()); + RegionDTO regionDTO = regionCacheHelper.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel()); ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode()); expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel()); -// expertRegionInfo.setRegionName(regionDTO.getRegionName()); + expertRegionInfo.setRegionName(regionDTO.getRegionName()); expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo); List expertDictionaryList = expertDictionaryListMap.get(userId); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java new file mode 100644 index 0000000..75d0798 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.meta.helper; + +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; + +/** + * @author liuxinxin + * @date 2023/3/2 上午11:02 + */ + +public interface ExpertUserInfoHelper { + + ExpertUserFullInfo getExpertBasicFullInfo(Long expertUserId); + + ExpertRegionInfo getExpertRegionInfo(Long expertUserId); +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java new file mode 100644 index 0000000..63e2497 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java @@ -0,0 +1,63 @@ +package com.ningdatech.pmapi.meta.helper; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * @author liuxinxin + * @date 2022/8/30 下午2:17 + * 公共专家相关信息工具类 用于获取专家的一些基础信息 + */ +@Component +@RequiredArgsConstructor +public class ExpertUserInfoHelperImpl implements ExpertUserInfoHelper { + + private final IExpertUserFullInfoService iExpertUserFullInfoService; + + /** + * 获取专家 + * + * @param expertUserId + * @return + */ + @Override + public ExpertUserFullInfo getExpertBasicFullInfo(Long expertUserId) { + ExpertUserFullInfo one = iExpertUserFullInfoService + .getOne(Wrappers.lambdaQuery(ExpertUserFullInfo.class).eq(ExpertUserFullInfo::getUserId, expertUserId)); + return one; + } + + /** + * 获取专家层级 + * + * @param expertUserId + * @return + */ + @Override + public ExpertRegionInfo getExpertRegionInfo(Long expertUserId) { + ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId); + + Integer regionLevel = one.getRegionLevel(); + String regionCode = one.getRegionCode(); + ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo(); + expertRegionInfo.setRegionCode(regionCode); + expertRegionInfo.setRegionLevel(regionLevel); + return expertRegionInfo; + } + +// /** +// * 专家是否已经出库 +// */ +// public Boolean isDelivery(Long expertUserId) { +// ExpertUserFullInfo one = getExpertBasicFullInfo(expertUserId); +// if (Objects.isNull(one)) { +// return true; +// } +// return ExpertAccountStatusEnum.DELIVERY.getKey().equals(one.getExpertAccountStatus()); +// } + +} diff --git a/pmapi/src/main/resources/application-dev.yml b/pmapi/src/main/resources/application-dev.yml index f2e6e8c..f16ff34 100644 --- a/pmapi/src/main/resources/application-dev.yml +++ b/pmapi/src/main/resources/application-dev.yml @@ -173,7 +173,7 @@ sa-token: #浙政钉公司顶级organizationCode organization: dept-visible-scopes: - - 430857a6-fa0b-49f6-89f8-5437b0e2d234 + - GO_ff70e47bae684fdba0d64f4acab85661 yxt: wsdl-url: http://115.239.137.23:9501/ws/v1?wsdl