|
|
|
@ -281,10 +281,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
|
|
|
|
|
String groupId = (String) params.get("viewCondition");
|
|
|
|
|
if ("0".equals(groupId)) {
|
|
|
|
|
groupId = GROUP_ID.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
|
|
|
|
|
DepartmentPO oldDept = getDepartmentMapper().getDeptById(searchParam.getId());
|
|
|
|
|
String deptNo = searchParam.getDeptNo();
|
|
|
|
|
if (!deptNo.equals(oldDept.getDeptNo())) {
|
|
|
|
@ -318,10 +315,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
|
|
|
|
// 更新主表数据
|
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
|
|
|
|
|
// 更新主表拓展表
|
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
|
|
|
|
|
//更新明细表
|
|
|
|
|
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
|
|
|
|
|
|
|
|
|
|
DepartmentPO newDeptById = getDepartmentMapper().getDeptById(searchParam.getId());
|
|
|
|
|
new DepartmentTriggerRunnable(oldDept, newDeptById).run();
|
|
|
|
@ -332,6 +325,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(searchParam.getId());
|
|
|
|
|
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentComp));
|
|
|
|
|
forbiddenChildTag(parentComp, ecCompanyId, childList);
|
|
|
|
|
}
|
|
|
|
|
// 更新主表拓展表
|
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, "", searchParam.getId());
|
|
|
|
|
//更新明细表
|
|
|
|
|
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
|
|
|
|
|
|
|
|
|
|
return searchParam.getId();
|
|
|
|
|
}
|
|
|
|
@ -687,7 +685,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
updateEcDepartment(targetDepartment);
|
|
|
|
|
getDepartmentMapper().updateBaseDept(targetDepartment);
|
|
|
|
|
// 更新组织架构图
|
|
|
|
|
new DepartmentTriggerRunnable(oldFParentId,targetDepartment.getId()).run();
|
|
|
|
|
new DepartmentTriggerRunnable(oldFParentId, targetDepartment.getId()).run();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -730,7 +728,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
deptById.setEcDepartment(null);
|
|
|
|
|
|
|
|
|
|
// 更新组织架构图
|
|
|
|
|
new DepartmentTriggerRunnable(company.toString(),deptById).run();
|
|
|
|
|
new DepartmentTriggerRunnable(company.toString(), deptById).run();
|
|
|
|
|
} else if ("1".equals(moveParam.getMoveType())) {
|
|
|
|
|
Long department = moveParam.getDepartment();
|
|
|
|
|
Long departmentId = Objects.requireNonNull(EcHrmRelationUtil.getJclDepartmentId(Util.null2String(department))).getId();
|
|
|
|
@ -749,7 +747,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
deptById.setEcCompany(parentDepartment.getEcCompany());
|
|
|
|
|
|
|
|
|
|
// 更新组织架构图
|
|
|
|
|
new DepartmentTriggerRunnable(Integer.toString(100000000+department.intValue()),deptById).run();
|
|
|
|
|
new DepartmentTriggerRunnable(Integer.toString(100000000 + department.intValue()), deptById).run();
|
|
|
|
|
}
|
|
|
|
|
// 更新EC部门
|
|
|
|
|
updateEcDepartment(deptById);
|
|
|
|
@ -847,7 +845,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
|
|
|
|
|
Set<CompPO> builderComps = new HashSet<>();
|
|
|
|
|
for (CompPO compPO : filterComps) {
|
|
|
|
|
buildParentComps(compPO, builderComps,allMaps);
|
|
|
|
|
buildParentComps(compPO, builderComps, allMaps);
|
|
|
|
|
}
|
|
|
|
|
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps));
|
|
|
|
|
|
|
|
|
|