From d8e36ba0bd39f150872b0ed0a09b5e03360e1c03 Mon Sep 17 00:00:00 2001 From: lizhenhua <1075222162@qq.com> Date: Tue, 1 Jul 2025 10:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/domain/DeptTreeSelect.java | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/equipment/domain/DeptTreeSelect.java diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/equipment/domain/DeptTreeSelect.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/equipment/domain/DeptTreeSelect.java new file mode 100644 index 0000000..36060b6 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/equipment/domain/DeptTreeSelect.java @@ -0,0 +1,110 @@ +package com.bonus.material.equipment.domain; + +import com.bonus.system.api.domain.SysDept; +import com.bonus.system.api.domain.SysMenu; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Treeselect树结构实体类 + * + * @author bonus + */ +public class DeptTreeSelect implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 节点ID + */ + private Long id; + + /** 父部门ID */ + private Long parentId; + + /** + * 节点名称 + */ + private String label; + + private String status; + + private Integer level; + + + /** + * 子节点 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + public DeptTreeSelect() { + + } + + public DeptTreeSelect(SysDept dept) { + this.id = dept.getDeptId(); + this.parentId = dept.getParentId(); + this.status = dept.getStatus(); + this.label = dept.getDeptName(); + this.level = dept.getLevel(); + this.children = dept.getChildren().stream().map(DeptTreeSelect::new).collect(Collectors.toList()); + } + + public DeptTreeSelect(SysMenu menu) { + this.id = menu.getMenuId(); + this.label = menu.getMenuName(); + this.status = menu.getStatus(); + this.children = menu.getChildren().stream().map(DeptTreeSelect::new).collect(Collectors.toList()); + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +}