manage:代码结构调整
parent
d912bbaeeb
commit
6fa9641290
@ -1,15 +1,15 @@
|
|||||||
package com.supervision.manage.service;
|
package com.supervision.manage.service;
|
||||||
|
|
||||||
import com.supervision.model.ConfigTreatmentPlan;
|
import com.supervision.model.ConfigTreatmentPlan;
|
||||||
import com.supervision.vo.manage.ConfigTreatmentPlanWrapVo;
|
import com.supervision.vo.manage.TreeNode;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ConfigTreatmentPlanManageService {
|
public interface ConfigTreatmentPlanManageService {
|
||||||
|
|
||||||
ConfigTreatmentPlanWrapVo queryTree(Integer disposalMethod);
|
List<TreeNode> queryTree(Integer disposalMethod);
|
||||||
|
|
||||||
List<ConfigTreatmentPlan> queryList(Integer disposalMethod);
|
List<ConfigTreatmentPlan> queryList(Integer disposalMethod);
|
||||||
|
|
||||||
ConfigTreatmentPlanWrapVo findById(String id);
|
TreeNode findById(String id);
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
package com.supervision.vo.manage;
|
|
||||||
|
|
||||||
import com.supervision.model.ConfigTreatmentPlan;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ConfigTreatmentPlanWrapVo {
|
|
||||||
|
|
||||||
private List<ConfigTreatmentPlanWrap> configTreatmentPlanWraps;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
static class ConfigTreatmentPlanWrap extends ConfigTreatmentPlan {
|
|
||||||
|
|
||||||
private List<ConfigTreatmentPlan> child;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.supervision.vo.manage;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TreeNode {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private List<TreeNode> child;
|
||||||
|
|
||||||
|
|
||||||
|
public TreeNode() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeNode(String id, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public List<TreeNode> getOrDefaultChild(){
|
||||||
|
if (null == child){
|
||||||
|
child = new ArrayList<>();
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeNode findChildByName(String name){
|
||||||
|
if (CollUtil.isEmpty(child) || StrUtil.isEmpty(name)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return child.stream().filter(node -> name.equals(node.getName())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue