From 886ee69587d7a5e36c698876bbdf3e32de429973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Mon, 3 Apr 2023 10:41:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix=20=E4=B8=93=E5=AE=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E6=96=B0=E5=A2=9E=E4=B8=93=E5=AE=B6=E5=90=8E=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/expert/manage/ExpertManage.java | 16 +++++++++++++--- .../pmapi/expert/service/ExpertInfoService.java | 2 +- .../pmapi/expert/service/impl/ExpertInfoServiceImpl.java | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java index 0e20ce2..978ead5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java @@ -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 recommendedWay = recommendInfo.getRecommendedWay(); // 推荐方式 List 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 recommendedWay, List recommendProofFile, Long expertUserId) { + public Long expertRecommendProofSubmit(List recommendedWay, List 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) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java index c0b9aa0..02b34b5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java @@ -19,7 +19,7 @@ public interface ExpertInfoService { * * @param expertRecommendProofSaveCmd */ - void expertRecommendProofSave(ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd); + Long expertRecommendProofSave(ExpertRecommendProofSaveCmd expertRecommendProofSaveCmd); void expertIntentionApplyDeal(ExpertIntentionApplyDealCmd expertIntentionApplyDealCmd); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java index 50da3ed..63e6682 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java @@ -231,7 +231,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 +263,8 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { expertRegionApply.setUserId(userId); expertRegionApply.setDisplayEnable(BoolDisplayEnum.Y.name()); iExpertMetaApplyService.save(expertRegionApply); + + return expertRegionApply.getId(); } @Override From a63393fae9e845cb1340369622636f34a051aa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Mon, 3 Apr 2023 11:04:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E8=8E=B7=E5=8F=96=E6=B5=99=E6=94=BF=E9=92=89=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E4=B8=93=E5=AE=B6=E5=8D=95=E4=BD=8Dcode=20?= =?UTF-8?q?=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expert/assembler/ExpertUserInfoAssembler.java | 2 +- .../pmapi/expert/controller/ExpertController.java | 8 ++++ .../pmapi/expert/entity/ExpertUserFullInfo.java | 2 + .../pmapi/expert/manage/ExpertAdminManage.java | 43 ++++++++++++++++++++++ .../pmapi/expert/model/req/GetZzdInfoRequest.java | 20 ++++++++++ .../pmapi/expert/model/vo/ZzdInfoByMobileVO.java | 26 +++++++++++++ .../expert/service/impl/ExpertInfoServiceImpl.java | 1 + 7 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java index be44b6d..eb03406 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java @@ -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()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java index cc55bd1..2045526 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java @@ -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); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java index f2d426c..e69361e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java @@ -71,6 +71,8 @@ public class ExpertUserFullInfo implements Serializable { private String company; + private String companyUniqCode; + private String legalEntityCode; private String administrativeDuties; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java index 4593086..183d0c4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertAdminManage.java @@ -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 dingInfoByMobile = zwddClient.getDingInfoByMobile(phoneNo); + DingInfoByMobileDTO dingInfo = dingInfoByMobile.getData(); + if (Objects.nonNull(dingInfo) && StringUtils.isNotBlank(dingInfo.getEmployeeCode())) { + zzdInfoByMobileVO.setIsDingUser(true); + String employeeCode = dingInfo.getEmployeeCode(); + GenericResult> listGenericResult = zwddClient.listEmployeePositionsByEmployeeCode(employeeCode); + List employeePositionsDTOS = listGenericResult.getData(); + if (CollectionUtils.isNotEmpty(employeePositionsDTOS)) { + EmployeePositionsDTO employeePositionsDTO = employeePositionsDTOS.get(0); + String organizationCode = employeePositionsDTO.getOrganizationCode(); + GenericResult dingOrgInfoDTOGenericResult = zwddClient.getOrganizationByCode(organizationCode); + DingOrgInfoDTO organizationByCode = dingOrgInfoDTOGenericResult.getData(); + String organizationName = organizationByCode.getOrganizationName(); + zzdInfoByMobileVO.setCompanyName(organizationName); + } + GenericResult 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; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java new file mode 100644 index 0000000..9ee3f8d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/GetZzdInfoRequest.java @@ -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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java new file mode 100644 index 0000000..2db6d40 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ZzdInfoByMobileVO.java @@ -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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java index 63e6682..e880fde 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java @@ -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; } From ff0d2c3d1a3b696b03b6c3eec4ee2f9075925430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Mon, 3 Apr 2023 11:25:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=94=A8=E6=88=B7=20=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index c51f3a8..76b0ac4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -161,8 +161,7 @@ public class UserInfoManage { if (CollUtil.isEmpty(userRoleList)) { return null; } - List roleIdList = iUserRoleService.list() - .stream().map(UserRole::getRoleId).collect(Collectors.toList()); + List roleIdList = userRoleList.stream().map(UserRoleVO::getId).collect(Collectors.toList()); List compliantUserIdList = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class) .in(UserRole::getRoleId, roleIdList)).stream().map(UserRole::getUserId).distinct().collect(Collectors.toList()); From 5bcc169e0e1d9a97bcb4a229f7171a3ea261a420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Mon, 3 Apr 2023 11:45:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=E7=94=A8=E6=88=B7=20=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index 76b0ac4..badfff0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -158,6 +158,7 @@ public class UserInfoManage { * @param userRoleList */ private List getRoleCompliantEmployeeCodeList(List userRoleList) { + userRoleList = userRoleList.stream().filter(r -> Objects.nonNull(r.getId())).collect(Collectors.toList()); if (CollUtil.isEmpty(userRoleList)) { return null; }