From 7a6100c35ea4aa908ed34e0fdb0ba82c84187c2b Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 21 Dec 2023 11:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E3=80=81?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E4=B8=93=E5=AE=B6=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pm/api/expert/controller/ExpertController.java | 4 +- .../hz/pm/api/expert/manage/ExpertAdminManage.java | 4 +- .../expert/model/ExpertAdminExpertManageQuery.java | 51 ------ .../hz/pm/api/expert/model/ExpertLibraryReq.java | 53 +++++++ .../com/hz/pm/api/external/MhUserOrgClient.java | 76 +++++++++ .../hz/pm/api/external/model/dto/MhExpertDTO.java | 22 +++ .../com/hz/pm/api/external/model/dto/MhOrgDTO.java | 24 +++ .../com/hz/pm/api/external/model/dto/MhRetDTO.java | 35 +++++ .../api/external/model/dto/MhReviewExpertDTO.java | 172 +++++++++++++++++++++ .../pm/api/external/model/dto/MhTechExpertDTO.java | 158 +++++++++++++++++++ .../hz/pm/api/external/model/dto/MhUserDTO.java | 45 ++++++ .../hz/pm/api/meeting/manage/MeetingManage.java | 16 +- 12 files changed, 598 insertions(+), 62 deletions(-) delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertAdminExpertManageQuery.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java index b29c1d9..1a79206 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java @@ -3,7 +3,7 @@ package com.hz.pm.api.expert.controller; import com.hz.pm.api.expert.manage.ExpertAdminManage; import com.hz.pm.api.expert.manage.ExpertManage; -import com.hz.pm.api.expert.model.ExpertAdminExpertManageQuery; +import com.hz.pm.api.expert.model.ExpertLibraryReq; import com.hz.pm.api.expert.model.req.AdminExpertBasicInfoModifyRequest; import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest; import com.hz.pm.api.expert.model.req.ExpertUserBasicInfoSubmitRequest; @@ -96,7 +96,7 @@ public class ExpertController { @PostMapping("/expert-library/list") @ApiOperation("专家库列表查询接口") - public PageVo getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) { + public PageVo getExpertLibraryList(@RequestBody @Valid ExpertLibraryReq query) { return expertAdminManage.getExpertLibraryList(query); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java index 3f5f403..c06e78b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java @@ -77,7 +77,7 @@ public class ExpertAdminManage { * @param query * @return */ - public PageVo getExpertLibraryList(ExpertAdminExpertManageQuery query) { + public PageVo getExpertLibraryList(ExpertLibraryReq query) { Long userId = LoginUserUtil.getUserId(); ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(query, userId); if (queryCmd.isHasNonData()) { @@ -92,7 +92,7 @@ public class ExpertAdminManage { } - private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(ExpertAdminExpertManageQuery query, Long userId) { + private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(ExpertLibraryReq query, Long userId) { ExpertAdminExpertManageQueryCmd queryCmd = new ExpertAdminExpertManageQueryCmd(); queryCmd.setPageNumber(query.getPageNumber()); queryCmd.setPageSize(query.getPageSize()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertAdminExpertManageQuery.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertAdminExpertManageQuery.java deleted file mode 100644 index a13f4be..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertAdminExpertManageQuery.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.hz.pm.api.expert.model; - - -import com.ningdatech.basic.model.PagePo; -import com.hz.pm.api.meta.model.ExpertRegionInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author liuxinxin - * @date 2022/8/4 上午10:18 - */ -@Data -@ApiModel("专家库筛选接口") -public class ExpertAdminExpertManageQuery extends PagePo { - - @ApiModelProperty("专家姓名(精准匹配)") - private String expertName; - - @ApiModelProperty("工作单位(模糊匹配)") - private String company; - - @ApiModelProperty("职称级别字典编码") - private String titleLevelDictionaryCode; - - @ApiModelProperty("单位属性字典编码") - private String companyAttributeDictionaryCode; - - @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") - private String expertAccountStatus; - - @ApiModelProperty("专家区域区域信息") - private ExpertRegionInfo expertRegionInfo; - - @ApiModelProperty("履职意向地区域信息") - private ExpertRegionInfo intentionRegionInfo; - - @ApiModelProperty(value = "是否浙政钉用户") - private Boolean isDingUser; - - @ApiModelProperty("内外围字典编码") - private String expertTypeDictionaryCode; - - @ApiModelProperty("专家来源标签编码") - private String expertSourceTagCode; - - @ApiModelProperty("擅长方向标签编码") - private String goodAtTagCode; - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java new file mode 100644 index 0000000..e8820b3 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java @@ -0,0 +1,53 @@ +package com.hz.pm.api.expert.model; + + +import com.ningdatech.basic.model.PagePo; +import com.hz.pm.api.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author liuxinxin + * @date 2022/8/4 上午10:18 + */ +@Data +@ApiModel("专家库筛选接口") +@EqualsAndHashCode(callSuper = true) +public class ExpertLibraryReq extends PagePo { + + @ApiModelProperty("专家姓名(精准匹配)") + private String expertName; + + @ApiModelProperty("工作单位(模糊匹配)") + private String company; + + @ApiModelProperty("职称级别字典编码") + private String titleLevelDictionaryCode; + + @ApiModelProperty("单位属性字典编码") + private String companyAttributeDictionaryCode; + + @ApiModelProperty(value = "专家账号状态", allowableValues = "冻结:freezing,正常:normal") + private String expertAccountStatus; + + @ApiModelProperty("专家区域区域信息") + private ExpertRegionInfo expertRegionInfo; + + @ApiModelProperty("履职意向地区域信息") + private ExpertRegionInfo intentionRegionInfo; + + @ApiModelProperty(value = "是否浙政钉用户") + private Boolean isDingUser; + + @ApiModelProperty("专家类型:评审专家(300000)、技术专家(300001)") + private String expertTypeDictionaryCode; + + @ApiModelProperty("专家来源标签编码") + private String expertSourceTagCode; + + @ApiModelProperty("擅长方向标签编码") + private String goodAtTagCode; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java new file mode 100644 index 0000000..6ca7615 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java @@ -0,0 +1,76 @@ +package com.hz.pm.api.external; + +import cn.hutool.core.codec.Base64; +import cn.hutool.core.codec.Base64Encoder; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.lang.TypeReference; +import cn.hutool.core.map.MapUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; +import com.hz.pm.api.external.model.dto.MhExpertDTO; +import com.hz.pm.api.external.model.dto.MhOrgDTO; +import com.hz.pm.api.external.model.dto.MhRetDTO; +import com.hz.pm.api.external.model.dto.MhUserDTO; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.net.URLEncoder; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMATTER; + +/** + *

+ * UserOrgClient + *

+ * + * @author WendyYang + * @since 20:41 2023/12/20 + */ +@Component +public class MhUserOrgClient { + + @Value("${xc.api-host:}") + private String xcApiHost; + + public static final String UNIT_URL = "/sync/unit"; + public static final String USER_URL = "/sync/user"; + public static final String EXPERT_URL = "/sync/expert"; + + public MhRetDTO> queryOrges() { + String requestUrl = xcApiHost + UNIT_URL; + String retBody = HttpUtil.get(requestUrl); + return JSONUtil.toBean(retBody, new TypeReference>>() { + }, false); + } + + public MhRetDTO> queryUsers(LocalDateTime syncDateTime) { + String requestUrl = xcApiHost + USER_URL; + if (syncDateTime != null) { + String timeString = LocalDateTimeUtil.format(syncDateTime, NORM_DATETIME_FORMATTER); + requestUrl = "?syncDateTime=" + timeString; + } + String retBody = HttpUtil.get(requestUrl); + return JSONUtil.toBean(retBody, new TypeReference>>() { + }, false); + } + + public MhRetDTO queryExperts(LocalDateTime syncDateTime) { + String requestUrl = xcApiHost + EXPERT_URL; + if (syncDateTime != null) { + String timeString = LocalDateTimeUtil.format(syncDateTime, NORM_DATETIME_FORMATTER); + requestUrl = "?syncDateTime=" + timeString; + } + String retBody = HttpUtil.get(requestUrl); + return JSONUtil.toBean(retBody, new TypeReference>() { + }, false); + } + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java new file mode 100644 index 0000000..39ccbdb --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java @@ -0,0 +1,22 @@ +package com.hz.pm.api.external.model.dto; + +import lombok.Data; + +import java.util.List; + +/** + *

+ * MhExpertDTO + *

+ * + * @author WendyYang + * @since 22:11 2023/12/20 + */ +@Data +public class MhExpertDTO { + + private List technicalExpertVOList; + + private List reviewExpertVOList; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java new file mode 100644 index 0000000..c3d5dd7 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java @@ -0,0 +1,24 @@ +package com.hz.pm.api.external.model.dto; + +import lombok.Data; + +/** + *

+ * OrgDTO-信创组织同步实体 + *

+ * + * @author WendyYang + * @since 20:42 2023/12/20 + */ +@Data +public class MhOrgDTO { + + private String sortNum; + + private Long unitId; + + private String unitName; + + private Long unitPid; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java new file mode 100644 index 0000000..7aead49 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java @@ -0,0 +1,35 @@ +package com.hz.pm.api.external.model.dto; + +import lombok.Data; + +/** + *

+ * XcRetDTO + *

+ * + * @author WendyYang + * @since 20:46 2023/12/20 + */ +@Data +public class MhRetDTO { + + /** + * 成功状态码 + */ + private static final int OK_CODE = 200; + /** + * 失败状态码 + */ + private static final int FAIL_CODE = 500; + + private Integer code; + + private String msg; + + private T data; + + public boolean isOk() { + return OK_CODE == this.code; + } + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java new file mode 100644 index 0000000..fc45e1e --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java @@ -0,0 +1,172 @@ +package com.hz.pm.api.external.model.dto; + +import lombok.Data; + +/** + *

+ * MhReviewExpertDTO + *

+ * + * @author WendyYang + * @since 22:51 2023/12/20 + */ +@Data +public class MhReviewExpertDTO { + + /** + * 主键ID + */ + private String id; + + /** + * 专家编号 + */ + private String expertNo; + + /** + * 姓名 + */ + private String name; + + /** + * 性别 + */ + private String gender; + + /** + * 民族 + */ + private String nation; + + /** + * 籍贯 + */ + private String nativePlace; + + /** + * 生日 + */ + private Long birthday; + + /** + * 政治面貌 + */ + private String political; + + /** + * 学历 + */ + private String education; + + /** + * 毕业院校及专业方向 + */ + private String school; + + /** + * 专业职称及评定时间 + */ + private String title; + + /** + * 职务 + */ + private String duties; + + /** + * 专业特长 + */ + private String skills; + + /** + * 经验 + */ + private String experience; + + /** + * 单位性质 + */ + private String nature; + + /** + * 单位意思 + */ + private String evaluate; + + /** + * 所属领域 + */ + private String area; + + /** + * 所在单位 + */ + private String unit; + + /** + * 通讯地址 + */ + private String place; + + /** + * 邮箱 + */ + private String email; + + /** + * 座机 + */ + private String tel; + + /** + * 手机号 + */ + private String phone; + + /** + * 报名日期 + */ + private long signTime; + + /** + * 分级 + */ + private String grade; + + /** + * 专家级别 + */ + private String expertLevel; + + /** + * 是否入库 + */ + private String isPut; + + /** + * 入库时间 + */ + private String inPutTime; + + /** + * 头像 + */ + private String filePhoto; + + /** + * 微信公众号openId + */ + private String openId; + + /** + * 码的颜色 + * 1:绿码 2:黄码 3:红码 + */ + private Integer star; + + /** + * 工作简历 + */ + private String remark; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java new file mode 100644 index 0000000..d92e568 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java @@ -0,0 +1,158 @@ +package com.hz.pm.api.external.model.dto; + +import cn.hutool.core.collection.CollUtil; +import lombok.Data; + +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * MhTechExpertDTO + *

+ * + * @author WendyYang + * @since 22:59 2023/12/20 + */ +@Data +public class MhTechExpertDTO { + + /** + * 主键ID + */ + private String id; + /** + * 专家编号 + */ + private String expertNo; + /** + * 姓名 + */ + private String name; + /** + * 性别 + */ + private String gender; + /** + * 生日 + */ + private Long birthday; + /** + * 身份证号 + */ + private String idCard; + /** + * 政治面貌 + */ + private String political; + /** + * 学历 + */ + private String education; + /** + * 专家来源 + */ + private String expertCate; + /** + * 专家级别 + */ + private String expertLevel; + /** + * 企业ID + */ + private String companyId; + /** + * 发证日期 + */ + private String cartDate; + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private String createUser; + /** + * 专业技术资格 + */ + private String credentialsSpeciality; + /** + * 信创技术资格 + */ + private String credentialsTechnology; + /** + * 学位证书 + */ + private String fileDegree; + /** + * 学历证书 + */ + private String fileDiploma; + /** + * 专家身份证 + */ + private String fileIdCard; + /** + * 其他附件 + */ + private String fileOther; + /** + * 专家照片 + */ + private String filePhoto; + /** + * 专家推荐表 + */ + private String fileRecommend; + /** + * 社保记录 + */ + private String fileSocial; + /** + * 微信公众号openId + */ + private String openId; + /** + * 手机号 + */ + private String phone; + /** + * 入库时间 + */ + private String inPutTime; + /** + * 是否入库 + */ + private String isPut; + /** + * 1:绿码 2:黄码 3:红码 + */ + private Integer star; + /** + * 信创工作相关经验 + */ + private String textExperience; + /** + * 信息化相关简历 + */ + private String textNotes; + /** + * 专业特长 + */ + private String skills; + + + public static void main(String[] args) { + List collect = Arrays.stream(MhReviewExpertDTO.class.getDeclaredFields()).map(w -> w.getName()).sorted().collect(Collectors.toList()); + List collect1 = Arrays.stream(MhTechExpertDTO.class.getDeclaredFields()).map(w -> w.getName()).sorted().collect(Collectors.toList()); + + System.out.println(CollUtil.intersection(collect1, collect)); + System.out.println(CollUtil.subtract(collect1, collect)); + System.out.println(CollUtil.subtract(collect, collect1)); + + } + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java new file mode 100644 index 0000000..9549b50 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java @@ -0,0 +1,45 @@ +package com.hz.pm.api.external.model.dto; + +import lombok.Data; + +/** + *

+ * XcUserDTO + *

+ * + * @author WendyYang + * @since 21:06 2023/12/20 + */ +@Data +public class MhUserDTO { + + /** + * 用户账号 + */ + private String account; + /** + * 浙政钉账号ID + */ + private String accountId; + /** + * 是否是浙政钉账号 + */ + private Boolean isZzdAccount; + /** + * 用户所属组织ID + */ + private Long mhUnitId; + /** + * 用户状态 + */ + private Integer status; + /** + * 用户ID + */ + private String userId; + /** + * 用户姓名 + */ + private String userName; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index 4666377..d9c7e2b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -624,13 +624,15 @@ public class MeetingManage { result.setAvoidInfo(vo); } else { List appoints = groupByType.get(APPOINT); - ExpertInviteRule appoint = appoints.get(0); - AppointInviteRuleDTO appointRule = JSON.parseObject(appoint.getInviteRule(), AppointInviteRuleDTO.class); - appointRule.setId(appoint.getId()); - AppointRuleVO vo = new AppointRuleVO(); - vo.setInviteDesc(appointRule.getInviteDesc()); - vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values())); - result.setAppointRule(vo); + if (!CollUtil.isEmpty(appoints)) { + ExpertInviteRule appoint = appoints.get(0); + AppointInviteRuleDTO appointRule = JSON.parseObject(appoint.getInviteRule(), AppointInviteRuleDTO.class); + appointRule.setId(appoint.getId()); + AppointRuleVO vo = new AppointRuleVO(); + vo.setInviteDesc(appointRule.getInviteDesc()); + vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values())); + result.setAppointRule(vo); + } } return result; }