Merge branch 'feature/REQ-3488-syl' into 'feature/REQ-3488'
feat(REQ-3488): 人员异动记录api调整 See merge request universal/infrastructure/backend/orgmanax!93
This commit is contained in:
commit
a5ea6b4f22
@ -0,0 +1,27 @@
|
|||||||
|
package cn.axzo.orgmanax.api.nodeuser.feign;
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageResp;
|
||||||
|
import cn.axzo.foundation.result.ApiResult;
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.req.PageOrgUserChangedRecordReq;
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.resp.OrgUserChangedRecordResp;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织人员异动api
|
||||||
|
* TODO: 第三期实现
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
value = "orgmanax",
|
||||||
|
url = "${axzo.service.orgmanax:http://orgmanax:8080}")
|
||||||
|
public interface OrgUserChangeRecordApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员异动记录分页查询
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/org/user/changed-record/page")
|
||||||
|
ApiResult<PageResp<OrgUserChangedRecordResp>> page(@RequestBody @Valid PageOrgUserChangedRecordReq req);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.axzo.orgmanax.dto.nodeuser.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description
|
||||||
|
* 人员异动场景
|
||||||
|
* @author luofu
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/10/24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
|
public enum OrgUserChangedScenarioEnum {
|
||||||
|
|
||||||
|
JOINED("JOINED", "加入"),
|
||||||
|
WITHDRAW("WITHDRAW", "离开<单位:离职,项目:退场>"),
|
||||||
|
LEAVED("LEAVED", "离场"),
|
||||||
|
CHANGED("CHANGED", "部门岗位变更");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
public static Optional<OrgUserChangedScenarioEnum> codeOf(String code) {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.filter(e -> Objects.equals(code, e.code))
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OrgUserChangedScenarioEnum codeOfThrowException(String code) {
|
||||||
|
return codeOf(code)
|
||||||
|
.orElseThrow(() -> new RuntimeException(String.format("invalid code.[%s]", code)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package cn.axzo.orgmanax.dto.nodeuser.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Optional;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description
|
||||||
|
* 人员在组织中的状态
|
||||||
|
* @author luofu
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/10/24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
|
public enum OrgUserStatusEnum {
|
||||||
|
|
||||||
|
INACTIVE(0, "入场中"), ACTIVE(1, "已入场"), LEAVE(3, "离场"),
|
||||||
|
WITHDRAW(4, "退场"), JOINED(5, "在职"), QUIT(6, "离职"),
|
||||||
|
NONE(-1, "非法值");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
public boolean isEqual(int code) {
|
||||||
|
return this.code == code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Optional<OrgUserStatusEnum> codeOf(int code) {
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.filter(e -> e.code == code)
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OrgUserStatusEnum codeOfThrowException(int code) {
|
||||||
|
return codeOf(code).orElseThrow(() -> new RuntimeException(String.format("invalid code.[%d]", code)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
package cn.axzo.orgmanax.dto.nodeuser.req;
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageReqV2;
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.enums.OrgUserChangedScenarioEnum;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PageOrgUserChangedRecordReq extends PageReqV2 {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自然人id集合
|
||||||
|
*/
|
||||||
|
private Set<Long> personIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
private Long workspaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位id
|
||||||
|
*/
|
||||||
|
private Collection<Long> ouIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员异动场景列表
|
||||||
|
* @see OrgUserChangedScenarioEnum
|
||||||
|
*/
|
||||||
|
private Collection<String> scenarios;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜素关键字:
|
||||||
|
* 1、姓名模糊匹配;
|
||||||
|
* 2、手机号精确匹配;
|
||||||
|
*/
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询的开始时间
|
||||||
|
*/
|
||||||
|
private Date beginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询的结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要每个person 最新的记录
|
||||||
|
* 默认 不需要
|
||||||
|
*/
|
||||||
|
private Boolean needLatestFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,182 @@
|
|||||||
|
package cn.axzo.orgmanax.dto.nodeuser.resp;
|
||||||
|
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.enums.OrgUserStatusEnum;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author luofu
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/10/27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OrgUserBasicInfoResp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -417565663936325962L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态
|
||||||
|
* @see OrgUserStatusEnum
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserNodeInfoDTO> orgNodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserJobInfoDTO> jobs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserRoleDTO> roles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属主管信息
|
||||||
|
*/
|
||||||
|
private DirectManagerDTO directManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class OrgUserNodeInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1553728683787221674L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶级部门id
|
||||||
|
*/
|
||||||
|
private Long topNodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门主管标识
|
||||||
|
*/
|
||||||
|
private boolean manager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称path,包含当前部门
|
||||||
|
*/
|
||||||
|
private List<String> path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class OrgUserJobInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4468117792583126437L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class OrgUserRoleDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6964230627747183642L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class DirectManagerDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 3009318843471722223L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属主管id
|
||||||
|
*/
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属主管名称
|
||||||
|
*/
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属主管手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
package cn.axzo.orgmanax.dto.nodeuser.resp;
|
||||||
|
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.enums.OrgUserChangedScenarioEnum;
|
||||||
|
import cn.axzo.orgmanax.dto.nodeuser.enums.OrgUserStatusEnum;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OrgUserChangedRecordResp {
|
||||||
|
/**
|
||||||
|
* 自然人id
|
||||||
|
*/
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号,加密
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户真实姓名
|
||||||
|
*/
|
||||||
|
private String realName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位id
|
||||||
|
*/
|
||||||
|
private Long ouId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
private String ouName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
private Long workspaceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户名称
|
||||||
|
*/
|
||||||
|
private String workspaceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户类型
|
||||||
|
* GENERAL_ENT 总包企业级
|
||||||
|
* GENERAL_PROJECT 总包项目级
|
||||||
|
* GOVERNMENT 政务监管平台
|
||||||
|
* AGENCY_ENT 分包企业级
|
||||||
|
* OMS OMS工作台
|
||||||
|
*/
|
||||||
|
private String workspaceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员异动情景
|
||||||
|
* @see OrgUserChangedScenarioEnum
|
||||||
|
*/
|
||||||
|
private OrgUserChangedScenarioEnum scenario;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员组织架构信息
|
||||||
|
*/
|
||||||
|
private OrgUserBasicInfoResp orgUserInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录时间
|
||||||
|
*/
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人的id
|
||||||
|
*/
|
||||||
|
private Long operatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人姓名
|
||||||
|
*/
|
||||||
|
private String operatorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态
|
||||||
|
* @see OrgUserStatusEnum
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserBasicInfoResp.OrgUserNodeInfoDTO> orgNodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserBasicInfoResp.OrgUserJobInfoDTO> jobs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色列表
|
||||||
|
*/
|
||||||
|
private List<OrgUserBasicInfoResp.OrgUserRoleDTO> roles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直属主管信息
|
||||||
|
*/
|
||||||
|
private OrgUserBasicInfoResp.DirectManagerDTO directManager;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user