拖拽逻辑代码优化

pull/217/head
Mlin 2 years ago
parent 49e9e33624
commit 2a6d6dfd16

@ -704,15 +704,15 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
OrganizationAssert.isFalse("d".equals(targetType), "分部不能拖拽至部门下"); OrganizationAssert.isFalse("d".equals(targetType), "分部不能拖拽至部门下");
if ("c".equals(targetType)) {// 集团下上级分部为0 if ("c".equals(targetType)) {// 集团下上级分部为0
params.put("supsubcomid", "0"); params.put("supsubcomid", "0");
}else if ("s".equals(targetType)){ } else if ("s".equals(targetType)) {
params.put("supsubcomid", targetId);//上下级关系 params.put("supsubcomid", targetId);//上下级关系
} }
}else{//外部 } else {//外部
if("s".equals(targetType)){// 分部外(平级) if ("s".equals(targetType)) {// 分部外(平级)
params.put("supsubcomid",supId); params.put("supsubcomid", supId);
}else{// 部门外(找上级) } else {// 部门外(找上级)
OrganizationAssert.isFalse("d".equals(ftype), "分部不能拖拽至部门下"); OrganizationAssert.isFalse("d".equals(ftype), "分部不能拖拽至部门下");
params.put("supsubcomid",supId); params.put("supsubcomid", supId);
} }
} }
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync(); new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
@ -721,10 +721,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
Set<Integer> disableIds = new HashSet<>(); Set<Integer> disableIds = new HashSet<>();
if ("0".equals(dragPostion)) {//内部 if ("0".equals(dragPostion)) {//内部
OrganizationAssert.isFalse("c".equals(targetType), "部门不能拖拽至集团下"); OrganizationAssert.isFalse("c".equals(targetType), "部门不能拖拽至集团下");
if("s".equals(targetType)){ if ("s".equals(targetType)) {
deptById.setSubCompanyId1(Util.getIntValue(targetId)); deptById.setSubCompanyId1(Util.getIntValue(targetId));
deptById.setSupDepId(null); deptById.setSupDepId(null);
}else{ } else {
deptListByPId = getDepartmentMapper().getDeptListByPId(Util.getIntValue(targetId)); deptListByPId = getDepartmentMapper().getDeptListByPId(Util.getIntValue(targetId));
disableIds.add(Util.getIntValue(sourceKey.substring(1))); disableIds.add(Util.getIntValue(sourceKey.substring(1)));
if (CollectionUtils.isNotEmpty(deptListByPId)) { if (CollectionUtils.isNotEmpty(deptListByPId)) {
@ -735,12 +735,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(Util.getIntValue(targetId)); DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(Util.getIntValue(targetId));
deptById.setSubCompanyId1(parentDepartment.getSubCompanyId1()); deptById.setSubCompanyId1(parentDepartment.getSubCompanyId1());
} }
}else{//外部 } else {//外部
if("s".equals(targetType)){ if ("s".equals(targetType)) {
OrganizationAssert.isFalse("0".equals(supId), "部门不能拖拽至集团下"); OrganizationAssert.isFalse("0".equals(supId), "部门不能拖拽至集团下");
deptById.setSubCompanyId1(Util.getIntValue(supId)); deptById.setSubCompanyId1(Util.getIntValue(supId));
deptById.setSupDepId(null); deptById.setSupDepId(null);
}else{ } else {
// 转移到部门外 // 转移到部门外
deptListByPId = getDepartmentMapper().getDeptListByPId(Util.getIntValue(supId)); deptListByPId = getDepartmentMapper().getDeptListByPId(Util.getIntValue(supId));
disableIds.add(Util.getIntValue(sourceKey.substring(1))); disableIds.add(Util.getIntValue(sourceKey.substring(1)));

Loading…
Cancel
Save