Selaa lähdekoodia

fix 专家审核页面没有 专家类型的相关内容

tags/24080901
niohe·erbao 1 vuosi sitten
vanhempi
commit
1b4cf9fef8
4 muutettua tiedostoa jossa 62 lisäystä ja 16 poistoa
  1. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java
  2. +55
    -15
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  3. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java Näytä tiedosto

@@ -35,7 +35,6 @@ public class ExpertMetaApplyController {
@PostMapping("/list")
@ApiOperation(value = "审核列表筛选")
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(@RequestBody @Valid MetaApplyListQuery metaApplyListQuery) {
// ExpertMetaApplyValidator.metaApplyListQueryValidate(metaApplyListQuery);
return expertMetaApplyManage.metaApplyListQuery(metaApplyListQuery);
}



+ 55
- 15
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java Näytä tiedosto

@@ -14,7 +14,6 @@ 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;
import com.ningdatech.pmapi.expert.assembler.RegionWrapperAssembler;
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum;
@@ -82,18 +81,40 @@ public class ExpertMetaApplyManage {

private final ExpertAdminManageService expertAdminManageService;

private final IExpertDictionaryService iExpertDictionaryService;


public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) {
Long expertAdminUserId = LoginUserUtil.getUserId();
// 筛选符合专家类型的用户id
List<Long> filterExpertTypeUserIdList = null;
DictionaryFieldInfo expertType = req.getExpertType();
if (Objects.nonNull(expertType) && StringUtils.isNotBlank(expertType.getDictionaryCode())) {
List<ExpertDictionary> expertTypeDictionaryList = iExpertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class)
.eq(ExpertDictionary::getDictionaryCode, expertType.getDictionaryCode()));
filterExpertTypeUserIdList = expertTypeDictionaryList.stream().map(ExpertDictionary::getUserId).distinct().collect(Collectors.toList());
}

// 查找符合专家条件的用户id
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req);
List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd);
if (CollUtil.isEmpty(filterExpertUserIdList)) {

// 取交集
List<Long> finalFilterExpertUserIdList = new ArrayList<>();
if (Objects.nonNull(filterExpertTypeUserIdList)) {
for (Long userId : filterExpertUserIdList) {
if (filterExpertTypeUserIdList.contains(userId)) {
finalFilterExpertUserIdList.add(userId);
}
}
}

if (CollUtil.isEmpty(finalFilterExpertUserIdList)) {
return PageVo.empty();
}

LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery =
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList);
buildMetaApplyListQueryWrapper(req, finalFilterExpertUserIdList);
Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery);
PageVo<ExpertApplyMetaVO> result = new PageVo<>();
result.setTotal(pageResult.getTotal());
@@ -102,9 +123,12 @@ public class ExpertMetaApplyManage {
// 根据用户id 获取专家基本信息
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds);
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId);
List<ExpertDictionary> expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL);
Map<Long, List<ExpertDictionary>> dictMap = CollUtils.group(expertDictList, ExpertDictionary::getUserId);
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, dictMap));
List<ExpertDictionary> titleLevelDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL);
Map<Long, List<ExpertDictionary>> titleLevelDictMap = CollUtils.group(titleLevelDictList, ExpertDictionary::getUserId);

List<ExpertDictionary> expertTypeDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.EXPERT_TYPE);
Map<Long, List<ExpertDictionary>> expertTypeDictMap = CollUtils.group(expertTypeDictList, ExpertDictionary::getUserId);
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, titleLevelDictMap, expertTypeDictMap));
});
return result;
}
@@ -398,18 +422,19 @@ public class ExpertMetaApplyManage {
return expertAdminExpertManageQueryCmd;
}


/**
* 装配 专家审核列表筛选返回VO
*
* @param expertMetaApplyList /
* @param expertUserFullInfoMap /
* @param expertDictionaryListMap /
* @return /
* @param expertMetaApplyList
* @param expertUserFullInfoMap
* @param titleLevelDictMap
* @param expertTypeDictMap
* @return
*/
private List<ExpertApplyMetaVO> buildExpertApplyMetaVOList(List<ExpertMetaApply> expertMetaApplyList
, Map<Long, ExpertUserFullInfo> expertUserFullInfoMap
, Map<Long, List<ExpertDictionary>> expertDictionaryListMap) {
, Map<Long, List<ExpertDictionary>> titleLevelDictMap
, Map<Long, List<ExpertDictionary>> expertTypeDictMap) {
List<ExpertApplyMetaVO> expertApplyMetaVOList = new ArrayList<>();
for (ExpertMetaApply expertMetaApply : expertMetaApplyList) {
ExpertApplyMetaVO expertApplyMetaVO = new ExpertApplyMetaVO();
@@ -435,9 +460,24 @@ public class ExpertMetaApplyManage {
expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo);
}

List<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId);
if (CollectionUtils.isNotEmpty(expertDictionaryList)) {
expertApplyMetaVO.setTitleLevel(expertDictionaryList.stream().map(r -> {
List<ExpertDictionary> titleLevelDictionaryList = titleLevelDictMap.get(userId);
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) {
expertApplyMetaVO.setTitleLevel(titleLevelDictionaryList.stream().map(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
if (Objects.nonNull(dictionaryDTO)) {
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName());
}
return dictionaryFieldInfo;
}).collect(Collectors.toList()));
}

// 装配专家类型
List<ExpertDictionary> expertTypeDictionaryList = expertTypeDictMap.get(userId);
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) {
expertApplyMetaVO.setExpertType(expertTypeDictionaryList.stream().map(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());


+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java Näytä tiedosto

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.expert.model.cmd;
import com.ningdatech.basic.model.PagePo;
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum;
import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -43,4 +44,7 @@ public class MetaApplyListQuery extends PagePo {
@ApiModelProperty("筛选结束时间")
private LocalDateTime applyEndTime;

@ApiModelProperty("专家类型")
private DictionaryFieldInfo expertType;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java Näytä tiedosto

@@ -72,5 +72,8 @@ public class ExpertApplyMetaVO {
@ApiModelProperty("申请时间")
private LocalDateTime applyTime;

@ApiModelProperty("专家类型")
private List<DictionaryFieldInfo> expertType;


}

Loading…
Peruuta
Tallenna