mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
添加工作经历
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCarVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCertVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpFamilyMemberVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpWorkRecordVO;
|
||||
|
||||
import jakarta.persistence.ElementCollection;
|
||||
|
||||
@@ -84,6 +85,8 @@ public class CreateEmployeeDto extends OrgCommonDto {
|
||||
@ElementCollection
|
||||
private List<EmpCarVO> cars;
|
||||
|
||||
private List<EmpWorkRecordVO> workRecords;
|
||||
|
||||
@Comment("养老保险基数")
|
||||
private Double insurance1Base;
|
||||
@Comment("养老保险比例")
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.lihongjie.coal.department.dto.DepartmentDto;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCarVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCertVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpFamilyMemberVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpWorkRecordVO;
|
||||
import cn.lihongjie.coal.file.entity.FileEntity;
|
||||
import cn.lihongjie.coal.jobPost.dto.JobPostDto;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
@@ -130,6 +131,8 @@ public class EmployeeDto extends OrgCommonDto {
|
||||
@ElementCollection
|
||||
private List<EmpCarVO> cars;
|
||||
|
||||
private List<EmpWorkRecordVO> workRecords;
|
||||
|
||||
|
||||
@Comment("养老保险基数")
|
||||
private Double insurance1Base;
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCarVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpCertVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpFamilyMemberVO;
|
||||
import cn.lihongjie.coal.employee.entity.EmpWorkRecordVO;
|
||||
|
||||
import jakarta.persistence.ElementCollection;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
@@ -89,6 +90,10 @@ public class UpdateEmployeeDto extends OrgCommonDto {
|
||||
|
||||
@ElementCollection
|
||||
private List<EmpCarVO> cars;
|
||||
|
||||
|
||||
private List<EmpWorkRecordVO> workRecords;
|
||||
|
||||
@Comment("养老保险基数")
|
||||
private Double insurance1Base;
|
||||
@Comment("养老保险比例")
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.lihongjie.coal.employee.entity;
|
||||
|
||||
import cn.lihongjie.coal.file.entity.FileEntity;
|
||||
|
||||
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.persistence.Transient;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
@Embeddable
|
||||
public class EmpWorkRecordVO {
|
||||
|
||||
|
||||
@Comment("入职时间")
|
||||
private Date entryDate;
|
||||
|
||||
@Comment("离职时间")
|
||||
private Date resignDate;
|
||||
|
||||
|
||||
@Comment("工作单位")
|
||||
private String company;
|
||||
|
||||
@Comment("部门")
|
||||
private String department;
|
||||
|
||||
@Comment("职务")
|
||||
private String jobPost;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Comment("备注")
|
||||
private String remarks;
|
||||
|
||||
@Comment("关联附件")
|
||||
@Column(columnDefinition = "text[]")
|
||||
@Type(ListArrayType.class)
|
||||
private List<String> fileIds;
|
||||
|
||||
|
||||
|
||||
@Transient
|
||||
private List<FileEntity> files;
|
||||
|
||||
|
||||
}
|
||||
@@ -112,6 +112,12 @@ public class EmployeeEntity extends OrgCommonEntity {
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
private List<EmpCarVO> cars;
|
||||
|
||||
|
||||
|
||||
@ElementCollection
|
||||
@Fetch(FetchMode.SUBSELECT)
|
||||
private List<EmpWorkRecordVO> workRecords;
|
||||
|
||||
/**
|
||||
* “五险”讲的是五种保险,包括养老保险、医疗保险、失业保险、工伤保险和生育保险。
|
||||
*
|
||||
|
||||
@@ -108,6 +108,15 @@ public class EmployeeService extends BaseService<EmployeeEntity, EmployeeReposit
|
||||
x.setFiles(fileService.findAllByIds(x.getFileIds()));
|
||||
});
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(dto.getWorkRecords())) {
|
||||
dto.getWorkRecords()
|
||||
.forEach(
|
||||
x -> {
|
||||
if (CollectionUtils.isNotEmpty(x.getFileIds()))
|
||||
x.setFiles(fileService.findAllByIds(x.getFileIds()));
|
||||
});
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user