添加员工车辆信息

This commit is contained in:
2024-03-16 20:30:32 +08:00
parent 7f88b5e92e
commit aef241821a
5 changed files with 27 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package cn.lihongjie.coal.employee.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import cn.lihongjie.coal.department.entity.DepartmentEntity;
import cn.lihongjie.coal.employee.entity.EmpCarVO;
import cn.lihongjie.coal.employee.entity.EmpCertVO;
import cn.lihongjie.coal.employee.entity.EmpFamilyMemberVO;
@@ -77,6 +78,10 @@ public class CreateEmployeeDto extends OrgCommonDto {
@Comment("员工证件信息")
private List<EmpCertVO> certs;
@ElementCollection
@Comment("员工车辆信息")
private List<EmpCarVO> cars;
@Comment("养老保险基数")
private Double insurance1Base;
@Comment("养老保险比例")

View File

@@ -2,6 +2,7 @@ package cn.lihongjie.coal.employee.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import cn.lihongjie.coal.department.entity.DepartmentEntity;
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.file.entity.FileEntity;
@@ -115,6 +116,10 @@ public class EmployeeDto extends OrgCommonDto {
@Comment("员工证件信息")
private List<EmpCertVO> certs;
@ElementCollection
@Comment("员工车辆信息")
private List<EmpCarVO> cars;
@Comment("养老保险基数")
private Double insurance1Base;

View File

@@ -2,6 +2,7 @@ package cn.lihongjie.coal.employee.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import cn.lihongjie.coal.department.entity.DepartmentEntity;
import cn.lihongjie.coal.employee.entity.EmpCarVO;
import cn.lihongjie.coal.employee.entity.EmpCertVO;
import cn.lihongjie.coal.employee.entity.EmpFamilyMemberVO;
@@ -74,10 +75,15 @@ public class UpdateEmployeeDto extends OrgCommonDto {
private List<EmpFamilyMemberVO> familyMembers;
@ElementCollection
@Comment("员工证件信息")
private List<EmpCertVO> certs;
@ElementCollection
@Comment("员工车辆信息")
private List<EmpCarVO> cars;
@Comment("养老保险基数")
private Double insurance1Base;
@Comment("养老保险比例")

View File

@@ -41,6 +41,8 @@ public class EmpCertVO {
@Type(ListArrayType.class)
private List<String> fileIds;
@Transient
private List<FileEntity> files;

View File

@@ -71,6 +71,15 @@ class EmployeeService extends BaseService<EmployeeEntity, EmployeeRepository> {
x.setFiles(fileService.findAllByIds(x.getFileIds()));
});
}
if (CollectionUtils.isNotEmpty(dto.getCars())) {
dto.getCars()
.forEach(
x -> {
if (CollectionUtils.isNotEmpty(x.getFileIds()))
x.setFiles(fileService.findAllByIds(x.getFileIds()));
});
}
return dto;
}