From d5a24e3bfb472c93a60694e39d3f2f0f02f958a3 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 23 Dec 2024 10:09: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=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/impl/OrgChartServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 0c116879..f216f356 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -611,9 +611,15 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { Map datas = new HashMap<>(); RecordSet rs = new RecordSet(); String fclass = Util.null2String(params.get("fclass")); + String timeName = Util.null2String(params.get("timeName")); List timeLinesBOList = new ArrayList<>(); timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build()); - rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ? order by id desc", fclass, 0); + String sql = "SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ?"; + if (StringUtils.isNotEmpty(timeName)) { + sql += " and description like '%"+timeName+"%'"; + } + sql += " order by id desc"; + rs.executeQuery(sql, fclass, 0); while (rs.next()) { timeLinesBOList.add(TimeLinesBO.builder() .key(rs.getInt("id")) 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 2/2] =?UTF-8?q?1=E7=BB=84=E7=BB=87=E5=8C=85=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=201.=E8=8A=B1=E5=90=8D=E5=86=8C=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=B8=8D=E6=98=BE=E7=A4=BA=202.=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=9E=B6=E6=9E=84=E5=9B=BE=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=203.=E8=8A=B1=E5=90=8D?= =?UTF-8?q?=E5=86=8C=E5=B7=A6=E4=BE=A7=E6=A0=91=E8=81=94=E6=9F=A5=E5=8C=85?= =?UTF-8?q?=E5=90=AB=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));