|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
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;
|
|
|
|
@ -12,6 +14,7 @@ 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;
|
|
|
|
@ -19,7 +22,8 @@ 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
|
|
|
|
@ -29,6 +33,9 @@ import java.util.List;
|
|
|
|
|
**/
|
|
|
|
|
public class DepartmentServiceImpl extends Service implements DepartmentService {
|
|
|
|
|
|
|
|
|
|
private DepartmentMapper getDepartmentMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param) {
|
|
|
|
@ -38,7 +45,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptListByCompId(param.getParentComp());
|
|
|
|
|
PageInfo<DepartmentPO> pageInfo = new PageInfo<>(departmentPOS);
|
|
|
|
|
List<SingleDeptTreeVO> singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS);
|
|
|
|
|
PageInfo<SingleDeptTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS,SingleDeptTreeVO.class);
|
|
|
|
|
PageInfo<SingleDeptTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleDeptTreeVO.class);
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
@ -51,10 +58,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
PageUtil.start(param.getCurrent(), param.getPageSize());
|
|
|
|
|
List<DepartmentPO> parentList = getDepartmentMapper().listParent();
|
|
|
|
|
PageInfo<DepartmentPO> pageInfo = new PageInfo<>(parentList);
|
|
|
|
|
List<DepartmentPO> list = new ArrayList<>();
|
|
|
|
|
list.addAll(parentList);
|
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(parentList)) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(parentList)) {
|
|
|
|
|
// 递归查询子数据
|
|
|
|
|
getChildPOs(parentList, list);
|
|
|
|
|
}
|
|
|
|
@ -64,7 +72,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
|
|
|
|
|
List<DepartmentListDTO> departmentListDTOS = DepartmentBO.buildDeptDTOList(list, filterList);
|
|
|
|
|
PageInfo<DepartmentListDTO> pageInfos = new PageInfo<>(departmentListDTOS, DepartmentListDTO.class);
|
|
|
|
|
pageInfos.setTotal(pageInfos.getTotal());
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
@ -85,6 +93,53 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|
|
|
|
return datas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int saveBaseComp(DeptSearchParam params) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSaveForm() {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> 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数据
|
|
|
|
|
*
|
|
|
|
|