From 5a2affb1a8fef4fcc53d2774eff7b71575784a76 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 30 Dec 2024 15:44:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E7=BB=84=E7=BB=87=E5=8C=85=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=201.=E8=8A=B1=E5=90=8D=E5=86=8C=E5=A4=96=E9=83=A8=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=B8=8D=E6=98=BE=E7=A4=BA=202.=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E5=9B=BE=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=9D=A1=E4=BB=B6=203.=E8=8A=B1=E5=90=8D=E5=86=8C?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=A0=91=E8=81=94=E6=9F=A5=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HrmResourceServiceImpl.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index 0ccd5ea6..a4df3778 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -63,6 +63,8 @@ import weaver.general.BaseBean; import weaver.general.StringUtil; import weaver.general.TimeUtil; import weaver.general.Util; +import weaver.hrm.company.DepartmentComInfo; +import weaver.hrm.company.SubCompanyComInfo; import weaver.hrm.definedfield.HrmFieldManager; import weaver.systeminfo.SystemEnv; @@ -786,9 +788,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, conditionItems); Map allFieldsMap = conditionItems.stream().collect(Collectors.toMap(item -> item.getDomkey()[0], item -> item, (k1, k2) -> k1)); boolean isQuickSearch = "true".equals(Util.null2String(params.get("isQuickSearch"))); + DepartmentComInfo deptInfo = new DepartmentComInfo(); + SubCompanyComInfo subInfo = new SubCompanyComInfo(); DBType dbType = DBType.get(new RecordSet().getDBType()); StringBuilder sb = new StringBuilder(" where 1=1 "); + // 默认去除外部人员显示 + sb.append( " and t.seclevel >= 0 "); + if (params.containsKey("lastName") || !params.containsKey("-1_hrm_status")) { // sb.append(" and t.status = 1"); sb.append(" and t.status < 4"); @@ -810,10 +817,18 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic sb.append(" and t.lastname ").append(dbType.like(value)); } if ("companyId".equals(key)) { - sb.append(" and t.subcompanyid1 ='").append(value).append("'"); + ArrayList list = new ArrayList<>(); + list.add(Integer.parseInt(value)); + subInfo.getSubCompanyLists(value,list); + String allSub = StringUtils.join(list,","); + sb.append(" and t.subcompanyid1 in(").append(allSub).append(")"); } if ("departmentId".equals(key)) { - sb.append(" and t.departmentId ='").append(value).append("'"); + ArrayList list = new ArrayList<>(); + list.add(Integer.parseInt(value)); + deptInfo.getAllChildDeptByDepId(list,value); + String allDept = StringUtils.join(list,","); + sb.append(" and t.departmentId in (").append(allDept).append(")"); } if ("jobTitle".equals(key)) { JobPO jobById = getJobMapper().getJobById(Long.parseLong(value));