Browse Source

专家库列表查询增加履职意向地

master
WendyYang 1 year ago
parent
commit
746fa1a834
10 changed files with 82 additions and 45 deletions
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/HmacAuthUtil.java
  3. +3
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java
  4. +47
    -37
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java
  5. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.java
  6. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml
  7. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAdminExpertManageQuery.java
  8. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java
  9. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java
  10. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAdminManageServiceImpl.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionLimitHelperImpl.java View File

@@ -76,6 +76,8 @@ public class RegionLimitHelperImpl extends AbstractRegionLimitHelper {
resultBoList.add(regionContainsBO);
}
}
} else {
resultBoList.add(queryRegionContainBo);
}
return resultBoList;
} else {


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/util/HmacAuthUtil.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.common.util;

import javafx.util.Pair;
import org.apache.commons.math3.util.Pair;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;


+ 3
- 4
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java View File

@@ -68,16 +68,14 @@ public class ExpertController {

@PostMapping("/expert-library/list")
@ApiOperation("专家库列表查询接口")
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(
@RequestBody @Valid ExpertAdminExpertManageQuery expertAdminExpertManageQuery) {
return expertAdminManage.getExpertLibraryList(expertAdminExpertManageQuery);
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) {
return expertAdminManage.getExpertLibraryList(query);
}

@PostMapping("/basic-info-modify")
@ApiOperation("专家信息编辑")
@WebLog("专家信息编辑")
public ExpertBasicInfoModifyResultVO expertBasicInfoModify(@Valid @RequestBody AdminExpertBasicInfoModifyRequest request) {
// ExpertUserInfoValidator.expertBasicInfoModifyRequestValidate(request);
return expertAdminManage.adminModifyExpertBasicInfo(request);
}

@@ -87,4 +85,5 @@ public class ExpertController {
public ZzdInfoByMobileVO getZzdInfo(@Valid @RequestBody GetZzdInfoRequest request) {
return expertAdminManage.getZzdInfo(request);
}

}

+ 47
- 37
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java View File

@@ -36,6 +36,7 @@ import com.ningdatech.pmapi.expert.service.ExpertInfoService;
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
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.user.util.LoginUserUtil;
import com.ningdatech.zwdd.client.ZwddClient;
@@ -49,6 +50,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

@@ -79,9 +81,8 @@ public class ExpertAdminManage {
*/
public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) {
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.setTotal(pageResult.getItemsTotal());
@@ -91,33 +92,33 @@ public class ExpertAdminManage {


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())) {
expertAdminExpertManageQueryCmd.setExpertName(query.getExpertName());
queryCmd.setExpertName(query.getExpertName());
}
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())) {
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())) {
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())) {
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<>();
if (StringUtils.isNotBlank(query.getExpertSourceTagCode())) {
@@ -136,42 +137,51 @@ public class ExpertAdminManage {
QueryExpertAccountStatusEnum queryExpertAccountStatusEnum = QueryExpertAccountStatusEnum.of(query.getExpertAccountStatus());
switch (queryExpertAccountStatusEnum) {
case NORMAL:
expertAdminExpertManageQueryCmd
.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE));
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.AVAILABLE));
break;
case FREEZING:
expertAdminExpertManageQueryCmd
.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.FREEZE));
queryCmd.setExpertAccountStatusList(CollectionUtil.toList(ExpertAccountStatusEnum.FREEZE));
break;
default:
break;
}
} 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()) {
expertAdminContainsRegionList = regionLimitHelper.getExpertAdminContainsRegion(userId);
} else {
expertAdminContainsRegionList = Collections.emptyList();
}

List<RegionContainsBO> containsRegion = new ArrayList<>();
List<RegionContainsBO> containsRegion = null;
if (Objects.nonNull(query.getExpertRegionInfo())) {
RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegionInfo().getRegionLevel()
, query.getExpertRegionInfo().getRegionCode());
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;
}
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;
}




+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.java View File

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.expert.mapper;

import com.ningdatech.pmapi.expert.model.query.ListExpertQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@@ -9,6 +10,7 @@ import java.util.List;
* @author liuxinxin
* @date 2022/8/5 上午10:27
*/
@Repository
public interface ExpertAdminManageMapper {

/**


+ 11
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml View File

@@ -41,6 +41,17 @@
</foreach>
)
</if>
<if test="query.intentionRegionList != null and query.intentionRegionList.size > 0">
AND exists(select 1 from expert_intention_work_region eiwr where eiwr.user_id = nd_expert_user_full_info.user_id and
<foreach collection="query.intentionRegionList" item="intentionRegions" open="(" close=")" separator="or">
(<![CDATA[ region_level>= #{intentionRegions.parentRegionTreeLevel} AND region_code IN ]]>
<foreach collection="intentionRegions.containsRegionCodeList" item="intentionRegionCode"
index="index" open="(" close=")" separator=",">#{intentionRegionCode}
</foreach>
)
</foreach>
)
</if>
</where>
ORDER BY update_on DESC
</sql>


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAdminExpertManageQuery.java View File

@@ -30,9 +30,12 @@ public class ExpertAdminExpertManageQuery extends PagePo {
@ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal")
private String expertAccountStatus;

@ApiModelProperty("区域信息")
@ApiModelProperty("专家区域区域信息")
private ExpertRegionInfo expertRegionInfo;

@ApiModelProperty("履职意向地区域信息")
private ExpertRegionInfo intentionRegionInfo;

@ApiModelProperty(value = "是否浙政钉用户")
private Boolean isDingUser;



+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java View File

@@ -45,6 +45,11 @@ public class ExpertAdminExpertManageQueryCmd extends CommonPageReq {
List<RegionContainsBO> regionContainsList;

/**
* 专家履职意向地区域范围
*/
List<RegionContainsBO> intentionRegionList;

/**
* 专家字典信息
*/
private List<ExpertDictionaryQuery> expertDictionaryQueryList;


+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java View File

@@ -44,6 +44,10 @@ public class ListExpertQuery {
* 专家管理区域范围
*/
List<RegionContainsBO> regionContainsList;
/**
* 专家管理区域范围
*/
List<RegionContainsBO> intentionRegionList;

/**
* 专家字典信息


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAdminManageServiceImpl.java View File

@@ -53,8 +53,8 @@ public class ExpertAdminManageServiceImpl implements ExpertAdminManageService {
userIdList.retainAll(tagUserIdList);
}

List<ExpertDictionaryQuery> expertDictionaryQueryList = listExpertQuery.getExpertDictionaryQueryList();
if (CollectionUtils.isNotEmpty(expertDictionaryQueryList)) {
List<ExpertDictionaryQuery> expertDictQueryList = listExpertQuery.getExpertDictionaryQueryList();
if (CollectionUtils.isNotEmpty(expertDictQueryList)) {
List<Long> dictionaryUserIdList = expertAdminManageMapper.listExpertDictionaryUserId(listExpertQuery);
userIdList.retainAll(dictionaryUserIdList);
}
@@ -118,6 +118,7 @@ public class ExpertAdminManageServiceImpl implements ExpertAdminManageService {
listExpertQuery.setExpertDictionaryQueryList(queryCmd.getExpertDictionaryQueryList());
listExpertQuery.setExpertTagQueryList(queryCmd.getExpertTagQueryList());
listExpertQuery.setRegionContainsList(queryCmd.getRegionContainsList());
listExpertQuery.setIntentionRegionList(queryCmd.getIntentionRegionList());
listExpertQuery.setIsDingUser(queryCmd.getIsDingUser());
listExpertQuery.setLimit(queryCmd.getLimit());
listExpertQuery.setOffset(queryCmd.getOffset());


Loading…
Cancel
Save