From 2fdd60487211ccdd3e12d65f6abde26545b8e7ce Mon Sep 17 00:00:00 2001 From: Mlin Date: Tue, 1 Aug 2023 15:17:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=8B=96=E6=8B=BD:=E5=88=86?= =?UTF-8?q?=E9=83=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DepartmentServiceImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 436254fa..aa4b353e 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -680,11 +680,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService RecordSet recordSet = new RecordSet(); // 部门不能到集团下 + String sourceType = sourceKey.substring(0,1); + String sourceId = sourceKey.substring(1); String targetType = targetKey.substring(0, 1); String targetId = targetKey.substring(1); String supComId = ""; String supId = ""; String querySupIdSql; + OrganizationAssert.isFalse( "s".equals(sourceType)&&"d".equals(targetType),"分部不能转移到部门下"); if ("s".equals(targetType)) {// 分部 querySupIdSql = "select companyId as supComId,supsubcomid as supId from hrmsubcompany where id = ?"; @@ -720,8 +723,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService } else { if ("s".equals(targetType)) { //转移到分部下 - deptById.setSubCompanyId1(Util.getIntValue(targetId)); - deptById.setSupDepId(null); + Map params = new HashMap<>(); + params.put("id",sourceId); + params.put("supsubcomid",targetId); + new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync(); } else { //转移到部门下 List deptListByPId = getDepartmentMapper().getDeptListByPId(Util.getIntValue(targetId)); @@ -734,13 +739,13 @@ public class DepartmentServiceImpl extends Service implements DepartmentService deptById.setSupDepId(Util.getIntValue(targetId)); DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(Util.getIntValue(targetId)); deptById.setSubCompanyId1(parentDepartment.getSubCompanyId1()); + // 更新EC部门 + updateEcDepartment(deptById); + // 刷新岗位分部 + List deptList = getDepartmentMapper().getDeptListByPId(deptById.getId()); + forbiddenChildTag(deptById.getSubCompanyId1(), deptList); } } - // 更新EC部门 - updateEcDepartment(deptById); - // 刷新岗位分部 - List deptList = getDepartmentMapper().getDeptListByPId(deptById.getId()); - forbiddenChildTag(deptById.getSubCompanyId1(), deptList); return 1; }