diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java index 9d6155db..283ffc01 100644 --- a/src/com/engine/organization/entity/department/bo/DepartmentBO.java +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -38,7 +38,7 @@ public class DepartmentBO { .subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName()) .supDepId(e.getSupDepId()) .supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName()) - // .deptPrincipal(getEmployeeNameById(e.getDeptPrincipal())) + .deptPrincipal(getEmployeeNameById(e.getId())) .showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder()) .canceled(null == e.getCanceled() ? 0 : e.getCanceled()) .build()).collect(Collectors.toList()); @@ -82,6 +82,7 @@ public class DepartmentBO { return DepartmentPO .builder() .id(param.getId() == null ? 0 : param.getId()) + .departmentId(param.getDepartmentId()) .departmentMark(param.getDepartmentMark()) .departmentName(param.getDepartmentName()) .subCompanyId1(param.getSubCompanyId1()) @@ -152,8 +153,12 @@ public class DepartmentBO { return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id); } - public static String getEmployeeNameById(Long id) { - return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(id); + public static String getEmployeeNameById(Integer id) { + Long departmentPrincipal = MapperProxyFactory.getProxy(DepartmentMapper.class).getDepartmentPrincipal(id); + if (null == departmentPrincipal) { + return ""; + } + return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(departmentPrincipal); } diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java index 5b6e0892..6b18b28e 100644 --- a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -63,11 +63,11 @@ public class DepartmentListDTO { private Integer supDepId; - ///** - // * 部门负责人 - // */ - //@TableTitle(title = "部门负责人", dataIndex = "deptPrincipal", key = "deptPrincipal") - //private String deptPrincipal; + /** + * 部门负责人 + */ + @TableTitle(title = "部门负责人", dataIndex = "deptPrincipal", key = "deptPrincipal") + private String deptPrincipal; /** * 显示顺序 diff --git a/src/com/engine/organization/entity/department/param/DeptSearchParam.java b/src/com/engine/organization/entity/department/param/DeptSearchParam.java index 3b29ee4f..bb4b005e 100644 --- a/src/com/engine/organization/entity/department/param/DeptSearchParam.java +++ b/src/com/engine/organization/entity/department/param/DeptSearchParam.java @@ -26,6 +26,7 @@ public class DeptSearchParam extends BaseQueryParam { private Boolean canceled; private String departmentCode; private Integer coadjutant; + private String departmentId; private String uuid; private Double showOrder; diff --git a/src/com/engine/organization/entity/department/po/DepartmentPO.java b/src/com/engine/organization/entity/department/po/DepartmentPO.java index 80833e4d..ba80e5e7 100644 --- a/src/com/engine/organization/entity/department/po/DepartmentPO.java +++ b/src/com/engine/organization/entity/department/po/DepartmentPO.java @@ -27,6 +27,7 @@ public class DepartmentPO { private Integer canceled; private String departmentCode; private Integer coadjutant; + private String departmentId; private Date created; private Integer creater; diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.java b/src/com/engine/organization/mapper/department/DepartmentMapper.java index 92822914..94b188a2 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.java +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.java @@ -96,4 +96,6 @@ public interface DepartmentMapper { String getIdByDepartmentCode(@Param("departmentCode") String departmentCode); + Long getDepartmentPrincipal(@Param("deptId") Integer deptId); + } diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index 4b6d195e..66be567d 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -59,6 +59,9 @@ and t.supDepId = #{departmentPO.supDepId} + + and t.id = #{departmentPO.departmentId} + order by ${orderSql} @@ -144,6 +147,11 @@ from hrmdepartment where departmentcode = #{departmentCode} + diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 47f2a37e..0a99ba57 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -321,7 +321,9 @@ public class CompServiceImpl extends Service implements CompService { } groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList)); - groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + if (CollectionUtils.isNotEmpty(extendItemList)) { + groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + } } } HashMap buttonsMap = new HashMap<>(); @@ -542,7 +544,9 @@ public class CompServiceImpl extends Service implements CompService { } } groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList)); - groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + if (CollectionUtils.isNotEmpty(extendItemList)) { + groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + } } return groupList; } diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index f0e63d6c..0d368dc2 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -367,7 +367,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService itemList.add(searchConditionItem); } groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList)); - groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + if (CollectionUtils.isNotEmpty(extendItemList)) { + groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + } } } @@ -411,12 +413,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService isCheckItem.setDetailtype(2); SearchConditionItem copySubDeptItem = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "复制子部门信息", "copySubDept"); copySubDeptItem.setDetailtype(2); - SearchConditionItem copySubJob = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "复制子部门岗位信息", "copySubJob"); - copySubJob.setDetailtype(2); condition.add(compBrowserItem); condition.add(isCheckItem); condition.add(copySubDeptItem); - condition.add(copySubJob); addGroups.add(new SearchConditionGroup("", true, condition)); return addGroups; } @@ -693,7 +692,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService return !(StringUtil.isEmpty(departmentPO.getDepartmentCode()) && StringUtil.isEmpty(departmentPO.getDepartmentName()) && null == departmentPO.getSubCompanyId1() - && null == departmentPO.getSupDepId()); + && null == departmentPO.getSupDepId() + && null == departmentPO.getDepartmentId()); } @@ -880,32 +880,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService String id = Util.null2String(params.get("id")); int viewAttr = Util.getIntValue(Util.null2String(params.get("viewattr")), 1); - String nodeType = Util.null2String(params.get("type")); String addType = Util.null2String(params.get("addType")); - DepartmentComInfo departmentComInfo = new DepartmentComInfo(); - String subcompanyid1 = ""; - String supDepId = ""; - - switch (addType) { - case "normal": - if ("subcompany".equals(nodeType)) { - subcompanyid1 = id; - } else { - subcompanyid1 = departmentComInfo.getSubcompanyid1(id); - } - break; - case "sibling": - subcompanyid1 = departmentComInfo.getSubcompanyid1(id); - supDepId = departmentComInfo.getDepartmentsupdepid(id); - break; - case "child": - subcompanyid1 = departmentComInfo.getSubcompanyid1(id); - supDepId = id; - break; - default: - break; + String subcompanyid1 = Util.null2String(params.get("subcompanyid1")); + String supDepId = Util.null2String(params.get("departmentid")); + if (StringUtils.isNotBlank(supDepId)) { + subcompanyid1 = new DepartmentComInfo().getSubcompanyid1(supDepId); } + HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo(); HrmFieldComInfo HrmFieldComInfo = new HrmFieldComInfo(); HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo(); @@ -1018,7 +1000,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService } } groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(grouplabel, user.getLanguage()), true, itemList)); - groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + if (CollectionUtils.isNotEmpty(extendItemList)) { + groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList)); + } } return groupList; }