diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java index da7bae34..d07d15ab 100644 --- a/src/com/engine/organization/entity/department/bo/DepartmentBO.java +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -1,5 +1,7 @@ package com.engine.organization.entity.department.bo; +import com.engine.organization.entity.department.dto.DepartmentListDTO; +import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import com.engine.organization.mapper.department.DepartmentMapper; @@ -7,8 +9,7 @@ import com.engine.organization.mapper.employee.EmployeeMapper; import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections.CollectionUtils; -import java.util.Collections; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -19,7 +20,59 @@ import java.util.stream.Collectors; **/ public class DepartmentBO { - public static List buildSingleDeptTreeVOS(List departmentPOs) { + public static List buildDeptDTOList(Collection list, List filterList) { + // 搜索结果为空,直接返回空 + if (CollectionUtils.isEmpty(filterList)) { + return Collections.emptyList(); + } + // 递归添加父级数据 + Map poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item)); + List addedList = new ArrayList<>(); + for (DepartmentPO po : filterList) { + dealParentData(addedList, po, poMaps); + } + + List dtoList = addedList.stream().map(e -> DepartmentListDTO.builder() + .id(e.getId()) + .deptNo(e.getDeptNo()) + .deptName(e.getDeptName()) + .deptNameShort(e.getDeptNameShort()) + .parentComp(e.getParentComp() + "")// 命名 + .parentDept(e.getParentDept()) + .parentDeptName(null == poMaps.get(e.getParentDept()) ? "" : poMaps.get(e.getParentDept()).getDeptName()) + .deptPrincipal(getEmployeeNameById((long) e.getDeptPrincipal())) + .showOrder(e.getShowOrder()) + .forbiddenTag(e.getForbiddenTag()) + .build() + ).collect(Collectors.toList()); + Map> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept)); + return dtoList.stream().map(e -> { + e.setChildren(collects.get(e.getId())); + return e; + }).filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).collect(Collectors.toList()); + } + + public static DepartmentPO convertParamsToPO(DeptSearchParam param, Long employeeId) { + if (null == param) { + return null; + } + return DepartmentPO.builder() + .id(param.getId() == null ? 0 : param.getId()) + .deptNo(param.getDeptNo()) + .deptName(param.getDeptName()) + .deptNameShort(param.getDeptNameShort()) + .parentComp(param.getParentComp()) + .parentDept(param.getParentDept()) + .deptPrincipal(param.getDeptPrincipal()) + .showOrder(param.getShowOrder()) + .forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1) + .deleteType(0) + .createTime(new Date()) + .updateTime(new Date()) + .creator(employeeId).build(); + } + + public static List buildSingleDeptTreeVOS(List departmentPOs) { if (CollectionUtils.isEmpty(departmentPOs)) { return Collections.emptyList(); @@ -29,7 +82,7 @@ public class DepartmentBO { List singleDeptTreeVOS = departmentPOs.stream().map(e -> SingleDeptTreeVO.builder() .id(e.getId()) .deptName(e.getDeptName()) - .parentDeptName(getDeptNameById(e.getParentDept())) + .parentDeptName(getDeptNameById(e.getParentDept().intValue())) .deptPrincipalName(getEmployeeNameById((long) e.getDeptPrincipal())) .children(recursiveData(e.getId())) .build() @@ -40,8 +93,8 @@ public class DepartmentBO { } - public static String getDeptNameById(int id) { - return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id); + public static String getDeptNameById(Integer id) { + return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id); } public static String getEmployeeNameById(Long id) { @@ -49,8 +102,26 @@ public class DepartmentBO { } + /** + * 递归获取查询后数据的父级数据 + * + * @param addedList + * @param po + * @param poMaps + */ + private static void dealParentData(List addedList, DepartmentPO po, Map poMaps) { + if (!addedList.contains(po)) { + addedList.add(po); + } + DepartmentPO parentPO = poMaps.get(po.getParentDept()); + if (null != parentPO) { + dealParentData(addedList, parentPO, poMaps); + } + } + /** * 递归获取 + * * @param parentDeptId * @return */ @@ -61,17 +132,16 @@ public class DepartmentBO { } List singleDeptTreeVOS = departmentPOS.stream().map(e -> SingleDeptTreeVO.builder() - .id(e.getId()) - .deptName(e.getDeptName()) - .parentDeptName(getDeptNameById(e.getParentDept())) - .deptPrincipalName(getEmployeeNameById((long) e.getDeptPrincipal())) - .children(recursiveData(e.getId())) - .build() - ).collect(Collectors.toList()); + .id(e.getId()) + .deptName(e.getDeptName()) + .parentDeptName(getDeptNameById(e.getParentDept().intValue())) + .deptPrincipalName(getEmployeeNameById((long) e.getDeptPrincipal())) + .children(recursiveData(e.getId())) + .build() + ).collect(Collectors.toList()); return singleDeptTreeVOS; } - } diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java new file mode 100644 index 00000000..1731a5da --- /dev/null +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -0,0 +1,98 @@ +package com.engine.organization.entity.department.dto; + +import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.organization.annotation.OrganizationTable; +import com.engine.organization.annotation.OrganizationTableOperate; +import com.engine.organization.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/19 + * @Version V1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508", + tableType = WeaTableType.NONE, + operates = { + @OrganizationTableOperate(index = "0", text = "编辑"), + @OrganizationTableOperate(index = "1", text = "删除"), + @OrganizationTableOperate(index = "2", text = "合并"), + @OrganizationTableOperate(index = "3", text = "转移"), + @OrganizationTableOperate(index = "4", text = "联查岗位"), + @OrganizationTableOperate(index = "4", text = "联查人员") + }) +public class DepartmentListDTO { + + private Long id; + + /** + * 编号 + */ + @TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo") + private String deptNo; + + /** + * 名称 + */ + @TableTitle(title = "名称", dataIndex = "deptName", key = "deptName") + private String deptName; + + /** + * 简称 + */ + @TableTitle(title = "简称", dataIndex = "deptNameShort", key = "deptNameShort") + private String deptNameShort; + + /** + * 所属分部 + */ + @TableTitle(title = "所属分部", dataIndex = "parentComp", key = "parentComp") + private String parentComp; + + /** + * 上级部门 + */ + @TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName") + private String parentDeptName; + + private Long parentDept; + + /** + * 部门负责人 + */ + @TableTitle(title = "部门负责人", dataIndex = "deptPrincipal", key = "deptPrincipal") + private String deptPrincipal; + + /** + * 显示顺序 + */ + @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder") + private int showOrder; + + /** + * 说明 + */ + @TableTitle(title = "说明", dataIndex = "description", key = "description") + private String description; + + /** + * 禁用标记 + */ + @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + private int forbiddenTag; + + /** + * 子节点 + */ + private List children; +} diff --git a/src/com/engine/organization/entity/department/param/DeptSearchParam.java b/src/com/engine/organization/entity/department/param/DeptSearchParam.java new file mode 100644 index 00000000..75004134 --- /dev/null +++ b/src/com/engine/organization/entity/department/param/DeptSearchParam.java @@ -0,0 +1,37 @@ +package com.engine.organization.entity.department.param; + +import com.engine.organization.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/23 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeptSearchParam extends BaseQueryParam { + private Long id; + + private String deptNo; + + private String deptName; + + private String deptNameShort; + + private Long parentComp; + + private Long parentDept; + + private Integer deptPrincipal; + + private Integer showOrder; + + private Boolean forbiddenTag; +} diff --git a/src/com/engine/organization/entity/department/po/DepartmentPO.java b/src/com/engine/organization/entity/department/po/DepartmentPO.java index e06c1a0b..512b0367 100644 --- a/src/com/engine/organization/entity/department/po/DepartmentPO.java +++ b/src/com/engine/organization/entity/department/po/DepartmentPO.java @@ -27,17 +27,17 @@ public class DepartmentPO { private String deptNameShort; - private int parentComp; + private Long parentComp; - private int parentDept; + private Long parentDept; - private int deptPrincipal; //部门负责人 + private Integer deptPrincipal; //部门负责人 - private int showOrder; + private Integer showOrder; private String description; - private int forbiddenTag; + private Integer forbiddenTag; private Long creator; diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java index 50db87a4..479fcc67 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -1,8 +1,24 @@ package com.engine.organization.entity.extend.bo; +import com.api.browser.bean.BrowserBean; +import com.api.browser.bean.BrowserValueInfo; +import com.api.browser.bean.SearchConditionItem; +import com.api.browser.service.BrowserValueInfoService; +import com.api.browser.util.BrowserInitUtil; +import com.api.browser.util.ConditionFactory; +import com.api.browser.util.ConditionType; import com.api.hrm.bean.FieldItem; import com.api.hrm.util.FieldType; +import com.api.hrm.util.ServiceUtil; +import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit; import com.engine.organization.entity.extend.po.ExtendInfoPO; +import com.engine.organization.util.OrganizationFormItemUtil; +import com.engine.sensitive.biz.SensitiveWordTypeComInfo; +import weaver.file.ImageFileManager; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.definedfield.HrmFieldManager; +import weaver.systeminfo.SystemEnv; import java.util.ArrayList; import java.util.HashMap; @@ -17,8 +33,14 @@ import java.util.Map; */ public class ExtendInfoBO { + public static String DATE_SELECT = "select"; + public static String DATE_FROM = "from"; + public static String DATE_TO = "to"; + public static String DATE_Time_FROM = "_start"; + public static String DATE_Time_TO = "_end"; + // 封装对象为table组件 - public static List> convertInfoListToTable(List infoPOList, int viewAttr, boolean showLabel) { + public static List> convertInfoListToTable(User user, List infoPOList, int viewAttr, boolean showLabel) { List> lsCol = new ArrayList>(); Map col = null; @@ -31,7 +53,7 @@ public class ExtendInfoBO { col.put("key", tmpkey); col.put("dataIndex", tmpkey); - col.put("com", getFieldDetialInfo(extendInfoPO, viewAttr, showLabel, width)); + col.put("com", getFieldDetialInfo(user, extendInfoPO, viewAttr, showLabel, width)); col.put("width", width + "%"); @@ -45,13 +67,14 @@ public class ExtendInfoBO { /** * 明细表字段 * + * @param user * @param extendInfoPO * @param viewAttr * @return */ - private static List getFieldDetialInfo(ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { + private static List getFieldDetialInfo(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { List ls = new ArrayList(); - FieldItem fieldItem = createField(extendInfoPO, viewAttr, showLabel, width); + FieldItem fieldItem = createField(user, extendInfoPO, viewAttr, showLabel, width); ls.add(fieldItem); return ls; } @@ -59,13 +82,14 @@ public class ExtendInfoBO { /** * 创建列表字段信息 * + * @param user * @param extendInfoPO * @param viewAttr * @param showLabel * @param width * @return */ - private static FieldItem createField(ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { + private static FieldItem createField(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { FieldItem fieldItem = new FieldItem(); if (showLabel) { fieldItem.setLabel(extendInfoPO.getFieldNameDesc()); @@ -88,6 +112,12 @@ public class ExtendInfoBO { } } + // 浏览按钮特殊处理 + if (FieldType.BROWSER.equals(fieldItem.getType())) { + BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), "").getBrowserConditionParam(); + fieldItem.setBrowserConditionParam(browserConditionParam); + } + fieldItem.setWidth(width + "%"); return fieldItem; } @@ -98,7 +128,7 @@ public class ExtendInfoBO { * @param fieldhtmltype * @return */ - public static FieldType getFieldhtmltype(String fieldhtmltype) { + private static FieldType getFieldhtmltype(String fieldhtmltype) { FieldType fieldtype = null; if (fieldhtmltype.equals("1")) { fieldtype = FieldType.INPUT; @@ -117,4 +147,272 @@ public class ExtendInfoBO { } return fieldtype; } + + + public static SearchConditionItem getSearchConditionItem(User user, int viewAttr, ExtendInfoPO extendInfoPO, Object fieldvalue) { + SearchConditionItem searchConditionItem = null; + try { + if (user == null) { + user = new User(); + user.setLanguage(7); + } + ConditionFactory conditionFactory = new ConditionFactory(user); + HrmFieldManager hrmFieldManager = new HrmFieldManager(); + String fieldid = Util.null2String(extendInfoPO.getId());//字段id + String fieldname = Util.null2String(extendInfoPO.getFieldName());//字段名 + String fieldlabel = Util.null2String(extendInfoPO.getFieldNameDesc());//字段显示名 + String fieldhtmltype = Util.null2String(extendInfoPO.getControlType());//字段类型 + String detailtype = Util.null2String(extendInfoPO.getBrowserType());//字段二级类型(浏览框--单人力) + String dmlurl = Util.null2String(""); + boolean isQuickSearch = true; + boolean isScope = false; + + if (fieldhtmltype.equals("1")) {//单行文本框 + if (isScope) {//范围 + if (Util.null2String(fieldvalue).length() == 0) { + fieldvalue = new HashMap(); + } + searchConditionItem = conditionFactory.createCondition(ConditionType.SCOPE, fieldlabel, new String[]{fieldname, fieldname + "to"}); + } else if (detailtype.equals("2")) {//数字 + searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, fieldlabel, fieldname, isQuickSearch); + } + } else if (fieldhtmltype.equals("2")) {//多行文本框 + searchConditionItem = conditionFactory.createCondition(ConditionType.TEXTAREA, fieldlabel, fieldname); + } else if (fieldhtmltype.equals("3")) {//浏览按钮 + if (detailtype.equals("2")) { + if (!extendInfoPO.getTableName().toLowerCase().contains("_dt")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATE, fieldlabel, fieldname, detailtype); + searchConditionItem.setDomkey(new String[]{fieldname + DATE_SELECT, fieldname + DATE_FROM, fieldname + DATE_TO}); + searchConditionItem.setOptions(ServiceUtil.getDateSelectFromTo(user.getLanguage())); + } + } else if (detailtype.equals("19")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.TIMEPICKER, fieldlabel, fieldname, detailtype); + } else if (detailtype.equals("402")) { // 年 + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname, detailtype); + searchConditionItem.setFormat("yyyy"); + searchConditionItem.setMode("year"); + searchConditionItem.setPlaceholder(SystemEnv.getHtmlLabelNames("526306", user.getLanguage())); + searchConditionItem.setShowTime(false); + } else if (detailtype.equals("403")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname, detailtype); + searchConditionItem.setFormat("yyyy-MM"); + searchConditionItem.setMode("month"); + searchConditionItem.setPlaceholder(SystemEnv.getHtmlLabelNames("126137", user.getLanguage())); + searchConditionItem.setShowTime(false); + } else if (detailtype.equals("RANGEPICKER")) {//日期区间 + String[] domkey = new String[]{DATE_FROM + fieldname, DATE_TO + fieldname}; + searchConditionItem = conditionFactory.createCondition(ConditionType.RANGEPICKER, fieldlabel, domkey); + searchConditionItem.setValue(fieldvalue); + } else if (detailtype.equals("TIMERANGEPICKER")) {//时间区间 + String[] domkey = new String[]{fieldname + DATE_Time_FROM, fieldname + DATE_Time_TO}; + searchConditionItem = conditionFactory.createCondition(ConditionType.TIMERANGEPICKER, fieldlabel, domkey); + searchConditionItem.setValue(fieldvalue); + } else { + //if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) { + // BrowserBean browserbean = new BrowserBean(detailtype + ""); + // BrowserInitUtil browserInitUtil = new BrowserInitUtil(); + // String fielddbtype = dmlurl; + // if (!dmlurl.startsWith("browser.")) { + // fielddbtype = "browser." + dmlurl; + // } + // if (detailtype.equals("161") || detailtype.equals("162")) { + // browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID()); + // } else { + // browserbean.getDataParams().put("cube_treeid", dmlurl); + // browserbean.getDataParams().put("currenttime", System.currentTimeMillis()); + // browserInitUtil.initBrowser(browserbean, user.getLanguage()); + // } + // searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, SystemEnv.getHtmlLabelNames(fieldlabel, user.getLanguage()), new String[]{fieldname}, browserbean); + //} else { + searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype); + //} + // searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(hrmFieldBean.getHideVirtualOrg()); + List> replaceDatas = new ArrayList>(); + String tmpFieldValue = Util.null2String(fieldvalue); + if (detailtype.equals("mkqshift")) { + ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit(); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + String fieldshowname = Util.null2String(shiftManagementToolKit.getShiftOnOffWorkSections(fieldvalues[i], user.getLanguage())); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else if (detailtype.equals("sensitivewordstype")) { + SensitiveWordTypeComInfo sensitiveWordTypeComInfo = new SensitiveWordTypeComInfo(); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + String fieldshowname = Util.null2String(sensitiveWordTypeComInfo.getName(fieldvalues[i])); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else if (detailtype.equals("doccategory")) { + List fieldvalues = new BrowserValueInfoService().getBrowserValueInfo(detailtype, Util.null2String(fieldvalue)); + for (int i = 0; fieldvalues != null && i < fieldvalues.size(); i++) { + BrowserValueInfo valueInfo = fieldvalues.get(i); + String fieldshowname = valueInfo.getName(); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", valueInfo.getId()); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else { + if (tmpFieldValue.length() > 0) { + String fieldshowname = hrmFieldManager.getFieldvalue(user, dmlurl, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + String[] fieldshownames = Util.splitString(fieldshowname, ","); + if (detailtype.equals("257")) { + if (fieldshowname.endsWith(" ")) { + fieldshowname = fieldshowname.substring(0, fieldshowname.length() - 5); + } + fieldshownames = Util.splitString(fieldshowname, " "); + } + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + if (fieldvalues.length != fieldshownames.length) { + break; + } + if (Util.null2String(fieldshownames[i]).length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshownames[i]); + replaceDatas.add(replaceData); + } + } + } + fieldvalue = replaceDatas; + } + } else if (fieldhtmltype.equals("4")) {//Check框 + searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, fieldlabel, fieldname); + if (detailtype.equals("2")) { + searchConditionItem.setConditionType(ConditionType.SWITCH); + } + + } else if (fieldhtmltype.equals("5")) { //选择框 + // List statusOptions = hrmFieldBean.getSelectOption(); + // if (statusOptions == null) statusOptions = new ArrayList(); + // try { + // if (fieldid.length() > 0) { + // rs = new RecordSet(); + // char flag = Util.getSeparator(); + // if (hrmFieldBean.getIsFormField()) { + // if (Util.null2String(hrmFieldBean.getIssystem()).equals("1")) { + // rs.executeProc("hrm_selectitembyid_new", "" + fieldid + flag + 1); + // } else { + // rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1); + // } + // } else { + // if (fieldname.startsWith("column_")) { + // rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1); + // } else { + // rs.executeProc("hrm_searchselectitembyid", fieldid); + // } + // } + // while (rs.next()) { + // String tmpselectvalue = Util.null2String(rs.getString("selectvalue")); + // String tmpselectname = Util.toScreen(rs.getString("selectname"), user.getLanguage()); + // if (Util.null2String(rs.getString("cancel")).equals("1")) continue; + // boolean isDefault = Util.null2String(rs.getString("isdefault")).equals("y"); + // if (!isDefault) { + // isDefault = Util.null2String(rs.getString("hrm_isdefault")).equals("1"); + // } + // SearchConditionOption searchConditionOption = new SearchConditionOption(tmpselectvalue, tmpselectname, isDefault); + // if (!statusOptions.contains(searchConditionOption)) { + // statusOptions.add(searchConditionOption); + // } + // } + // } + // } catch (Exception e) { + // writeLog(e); + // } + // searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, statusOptions); + // if (detailtype.equals("") || detailtype.equals("0")) { + // detailtype = "1"; + // } + // searchConditionItem.setKey(Util.null2String(fieldvalue)); + // searchConditionItem.setValue(fieldvalue); + // searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3)); + } else if (fieldhtmltype.equals("6")) {//附件 + if (fieldname.equals("resourceimageid")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.UPLOAD, fieldlabel, fieldname, isQuickSearch); + searchConditionItem.setUploadUrl("/api/doc/upload/uploadFile"); + searchConditionItem.setCategory("category"); + searchConditionItem.setMaxFilesNumber(10); + searchConditionItem.setMultiSelection(true); + Map otherParamsMap = new HashMap<>(); + otherParamsMap.put("showClearAll", false); + otherParamsMap.put("showOrder", true); + searchConditionItem.setOtherParams(otherParamsMap); + if (Util.null2String(fieldvalue).length() > 0) { + List datas = new ArrayList(); + Map data = null; + String[] tmpIds = Util.splitString(Util.null2String(fieldvalue), ","); + for (int i = 0; i < tmpIds.length; i++) { + String fileid = tmpIds[i]; + ImageFileManager manager = new ImageFileManager(); + manager.getImageFileInfoById(Util.getIntValue(fileid)); + String filename = manager.getImageFileName(); + String extname = filename.contains(".") ? filename.substring(filename.lastIndexOf(".") + 1) : ""; + data = new HashMap(); + data.put("acclink", "/weaver/weaver.file.FileDownload?fileid=" + fileid); + data.put("fileExtendName", extname); + data.put("fileid", fileid); + //if (Util.null2String(this.isMobile).equals("1")) { + // data.put("filelink", "/spa/document/static4mobile/index.html#/attach/" + fileid); + //} else { + data.put("filelink", "/spa/document/index2file.jsp?imagefileId=" + fileid + "#/main/document/fileView"); + //} + data.put("filename", filename); + data.put("filesize", manager.getImgsize()); + data.put("imgSrc", ""); + data.put("isImg", ""); + data.put("loadlink", "/weaver/weaver.file.FileDownload?fileid=" + fileid + "&download=1"); + data.put("showDelete", "true"); + data.put("showLoad", "true"); + datas.add(data); + } + searchConditionItem.setDatas(datas); + } + } + } else if (fieldhtmltype.equals("7")) {//颜色选择 + searchConditionItem = conditionFactory.createCondition(ConditionType.COLORPICKER, fieldlabel, fieldname, true); + searchConditionItem.setValue(fieldvalue); + } else if (fieldhtmltype.equals("8")) {//DESCRIPTION + searchConditionItem = conditionFactory.createCondition(ConditionType.DESCRIPTION, fieldlabel, fieldname); + searchConditionItem.setValue(fieldvalue); + } + if (searchConditionItem != null) { + BrowserInitUtil.setConditionItemDefaultValue(searchConditionItem, fieldvalue, 2); + searchConditionItem.setLabelcol(6); + searchConditionItem.setFieldcol(12); + searchConditionItem.setViewAttr(viewAttr); + if (searchConditionItem.getBrowserConditionParam() != null) { + searchConditionItem.getBrowserConditionParam().setViewAttr(viewAttr); + } + if (searchConditionItem.getConditionType().equals(ConditionType.DATE)) { + searchConditionItem.setFieldcol(18); + } + + if (Util.null2String(extendInfoPO.getFieldNameDesc()).length() > 0) { + searchConditionItem.setLabel(extendInfoPO.getFieldNameDesc()); + } + + } + } catch (Exception e) { + throw new RuntimeException(e); + } + + return searchConditionItem; + } } diff --git a/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java b/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java index acdd7b1a..aba76bc9 100644 --- a/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java +++ b/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java @@ -53,6 +53,12 @@ public class ExtendInfoPO { */ private Integer controlType; + + /** + * 浏览按钮类型 + */ + private String browserType; + /** * 分组主键 */ diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.java b/src/com/engine/organization/mapper/department/DepartmentMapper.java index cbf2912b..f11d7f57 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.java +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.java @@ -3,6 +3,7 @@ package com.engine.organization.mapper.department; import com.engine.organization.entity.department.po.DepartmentPO; import org.apache.ibatis.annotations.Param; +import java.util.Collection; import java.util.List; /** @@ -15,7 +16,26 @@ public interface DepartmentMapper { List getDeptListByCompId(@Param("parentComp") int parentComp); - List getDeptListByPId(@Param("PId")Long PId); + List getDeptListByPId(@Param("PId") Long PId); - String getDeptNameById(@Param("id")int id); + List getDeptList(DepartmentPO departmentPO); + + /** + * 获取顶级数据 + * + * @return + */ + List listParent(); + + /** + * 获取子层级数据 + * + * @param ids + * @return + */ + List listChild(@Param("ids") Collection ids); + + DepartmentPO getDeptById(@Param("id") int id); + + String getDeptNameById(@Param("id") int id); } diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index 49ecedaa..9b022ad2 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -1,20 +1,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + and t.dept_no like CONCAT('%',#{deptNo},'%') + + + and t.dept_name like CONCAT('%',#{deptName},'%') + + + and t.dept_name_short like CONCAT('%',#{deptNameShort},'%') + + + + + + and t.dept_no like '%'||#{deptNo}||'%' + + + and t.dept_name like '%'||#{deptName}||'%' + + + and t.dept_name_short like '%'||#{deptNameShort}||'%' + + + + + + and t.dept_no like '%'+#{deptNo}+'%' + + + and t.dept_name like '%'+#{deptName}+'%' + + + and t.dept_name_short like '%'+#{deptNameShort}+'%' + + + + + and ifnull(parent_dept,'0')='0' + + + + and isnull(parent_dept,'0')='0' + + + + and NVL(parent_dept,'0')='0' + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/comp/CompExtDTMapper.java b/src/com/engine/organization/mapper/extend/ExtDTMapper.java similarity index 85% rename from src/com/engine/organization/mapper/comp/CompExtDTMapper.java rename to src/com/engine/organization/mapper/extend/ExtDTMapper.java index 31f05c9f..baf68619 100644 --- a/src/com/engine/organization/mapper/comp/CompExtDTMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtDTMapper.java @@ -1,6 +1,5 @@ -package com.engine.organization.mapper.comp; +package com.engine.organization.mapper.extend; -import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,7 +11,7 @@ import java.util.Map; * @createTime: 2022/05/20 * @version: 1.0 */ -public interface CompExtDTMapper { +public interface ExtDTMapper { /** * 根据主表id,查询拓展表数据 @@ -21,7 +20,6 @@ public interface CompExtDTMapper { * @param id * @return */ - @MapKey("id") List> listCompExtDT(@Param("tableName") String tableName, @Param("id") long id, @Param("fields") String fields); /** diff --git a/src/com/engine/organization/mapper/comp/CompExtDTMapper.xml b/src/com/engine/organization/mapper/extend/ExtDTMapper.xml similarity index 84% rename from src/com/engine/organization/mapper/comp/CompExtDTMapper.xml rename to src/com/engine/organization/mapper/extend/ExtDTMapper.xml index 4ecb3ac4..d9ef99a7 100644 --- a/src/com/engine/organization/mapper/comp/CompExtDTMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtDTMapper.xml @@ -1,6 +1,6 @@ - + @@ -21,7 +21,7 @@ where mainid = #{mainId} - select ${fields} from ${tableName} where mainid = #{id} diff --git a/src/com/engine/organization/mapper/comp/CompExtMapper.java b/src/com/engine/organization/mapper/extend/ExtMapper.java similarity index 92% rename from src/com/engine/organization/mapper/comp/CompExtMapper.java rename to src/com/engine/organization/mapper/extend/ExtMapper.java index ff6482d7..da7b11d5 100644 --- a/src/com/engine/organization/mapper/comp/CompExtMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtMapper.java @@ -1,4 +1,4 @@ -package com.engine.organization.mapper.comp; +package com.engine.organization.mapper.extend; import org.apache.ibatis.annotations.Param; @@ -10,7 +10,7 @@ import java.util.Map; * @createTime: 2022/05/20 * @version: 1.0 */ -public interface CompExtMapper { +public interface ExtMapper { /** * 根据主表id,查询主表拓展表数据 diff --git a/src/com/engine/organization/mapper/comp/CompExtMapper.xml b/src/com/engine/organization/mapper/extend/ExtMapper.xml similarity index 93% rename from src/com/engine/organization/mapper/comp/CompExtMapper.xml rename to src/com/engine/organization/mapper/extend/ExtMapper.xml index e2305c1c..40b9672f 100644 --- a/src/com/engine/organization/mapper/comp/CompExtMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml index c06dec91..5d9855cc 100644 --- a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml @@ -9,6 +9,7 @@ + @@ -35,6 +36,7 @@ , t.field_name_desc , t.field_type , t.control_type + , t.browser_type , t.extend_group_id , t.isenable , t.isrequired diff --git a/src/com/engine/organization/service/DepartmentService.java b/src/com/engine/organization/service/DepartmentService.java index 0a32073b..79ae4d39 100644 --- a/src/com/engine/organization/service/DepartmentService.java +++ b/src/com/engine/organization/service/DepartmentService.java @@ -1,9 +1,12 @@ package com.engine.organization.service; +import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.param.QuerySingleDeptListParam; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import com.engine.organization.util.page.PageInfo; +import java.util.Map; + /** * @Author weaver_cl * @Description: TODO @@ -15,8 +18,35 @@ public interface DepartmentService { /** * 根据分部id获取部门tree * 联查部门 + * * @param param * @return */ PageInfo getDeptListByPid(QuerySingleDeptListParam param); + + /** + * 列表数据展示 + * + * @param param + * @return + */ + Map listPage(DeptSearchParam param); + + /** + * 保存部门基础信息 + * + * @param params + * @return + */ + int saveBaseComp(DeptSearchParam params); + + + /** + * 获取新增表单 + * + * @return + */ + Map getSaveForm(); + + } diff --git a/src/com/engine/organization/service/ExtService.java b/src/com/engine/organization/service/ExtService.java new file mode 100644 index 00000000..4165b5b9 --- /dev/null +++ b/src/com/engine/organization/service/ExtService.java @@ -0,0 +1,77 @@ +package com.engine.organization.service; + +import com.api.browser.bean.SearchConditionItem; +import com.engine.organization.entity.TopTab; +import weaver.hrm.User; + +import java.util.List; +import java.util.Map; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/24 + * @version: 1.0 + */ +public interface ExtService { + + /** + * 组装主表拓展表表单 + * + * @param user + * @param extendType + * @param tableName + * @param viewAttr + * @param id + * @param groupId + * @return + */ + List getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId); + + /** + * 组装明细表表单 + * + * @param user + * @param extendType + * @param tableName + * @param id + * @param viewAttr + * @param showLabel + * @return + */ + List> getExtendTables(User user, String extendType, String tableName, long id, int viewAttr, boolean showLabel); + + /** + * 拓展页面分组 + * + * @param extendType + * @param tableName + * @return + */ + List getTabInfo(String extendType, String tableName); + + + /** + * 更新主表拓展表 + * + * @param user + * @param extendType + * @param tableName + * @param params + * @param groupId + * @param id + * @return + */ + int updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id); + + /** + * 更新明细表 + * + * @param user + * @param extendType + * @param tableName + * @param params + * @param id + */ + void updateExtDT(User user, String extendType, String tableName, Map params, Long id); +} diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 22b1b10d..bd6f7765 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -8,21 +8,17 @@ import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionOption; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.organization.component.OrganizationWeaTable; -import com.engine.organization.entity.TopTab; import com.engine.organization.entity.comp.bo.CompBO; import com.engine.organization.entity.comp.dto.CompListDTO; import com.engine.organization.entity.comp.param.CompSearchParam; import com.engine.organization.entity.comp.po.CompPO; -import com.engine.organization.entity.extend.bo.ExtendInfoBO; -import com.engine.organization.entity.extend.po.ExtendInfoPO; -import com.engine.organization.mapper.comp.CompExtDTMapper; -import com.engine.organization.mapper.comp.CompExtMapper; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.extend.ExtendGroupMapper; -import com.engine.organization.mapper.extend.ExtendInfoMapper; import com.engine.organization.service.CompService; +import com.engine.organization.service.ExtService; import com.engine.organization.util.MenuBtn; import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationFormItemUtil; @@ -34,6 +30,7 @@ import org.apache.commons.collections4.CollectionUtils; import weaver.crm.Maint.SectorInfoComInfo; import weaver.general.StringUtil; import weaver.general.Util; +import weaver.hrm.User; import weaver.hrm.resource.ResourceComInfo; import java.util.*; @@ -70,16 +67,8 @@ public class CompServiceImpl extends Service implements CompService { return MapperProxyFactory.getProxy(ExtendGroupMapper.class); } - private ExtendInfoMapper getExtendInfoMapper() { - return MapperProxyFactory.getProxy(ExtendInfoMapper.class); - } - - private CompExtDTMapper getCompExtDTMapper() { - return MapperProxyFactory.getProxy(CompExtDTMapper.class); - } - - private CompExtMapper getCompExtMapper() { - return MapperProxyFactory.getProxy(CompExtMapper.class); + private ExtService getExtService(User user) { + return ServiceUtil.getService(ExtServiceImpl.class, user); } @@ -92,8 +81,10 @@ public class CompServiceImpl extends Service implements CompService { List list = new ArrayList<>(); list.addAll(parentList); - // 递归查询子数据 - getChildPOs(parentList, list); + if (CollectionUtils.isNotEmpty(parentList)) { + // 递归查询子数据 + getChildPOs(parentList, list); + } CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID()); // 搜索条件过滤数据 @@ -146,52 +137,12 @@ public class CompServiceImpl extends Service implements CompService { // 更新主表数据 updateBaseComp = getCompMapper().updateBaseComp(compPO); } else { - List extInfoPOList = getExtendInfoMapper().listFields(EXTEND_TYPE, groupId, JCL_ORG_COMPEXT); - List extFields = extInfoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList()); - Map map = new HashMap<>(); - for (String dtField : extFields) { - map.put(dtField, params.get(dtField)); - } - // 判断更新还是插入 - int count = getCompExtMapper().countCompExtById(JCL_ORG_COMPEXT, searchParam.getId()); - if (count > 0) { - map.put("update_time", compPO.getUpdateTime()); - updateBaseComp = getCompExtMapper().updateCompExt(JCL_ORG_COMPEXT, compPO.getId(), map); - } else { - map.put("creator", compPO.getCreator()); - map.put("delete_type", compPO.getDeleteType()); - map.put("create_time", compPO.getCreateTime()); - map.put("update_time", compPO.getUpdateTime()); - map.put("id", compPO.getId()); - updateBaseComp = getCompExtMapper().insertCompExt(JCL_ORG_COMPEXT, map); - } + // 更新主表拓展表 + updateBaseComp = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, compPO.getId()); } - // 获取分部明细表的所有拓展列 - List dtInfoPOList = getExtendInfoMapper().listFields(EXTEND_TYPE, "", JCL_ORG_COMPEXT_DT1); - List dtFields = dtInfoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList()); - - List> insertList = new ArrayList<>(); - // 删除明细表数据 - getCompExtDTMapper().deleteByMainID(JCL_ORG_COMPEXT_DT1, compPO.getId()); - // 处理明细表数据 - int rowNum = Util.getIntValue((String) params.get("rownum")); - for (int i = 0; i < rowNum; i++) { - Map map = new HashMap<>(); - for (String dtField : dtFields) { - map.put(dtField, params.get(dtField + "_" + i)); - } - map.put("mainid", compPO.getId()); - map.put("creator", compPO.getCreator()); - map.put("delete_type", compPO.getDeleteType()); - map.put("create_time", compPO.getCreateTime()); - map.put("update_time", compPO.getUpdateTime()); - insertList.add(map); - } - // 更新拓展表数据 - for (Map map : insertList) { - getCompExtDTMapper().insertCompExtDT(JCL_ORG_COMPEXT_DT1, map); - } + //更新明细表 + getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, compPO.getId()); return updateBaseComp; } @@ -279,16 +230,17 @@ public class CompServiceImpl extends Service implements CompService { if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) { addGroups.add(new SearchConditionGroup("基本信息", true, getBaseForm(viewAttr, id))); } else { - addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtForm(viewAttr, id, groupId))); + addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtService(user).getExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, viewAttr, id, groupId))); } - HashMap resultMap = new HashMap<>(); resultMap.put("buttons", buttonsMap); resultMap.put("conditions", addGroups); resultMap.put("id", id); - resultMap.put("tabInfo", getTabInfo()); - resultMap.put("tables", getExtendTables(id, viewAttr, false)); + // 拓展页面分组 + resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_COMPEXT)); + // 处理明细表 + resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, id, viewAttr, false)); Map apiDatas = new HashMap<>(); apiDatas.put("result", resultMap); @@ -386,34 +338,6 @@ public class CompServiceImpl extends Service implements CompService { } - /** - * 处理明细表 - * - * @return - */ - private List> getExtendTables(long id, int viewAttr, boolean showLabel) { - List> tables = new ArrayList<>(); - // 查询所有分布模块,拓展明细表信息 - List infoPOList = getExtendInfoMapper().listFields(EXTEND_TYPE, "", JCL_ORG_COMPEXT_DT1); - Map> groupMap = infoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId)); - // 遍历Map,组装数据 - for (Map.Entry> entry : groupMap.entrySet()) { - Map tableMap = new HashMap<>(); - tableMap.put("hide", false); - tableMap.put("tabname", getExtendGroupMapper().getGroupNameById(entry.getKey() + "")); - Map tabinfoMap = new HashMap<>(); - tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(entry.getValue(), viewAttr, showLabel)); - tabinfoMap.put("rownum", "rownum"); - - String fields = entry.getValue().stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); - tabinfoMap.put("datas", getCompExtDTMapper().listCompExtDT(JCL_ORG_COMPEXT_DT1, id, fields)); - tableMap.put("tabinfo", tabinfoMap); - tables.add(tableMap); - } - return tables; - } - - /** * 浏览按钮类型赋值转换 * @@ -431,26 +355,6 @@ public class CompServiceImpl extends Service implements CompService { } - /** - * 拓展页面分组 - * - * @return - */ - private List getTabInfo() { - List topTabs = new ArrayList<>(); - // 基本信息 - topTabs.add(TopTab.builder().color("#000000").groupId("0").showcount(false).title("基本信息").viewCondition("0").build()); - - List infoPOList = getExtendInfoMapper().listFields(EXTEND_TYPE, "", JCL_ORG_COMPEXT); - List extendGroups = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList()); - // 拓展信息 - if (CollectionUtils.isNotEmpty(extendGroups)) { - for (Long groupId : extendGroups) { - topTabs.add(TopTab.builder().color("#000000").groupId(groupId + "").showcount(false).title(getExtendGroupMapper().getGroupNameById(groupId + "")).viewCondition(groupId + "").build()); - } - } - return topTabs; - } /** * 基本信息基础表单 @@ -532,63 +436,4 @@ public class CompServiceImpl extends Service implements CompService { } - /** - * 根据viewCondition获取拓展表单 - * - * @param viewAttr - * @param id - * @param groupId - * @return - */ - private List getExtForm(int viewAttr, long id, String groupId) { - List conditionItems = new ArrayList<>(); - - // 2编辑 1查看 - OrganizationAssert.notNull(groupId, "请选择对应的拓展页"); - List infoPOList = getExtendInfoMapper().listFields(EXTEND_TYPE, groupId, JCL_ORG_COMPEXT); - String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); - Map compExtMap = getCompExtMapper().listCompExt(JCL_ORG_COMPEXT, fields, id); - - // 组装拓展页内容 - for (ExtendInfoPO extendInfoPO : infoPOList) { - SearchConditionItem item = null; - switch (ExtendInfoBO.getFieldhtmltype(extendInfoPO.getControlType() + "")) { - case INPUT: - item = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName()); - item.setValue(compExtMap.get(extendInfoPO.getFieldName())); - break; - case TEXTAREA: - item = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 1, 60, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName()); - item.setValue(compExtMap.get(extendInfoPO.getFieldName())); - break; - case BROWSER: - // TODO - // item=OrganizationFormItemUtil.browserItem() - break; - case CHECKBOX: - item = OrganizationFormItemUtil.checkboxItem(user, 2, 16, 1, true, extendInfoPO.getFieldNameDesc(), extendInfoPO.getFieldName()); - item.setValue(compExtMap.get(extendInfoPO.getFieldName())); - break; - case SELECT: - // TODO - // item = OrganizationFormItemUtil.selectItem(); - break; - case FILEUPLOAD: - case TEXT: - default: - break; - } - if (null != item) { - // 根据viewAttr设置编辑或只读 - item.setViewAttr(viewAttr); - // 是否必填 - if (1 == extendInfoPO.getIsrequired()) { - item.setViewAttr(3); - item.setRules("required|string"); - } - conditionItems.add(item); - } - } - return conditionItems; - } } diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 44c9a89d..e3e8756e 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -1,17 +1,29 @@ package com.engine.organization.service.impl; +import com.api.browser.bean.SearchConditionGroup; +import com.api.browser.bean.SearchConditionItem; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.core.impl.Service; +import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.entity.department.bo.DepartmentBO; +import com.engine.organization.entity.department.dto.DepartmentListDTO; +import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.param.QuerySingleDeptListParam; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.service.DepartmentService; +import com.engine.organization.util.OrganizationFormItemUtil; import com.engine.organization.util.db.MapperProxyFactory; +import com.engine.organization.util.page.Column; import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageUtil; +import org.apache.commons.collections4.CollectionUtils; +import weaver.general.StringUtil; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @Author weaver_cl @@ -21,20 +33,155 @@ import java.util.List; **/ public class DepartmentServiceImpl extends Service implements DepartmentService { + private DepartmentMapper getDepartmentMapper() { + return MapperProxyFactory.getProxy(DepartmentMapper.class); + } @Override public PageInfo getDeptListByPid(QuerySingleDeptListParam param) { //1.查询分部下所有部门 - PageUtil.start(param.getCurrent(),param.getPageSize()); + PageUtil.start(param.getCurrent(), param.getPageSize()); List departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptListByCompId(param.getParentComp()); PageInfo pageInfo = new PageInfo<>(departmentPOS); List singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS); - PageInfo pageInfos = new PageInfo<>(singleDeptTreeVOS,SingleDeptTreeVO.class); + PageInfo pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleDeptTreeVO.class); pageInfos.setTotal(pageInfo.getTotal()); pageInfos.setPageNum(param.getCurrent()); pageInfos.setPageSize(param.getPageSize()); return pageInfos; } + + @Override + public Map listPage(DeptSearchParam param) { + Map datas = new HashMap<>(); + PageUtil.start(param.getCurrent(), param.getPageSize()); + List parentList = getDepartmentMapper().listParent(); + PageInfo pageInfo = new PageInfo<>(parentList); + List list = new ArrayList<>(); + list.addAll(parentList); + + if (CollectionUtils.isNotEmpty(parentList)) { + // 递归查询子数据 + getChildPOs(parentList, list); + } + DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, (long) user.getUID()); + // 搜索条件过滤数据 + List filterList = filterListByParams(list, departmentPO); + + List departmentListDTOS = DepartmentBO.buildDeptDTOList(list, filterList); + PageInfo pageInfos = new PageInfo<>(departmentListDTOS, DepartmentListDTO.class); + pageInfos.setTotal(pageInfo.getTotal()); + pageInfos.setPageNum(param.getCurrent()); + pageInfos.setPageSize(param.getPageSize()); + + OrganizationWeaTable table = new OrganizationWeaTable<>(user, DepartmentListDTO.class); + List columns = pageInfos.getColumns(); + List weaTableColumn = columns.stream().map(v -> new WeaTableColumn("100", v.getTitle(), v.getKey())).collect(Collectors.toList()); + + + table.setColumns(weaTableColumn); + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + + datas.put("pageInfo", pageInfos); + datas.put("dataKey", result.getResultMap()); + return datas; + } + + @Override + public int saveBaseComp(DeptSearchParam params) { + return 0; + } + + @Override + public Map getSaveForm() { + Map apiDatas = new HashMap<>(); + List addGroups = new ArrayList<>(); + List conditionItems = new ArrayList<>(); + // 编号 + SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "deptNo"); + deptNoItem.setRules("required|string"); + // 名称 + SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "deptName"); + deptNameItem.setRules("required|string"); + // 简称 + SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "deptNameShort"); + deptNameShortItem.setRules("required|string"); + // TODO 自定义按钮 + // 所属分部 + SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser"); + //上级部门 + SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentDept", "deptBrowser"); + // 部门负责人 + SearchConditionItem deptPrincipalItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", ""); + // 显示顺序 + SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "编号", "showOrder"); + // 说明 + SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description"); + + conditionItems.add(deptNoItem); + conditionItems.add(deptNameItem); + conditionItems.add(deptNameShortItem); + conditionItems.add(compBrowserItem); + conditionItems.add(deptBrowserItem); + conditionItems.add(deptPrincipalItem); + conditionItems.add(showOrderItem); + conditionItems.add(descriptionItem); + + + addGroups.add(new SearchConditionGroup("基本信息", true, conditionItems)); + apiDatas.put("condition", addGroups); + + return apiDatas; + } + + /** + * 通过搜索条件过滤list数据 + * + * @param departmentPOS + * @param departmentPO + * @return + */ + private List filterListByParams(Collection departmentPOS, DepartmentPO departmentPO) { + // 搜索后的数据 + List filterList = new ArrayList<>(); + // 筛选数据 + for (Iterator iterator = departmentPOS.iterator(); iterator.hasNext(); ) { + DepartmentPO next = iterator.next(); + boolean isAdd = (StringUtil.isEmpty(departmentPO.getDeptName()) || next.getDeptName().contains(departmentPO.getDeptName())) // 名称 + && (StringUtil.isEmpty(departmentPO.getDeptNo()) || next.getDeptNo().contains(departmentPO.getDeptNo()))//编号 + && (StringUtil.isEmpty(departmentPO.getDeptNameShort()) || next.getDeptNameShort().contains(departmentPO.getDeptNameShort()))//简称 + && (null == departmentPO.getParentComp() || next.getParentComp().equals(departmentPO.getParentComp()))//所属分部 + && (null == departmentPO.getParentDept() || next.getParentDept().equals(departmentPO.getParentDept()))//上级部门 + && (null == departmentPO.getDeptPrincipal() || next.getDeptPrincipal().equals(departmentPO.getDeptPrincipal()))//部门负责人 + && (null == departmentPO.getShowOrder() || next.getShowOrder().equals(departmentPO.getShowOrder()))//显示顺序 + && (null == departmentPO.getForbiddenTag() || next.getForbiddenTag().equals(departmentPO.getForbiddenTag()));//禁用标记 + + if (isAdd) { + filterList.add(next); + } + + } + return filterList; + } + + /** + * 递归获取子级数据 + * + * @param parentList + * @param list + */ + private void getChildPOs(List parentList, List list) { + List ids = parentList.stream().map(DepartmentPO::getId).collect(Collectors.toList()); + List listChild = getDepartmentMapper().listChild(ids); + if (CollectionUtils.isNotEmpty(listChild)) { + list.addAll(listChild); + getChildPOs(listChild, list); + } + } } diff --git a/src/com/engine/organization/service/impl/ExtServiceImpl.java b/src/com/engine/organization/service/impl/ExtServiceImpl.java new file mode 100644 index 00000000..fc2b4edc --- /dev/null +++ b/src/com/engine/organization/service/impl/ExtServiceImpl.java @@ -0,0 +1,167 @@ +package com.engine.organization.service.impl; + +import com.api.browser.bean.SearchConditionItem; +import com.engine.core.impl.Service; +import com.engine.organization.entity.TopTab; +import com.engine.organization.entity.extend.bo.ExtendInfoBO; +import com.engine.organization.entity.extend.po.ExtendInfoPO; +import com.engine.organization.mapper.extend.ExtDTMapper; +import com.engine.organization.mapper.extend.ExtMapper; +import com.engine.organization.mapper.extend.ExtendGroupMapper; +import com.engine.organization.mapper.extend.ExtendInfoMapper; +import com.engine.organization.service.ExtService; +import com.engine.organization.util.OrganizationAssert; +import com.engine.organization.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; +import weaver.general.Util; +import weaver.hrm.User; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/24 + * @version: 1.0 + */ +public class ExtServiceImpl extends Service implements ExtService { + + private ExtendInfoMapper getExtendInfoMapper() { + return MapperProxyFactory.getProxy(ExtendInfoMapper.class); + } + + private ExtendGroupMapper getExtendGroupMapper() { + return MapperProxyFactory.getProxy(ExtendGroupMapper.class); + } + + private ExtDTMapper getExtDTMapper() { + return MapperProxyFactory.getProxy(ExtDTMapper.class); + } + + private ExtMapper getExtMapper() { + return MapperProxyFactory.getProxy(ExtMapper.class); + } + + + @Override + public List getExtForm(User user, String extendType, String tableName, int viewAttr, long id, String groupId) { + List conditionItems = new ArrayList<>(); + + // 2编辑 1查看 + OrganizationAssert.notNull(groupId, "请选择对应的拓展页"); + List infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName); + String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); + infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); + Map compExtMap = getExtMapper().listCompExt(tableName, fields, id); + // 组装拓展页内容 + for (ExtendInfoPO extendInfoPO : infoPOList) { + SearchConditionItem item = ExtendInfoBO.getSearchConditionItem(user, viewAttr, extendInfoPO, compExtMap.get(extendInfoPO.getFieldName())); + item.setFieldcol(16); + if (null != item && 2 == viewAttr && 1 == extendInfoPO.getIsrequired()) { + item.setViewAttr(3); + item.setRules("required|string"); + } + conditionItems.add(item); + } + return conditionItems; + } + + @Override + public List> getExtendTables(User user, String extendType, String tableName, long id, int viewAttr, boolean showLabel) { + List> tables = new ArrayList<>(); + // 查询所有分布模块,拓展明细表信息 + List infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName); + Map> groupMap = infoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId)); + // 遍历Map,组装数据 + for (Map.Entry> entry : groupMap.entrySet()) { + Map tableMap = new HashMap<>(); + tableMap.put("hide", false); + tableMap.put("tabname", getExtendGroupMapper().getGroupNameById(entry.getKey() + "")); + Map tabinfoMap = new HashMap<>(); + tabinfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, entry.getValue(), viewAttr, showLabel)); + tabinfoMap.put("rownum", "rownum"); + + String fields = entry.getValue().stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); + tabinfoMap.put("datas", getExtDTMapper().listCompExtDT(tableName, id, fields)); + tableMap.put("tabinfo", tabinfoMap); + tables.add(tableMap); + } + return tables; + } + + + /** + * 拓展页面分组 + * + * @return + */ + public List getTabInfo(String extendType, String tableName) { + List topTabs = new ArrayList<>(); + // 基本信息 + topTabs.add(TopTab.builder().color("#000000").groupId("0").showcount(false).title("基本信息").viewCondition("0").build()); + + List infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName); + List extendGroups = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList()); + // 拓展信息 + if (CollectionUtils.isNotEmpty(extendGroups)) { + for (Long groupId : extendGroups) { + topTabs.add(TopTab.builder().color("#000000").groupId(groupId + "").showcount(false).title(getExtendGroupMapper().getGroupNameById(groupId + "")).viewCondition(groupId + "").build()); + } + } + return topTabs; + } + + @Override + public int updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id) { + int updateBaseComp; + List extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName); + List extFields = extInfoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList()); + Map map = new HashMap<>(); + for (String dtField : extFields) { + map.put(dtField, params.get(dtField)); + } + // 判断更新还是插入 + int count = getExtMapper().countCompExtById(tableName, id); + if (count > 0) { + map.put("update_time", new Date()); + updateBaseComp = getExtMapper().updateCompExt(tableName, id, map); + } else { + map.put("creator", user.getUID()); + map.put("delete_type", 0); + map.put("create_time", new Date()); + map.put("update_time", new Date()); + map.put("id", id); + updateBaseComp = getExtMapper().insertCompExt(tableName, map); + } + return updateBaseComp; + } + + @Override + public void updateExtDT(User user, String extendType, String tableName, Map params, Long id) { + List dtInfoPOList = getExtendInfoMapper().listFields(extendType, "", tableName); + List dtFields = dtInfoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.toList()); + + List> insertList = new ArrayList<>(); + // 删除明细表数据 + getExtDTMapper().deleteByMainID(tableName, id); + // 处理明细表数据 + int rowNum = Util.getIntValue((String) params.get("rownum")); + for (int i = 0; i < rowNum; i++) { + Map map = new HashMap<>(); + for (String dtField : dtFields) { + map.put(dtField, params.get(dtField + "_" + i)); + } + map.put("mainid", id); + map.put("creator", user.getUID()); + map.put("delete_type", 0); + map.put("create_time", new Date()); + map.put("update_time", new Date()); + insertList.add(map); + } + // 更新拓展表数据 + for (Map map : insertList) { + getExtDTMapper().insertCompExtDT(tableName, map); + } + } +} diff --git a/src/com/engine/organization/web/DepartmentController.java b/src/com/engine/organization/web/DepartmentController.java index d8b05372..e191dc0d 100644 --- a/src/com/engine/organization/web/DepartmentController.java +++ b/src/com/engine/organization/web/DepartmentController.java @@ -1,6 +1,7 @@ package com.engine.organization.web; import com.engine.common.util.ServiceUtil; +import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.param.QuerySingleDeptListParam; import com.engine.organization.util.response.ReturnResult; import com.engine.organization.wrapper.DepartmentWrapper; @@ -10,6 +11,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -25,20 +27,60 @@ import javax.ws.rs.core.MediaType; public class DepartmentController { private DepartmentWrapper getDepartmentWrapper(User user) { - return ServiceUtil.getService(DepartmentWrapper.class,user); + return ServiceUtil.getService(DepartmentWrapper.class, user); } @POST @Path("/getDeptListByPid") @Produces(MediaType.APPLICATION_JSON) - public ReturnResult getDeptListByPid(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody QuerySingleDeptListParam querySingleDeptListParam) { + public ReturnResult getDeptListByPid(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QuerySingleDeptListParam querySingleDeptListParam) { try { User user = HrmUserVarify.getUser(request, response); return getDepartmentWrapper(user).getDeptListByPid(querySingleDeptListParam); - }catch (Exception e) { + } catch (Exception e) { return ReturnResult.exceptionHandle(e.getMessage()); } } + + /** + * 获取list列表 + * + * @param request + * @param response + * @param params + * @return + */ + @POST + @Path("/listDept") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult listDept(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeptSearchParam params) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getDepartmentWrapper(user).listPage(params)); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + /** + * 新增保存表单 + * + * @param request + * @param response + * @return + */ + @GET + @Path("/getSaveForm") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult getSaveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getDepartmentWrapper(user).getSaveForm()); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + } diff --git a/src/com/engine/organization/webservice/CustomBrowserService.java b/src/com/engine/organization/webservice/CustomBrowserService.java new file mode 100644 index 00000000..d6086e7f --- /dev/null +++ b/src/com/engine/organization/webservice/CustomBrowserService.java @@ -0,0 +1,30 @@ +package com.engine.organization.webservice; + +import com.engine.organization.entity.comp.po.CompPO; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import java.util.List; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/23 + * @version: 1.0 + */ +@WebService +public interface CustomBrowserService { + + + /** + * 公司/分部 树形列表 + * 只获取未删除且启用的数据 + * + * @return + */ + @WebMethod( + operationName = "getCompTreeList", + action = "com.engine.organization.webservice.CustomBrowserService.getCompTreeList" + ) + List getCompTreeList(); +} diff --git a/src/com/engine/organization/webservice/CustomBrowserServiceImpl.java b/src/com/engine/organization/webservice/CustomBrowserServiceImpl.java new file mode 100644 index 00000000..94c0d1e1 --- /dev/null +++ b/src/com/engine/organization/webservice/CustomBrowserServiceImpl.java @@ -0,0 +1,53 @@ +package com.engine.organization.webservice; + +import com.engine.organization.entity.comp.po.CompPO; +import com.engine.organization.mapper.comp.CompMapper; +import com.engine.organization.util.db.MapperProxyFactory; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/23 + * @version: 1.0 + */ +public class CustomBrowserServiceImpl implements CustomBrowserService { + private CompMapper getCompMapper() { + return MapperProxyFactory.getProxy(CompMapper.class); + } + + @Override + public List getCompTreeList() { + // 获取所有启用数据 + List allList = getCompMapper().list().stream().filter(item -> 0 == item.getForbiddenTag()).collect(Collectors.toList()); + + List parentList = allList.stream().filter(item -> (null == item.getParentCompany() || 0 == item.getParentCompany())).collect(Collectors.toList()); + Map> compMap = allList.stream().filter(item -> (null != item.getParentCompany() && 0 != item.getParentCompany())).collect(Collectors.groupingBy(CompPO::getParentCompany)); + List returnList = new ArrayList<>(); + dealChildren(parentList, returnList, compMap); + + return returnList; + } + + /** + * 处理分部子节点 + * + * @param parentList + * @param returnList + * @param compMap + */ + private void dealChildren(List parentList, List returnList, Map> compMap) { + if (CollectionUtils.isEmpty(parentList)) { + return; + } + for (CompPO compPO : parentList) { + returnList.add(compPO); + dealChildren(compMap.get(compPO.getId()), returnList, compMap); + } + } +} diff --git a/src/com/engine/organization/wrapper/DepartmentWrapper.java b/src/com/engine/organization/wrapper/DepartmentWrapper.java index 114d5c50..8e90b9fc 100644 --- a/src/com/engine/organization/wrapper/DepartmentWrapper.java +++ b/src/com/engine/organization/wrapper/DepartmentWrapper.java @@ -2,6 +2,7 @@ package com.engine.organization.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.param.QuerySingleDeptListParam; import com.engine.organization.service.DepartmentService; import com.engine.organization.service.impl.DepartmentServiceImpl; @@ -10,6 +11,8 @@ import com.engine.organization.util.response.ReturnResult; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import weaver.hrm.User; +import java.util.Map; + /** * @Author weaver_cl * @Description: TODO @@ -19,11 +22,30 @@ import weaver.hrm.User; public class DepartmentWrapper extends Service { public DepartmentService getDepartmentService(User user) { - return ServiceUtil.getService(DepartmentServiceImpl.class,user); + return ServiceUtil.getService(DepartmentServiceImpl.class, user); } public ReturnResult getDeptListByPid(QuerySingleDeptListParam param) { PageInfo singleDeptTreeVOS = getDepartmentService(user).getDeptListByPid(param); return ReturnResult.successed(singleDeptTreeVOS); } + + /** + * 列表数据展示 + * + * @param param + * @return + */ + public Map listPage(DeptSearchParam param) { + return getDepartmentService(user).listPage(param); + } + + /** + * 获取保存表单 + * + * @return + */ + public Map getSaveForm() { + return getDepartmentService(user).getSaveForm(); + } }