部门拖拽:分部优化
This commit is contained in:
parent
63491e9906
commit
2fdd604872
|
|
@ -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<String, Object> params = new HashMap<>();
|
||||
params.put("id",sourceId);
|
||||
params.put("supsubcomid",targetId);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
|
||||
} else {
|
||||
//转移到部门下
|
||||
List<DepartmentPO> 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<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(deptById.getId());
|
||||
forbiddenChildTag(deptById.getSubCompanyId1(), deptList);
|
||||
}
|
||||
}
|
||||
// 更新EC部门
|
||||
updateEcDepartment(deptById);
|
||||
// 刷新岗位分部
|
||||
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(deptById.getId());
|
||||
forbiddenChildTag(deptById.getSubCompanyId1(), deptList);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue