2 changed files with 95 additions and 0 deletions
@ -1,9 +1,58 @@ |
|||||
package com.project.ding.domain.dto; |
package com.project.ding.domain.dto; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import com.project.base.domain.dto.BaseDTO; |
import com.project.base.domain.dto.BaseDTO; |
||||
|
import io.vavr.control.Try; |
||||
import lombok.Data; |
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
@Data |
@Data |
||||
public class UserDTO extends BaseDTO { |
public class UserDTO extends BaseDTO { |
||||
|
|
||||
|
private String unionId; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private String avatar; |
||||
|
|
||||
|
private String mobile; |
||||
|
|
||||
|
private String jobNumber; |
||||
|
|
||||
|
private String title; |
||||
|
|
||||
|
private List<Long> deptIdList; |
||||
|
|
||||
|
private String deptIdStr; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
private Date hiredDate; |
||||
|
|
||||
|
/** |
||||
|
* 需要参与考试任务数 |
||||
|
*/ |
||||
|
private Integer needExamTaskCount; |
||||
|
/** |
||||
|
* 已参与考试任务数 |
||||
|
*/ |
||||
|
private Integer participatedExamTaskCount; |
||||
|
|
||||
|
/** |
||||
|
* 已通过考试任务数 |
||||
|
*/ |
||||
|
private Integer passedExamTaskCount; |
||||
|
|
||||
|
|
||||
|
public static UserDTO fromDingUserDTO(DingUserDTO dto) { |
||||
|
UserDTO userDTO = new UserDTO(); |
||||
|
BeanUtil.copyProperties(dto , userDTO); |
||||
|
userDTO.setId(Try.of(() -> Long.valueOf(dto.getUserId())).getOrElse(-1L)); |
||||
|
userDTO.setDeptIdStr(dto.getDeptIdList().stream().map(Object::toString) |
||||
|
.collect(Collectors.joining(","))); |
||||
|
return userDTO; |
||||
|
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,46 @@ |
|||||
|
package com.project.ding.domain.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.project.base.domain.entity.BaseEntity; |
||||
|
import jakarta.persistence.Column; |
||||
|
import jakarta.persistence.Entity; |
||||
|
import jakarta.persistence.Index; |
||||
|
import jakarta.persistence.Table; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.hibernate.annotations.Comment; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
@Data |
||||
|
@Table(name = "evaluator_user" , indexes = {@Index(name = "Idx_parentId", columnList = "parent_id")}) |
||||
|
@Entity |
||||
|
@TableName("evaluator_user") |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
public class UserEntity extends BaseEntity { |
||||
|
|
||||
|
@Column(name = "union_id" , columnDefinition="varchar(255) comment '企业架构内唯一标识'") |
||||
|
private String unionId; |
||||
|
|
||||
|
@Column(name = "name" , columnDefinition="varchar(255) comment '员工姓名'") |
||||
|
private String name; |
||||
|
|
||||
|
@Column(name = "avatar" , columnDefinition="varchar(512) comment '员工姓名'") |
||||
|
private String avatar; |
||||
|
|
||||
|
@Column(name = "mobile" , columnDefinition="varchar(50) comment '手机号码'") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Column(name = "job_number" , columnDefinition="varchar(255) comment '员工工号'") |
||||
|
private String jobNumber; |
||||
|
|
||||
|
@Column(name = "title" , columnDefinition="varchar(50) comment '职位'") |
||||
|
private String title; |
||||
|
|
||||
|
@Column(name = "dept_id_str" , columnDefinition="varchar(2000) comment '部门id集合'") |
||||
|
private String deptIdStr; |
||||
|
|
||||
|
@Column(name = "hired_date") |
||||
|
@Comment("入职时间") |
||||
|
private Date hiredDate; |
||||
|
} |
||||
Loading…
Reference in new issue