From 436decbc85ef4784fb6ff984f48b345fd51b82f2 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 6 Jul 2023 13:30:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=BD=AC=E6=8D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/entity/chart/ChartPO.java | 9 +++++ .../hrmresource/bo/ResourceChartBO.java | 37 +++++++++++++++++++ .../hrmresource/po/ResourceChartPO.java | 6 +-- .../mapper/resource/HrmResourceMapper.xml | 18 +-------- .../service/impl/ChartServiceImpl.java | 5 ++- .../service/impl/HrmResourceServiceImpl.java | 9 +++-- 6 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java 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()); From 7809f9ad3c6370654b0df84084deea3604fd15e7 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 6 Jul 2023 13:55:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E4=BA=BA=E5=91=98=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/entity/chart/ChartPO.java | 2 ++ .../mapper/resource/HrmResourceMapper.xml | 2 +- .../organization/service/impl/ChartServiceImpl.java | 13 ++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/com/engine/organization/entity/chart/ChartPO.java b/src/com/engine/organization/entity/chart/ChartPO.java index 89bf1860..cca64fba 100644 --- a/src/com/engine/organization/entity/chart/ChartPO.java +++ b/src/com/engine/organization/entity/chart/ChartPO.java @@ -38,6 +38,8 @@ public class ChartPO { private String belongto; // 人员工龄 private String companyWorkYear; + // 人员头像 + private String fleaderimg; private String id; private String key; diff --git a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml index e7d48fa6..3bbc0605 100644 --- a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml +++ b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml @@ -445,7 +445,7 @@ \ 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 283fd751..e8b32363 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; import weaver.general.Util; +import weaver.hrm.resource.ResourceComInfo; import java.util.*; import java.util.stream.Collectors; @@ -212,6 +213,11 @@ public class ChartServiceImpl extends Service implements ChartService { chartPO.setHasChildren("0"); chartPO.setBelongto(Util.null2String(rs.getString("belongto"))); chartPO.setCompanyWorkYear(rs.getString("companyworkyear")); + try { + chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(chartPO.getId())); + } catch (Exception e) { + throw new RuntimeException(e); + } resourceList.add(chartPO); jobTitleSet.add(jobTitle); @@ -243,7 +249,11 @@ public class ChartServiceImpl extends Service implements ChartService { } } // 查询部门本身 - sql = "select a.id,a.departmentname as 'name',b.bmfzr from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'"; + if(hasVirtualFields){ + sql = "select a.id,a.departmentname as 'name',b.bmfzr,b.bmlx as 'isvitual' from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'"; + }else { + sql = "select a.id,a.departmentname as 'name',b.bmfzr from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'"; + } rs.executeQuery(sql); if(rs.next()){ String fLeader = Util.null2String(rs.getString("bmfzr")); @@ -256,6 +266,7 @@ public class ChartServiceImpl extends Service implements ChartService { chartPO.setExpand("1"); chartPO.setHasChildren(CollectionUtils.isNotEmpty(dataList) ? "1" : "0"); chartPO.setFonjob(departmentOnJob); + chartPO.setFisvitual(rs.getString("isvitual")); // 部门负责人 chartPO.setFleader(getDepartmentLeader(fLeader));