diff --git a/src/com/engine/organization/entity/chart/ChartPO.java b/src/com/engine/organization/entity/chart/ChartPO.java index e3b08876..89bf1860 100644 --- a/src/com/engine/organization/entity/chart/ChartPO.java +++ b/src/com/engine/organization/entity/chart/ChartPO.java @@ -36,6 +36,8 @@ public class ChartPO { // 人员主次账号 private String belongto; + // 人员工龄 + private String companyWorkYear; private String id; private String key; @@ -70,4 +72,11 @@ public class ChartPO { public String getKey() { return getId(); } + + public String getCompanyWorkYear() { + if (StringUtils.isNotBlank(ftype) && "4".equals(ftype)) { + return StringUtils.isNotBlank(companyWorkYear) ? companyWorkYear : "0"; + } + return null; + } } diff --git a/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java b/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java new file mode 100644 index 00000000..48d08b7e --- /dev/null +++ b/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java @@ -0,0 +1,37 @@ +package com.engine.organization.entity.hrmresource.bo; + +import com.engine.organization.entity.hrmresource.po.ResourceChartPO; +import com.engine.organization.entity.hrmresource.vo.ResourceChartVO; +import com.engine.organization.transmethod.HrmResourceTransMethod; +import weaver.general.Util; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author:dxfeng + * @createTime: 2023/07/06 + * @version: 1.0 + */ +public class ResourceChartBO { + + public static List convertToVO(List resourceChartPOS) { + List resourceChartVOS = new ArrayList<>(); + for (ResourceChartPO resourceChartPO : resourceChartPOS) { + ResourceChartVO resourceChartVO = new ResourceChartVO(); + resourceChartVO.setId(resourceChartPO.getId()); + resourceChartVO.setWorkCode(resourceChartPO.getWorkCode()); + resourceChartVO.setLastName(resourceChartPO.getLastName()); + resourceChartVO.setSex("1".equals(resourceChartPO.getSex()) ? "女" : "男"); + resourceChartVO.setDepartmentName(HrmResourceTransMethod.getDepartmentName(Util.null2String(resourceChartPO.getDepartmentId()))); + resourceChartVO.setSubcompanyName(HrmResourceTransMethod.getCompanyName(Util.null2String(resourceChartPO.getSubcompanyid1()))); + resourceChartVO.setJobTitle(HrmResourceTransMethod.getJobName(Util.null2String(resourceChartPO.getJobTitle()))); + resourceChartVO.setStatus(resourceChartPO.getStatus()); + resourceChartVO.setMobile(resourceChartPO.getMobile()); + resourceChartVOS.add(resourceChartVO); + } + return resourceChartVOS; + } + + +} diff --git a/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java b/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java index 48b68d96..63868f50 100644 --- a/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java +++ b/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java @@ -26,11 +26,11 @@ public class ResourceChartPO { private String sex; - private String departmentId; + private Integer departmentId; - private String subcompanyid1; + private Integer subcompanyid1; - private String jobTitle; + private Integer jobTitle; private Integer status; diff --git a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml index 56208857..e7d48fa6 100644 --- a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml +++ b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml @@ -444,22 +444,8 @@ \ No newline at end of file diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index c15b19c2..283fd751 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -194,9 +194,9 @@ public class ChartServiceImpl extends Service implements ChartService { String sql; // 查询当当前部门下的人员 if ("0".equals(dimension)) { - sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto from hrmresource a where a.departmentid = '" + departmentId + "'"; + sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto ,a.companyworkyear from hrmresource a where a.departmentid = '" + departmentId + "'"; } else { - sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where b.departmentid = '" + departmentId + "'"; + sql = "select a.id,a.lastname as 'name' ,a.jobtitle ,a.belongto ,a.companyworkyear from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid where b.departmentid = '" + departmentId + "'"; } rs.executeQuery(sql); while (rs.next()){ @@ -211,6 +211,7 @@ public class ChartServiceImpl extends Service implements ChartService { chartPO.setExpand("0"); chartPO.setHasChildren("0"); chartPO.setBelongto(Util.null2String(rs.getString("belongto"))); + chartPO.setCompanyWorkYear(rs.getString("companyworkyear")); resourceList.add(chartPO); jobTitleSet.add(jobTitle); diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index c7d054eb..aa2a34d7 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -21,10 +21,12 @@ import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.extend.bo.ExtendInfoBO; import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.hrmresource.bo.HrmRelationBO; +import com.engine.organization.entity.hrmresource.bo.ResourceChartBO; import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam; import com.engine.organization.entity.hrmresource.param.SearchTemplateParam; import com.engine.organization.entity.hrmresource.po.*; import com.engine.organization.entity.hrmresource.vo.HrmResourceVO; +import com.engine.organization.entity.hrmresource.vo.ResourceChartVO; import com.engine.organization.entity.jclimport.po.CusFormFieldPO; import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.po.JobPO; @@ -426,8 +428,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic Map dataMap = new HashMap<>(); List resourceListColumns = getTableColumns(); List resourceChartPOS = getHrmResourceMapper().selectByDepartmentId(departmentId); + List resourceChartVOS = ResourceChartBO.convertToVO(resourceChartPOS); dataMap.put("columns",resourceListColumns); - dataMap.put("dataSource",resourceChartPOS); + dataMap.put("dataSource",resourceChartVOS); return dataMap; } @@ -437,8 +440,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic list.add(ResourceListColumns.builder().title("工号").dataIndex("workCode").key("workCode").build()); list.add(ResourceListColumns.builder().title("姓名").dataIndex("lastName").key("lastName").build()); list.add(ResourceListColumns.builder().title("性别").dataIndex("sex").key("sex").build()); - list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentId").key("departmentId").build()); - list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompanyid1").key("subcompanyid1").build()); + list.add(ResourceListColumns.builder().title("部门").dataIndex("departmentName").key("departmentName").build()); + list.add(ResourceListColumns.builder().title("分部").dataIndex("subcompanyName").key("subcompanyName").build()); list.add(ResourceListColumns.builder().title("岗位").dataIndex("jobTitle").key("jobTitle").build()); //list.add(ResourceListColumns.builder().title("状态").dataIndex("status").key("status").build()); list.add(ResourceListColumns.builder().title("手机号").dataIndex("mobile").key("mobile").build());