diff --git a/src/com/engine/organization/entity/chart/ChartPO.java b/src/com/engine/organization/entity/chart/ChartPO.java index 9880fc05..f594c6ee 100644 --- a/src/com/engine/organization/entity/chart/ChartPO.java +++ b/src/com/engine/organization/entity/chart/ChartPO.java @@ -61,6 +61,15 @@ public class ChartPO { //岗位名称 private String jobTitle; + //部门类型 0部门 1科室 + private Integer deptType; + + //卡片跳转链接 + private String pcUrl; + + //用工性质 + private String personType; + public String getId() { if (StringUtils.isNotBlank(ftype)) { switch (ftype) { diff --git a/src/com/engine/organization/entity/chart/params/ModeHrmResourceParam.java b/src/com/engine/organization/entity/chart/params/ModeHrmResourceParam.java index f7f46b41..8888b562 100644 --- a/src/com/engine/organization/entity/chart/params/ModeHrmResourceParam.java +++ b/src/com/engine/organization/entity/chart/params/ModeHrmResourceParam.java @@ -26,6 +26,7 @@ public class ModeHrmResourceParam { private String versionId; + private String deptLevel; } diff --git a/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java b/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java index d89c0787..731e1fc3 100644 --- a/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java +++ b/src/com/engine/organization/entity/hrmresource/po/ResourceChartPO.java @@ -30,6 +30,8 @@ public class ResourceChartPO { private Integer subcompanyid1; + private Integer deptType; + private Integer jobTitle; private String jobBrowser; @@ -38,4 +40,8 @@ public class ResourceChartPO { private String mobile; + private String pcUrl; + + private String personType; + } diff --git a/src/com/engine/organization/entity/hrmresource/vo/ResourceChartVO.java b/src/com/engine/organization/entity/hrmresource/vo/ResourceChartVO.java index ba1f9748..498e8316 100644 --- a/src/com/engine/organization/entity/hrmresource/vo/ResourceChartVO.java +++ b/src/com/engine/organization/entity/hrmresource/vo/ResourceChartVO.java @@ -28,6 +28,8 @@ public class ResourceChartVO { private String departmentName; + private Integer deptType; + private String subcompanyName; private String jobTitle; @@ -38,6 +40,10 @@ public class ResourceChartVO { private Long key; + private String pcUrl; + + private String personType; + public Long getKey() { return id; } diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index a7109a69..49f61d83 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -383,9 +383,7 @@ public class ChartServiceImpl extends Service implements ChartService { String nbValue = Util.null2String(params.get("nbValue")); String wbValue = Util.null2String(params.get("wbValue")); String versionId = Util.null2String(params.get("versionId")); - - - + String deptLevel = Util.null2String(params.get("deptLevel")); String departmentId = rootId.split("_")[1]; @@ -394,6 +392,7 @@ public class ChartServiceImpl extends Service implements ChartService { .wbValue(wbValue) .departmentId(departmentId) .versionId(versionId) + .deptLevel(deptLevel) .build(); String detauleType = Util.null2String(params.get("detailType")); diff --git a/src/com/engine/organization/service/impl/ModeHrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/ModeHrmResourceServiceImpl.java index dfb7e1e9..38ac2f09 100644 --- a/src/com/engine/organization/service/impl/ModeHrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/ModeHrmResourceServiceImpl.java @@ -11,6 +11,7 @@ import com.engine.organization.entity.hrmresource.vo.ResourceChartVO; import com.engine.organization.mapper.hrmresource.SystemDataMapper; import com.engine.organization.service.ModeHrmResourceService; import com.engine.organization.util.db.MapperProxyFactory; +import com.weaver.general.BaseBean; import lombok.SneakyThrows; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; @@ -38,7 +39,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour List allSupDepartment = getAllSupDepartment(param.getDepartmentId()); List resourceChartVOS = new ArrayList<>(); if ("0".equals(param.getVersionId())) { - List resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue())); + List resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue(),param.getDeptLevel(),param.getDepartmentId())); resourceChartVOS.addAll(convertToVO(resourceChartNb,"1")); List resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment,param.getWbValue())); resourceChartVOS.addAll(convertToVO(resourceChartWb,"2")); @@ -128,7 +129,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour //人员 List allSupDepartment = getAllSupDepartment(param.getDepartmentId()); - List resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue())); + List resourceChartNb = new ArrayList<>(selectNbPerson(allSupDepartment,param.getNbValue(),param.getDeptLevel(),param.getDepartmentId())); List resourceChartVOS = convertToVO(resourceChartNb,"1"); List resourceChartWb = new ArrayList<>(selectWbPerson(allSupDepartment,param.getWbValue())); @@ -156,7 +157,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour RecordSet rs = new RecordSet(); int totalCount = 0; - rs.executeQuery("select count(1) as total_count from uf_zsygrzbdd where zt < 4 and bm in ("+departmentIds+")"); + rs.executeQuery("select count(1) as total_count from uf_zsygrzbdd where zt = 1 and bm in ("+departmentIds+")"); if (rs.next()) { totalCount = Util.getIntValue(rs.getString("total_count")); } @@ -175,9 +176,10 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour List nbCondition = new ArrayList<>(); List nbValue = new ArrayList<>(); List wbCondition = new ArrayList<>(); + List wbValue = new ArrayList<>(); //内部职工 - rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 0"); + rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 0 and sfxsss = 1"); while (rs.next()) { String mc = Util.null2String(rs.getString("mc")); String bh = Util.null2String(rs.getString("bh")); @@ -186,17 +188,21 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour } //外部人员 - rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 1"); + rs.executeQuery("select mc,bh from uf_ygxz where sfqy = 0 and syfw = 1 and sfxsss = 1"); while (rs.next()) { String mc = Util.null2String(rs.getString("mc")); String bh = Util.null2String(rs.getString("bh")); wbCondition.add(DetailConditionVO.builder().label(mc).value(bh).build()); + wbValue.add(bh); } + + Map datas = new HashMap<>(4); datas.put("nbCondition",nbCondition); datas.put("nbValue",nbValue); datas.put("wbCondition",wbCondition); + datas.put("wbValue",wbValue); return datas; } @@ -206,7 +212,7 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour * @param allSupDepartment * @return */ - private List selectNbPerson(Collection allSupDepartment,String workType) { + private List selectNbPerson(Collection allSupDepartment,String workType,String depetLevel,String departmentId) { List resourceChartPOS = new ArrayList<>(); if (StringUtils.isEmpty(workType)){ return resourceChartPOS; @@ -216,19 +222,35 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour .map(s -> "'" + s + "'") .collect(Collectors.joining(",")); + BaseBean bb = new BaseBean(); + String modeId = bb.getPropValue("hrmOrganization", "nbmodeId"); + String formId = bb.getPropValue("hrmOrganization", "nbformId"); + String customid = bb.getPropValue("hrmOrganization", "nbcustomid"); + RecordSet rs = new RecordSet(); String join = CollectionUtil.join(allSupDepartment, ","); + String sql = "select id,gh,xm,xb,bm,ks,gw,sjhm,ygxz from uf_zsygrzbdd where zt = 1 and zgzt = 1 and bm = "+departmentId+" and ygxz in ("+workType+")"; + //非一级部门情况下使用科室字段 + if (!"0".equals(depetLevel)) { + sql = "select id,gh,xm,xb,bm,ks,gw,sjhm,ygxz from uf_zsygrzbdd where zt = 1 and zgzt = 1 and ks in ("+join+") and ygxz in ("+workType+")"; + } - rs.executeQuery("select id,gh,xm,xb,bm,gw,sjhm from uf_zsygrzbdd where zt < 4 and bm in ("+join+") and ygxz in ("+workType+")"); + rs.executeQuery(sql); while (rs.next()) { + int bm = Util.getIntValue(rs.getString("bm")); + int ks = Util.getIntValue(rs.getString("ks")); + int id = Util.getIntValue(rs.getString("id")); ResourceChartPO build = ResourceChartPO.builder() - .id((long) Util.getIntValue(rs.getString("id"))) + .id((long) id) .workCode(Util.null2String(rs.getString("gh"))) .lastName(Util.null2String(rs.getString("xm"))) .sex(Util.null2String(rs.getString("xb"))) - .departmentId(Util.getIntValue(rs.getString("bm"))) + .departmentId(ks != -1 ? ks : bm) + .deptType(ks != -1 ? 1 : 0) .jobBrowser(Util.null2String(rs.getString("gw"))) .mobile(Util.null2String(rs.getString("sjhm"))) + .pcUrl(String.format("/spa/cube/index.html#/main/cube/card?type=0&modeId={}&formId={}&billid={}&opentype=0&customid={}&viewfrom=fromsearchlist",modeId,formId,id,customid)) + .personType(Util.null2String(rs.getString("ygxz"))) .build(); resourceChartPOS.add(build); } @@ -251,18 +273,27 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour .map(s -> "'" + s + "'") .collect(Collectors.joining(",")); + BaseBean bb = new BaseBean(); + String modeId = bb.getPropValue("hrmOrganization", "wbmodeId"); + String formId = bb.getPropValue("hrmOrganization", "wbformId"); + String customid = bb.getPropValue("hrmOrganization", "wbcustomid"); + RecordSet rs = new RecordSet(); String join = CollectionUtil.join(allSupDepartment, ","); - rs.executeQuery("select id,gh,xm,xb,bmbz,gw,lxfs from uf_qlwbrydngljmb where zt < 4 and bmbz in ("+join+") and ygxz in ("+workType+")"); + rs.executeQuery("select id,gh,xm,xb,bmbz,gw,lxfs,ks,ygxz from uf_qlwbrydngljmb where zt < 4 and ks in ("+join+") and ygxz in ("+workType+")"); while (rs.next()) { + int id = Util.getIntValue(rs.getString("id")); ResourceChartPO build = ResourceChartPO.builder() - .id((long) Util.getIntValue(rs.getString("id"))) + .id((long) id) .workCode(Util.null2String(rs.getString("gh"))) .lastName(Util.null2String(rs.getString("xm"))) .sex(Util.null2String(rs.getString("xb"))) - .departmentId(Util.getIntValue(rs.getString("bmbz"))) + .departmentId(Util.getIntValue(rs.getString("ks"))) + .deptType(1) .jobBrowser(Util.null2String(rs.getString("gw"))) .mobile(Util.null2String(rs.getString("lxfs"))) + .pcUrl(String.format("/spa/cube/index.html#/main/cube/card?type=0&modeId={}&formId={}&billid={}&opentype=0&customid={}&viewfrom=fromsearchlist",modeId,formId,id,customid)) + .personType(Util.null2String(rs.getString("ygxz"))) .build(); resourceChartPOS.add(build); } @@ -330,7 +361,11 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour resourceChartVO.setJobTitle(getJobBrowserName(item.getJobBrowser(),type)); resourceChartVO.setStatus(item.getStatus()); resourceChartVO.setMobile(item.getMobile()); + resourceChartVO.setDeptType(item.getDeptType()); + resourceChartVO.setPcUrl(item.getPcUrl()); + resourceChartVO.setPersonType(item.getPersonType()); resourceChartVOS.add(resourceChartVO); + } return resourceChartVOS; } @@ -405,6 +440,9 @@ public class ModeHrmResourceServiceImpl extends Service implements ModeHrmResour chartPO.setJobTitle(item.getJobTitle()); chartPO.setExpand("1"); chartPO.setHasChildren("false"); + chartPO.setDeptType(item.getDeptType()); + chartPO.setPcUrl(item.getPcUrl()); + chartPO.setPersonType(item.getPersonType()); try { String resourceId = getResourceIdByWorkCode(item.getWorkCode()); chartPO.setFleaderimg(new ResourceComInfo().getMessagerUrls(resourceId));