From a816b4eeee132904c9470682088b9b3f64355f02 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 26 Mar 2024 16:03:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE=E4=BA=8C?= =?UTF-8?q?=E5=BC=80=E6=8A=BD=E5=B1=89=E9=A1=B5=E9=9D=A2=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=BB=B4=E5=BA=A6=20=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E5=BB=BA=E6=A8=A1=E8=81=8C=E4=BD=8D=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmresource/bo/ResourceChartBO.java | 26 ++++++++++++++++++- .../service/impl/ChartServiceImpl.java | 16 ++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java b/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java index 48d08b7e..d464f067 100644 --- a/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java +++ b/src/com/engine/organization/entity/hrmresource/bo/ResourceChartBO.java @@ -3,6 +3,8 @@ 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.conn.RecordSet; +import weaver.general.BaseBean; import weaver.general.Util; import java.util.ArrayList; @@ -19,13 +21,14 @@ public class ResourceChartBO { 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.setJobTitle(selectCustomName(resourceChartPO.getId())); resourceChartVO.setStatus(resourceChartPO.getStatus()); resourceChartVO.setMobile(resourceChartPO.getMobile()); resourceChartVOS.add(resourceChartVO); @@ -34,4 +37,25 @@ public class ResourceChartBO { } + /** + * 上海港湾二开 查询自定义职位名称 uf_zwxxjmb + */ + private static String selectCustomName(long id){ + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + String scopeid = bb.getPropValue("hrmOrganization", "scopeid"); + String fieldid = bb.getPropValue("hrmOrganization", "fieldid"); + String jobName = ""; + rs.executeQuery("select c.zwmc as jobname from hrmresource a \n" + + "left join cus_fielddata b on a.id = b.id and b.scopeid = "+scopeid+"\n" + + "left join uf_zwxxjmb c on b."+fieldid+" = c.id\n" + + "where a.status < 4 and a.id = ?",id); + if (rs.next()){ + jobName = rs.getString("jobname"); + } + + return jobName; + } + + } diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 748702ec..5f32410b 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -320,11 +320,23 @@ public class ChartServiceImpl extends Service implements ChartService { departmentChartPO.setHasChildren(CollectionUtils.isNotEmpty(jobTitleList) ? "1" : "0"); } else { // 直接查询岗位下的人员 + BaseBean bb = new BaseBean(); + String scopeid = bb.getPropValue("hrmOrganization", "scopeid"); + String fieldid = bb.getPropValue("hrmOrganization", "fieldid"); + if (isRealTime) { if (isRealDimension) { - sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,b.jobtitlename as jobname from hrmresource a left join hrmjobtitles b on a.jobtitle=b.id where a.status < 4 and a.departmentid = ? "; + sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,c.zwmc as jobname \n" + + " from hrmresource a \n" + + " left join cus_fielddata b on a.id = b.id and b.scopeid = +"+scopeid+"\n" + + " left join uf_zwxxjmb c on b."+fieldid+" = c.id\n" + + " where a.status < 4 and a.departmentid = ?"; } else { - sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,c.jobtitlename as jobname from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid left join hrmjobtitles c on a.jobtitle=c.id where a.status < 4 and b.departmentid = ? "; + sql = "select a.id,a.lastname as name ,a.belongto ,a.companyworkyear,d.zwmc as jobname \n" + + " from hrmresource a inner join hrmresourcevirtual b on a.id = b.resourceid \n" + + " left join cus_fielddata c on a.id = c.id and c.scopeid = +"+scopeid+"\n" + + " left join uf_zwxxjmb d on c."+fieldid+" = d.id\n" + + " where a.status < 4 and b.departmentid = ?"; } } else { sql = "select a.resourceid as id,a.lastname as name ,a.belongto ,a.companyworkyear from jcl_chart_resource a where a.status < 4 and a.departmentid = ? and versionid = " + versionId;