diff --git a/src/main/java/cn/lihongjie/coal/employee/dto/CreateEmployeeDto.java b/src/main/java/cn/lihongjie/coal/employee/dto/CreateEmployeeDto.java index 57e07d43..ec40813c 100644 --- a/src/main/java/cn/lihongjie/coal/employee/dto/CreateEmployeeDto.java +++ b/src/main/java/cn/lihongjie/coal/employee/dto/CreateEmployeeDto.java @@ -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 certs; + @ElementCollection + @Comment("员工车辆信息") + private List cars; + @Comment("养老保险基数") private Double insurance1Base; @Comment("养老保险比例") diff --git a/src/main/java/cn/lihongjie/coal/employee/dto/EmployeeDto.java b/src/main/java/cn/lihongjie/coal/employee/dto/EmployeeDto.java index 17824439..ad3ff1ac 100644 --- a/src/main/java/cn/lihongjie/coal/employee/dto/EmployeeDto.java +++ b/src/main/java/cn/lihongjie/coal/employee/dto/EmployeeDto.java @@ -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 certs; + @ElementCollection + @Comment("员工车辆信息") + private List cars; + @Comment("养老保险基数") private Double insurance1Base; diff --git a/src/main/java/cn/lihongjie/coal/employee/dto/UpdateEmployeeDto.java b/src/main/java/cn/lihongjie/coal/employee/dto/UpdateEmployeeDto.java index 4f6453e1..bb71418b 100644 --- a/src/main/java/cn/lihongjie/coal/employee/dto/UpdateEmployeeDto.java +++ b/src/main/java/cn/lihongjie/coal/employee/dto/UpdateEmployeeDto.java @@ -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 familyMembers; + + @ElementCollection @Comment("员工证件信息") private List certs; + @ElementCollection + @Comment("员工车辆信息") + private List cars; @Comment("养老保险基数") private Double insurance1Base; @Comment("养老保险比例") diff --git a/src/main/java/cn/lihongjie/coal/employee/entity/EmpCertVO.java b/src/main/java/cn/lihongjie/coal/employee/entity/EmpCertVO.java index d3c7d832..77fb96a3 100644 --- a/src/main/java/cn/lihongjie/coal/employee/entity/EmpCertVO.java +++ b/src/main/java/cn/lihongjie/coal/employee/entity/EmpCertVO.java @@ -41,6 +41,8 @@ public class EmpCertVO { @Type(ListArrayType.class) private List fileIds; + + @Transient private List files; diff --git a/src/main/java/cn/lihongjie/coal/employee/service/EmployeeService.java b/src/main/java/cn/lihongjie/coal/employee/service/EmployeeService.java index 6d0570e2..18f5a770 100644 --- a/src/main/java/cn/lihongjie/coal/employee/service/EmployeeService.java +++ b/src/main/java/cn/lihongjie/coal/employee/service/EmployeeService.java @@ -71,6 +71,15 @@ class EmployeeService extends BaseService { 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; }