diff --git a/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java b/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java new file mode 100644 index 000000000..83f356300 --- /dev/null +++ b/src/com/engine/salary/entity/extemp/dto/ExtEmpDTO.java @@ -0,0 +1,57 @@ +package com.engine.salary.entity.extemp.dto; + + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 外部人员 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_external_employee +@ElogTransform( name = "非系统人员") +public class ExtEmpDTO { + + @ElogTransform(name = "主键id") + private Long id; + + /** + * 姓名 + */ + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + private String username; + + /** + * 部门 + */ + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + private String departmentName; + + + /** + * 分部 + */ + @TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName") + private String subcompanyName; + + /** + * 入职日期 + */ + @TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate") + private String companystartdate; + + + /** + * 工号 + */ + @TableTitle(title = "工号", dataIndex = "workcode", key = "workcode") + private String workcode; + +} diff --git a/src/com/engine/salary/service/ExtEmpService.java b/src/com/engine/salary/service/ExtEmpService.java index 7aaa9f11a..43ffacf58 100644 --- a/src/com/engine/salary/service/ExtEmpService.java +++ b/src/com/engine/salary/service/ExtEmpService.java @@ -1,6 +1,7 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.extemp.dto.ExtEmpDTO; import com.engine.salary.entity.extemp.param.ExtEmpImportParam; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; @@ -17,7 +18,7 @@ public interface ExtEmpService { List list(ExtEmpQueryParam param); - PageInfo listPage (ExtEmpQueryParam param); + PageInfo listPage (ExtEmpQueryParam param); void save(ExtEmpSaveParam po); diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 9d3bea91f..f2fbd1d89 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -5,6 +5,7 @@ import com.engine.core.impl.Service; import com.engine.salary.config.SalaryElogConfig; import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.extemp.dto.ExtEmpDTO; import com.engine.salary.entity.extemp.param.ExtEmpImportParam; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; @@ -78,9 +79,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } @Override - public PageInfo listPage(ExtEmpQueryParam param) { + public PageInfo listPage(ExtEmpQueryParam param) { List extEmpPOS = list(param); - return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class); + + List list = extEmpPOS.stream().map(po -> { + return ExtEmpDTO.builder() + .id(po.getId()) + .username(po.getUsername()) + .departmentName(po.getDepartmentName()) + .subcompanyName(po.getSubcompanyName()) + .companystartdate(po.getCompanystartdate()) + .workcode(po.getWorkcode()) + .build(); + }).collect(Collectors.toList()); + + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, ExtEmpDTO.class); } diff --git a/src/com/engine/salary/web/ExtEmpController.java b/src/com/engine/salary/web/ExtEmpController.java index 4e6225435..3ee37f187 100644 --- a/src/com/engine/salary/web/ExtEmpController.java +++ b/src/com/engine/salary/web/ExtEmpController.java @@ -1,6 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.extemp.dto.ExtEmpDTO; import com.engine.salary.entity.extemp.param.ExtEmpImportParam; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; @@ -48,7 +49,7 @@ public class ExtEmpController { @Produces(MediaType.APPLICATION_JSON) public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getExtEmpWrapper(user)::listPage, param); + return new ResponseResult>(user).run(getExtEmpWrapper(user)::listPage, param); } @POST diff --git a/src/com/engine/salary/wrapper/ExtEmpWrapper.java b/src/com/engine/salary/wrapper/ExtEmpWrapper.java index fd936d61d..9a60b3e30 100644 --- a/src/com/engine/salary/wrapper/ExtEmpWrapper.java +++ b/src/com/engine/salary/wrapper/ExtEmpWrapper.java @@ -2,6 +2,7 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.extemp.dto.ExtEmpDTO; import com.engine.salary.entity.extemp.param.ExtEmpImportParam; import com.engine.salary.entity.extemp.param.ExtEmpQueryParam; import com.engine.salary.entity.extemp.param.ExtEmpSaveParam; @@ -30,7 +31,7 @@ public class ExtEmpWrapper extends Service { } - public PageInfo listPage(ExtEmpQueryParam param) { + public PageInfo listPage(ExtEmpQueryParam param) { return getExtEmpService(user).listPage(param); }