From 5b0864d50356e97049f186684d22d0a81f0086c8 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 14 Jun 2022 14:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=88=86?= =?UTF-8?q?=E7=BB=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/extend/ExtendTitleMapper.java | 2 +- .../mapper/extend/ExtendTitleMapper.xml | 2 +- .../service/impl/CompServiceImpl.java | 4 +-- .../service/impl/DepartmentServiceImpl.java | 25 +++++++------- .../service/impl/JobServiceImpl.java | 34 +++++++------------ 5 files changed, 29 insertions(+), 38 deletions(-) diff --git a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java index a6e0c700..c825c5ad 100644 --- a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java @@ -18,7 +18,7 @@ public interface ExtendTitleMapper { * @param groupId * @return */ - List getTitlesByGroupID(@Param("groupId") String groupId); + List getTitlesByGroupID(@Param("groupId") Long groupId); List getTitlesByIds(@Param("ids") Collection ids); } diff --git a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml index f5ccee0d..36599d59 100644 --- a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml @@ -34,7 +34,7 @@ FROM jcl_field_extendtitle t WHERE t.delete_type = 0 - + and group_id = #{groupId} order by show_order diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 4c2235a3..f7bc2409 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -239,7 +239,7 @@ public class CompServiceImpl extends Service implements CompService { if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - List extendTitles = getExtendTitleMapper().getTitlesByGroupID(groupId); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId)); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { @@ -268,7 +268,7 @@ public class CompServiceImpl extends Service implements CompService { HasRightUtil.hasRight(user, RIGHT_NAME, false); Map apiDatas = new HashMap<>(); List addGroups = new ArrayList<>(); - List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID + ""); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue()))); diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 72f2ba4a..71f97b2c 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -17,7 +17,7 @@ import com.engine.organization.entity.department.dto.DepartmentListDTO; import com.engine.organization.entity.department.param.*; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; -import com.engine.organization.entity.extend.po.ExtendGroupPO; +import com.engine.organization.entity.extend.po.ExtendTitlePO; import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.vo.SingleJobTreeVO; @@ -25,7 +25,7 @@ import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.department.DepartmentMapper; -import com.engine.organization.mapper.extend.ExtendGroupMapper; +import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.service.DepartmentService; import com.engine.organization.service.ExtService; @@ -91,8 +91,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService return MapperProxyFactory.getProxy(CompMapper.class); } - private ExtendGroupMapper getExtendGroupMapper() { - return MapperProxyFactory.getProxy(ExtendGroupMapper.class); + private ExtendTitleMapper getExtendTitleMapper() { + return MapperProxyFactory.getProxy(ExtendTitleMapper.class); } private ExtService getExtService(User user) { @@ -293,10 +293,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_DEPTEXT : JCL_ORG_DEPT, viewAttr, id, extendGroupPO.getId().toString(), "dept_no"))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId)); + if (CollectionUtils.isNotEmpty(extendTitles)) { + for (ExtendTitlePO extendTitle : extendTitles) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_DEPTEXT : JCL_ORG_DEPT, viewAttr, id, extendTitle.getId().toString(), "dept_no"))); } } @@ -320,10 +320,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService HasRightUtil.hasRight(user, RIGHT_NAME, false); Map apiDatas = new HashMap<>(); List addGroups = new ArrayList<>(); - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendGroupPO.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue()))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); + + if (CollectionUtils.isNotEmpty(extendTitles)) { + for (ExtendTitlePO extendTitle : extendTitles) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue()))); } } apiDatas.put("condition", addGroups); diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index 7bb7f1b8..f38a2abd 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -17,8 +17,8 @@ import com.engine.organization.entity.department.bo.DepartmentBO; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.employee.vo.EmployeeTableVO; import com.engine.organization.entity.extend.bo.ExtendInfoBO; -import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendInfoPO; +import com.engine.organization.entity.extend.po.ExtendTitlePO; import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.dto.JobListDTO; import com.engine.organization.entity.job.param.JobSearchParam; @@ -29,13 +29,11 @@ import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.department.DepartmentMapper; -import com.engine.organization.mapper.extend.ExtendGroupMapper; +import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.mapper.job.JobDTMapper; import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.scheme.GradeMapper; import com.engine.organization.mapper.scheme.LevelMapper; -import com.engine.organization.mapper.scheme.SchemeMapper; -import com.engine.organization.mapper.sequence.SequenceMapper; import com.engine.organization.service.ExtService; import com.engine.organization.service.JobService; import com.engine.organization.util.HasRightUtil; @@ -117,16 +115,8 @@ public class JobServiceImpl extends Service implements JobService { return MapperProxyFactory.getProxy(DepartmentMapper.class); } - private SequenceMapper getSequenceMapper() { - return MapperProxyFactory.getProxy(SequenceMapper.class); - } - - private SchemeMapper getSchemeMapper() { - return MapperProxyFactory.getProxy(SchemeMapper.class); - } - - private ExtendGroupMapper getExtendGroupMapper() { - return MapperProxyFactory.getProxy(ExtendGroupMapper.class); + private ExtendTitleMapper getExtendTitleMapper() { + return MapperProxyFactory.getProxy(ExtendTitleMapper.class); } private ExtService getExtService(User user) { @@ -261,10 +251,10 @@ public class JobServiceImpl extends Service implements JobService { HasRightUtil.hasRight(user, RIGHT_NAME, false); Map apiDatas = new HashMap<>(); List addGroups = new ArrayList<>(); - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendGroupPO.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue()))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); + if (CollectionUtils.isNotEmpty(extendTitles)) { + for (ExtendTitlePO extendTitle : extendTitles) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue()))); } } apiDatas.put("condition", addGroups); @@ -288,10 +278,10 @@ public class JobServiceImpl extends Service implements JobService { if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_JOBEXT : JCL_ORG_JOB, viewAttr, id, extendGroupPO.getId().toString(), "job_no"))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); + if (CollectionUtils.isNotEmpty(extendTitles)) { + for (ExtendTitlePO extendTitle : extendTitles) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_JOBEXT : JCL_ORG_JOB, viewAttr, id, extendTitle.getId().toString(), "job_no"))); } } HashMap resultMap = new HashMap<>();