|
|
|
|
package com.engine.organization.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.api.browser.bean.BrowserBean;
|
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
|
|
|
|
import com.api.hrm.bean.TreeNode;
|
|
|
|
|
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.company.bo.CompBO;
|
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
|
import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
|
|
|
|
import com.engine.organization.entity.department.param.*;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
|
|
|
|
import com.engine.organization.entity.job.bo.JobBO;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTree;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtendGroupMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
import com.engine.organization.service.DepartmentService;
|
|
|
|
|
import com.engine.organization.service.ExtService;
|
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
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.conn.RecordSet;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
* @Description: TODO
|
|
|
|
|
* @Date 2022/5/20
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
public class DepartmentServiceImpl extends Service implements DepartmentService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分组类型
|
|
|
|
|
* 1:分部
|
|
|
|
|
* 2:部门
|
|
|
|
|
* 3:岗位
|
|
|
|
|
*/
|
|
|
|
|
private static final String EXTEND_TYPE = "2";
|
|
|
|
|
/**
|
|
|
|
|
* 主表拓展表
|
|
|
|
|
*/
|
|
|
|
|
private static final String JCL_ORG_DEPTEXT = "JCL_ORG_DEPTEXT";
|
|
|
|
|
/**
|
|
|
|
|
* 明细表拓展表
|
|
|
|
|
*/
|
|
|
|
|
private static final String JCL_ORG_DEPTEXT_DT1 = "JCL_ORG_DEPTEXT_DT1";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 左侧树 类型表示
|
|
|
|
|
* <p>
|
|
|
|
|
* 0:集团
|
|
|
|
|
* 1:分部
|
|
|
|
|
* 2:部门
|
|
|
|
|
*/
|
|
|
|
|
private static final String TYPE_GROUP = "0";
|
|
|
|
|
|
|
|
|
|
private DepartmentMapper getDepartmentMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CompMapper getCompMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(CompMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ExtendGroupMapper getExtendGroupMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ExtendGroupMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ExtService getExtService(User user) {
|
|
|
|
|
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param) {
|
|
|
|
|
|
|
|
|
|
//1.查询分部下所有部门
|
|
|
|
|
//PageUtil.start(param.getCurrent(), param.getPageSize());
|
|
|
|
|
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list();
|
|
|
|
|
PageInfo<DepartmentPO> pageInfo = new PageInfo<>(departmentPOS);
|
|
|
|
|
List<SingleDeptTreeVO> singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS, param.getParentComp());
|
|
|
|
|
PageInfo<SingleDeptTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleDeptTreeVO.class);
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
|
return pageInfos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
|
|
|
|
|
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listAll();
|
|
|
|
|
PageInfo<JobPO> pageInfo = new PageInfo<>(jobPOS);
|
|
|
|
|
List<SingleJobTreeVO> singleDeptTreeVOS = JobBO.buildSingleJobTreeVOS(jobPOS, param.getParentDept());
|
|
|
|
|
PageInfo<SingleJobTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleJobTreeVO.class);
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
return pageInfos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
|
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
|
|
|
SearchTree topGroup = getTopGroup();
|
|
|
|
|
// 集团
|
|
|
|
|
List<SearchTree> companyList = new ArrayList<>();
|
|
|
|
|
companyList.add(topGroup);
|
|
|
|
|
String keyword = params.getKeyword();
|
|
|
|
|
String type = Util.null2String(params.getType());
|
|
|
|
|
String id = params.getId();
|
|
|
|
|
|
|
|
|
|
List<TreeNode> treeDatas = getFilterCompany(id, keyword);
|
|
|
|
|
// 未点击,初始化树结构
|
|
|
|
|
if (StringUtil.isEmpty(type)) {
|
|
|
|
|
dataMap.put("companys", companyList);
|
|
|
|
|
SearchTree rootCompany = getTopGroup();
|
|
|
|
|
rootCompany.setSubs(treeDatas);
|
|
|
|
|
rootCompany.setIsParent(CollectionUtils.isNotEmpty(rootCompany.getSubs()));
|
|
|
|
|
Map<String, Object> rootCompanyMap = new HashMap<>();
|
|
|
|
|
rootCompanyMap.put("rootCompany", rootCompany);
|
|
|
|
|
dataMap.put("datas", rootCompanyMap);
|
|
|
|
|
} else {
|
|
|
|
|
// 根据ID查询
|
|
|
|
|
dataMap.put("datas", treeDatas);
|
|
|
|
|
}
|
|
|
|
|
return dataMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(DeptSearchParam param) {
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, user.getUID());
|
|
|
|
|
boolean filter = isFilter(departmentPO);
|
|
|
|
|
PageInfo<DepartmentListDTO> pageInfos;
|
|
|
|
|
List<DepartmentPO> allList = getDepartmentMapper().list();
|
|
|
|
|
// 通过子级遍历父级元素
|
|
|
|
|
if (filter) {
|
|
|
|
|
// 根据条件获取元素
|
|
|
|
|
List<DepartmentPO> filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO);
|
|
|
|
|
// 添加父级元素
|
|
|
|
|
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs);
|
|
|
|
|
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
|
|
|
|
|
pageInfos = new PageInfo<>(subList, DepartmentListDTO.class);
|
|
|
|
|
pageInfos.setTotal(compListDTOS.size());
|
|
|
|
|
} else {
|
|
|
|
|
// 组合list
|
|
|
|
|
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList);
|
|
|
|
|
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
|
|
|
|
|
pageInfos = new PageInfo<>(subList, DepartmentListDTO.class);
|
|
|
|
|
pageInfos.setTotal(compListDTOS.size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pageInfos.setPageNum(param.getCurrent());
|
|
|
|
|
pageInfos.setPageSize(param.getPageSize());
|
|
|
|
|
|
|
|
|
|
OrganizationWeaTable<DepartmentListDTO> table = new OrganizationWeaTable<>(user, DepartmentListDTO.class);
|
|
|
|
|
List<Column> columns = pageInfos.getColumns();
|
|
|
|
|
List<WeaTableColumn> 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 saveBaseForm(DeptSearchParam params) {
|
|
|
|
|
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(params.getDeptNo()));
|
|
|
|
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(params, user.getUID());
|
|
|
|
|
return getDepartmentMapper().insertIgnoreNull(departmentPO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateForbiddenTagById(DeptSearchParam params) {
|
|
|
|
|
DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
|
|
|
|
return getDepartmentMapper().updateForbiddenTagById(departmentPO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateForm(Map<String, Object> params) {
|
|
|
|
|
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
|
|
|
|
|
String groupId = (String) params.get("viewCondition");
|
|
|
|
|
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(searchParam, user.getUID());
|
|
|
|
|
int updateCount = 0;
|
|
|
|
|
// 更新主表数据
|
|
|
|
|
updateCount += getDepartmentMapper().updateBaseDept(departmentPO);
|
|
|
|
|
// 更新主表拓展表
|
|
|
|
|
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, departmentPO.getId());
|
|
|
|
|
//更新明细表
|
|
|
|
|
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, departmentPO.getId());
|
|
|
|
|
|
|
|
|
|
return updateCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteByIds(Collection<Long> ids) {
|
|
|
|
|
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
|
|
|
|
return getDepartmentMapper().deleteByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
// 编号
|
|
|
|
|
SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "deptNo");
|
|
|
|
|
// 名称
|
|
|
|
|
SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "departmentName");
|
|
|
|
|
// 简称
|
|
|
|
|
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "deptNameShort");
|
|
|
|
|
// TODO
|
|
|
|
|
// 所属分部
|
|
|
|
|
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
|
|
|
|
// 上级部门
|
|
|
|
|
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "161", "parentDept", "deptBrowser");
|
|
|
|
|
// 部门负责人
|
|
|
|
|
SearchConditionItem deptPrincipalBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
|
|
|
|
|
// 显示顺序
|
|
|
|
|
SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "显示顺序", "showOrder");
|
|
|
|
|
// 禁用标记
|
|
|
|
|
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
|
|
|
|
SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
|
|
|
|
|
SearchConditionOption disableOption = new SearchConditionOption("false", "禁用");
|
|
|
|
|
selectOptions.add(enableOption);
|
|
|
|
|
selectOptions.add(disableOption);
|
|
|
|
|
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "禁用标记", "forbiddenTag");
|
|
|
|
|
|
|
|
|
|
conditionItems.add(deptNoItem);
|
|
|
|
|
conditionItems.add(deptNameItem);
|
|
|
|
|
conditionItems.add(deptNameShortItem);
|
|
|
|
|
conditionItems.add(parentCompBrowserItem);
|
|
|
|
|
conditionItems.add(parentDeptBrowserItem);
|
|
|
|
|
conditionItems.add(deptPrincipalBrowserItem);
|
|
|
|
|
conditionItems.add(showOrderItem);
|
|
|
|
|
conditionItems.add(forbiddenTagItem);
|
|
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
|
|
|
|
apiDatas.put("conditions", addGroups);
|
|
|
|
|
return apiDatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getHasRight() {
|
|
|
|
|
Map<String, Object> btnDatas = new HashMap<>();
|
|
|
|
|
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
|
|
|
|
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
|
|
|
|
// 新增
|
|
|
|
|
topMenuList.add(MenuBtn.topMenu_addNew());
|
|
|
|
|
// 批量删除
|
|
|
|
|
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
|
|
|
|
// 复制
|
|
|
|
|
topMenuList.add(MenuBtn.topMenu_copy());
|
|
|
|
|
btnDatas.put("topMenu", topMenuList);
|
|
|
|
|
// 新增
|
|
|
|
|
rightMenuList.add(MenuBtn.rightMenu_addNew());
|
|
|
|
|
// 复制
|
|
|
|
|
rightMenuList.add(MenuBtn.rightMenu_copy());
|
|
|
|
|
// 日志
|
|
|
|
|
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
|
|
|
|
btnDatas.put("rightMenu", rightMenuList);
|
|
|
|
|
return btnDatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getDeptBaseForm(Map<String, Object> params) {
|
|
|
|
|
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
|
|
|
|
|
|
|
|
|
// 2编辑 1查看
|
|
|
|
|
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
|
|
|
|
long id = Long.parseLong((String) params.get("id"));
|
|
|
|
|
String groupId = (String) params.get("viewCondition");
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> buttonsMap = new HashMap<>();
|
|
|
|
|
buttonsMap.put("hasEdit", true);
|
|
|
|
|
buttonsMap.put("hasSave", true);
|
|
|
|
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
if (StringUtil.isEmpty(groupId) || "0".equals(groupId)) {
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, getBaseForm(viewAttr, id)));
|
|
|
|
|
} else {
|
|
|
|
|
addGroups.add(new SearchConditionGroup(getExtendGroupMapper().getGroupNameById(groupId), true, getExtService(user).getExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, viewAttr, id, groupId)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
resultMap.put("buttons", buttonsMap);
|
|
|
|
|
resultMap.put("conditions", addGroups);
|
|
|
|
|
resultMap.put("id", id);
|
|
|
|
|
// 拓展页面分组
|
|
|
|
|
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_DEPTEXT));
|
|
|
|
|
// 处理明细表
|
|
|
|
|
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, id, viewAttr, false));
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
apiDatas.put("result", resultMap);
|
|
|
|
|
|
|
|
|
|
return apiDatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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, "名称", "departmentName");
|
|
|
|
|
deptNameItem.setRules("required|string");
|
|
|
|
|
// 简称
|
|
|
|
|
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "deptNameShort");
|
|
|
|
|
deptNameShortItem.setRules("required|string");
|
|
|
|
|
// 所属分部
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 复制表单
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchConditionGroup> getCopyForm() {
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "161", "company", "compBrowser");
|
|
|
|
|
compBrowserItem.setRules("required|string");
|
|
|
|
|
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
|
|
|
|
SearchConditionOption Option = new SearchConditionOption("1", "");
|
|
|
|
|
selectOptions.add(Option);
|
|
|
|
|
SearchConditionItem isCheckItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "是否复制岗位信息", "copyJob");
|
|
|
|
|
isCheckItem.setDetailtype(2);
|
|
|
|
|
condition.add(compBrowserItem);
|
|
|
|
|
condition.add(isCheckItem);
|
|
|
|
|
addGroups.add(new SearchConditionGroup("", true, condition));
|
|
|
|
|
return addGroups;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 复制岗位到指定部门
|
|
|
|
|
*
|
|
|
|
|
* @param copyParam
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public int copyDepartment(DeptCopyParam copyParam) {
|
|
|
|
|
OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部");
|
|
|
|
|
int insertCount = 0;
|
|
|
|
|
List<Long> idList = Arrays.stream(copyParam.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
|
|
for (Long id : idList) {
|
|
|
|
|
DepartmentPO deptById = getDepartmentMapper().getDeptById(id);
|
|
|
|
|
// TODO 自动编号
|
|
|
|
|
deptById.setDeptNo("复制_" + deptById.getDeptNo());
|
|
|
|
|
deptById.setParentComp(Long.parseLong(copyParam.getCompany()));
|
|
|
|
|
insertCount += getDepartmentMapper().insertIgnoreNull(deptById);
|
|
|
|
|
if ("1".equals(copyParam.getCopyJob())) {
|
|
|
|
|
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(id);
|
|
|
|
|
for (JobPO jobPO : jobPOS) {
|
|
|
|
|
// TODO 自动编号
|
|
|
|
|
jobPO.setJobNo("部门复制_" + jobPO.getJobNo());
|
|
|
|
|
jobPO.setParentDept(deptById.getId());
|
|
|
|
|
jobPO.setCreator((long) user.getUID());
|
|
|
|
|
jobPO.setCreateTime(new Date());
|
|
|
|
|
jobPO.setParentComp(deptById.getParentComp());
|
|
|
|
|
insertCount += MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return insertCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchConditionGroup> getMergeForm(Long id) {
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并部门", "161", "department", "deptBrowser");
|
|
|
|
|
deptBrowserItem.setRules("required|string");
|
|
|
|
|
SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName");
|
|
|
|
|
mergeNameItem.setRules("required|string");
|
|
|
|
|
String departmentName = getDepartmentMapper().getDeptNameById(id.intValue());
|
|
|
|
|
mergeNameItem.setValue(departmentName);
|
|
|
|
|
|
|
|
|
|
condition.add(deptBrowserItem);
|
|
|
|
|
condition.add(mergeNameItem);
|
|
|
|
|
addGroups.add(new SearchConditionGroup("", true, condition));
|
|
|
|
|
return addGroups;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int mergeDepartment(DepartmentMergeParam mergeParam) {
|
|
|
|
|
int updateCount = 0;
|
|
|
|
|
OrganizationAssert.isFalse(mergeParam.getId().equals(mergeParam.getDepartment()), "所选部门与待合并部门一致,无需操作");
|
|
|
|
|
OrganizationAssert.isNull(mergeParam.getDepartment(), "请选择需要合并的部门");
|
|
|
|
|
OrganizationAssert.isBlank(mergeParam.getMergeName(), "请输入合并后的名称");
|
|
|
|
|
// 所选部门
|
|
|
|
|
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
|
|
|
|
|
mergeDepartment.setDeptName(mergeParam.getMergeName());
|
|
|
|
|
mergeDepartment.setDeptNameShort(mergeParam.getMergeName());
|
|
|
|
|
mergeDepartment.setParentDept(mergeParam.getDepartment());
|
|
|
|
|
updateCount += getDepartmentMapper().updateBaseDept(mergeDepartment);
|
|
|
|
|
// 合并后部门及子部门禁用
|
|
|
|
|
Set<Long> ids = new HashSet<>();
|
|
|
|
|
ids.add(mergeParam.getId());
|
|
|
|
|
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
|
|
|
|
forbiddenChildTag(deptList, ids);
|
|
|
|
|
updateCount += getDepartmentMapper().forbiddenDepartmentByIds(ids);
|
|
|
|
|
return updateCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SearchConditionGroup> getMoveForm() {
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> condition = new ArrayList<>();
|
|
|
|
|
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "请选择部门", "161", "company", "compBrowser");
|
|
|
|
|
compBrowserItem.setRules("required|string");
|
|
|
|
|
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "请选择部门", "161", "department", "deptBrowser");
|
|
|
|
|
deptBrowserItem.setRules("required|string");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
|
|
|
|
SearchConditionOption compOption = new SearchConditionOption("0", "公司/分部");
|
|
|
|
|
SearchConditionOption deptOption = new SearchConditionOption("1", "部门");
|
|
|
|
|
selectOptions.add(compOption);
|
|
|
|
|
selectOptions.add(deptOption);
|
|
|
|
|
SearchConditionItem moveTypeItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "转移到", "moveType");
|
|
|
|
|
moveTypeItem.setDetailtype(3);
|
|
|
|
|
|
|
|
|
|
condition.add(moveTypeItem);
|
|
|
|
|
condition.add(compBrowserItem);
|
|
|
|
|
condition.add(deptBrowserItem);
|
|
|
|
|
addGroups.add(new SearchConditionGroup("", true, condition));
|
|
|
|
|
return addGroups;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int moveDepartment(DepartmentMoveParam moveParam) {
|
|
|
|
|
OrganizationAssert.notBlank(moveParam.getMoveType(), "请选择转移类型");
|
|
|
|
|
DepartmentPO deptById = getDepartmentMapper().getDeptById(moveParam.getId());
|
|
|
|
|
// 0:公司/分部 1:部门
|
|
|
|
|
if ("0".equals(moveParam.getMoveType())) {
|
|
|
|
|
Long company = moveParam.getCompany();
|
|
|
|
|
OrganizationAssert.notNull(company, "请选择要转移到的公司/分部");
|
|
|
|
|
deptById.setParentComp(company);
|
|
|
|
|
deptById.setParentDept(null);
|
|
|
|
|
} else if ("1".equals(moveParam.getMoveType())) {
|
|
|
|
|
Long department = moveParam.getDepartment();
|
|
|
|
|
OrganizationAssert.notNull(department, "请选择要转移到的部门");
|
|
|
|
|
deptById.setParentDept(department);
|
|
|
|
|
deptById.setParentComp(null);
|
|
|
|
|
}
|
|
|
|
|
return getDepartmentMapper().updateBaseDept(deptById);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有子部门id
|
|
|
|
|
*
|
|
|
|
|
* @param deptList
|
|
|
|
|
* @param ids
|
|
|
|
|
*/
|
|
|
|
|
void forbiddenChildTag(List<DepartmentPO> deptList, Set<Long> ids) {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(deptList)) {
|
|
|
|
|
for (DepartmentPO departmentPO : deptList) {
|
|
|
|
|
ids.add(departmentPO.getId());
|
|
|
|
|
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
|
|
|
|
|
forbiddenChildTag(childList, ids);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 是否为搜索查询
|
|
|
|
|
*
|
|
|
|
|
* @param departmentPO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private boolean isFilter(DepartmentPO departmentPO) {
|
|
|
|
|
return !(StringUtil.isEmpty(departmentPO.getDeptNo()) && StringUtil.isEmpty(departmentPO.getDeptName()) && StringUtil.isEmpty(departmentPO.getDeptNameShort()) && null == departmentPO.getParentComp() && null == departmentPO.getParentDept() && null == departmentPO.getDeptPrincipal() && null == departmentPO.getShowOrder() && null == departmentPO.getForbiddenTag());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 基本信息基础表单
|
|
|
|
|
*
|
|
|
|
|
* @param viewAttr
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<SearchConditionItem> getBaseForm(int viewAttr, long id) {
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
// 编号
|
|
|
|
|
SearchConditionItem deptNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "编号", "deptNo");
|
|
|
|
|
// 名称
|
|
|
|
|
SearchConditionItem deptNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "名称", "departmentName");
|
|
|
|
|
deptNameItem.setRules("required|string");
|
|
|
|
|
// 简称
|
|
|
|
|
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "简称", "deptNameShort");
|
|
|
|
|
deptNameShortItem.setRules("required|string");
|
|
|
|
|
// 所属分部
|
|
|
|
|
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
|
|
|
|
|
// 上级部门
|
|
|
|
|
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "161", "parentDept", "deptBrowser");
|
|
|
|
|
// 部门负责人
|
|
|
|
|
SearchConditionItem deptPrincipalBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
|
|
|
|
|
// 显示顺序
|
|
|
|
|
SearchConditionItem showOrderItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "显示顺序", "showOrder");
|
|
|
|
|
// 说明
|
|
|
|
|
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "说明", "description");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conditionItems.add(deptNoItem);
|
|
|
|
|
conditionItems.add(deptNameItem);
|
|
|
|
|
conditionItems.add(deptNameShortItem);
|
|
|
|
|
conditionItems.add(parentCompBrowserItem);
|
|
|
|
|
conditionItems.add(parentDeptBrowserItem);
|
|
|
|
|
conditionItems.add(deptPrincipalBrowserItem);
|
|
|
|
|
conditionItems.add(showOrderItem);
|
|
|
|
|
conditionItems.add(descriptionItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑、查看状态赋值,设置只读状态
|
|
|
|
|
|
|
|
|
|
// 赋值
|
|
|
|
|
DepartmentPO departmentPO = getDepartmentMapper().getDeptById(id);
|
|
|
|
|
OrganizationAssert.notNull(departmentPO, "数据不存在或数据已删除");
|
|
|
|
|
deptNoItem.setValue(departmentPO.getDeptNo());
|
|
|
|
|
deptNameItem.setValue(departmentPO.getDeptName());
|
|
|
|
|
deptNameShortItem.setValue(departmentPO.getDeptNameShort());
|
|
|
|
|
|
|
|
|
|
// parentCompBrowserItem
|
|
|
|
|
if (null != departmentPO.getParentComp()) {
|
|
|
|
|
BrowserBean browserBean = parentCompBrowserItem.getBrowserConditionParam();
|
|
|
|
|
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getParentComp(), getCompMapper().listById(departmentPO.getParentComp()).getCompName()));
|
|
|
|
|
parentCompBrowserItem.setBrowserConditionParam(browserBean);
|
|
|
|
|
}
|
|
|
|
|
// parentDeptBrowserItem
|
|
|
|
|
if (null != departmentPO.getParentDept()) {
|
|
|
|
|
BrowserBean browserBean = parentDeptBrowserItem.getBrowserConditionParam();
|
|
|
|
|
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getParentDept(), getDepartmentMapper().getDeptById(departmentPO.getParentDept()).getDeptName()));
|
|
|
|
|
parentDeptBrowserItem.setBrowserConditionParam(browserBean);
|
|
|
|
|
}
|
|
|
|
|
// deptPrincipalBrowserItem
|
|
|
|
|
if (null != departmentPO.getDeptPrincipal()) {
|
|
|
|
|
BrowserBean browserBean = deptPrincipalBrowserItem.getBrowserConditionParam();
|
|
|
|
|
browserBean.setReplaceDatas(creatReplaceDatas(departmentPO.getDeptPrincipal(), DepartmentBO.getEmployeeNameById(departmentPO.getDeptPrincipal())));
|
|
|
|
|
deptPrincipalBrowserItem.setBrowserConditionParam(browserBean);
|
|
|
|
|
}
|
|
|
|
|
showOrderItem.setValue(departmentPO.getShowOrder());
|
|
|
|
|
descriptionItem.setValue(departmentPO.getDescription());
|
|
|
|
|
|
|
|
|
|
// 查看,全部置位只读
|
|
|
|
|
if (1 == viewAttr) {
|
|
|
|
|
for (SearchConditionItem item : conditionItems) {
|
|
|
|
|
item.setViewAttr(viewAttr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return conditionItems;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 浏览按钮类型赋值转换
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @param name
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<Map<String, Object>> creatReplaceDatas(Object id, Object name) {
|
|
|
|
|
List<Map<String, Object>> datas = new ArrayList<>();
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("id", id);
|
|
|
|
|
map.put("name", name);
|
|
|
|
|
datas.add(map);
|
|
|
|
|
return datas;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取集团
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private SearchTree getTopGroup() {
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String sql = "select * from HrmCompany ";
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
SearchTree groupTree = new SearchTree();
|
|
|
|
|
groupTree.setCanClick(false);
|
|
|
|
|
groupTree.setCanceled(false);
|
|
|
|
|
groupTree.setCompanyid("1");
|
|
|
|
|
groupTree.setIcon("icon-coms-LargeArea");
|
|
|
|
|
groupTree.setId("0");
|
|
|
|
|
groupTree.setIsVirtual("0");
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
groupTree.setName(rs.getString("COMPANYNAME"));
|
|
|
|
|
}
|
|
|
|
|
groupTree.setSelected(false);
|
|
|
|
|
groupTree.setType(TYPE_GROUP);
|
|
|
|
|
return groupTree;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据keyword查询数据
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @param keyword
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<TreeNode> getFilterCompany(String id, String keyword) {
|
|
|
|
|
List<TreeNode> compSearchTree = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// 查询部门信息
|
|
|
|
|
Long parentCompId = StringUtil.isEmpty(id) ? null : Long.parseLong(id);
|
|
|
|
|
CompPO compBuild = CompPO.builder().compName(keyword).parentCompany(parentCompId).build();
|
|
|
|
|
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild);
|
|
|
|
|
|
|
|
|
|
Set<CompPO> builderComps = new HashSet<>();
|
|
|
|
|
for (CompPO compPO : filterComps) {
|
|
|
|
|
buildParentComps(compPO, builderComps);
|
|
|
|
|
}
|
|
|
|
|
List<SearchTree> compTrees = builderTreeMode(CompBO.buildSetToSearchTree(builderComps));
|
|
|
|
|
|
|
|
|
|
// 排序,设置是否为叶子节点
|
|
|
|
|
List<TreeNode> collect = compTrees.stream().peek(item ->
|
|
|
|
|
item.setIsParent(CollectionUtils.isNotEmpty(item.getSubs()))
|
|
|
|
|
).sorted(Comparator.comparing(item -> Integer.parseInt(item.getId()))).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(collect)) {
|
|
|
|
|
compSearchTree.addAll(collect);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return compSearchTree;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加查询元素的父级元素
|
|
|
|
|
*
|
|
|
|
|
* @param compPO
|
|
|
|
|
* @param builderComps
|
|
|
|
|
*/
|
|
|
|
|
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
|
|
|
|
|
builderComps.add(compPO);
|
|
|
|
|
if (isTop(compPO.getParentCompany())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
|
|
|
|
|
if (null != parentComp) {
|
|
|
|
|
buildParentComps(parentComp, builderComps);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理树层级
|
|
|
|
|
*
|
|
|
|
|
* @param treeList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<SearchTree> builderTreeMode(List<SearchTree> treeList) {
|
|
|
|
|
Map<String, List<TreeNode>> collects = treeList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
|
|
|
|
|
return treeList.stream().peek(e -> e.setSubs(collects.get(e.getId()))).peek(item -> {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(item.getSubs())) {
|
|
|
|
|
item.setIsParent(true);
|
|
|
|
|
}
|
|
|
|
|
}).filter(item -> isTop(item.getPid())).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断是为顶层数据
|
|
|
|
|
*
|
|
|
|
|
* @param pid
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private boolean isTop(Long pid) {
|
|
|
|
|
return null == pid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断是为顶层数据
|
|
|
|
|
*
|
|
|
|
|
* @param pid
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private boolean isTop(String pid) {
|
|
|
|
|
return StringUtil.isEmpty(pid) || "0".equals(pid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|