From 06c9912d21adcc7c3f6a769a5465923f6763950f Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 9 Dec 2022 15:07:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D,=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/entity/job/bo/JobBO.java | 9 +++++++++ .../organization/mapper/comp/CompMapper.xml | 15 +++++++++------ .../mapper/department/DepartmentMapper.xml | 15 +++++++++------ .../engine/organization/mapper/job/JobMapper.xml | 2 +- .../service/impl/HrmResourceServiceImpl.java | 10 ++++++++-- .../organization/service/impl/JobServiceImpl.java | 12 ++++++++++-- 6 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/com/engine/organization/entity/job/bo/JobBO.java b/src/com/engine/organization/entity/job/bo/JobBO.java index d07e88e4..433031ab 100644 --- a/src/com/engine/organization/entity/job/bo/JobBO.java +++ b/src/com/engine/organization/entity/job/bo/JobBO.java @@ -5,7 +5,9 @@ import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.vo.SingleJobTreeVO; import com.engine.organization.entity.searchtree.SearchTree; +import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.transmethod.JobTransMethod; +import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections.CollectionUtils; import weaver.hrm.job.JobTitlesComInfo; @@ -157,4 +159,11 @@ public class JobBO { public static String getJobTitleNameByEcJobTitle(String ecJobTitle) { return new JobTitlesComInfo().getJobTitlesname(ecJobTitle); } + + public static JobPO getEcJobTitleByJobId(Long jobId) { + if (null == jobId) { + return null; + } + return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId); + } } diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 67392d6c..d93c8a52 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -215,16 +215,19 @@ - and ifnull(canceled,0)= - #{CompanyPO.canceled} + + and ifnull(canceled,0)= #{CompanyPO.canceled} + - and nvl(canceled,0)= - #{CompanyPO.canceled} + + and nvl(canceled,0)= #{CompanyPO.canceled} + - and isnull(canceled,0)= - #{CompanyPO.canceled} + + and isnull(canceled,0)= #{CompanyPO.canceled} + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index 28ab23da..50803f0d 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -182,16 +182,19 @@ - and ifnull(canceled,0)= - #{departmentPO.canceled} + + and ifnull(canceled,0)= #{departmentPO.canceled} + - and nvl(canceled,0)= - #{departmentPO.canceled} + + and nvl(canceled,0)= #{departmentPO.canceled} + - and isnull(canceled,0)= - #{departmentPO.canceled} + + and isnull(canceled,0)= #{departmentPO.canceled} + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/job/JobMapper.xml b/src/com/engine/organization/mapper/job/JobMapper.xml index 041e1e43..054165da 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.xml +++ b/src/com/engine/organization/mapper/job/JobMapper.xml @@ -5,7 +5,7 @@ - + diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index 71c521a1..c83f6b63 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -462,8 +462,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic } Long jobTitle = params.getJobTitle(); if (null != jobTitle) { - // TODO BUG修复 - sqlWhere += " AND t.jobtitle = '" + jobTitle + "'"; + JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobTitle); + if (null != ecJobTitleByJobId) { + sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'"; + sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'"; + sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'"; + } else { + sqlWhere = " where 1 = 2 "; + } } // 分权查询 diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index 37320e58..6450f6f0 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -499,8 +499,16 @@ public class JobServiceImpl extends Service implements JobService { @Override public Map getHrmListByJobId(Long jobId) { OrganizationWeaTable table = new OrganizationWeaTable<>(user, EmployeeTableVO.class); - // TODO BUG修复 - table.setSqlwhere(" where jobtitle = '" + jobId + "' and status<4"); + String sqlWhere = " where 1=1 "; + JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobId); + if (null != ecJobTitleByJobId) { + sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'"; + sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'"; + sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'"; + } else { + sqlWhere = " where 1 = 2 "; + } + table.setSqlwhere(sqlWhere + " and status<4"); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); result.success(); -- 2.40.0.windows.1 From 45a24cb0bec62b3deca5061df0423952a4ebb390 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 9 Dec 2022 15:39:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D,=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/department/param/DeptSearchParam.java | 1 + .../organization/service/impl/DepartmentServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/engine/organization/entity/department/param/DeptSearchParam.java b/src/com/engine/organization/entity/department/param/DeptSearchParam.java index bb4b005e..93b53094 100644 --- a/src/com/engine/organization/entity/department/param/DeptSearchParam.java +++ b/src/com/engine/organization/entity/department/param/DeptSearchParam.java @@ -31,4 +31,5 @@ public class DeptSearchParam extends BaseQueryParam { private String uuid; private Double showOrder; private Integer showOrderOfTree; + private Boolean forbiddenTag; } diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index c5d607ba..24a91fba 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -182,10 +182,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService @Override public int updateForbiddenTagById(DeptSearchParam params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); - DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).canceled(params.getCanceled() ? 0 : 1).build(); + DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).canceled(params.getForbiddenTag() ? 0 : 1).build(); Map map = new HashMap<>(); - map.put("id", departmentPO.getId()); - map.put("forbiddenTag", departmentPO.getCanceled()); + map.put("id", Util.null2String(departmentPO.getId())); + map.put("forbiddenTag", Util.null2String(departmentPO.getCanceled())); new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync(); return 1; } -- 2.40.0.windows.1