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();