Browse Source

增加用户、组织、专家同步接口

master
WendyYang 10 months ago
parent
commit
7a6100c35e
11 changed files with 549 additions and 13 deletions
  1. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java
  2. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java
  3. +4
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java
  4. +76
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java
  5. +22
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java
  6. +24
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java
  7. +35
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java
  8. +172
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java
  9. +158
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java
  10. +45
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java
  11. +9
    -7
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java

+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/controller/ExpertController.java View File

@@ -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<ExpertLibraryListItemVO> getExpertLibraryList(@RequestBody @Valid ExpertAdminExpertManageQuery query) {
public PageVo<ExpertLibraryListItemVO> getExpertLibraryList(@RequestBody @Valid ExpertLibraryReq query) {
return expertAdminManage.getExpertLibraryList(query);
}



+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java View File

@@ -77,7 +77,7 @@ public class ExpertAdminManage {
* @param query
* @return
*/
public PageVo<ExpertLibraryListItemVO> getExpertLibraryList(ExpertAdminExpertManageQuery query) {
public PageVo<ExpertLibraryListItemVO> 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());


hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertAdminExpertManageQuery.java → hz-pm-api/src/main/java/com/hz/pm/api/expert/model/ExpertLibraryReq.java View File

@@ -6,6 +6,7 @@ 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
@@ -13,7 +14,8 @@ import lombok.Data;
*/
@Data
@ApiModel("专家库筛选接口")
public class ExpertAdminExpertManageQuery extends PagePo {
@EqualsAndHashCode(callSuper = true)
public class ExpertLibraryReq extends PagePo {

@ApiModelProperty("专家姓名(精准匹配)")
private String expertName;
@@ -39,7 +41,7 @@ public class ExpertAdminExpertManageQuery extends PagePo {
@ApiModelProperty(value = "是否浙政钉用户")
private Boolean isDingUser;

@ApiModelProperty("内外围字典编码")
@ApiModelProperty("专家类型:评审专家(300000)、技术专家(300001)")
private String expertTypeDictionaryCode;

@ApiModelProperty("专家来源标签编码")

+ 76
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/MhUserOrgClient.java View File

@@ -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;

/**
* <p>
* UserOrgClient
* </p>
*
* @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<List<MhOrgDTO>> queryOrges() {
String requestUrl = xcApiHost + UNIT_URL;
String retBody = HttpUtil.get(requestUrl);
return JSONUtil.toBean(retBody, new TypeReference<MhRetDTO<List<MhOrgDTO>>>() {
}, false);
}

public MhRetDTO<List<MhUserDTO>> 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<MhRetDTO<List<MhUserDTO>>>() {
}, false);
}

public MhRetDTO<MhExpertDTO> 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<MhRetDTO<MhExpertDTO>>() {
}, false);
}

}

+ 22
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhExpertDTO.java View File

@@ -0,0 +1,22 @@
package com.hz.pm.api.external.model.dto;

import lombok.Data;

import java.util.List;

/**
* <p>
* MhExpertDTO
* </p>
*
* @author WendyYang
* @since 22:11 2023/12/20
*/
@Data
public class MhExpertDTO {

private List<MhTechExpertDTO> technicalExpertVOList;

private List<MhReviewExpertDTO> reviewExpertVOList;

}

+ 24
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhOrgDTO.java View File

@@ -0,0 +1,24 @@
package com.hz.pm.api.external.model.dto;

import lombok.Data;

/**
* <p>
* OrgDTO-信创组织同步实体
* </p>
*
* @author WendyYang
* @since 20:42 2023/12/20
*/
@Data
public class MhOrgDTO {

private String sortNum;

private Long unitId;

private String unitName;

private Long unitPid;

}

+ 35
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhRetDTO.java View File

@@ -0,0 +1,35 @@
package com.hz.pm.api.external.model.dto;

import lombok.Data;

/**
* <p>
* XcRetDTO
* </p>
*
* @author WendyYang
* @since 20:46 2023/12/20
*/
@Data
public class MhRetDTO<T> {

/**
* 成功状态码
*/
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;
}

}

+ 172
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhReviewExpertDTO.java View File

@@ -0,0 +1,172 @@
package com.hz.pm.api.external.model.dto;

import lombok.Data;

/**
* <p>
* MhReviewExpertDTO
* </p>
*
* @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;

}

+ 158
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhTechExpertDTO.java View File

@@ -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;

/**
* <p>
* MhTechExpertDTO
* </p>
*
* @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<String> collect = Arrays.stream(MhReviewExpertDTO.class.getDeclaredFields()).map(w -> w.getName()).sorted().collect(Collectors.toList());
List<String> 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));

}

}

+ 45
- 0
hz-pm-api/src/main/java/com/hz/pm/api/external/model/dto/MhUserDTO.java View File

@@ -0,0 +1,45 @@
package com.hz.pm.api.external.model.dto;

import lombok.Data;

/**
* <p>
* XcUserDTO
* </p>
*
* @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;

}

+ 9
- 7
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java View File

@@ -624,13 +624,15 @@ public class MeetingManage {
result.setAvoidInfo(vo);
} else {
List<ExpertInviteRule> 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;
}


Loading…
Cancel
Save