Bläddra i källkod

fix 单位列表树形结构查询

master
liuxinxin 1 år sedan
förälder
incheckning
d678a1f706
4 ändrade filer med 94 tillägg och 9 borttagningar
  1. +14
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  2. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java
  3. +63
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java
  4. +1
    -1
      pmapi/src/main/resources/application-dev.yml

+ 14
- 8
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java Visa fil

@@ -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<ExpertApplyMetaVO> 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<ExpertMetaApply> 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<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId);


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelper.java Visa fil

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

+ 63
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/ExpertUserInfoHelperImpl.java Visa fil

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

}

+ 1
- 1
pmapi/src/main/resources/application-dev.yml Visa fil

@@ -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


Laddar…
Avbryt
Spara