Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 year ago
parent
commit
ff8fb43241
10 changed files with 120 additions and 8 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java
  2. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java
  3. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java
  4. +43
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java
  5. +13
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java
  6. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java
  7. +26
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java
  8. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java
  9. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  10. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java View File

@@ -384,7 +384,7 @@ public class ExpertUserInfoAssembler {
}
expertUserFullInfoDTO.setRetiredAt(expertUserFullInfo.getRetiredAt());
expertUserFullInfoDTO.setCompany(expertUserFullInfo.getCompany());
// expertUserFullInfoDTO.setCompanyUniqCode(expertUserFullInfo.getCompanyUniqCode());
expertUserFullInfoDTO.setCompanyUniqCode(expertUserFullInfo.getCompanyUniqCode());
expertUserFullInfoDTO.setLegalEntityCode(expertUserFullInfo.getLegalEntityCode());
expertUserFullInfoDTO.setAdministrativeDuties(expertUserFullInfo.getAdministrativeDuties());
expertUserFullInfoDTO.setStartWorkAt(expertUserFullInfo.getStartWorkAt());


+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java View File

@@ -7,9 +7,11 @@ import com.ningdatech.pmapi.expert.manage.ExpertManage;
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery;
import com.ningdatech.pmapi.expert.model.req.AdminExpertBasicInfoModifyRequest;
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.ningdatech.pmapi.expert.model.req.GetZzdInfoRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO;
import com.ningdatech.pmapi.expert.model.vo.ExpertBasicInfoModifyResultVO;
import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO;
import com.ningdatech.pmapi.expert.model.vo.ZzdInfoByMobileVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -67,4 +69,10 @@ public class ExpertController {
// ExpertUserInfoValidator.expertBasicInfoModifyRequestValidate(request);
return expertAdminManage.adminModifyExpertBasicInfo(request);
}

@PostMapping("/get-zzd-info")
@ApiOperation("获取浙政钉用户信息")
public ZzdInfoByMobileVO getZzdInfo(@Valid @RequestBody GetZzdInfoRequest request) {
return expertAdminManage.getZzdInfo(request);
}
}

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java View File

@@ -71,6 +71,8 @@ public class ExpertUserFullInfo implements Serializable {

private String company;

private String companyUniqCode;

private String legalEntityCode;

private String administrativeDuties;


+ 43
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java View File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum;
import com.ningdatech.pmapi.common.helper.RegionLimitHelper;
@@ -25,9 +26,11 @@ import com.ningdatech.pmapi.expert.model.dto.ExpertAdminExpertManageListDTO;
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery;
import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery;
import com.ningdatech.pmapi.expert.model.req.AdminExpertBasicInfoModifyRequest;
import com.ningdatech.pmapi.expert.model.req.GetZzdInfoRequest;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO;
import com.ningdatech.pmapi.expert.model.vo.ExpertBasicInfoModifyResultVO;
import com.ningdatech.pmapi.expert.model.vo.ZzdInfoByMobileVO;
import com.ningdatech.pmapi.expert.service.ExpertAdminManageService;
import com.ningdatech.pmapi.expert.service.ExpertInfoService;
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService;
@@ -35,7 +38,13 @@ import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.constant.ExpertTagEnum;
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.ningdatech.zwdd.client.ZwddClient;
import com.ningdatech.zwdd.model.dto.DingInfoByMobileDTO;
import com.ningdatech.zwdd.model.dto.DingOrgInfoDTO;
import com.ningdatech.zwdd.model.dto.EmployeeInfoDTO;
import com.ningdatech.zwdd.model.dto.EmployeePositionsDTO;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

@@ -60,6 +69,7 @@ public class ExpertAdminManage {
private final ExpertMetaApplyManage expertMetaApplyManage;
private final ExpertAdminManageService expertAdminManageService;
private final ExpertAdminExpertManageAssembler expertAdminExpertManageAssembler;
private final ZwddClient zwddClient;

/**
* 专家管理员使用 专家库列表查询
@@ -218,4 +228,37 @@ public class ExpertAdminManage {
}
return new ExpertBasicInfoModifyResultVO(false);
}


public ZzdInfoByMobileVO getZzdInfo(GetZzdInfoRequest request) {
ZzdInfoByMobileVO zzdInfoByMobileVO = new ZzdInfoByMobileVO();
String phoneNo = request.getPhoneNo();
zzdInfoByMobileVO.setPhoneNo(phoneNo);

GenericResult<DingInfoByMobileDTO> dingInfoByMobile = zwddClient.getDingInfoByMobile(phoneNo);
DingInfoByMobileDTO dingInfo = dingInfoByMobile.getData();
if (Objects.nonNull(dingInfo) && StringUtils.isNotBlank(dingInfo.getEmployeeCode())) {
zzdInfoByMobileVO.setIsDingUser(true);
String employeeCode = dingInfo.getEmployeeCode();
GenericResult<List<EmployeePositionsDTO>> listGenericResult = zwddClient.listEmployeePositionsByEmployeeCode(employeeCode);
List<EmployeePositionsDTO> employeePositionsDTOS = listGenericResult.getData();
if (CollectionUtils.isNotEmpty(employeePositionsDTOS)) {
EmployeePositionsDTO employeePositionsDTO = employeePositionsDTOS.get(0);
String organizationCode = employeePositionsDTO.getOrganizationCode();
GenericResult<DingOrgInfoDTO> dingOrgInfoDTOGenericResult = zwddClient.getOrganizationByCode(organizationCode);
DingOrgInfoDTO organizationByCode = dingOrgInfoDTOGenericResult.getData();
String organizationName = organizationByCode.getOrganizationName();
zzdInfoByMobileVO.setCompanyName(organizationName);
}
GenericResult<EmployeeInfoDTO> infoDTOGenericResult = zwddClient.getEmployeeByCode(employeeCode);
EmployeeInfoDTO employeeInfoDTO = infoDTOGenericResult.getData();
if (Objects.nonNull(employeeInfoDTO)) {
String employeeName = employeeInfoDTO.getEmployeeName();
zzdInfoByMobileVO.setName(employeeName);
}
} else {
zzdInfoByMobileVO.setIsDingUser(false);
}
return zzdInfoByMobileVO;
}
}

+ 13
- 3
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java View File

@@ -17,6 +17,7 @@ import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd;
import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO;
import com.ningdatech.pmapi.expert.model.dto.ExpertFullInfoAllDTO;
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO;
import com.ningdatech.pmapi.expert.service.ExpertInfoService;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
@@ -53,6 +54,7 @@ public class ExpertManage {
private final FileService fileService;
private final ExpertUserInfoAssembler expertUserInfoAssembler;
private final IUserInfoService iUserInfoService;
private final ExpertMetaApplyManage expertMetaApplyManage;


/**
@@ -98,12 +100,19 @@ public class ExpertManage {
List<DictionaryFieldInfo> recommendedWay = recommendInfo.getRecommendedWay();
// 推荐方式
List<FileBasicInfo> recommendProofFile = recommendInfo.getRecommendationProofFile();
expertRecommendProofSubmit(recommendedWay, recommendProofFile, userId);
Long applyId = expertRecommendProofSubmit(recommendedWay, recommendProofFile, userId);

// 批量通过专家管理员审核
MetaApplyResultRequest applyResult = new MetaApplyResultRequest();
applyResult.setApplyId(applyId);
applyResult.setAuditOpinion("同意");
applyResult.setApplyResult(true);
expertMetaApplyManage.metaApplyResult(applyResult);
}


@Transactional(rollbackFor = Exception.class)
public void expertRecommendProofSubmit(List<DictionaryFieldInfo> recommendedWay, List<FileBasicInfo> recommendProofFile, Long expertUserId) {
public Long expertRecommendProofSubmit(List<DictionaryFieldInfo> recommendedWay, List<FileBasicInfo> recommendProofFile, Long expertUserId) {
// 用户id
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId);
// 判断专家状态,是否可以进行证明材料提交
@@ -129,7 +138,8 @@ public class ExpertManage {
}
expertRecommendProofSaveCmd.setRecommendedWay(recommendedWayDictionaryDTOList);
expertRecommendProofSaveCmd.setUserId(expertUserId);
expertInfoService.expertRecommendProofSave(expertRecommendProofSaveCmd);
Long applyId = expertInfoService.expertRecommendProofSave(expertRecommendProofSaveCmd);
return applyId;
}

public ExpertFullInfoVO getExpertFullInfoDetail(Long expertUserId) {


+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java View File

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.expert.model.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
* @author liuxinxin
* @date 2022/8/29 下午2:54
*/
@Data
@ApiModel(description = "通过手机号获取浙政钉信息请求")
public class GetZzdInfoRequest {

@NotBlank
@ApiModelProperty("手机号")
private String phoneNo;
}

+ 26
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java View File

@@ -0,0 +1,26 @@
package com.ningdatech.pmapi.expert.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author liuxinxin
* @date 2022/8/29 下午3:21
*/
@Data
@ApiModel("通过浙政钉获取手机号数据展示VO")
public class ZzdInfoByMobileVO {

@ApiModelProperty("手机号")
private String phoneNo;

@ApiModelProperty("公司名")
private String companyName;

@ApiModelProperty("姓名")
private String name;

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

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java View File

@@ -19,7 +19,7 @@ public interface ExpertInfoService {
*
* @param expertRecommendProofSaveCmd
*/
void expertRecommendProofSave(ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd);
Long expertRecommendProofSave(ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd);

void expertIntentionApplyDeal(ExpertIntentionApplyDealCmd expertIntentionApplyDealCmd);



+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java View File

@@ -179,6 +179,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
expertUserFullInfo.setRecommendationProofFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getRecommendationProofFileIdList()));
}
expertUserFullInfo.setRemark(expertUserInfoDTO.getRemark());
expertUserFullInfo.setCompanyUniqCode(expertUserFullInfo.getCompanyUniqCode());
return expertUserFullInfo;
}

@@ -231,7 +232,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {

@Override
@Transactional(rollbackFor = Exception.class)
public void expertRecommendProofSave(ExpertRecommendProofSaveCmd cmd) {
public Long expertRecommendProofSave(ExpertRecommendProofSaveCmd cmd) {
// 保存专家证明材料
Long userId = cmd.getUserId();
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId);
@@ -263,6 +264,8 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
expertRegionApply.setUserId(userId);
expertRegionApply.setDisplayEnable(BoolDisplayEnum.Y.name());
iExpertMetaApplyService.save(expertRegionApply);

return expertRegionApply.getId();
}

@Override


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -158,11 +158,11 @@ public class UserInfoManage {
* @param userRoleList
*/
private List<String> getRoleCompliantEmployeeCodeList(List<UserRoleVO> userRoleList) {
userRoleList = userRoleList.stream().filter(r -> Objects.nonNull(r.getId())).collect(Collectors.toList());
if (CollUtil.isEmpty(userRoleList)) {
return null;
}
List<Long> roleIdList = iUserRoleService.list()
.stream().map(UserRole::getRoleId).collect(Collectors.toList());
List<Long> roleIdList = userRoleList.stream().map(UserRoleVO::getId).collect(Collectors.toList());

List<Long> compliantUserIdList = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class)
.in(UserRole::getRoleId, roleIdList)).stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());


Loading…
Cancel
Save