From 8383c08a0635056618e232494626e115b1bf5daf Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 13 Dec 2022 18:19:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/mapper/comp/CompMapper.java | 2 +- .../organization/mapper/comp/CompMapper.xml | 19 ++++----- .../mapper/department/DepartmentMapper.xml | 11 +++-- .../mapper/resource/ResourceMapper.xml | 14 +++---- .../service/impl/CompServiceImpl.java | 42 ++++++++----------- .../service/impl/DepartmentServiceImpl.java | 41 +++++++++--------- .../thread/OrganizationSyncEc.java | 24 +---------- 7 files changed, 62 insertions(+), 91 deletions(-) diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index 29152732..d139b49d 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -37,7 +37,7 @@ public interface CompMapper { * @param ids * @return */ - List listChild(@Param("ids") Collection ids); + List listChild(@Param("ids") Collection ids); /** * 根据ID查询数据 diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index d93c8a52..03a49d57 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -54,7 +54,9 @@ and t.supSubComId = #{CompanyPO.supSubComId} - + + + order by ${orderSql} @@ -215,19 +217,16 @@ - - 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 50803f0d..f52a9bb0 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -95,13 +95,16 @@ from hrmdepartment t where departmentCode = #{departmentCode} - SELECT t.last_name as lastName,d.departmentname as departmentName, - c.subcompanyname as companyName,t.mobile,t.telephone,t1.last_name as managerName - from jcl_org_hrmresource t - left join hrmdepartment d on t.ec_department = d.id - left join hrmsubcompany c on t.ec_eompany = c.id - left join jcl_org_hrmresource t1 on t.manager_id = t1.id + SELECT t.lastname as lastName,d.departmentname as departmentName, + c.subcompanyname as companyName,t.mobile,t.telephone,t1.lastname as managerName + from hrmresource t + left join hrmdepartment d on t.subcompanyid1 = d.id + left join hrmsubcompany c on t.departmentid = c.id + left join hrmresource t1 on t.managerid = t1.id where 1 = 1 AND t.id IN @@ -92,7 +92,7 @@ - order by t.show_order asc + order by t.dsporder asc + + update jcl_org_job + + parent_comp = #{parentCompany}, + ec_company =#{ecCompany}, + + where delete_type = 0 + AND id IN + + #{id} + + + and ifnull(ec_department,0) = diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 172f73be..ae3597d8 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -820,15 +820,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService * @param parentComp */ private void refreshJobComp(Integer parentDepartment, Integer parentComp) { - //List jobPOS = getJobMapper().listJobsByDepartmentId(parentDepartment); - //jobPOS = jobPOS.stream().filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList()); - //if (CollectionUtils.isNotEmpty(jobPOS)) { - // getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, parentComp); - // for (JobPO jobPO : jobPOS) { - // // 刷新组织架构图 - // new JobTriggerRunnable(jobPO.getId()).run(); - // } - //} + List jobPOS = getJobMapper().listJobsByDepartmentId(parentDepartment); + jobPOS = jobPOS.stream().filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(jobPOS)) { + getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, parentComp); + } } private List getDepartmentConditionGroups(Map params) {