部门管理 列表 字段文本展示
parent
39eebf62fc
commit
cbd33dbd3b
@ -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<DepartmentListDTO> children;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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<CompPO> getCompTreeList();
|
||||||
|
}
|
@ -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<CompPO> getCompTreeList() {
|
||||||
|
// 获取所有启用数据
|
||||||
|
List<CompPO> allList = getCompMapper().list().stream().filter(item -> 0 == item.getForbiddenTag()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<CompPO> parentList = allList.stream().filter(item -> (null == item.getParentCompany() || 0 == item.getParentCompany())).collect(Collectors.toList());
|
||||||
|
Map<Long, List<CompPO>> compMap = allList.stream().filter(item -> (null != item.getParentCompany() && 0 != item.getParentCompany())).collect(Collectors.groupingBy(CompPO::getParentCompany));
|
||||||
|
List<CompPO> returnList = new ArrayList<>();
|
||||||
|
dealChildren(parentList, returnList, compMap);
|
||||||
|
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理分部子节点
|
||||||
|
*
|
||||||
|
* @param parentList
|
||||||
|
* @param returnList
|
||||||
|
* @param compMap
|
||||||
|
*/
|
||||||
|
private void dealChildren(List<CompPO> parentList, List<CompPO> returnList, Map<Long, List<CompPO>> compMap) {
|
||||||
|
if (CollectionUtils.isEmpty(parentList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (CompPO compPO : parentList) {
|
||||||
|
returnList.add(compPO);
|
||||||
|
dealChildren(compMap.get(compPO.getId()), returnList, compMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue