manage:代码结构调整
parent
822af5cec0
commit
6641bd4bbf
@ -1,13 +1,13 @@
|
|||||||
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.TreeNode;
|
import com.supervision.vo.manage.TreatmentPlanTreeNode;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ConfigTreatmentPlanManageService {
|
public interface ConfigTreatmentPlanManageService {
|
||||||
|
|
||||||
List<TreeNode> queryTree(Integer disposalMethod);
|
List<TreatmentPlanTreeNode> queryTree(Integer disposalMethod);
|
||||||
|
|
||||||
ConfigTreatmentPlan findById(String id);
|
ConfigTreatmentPlan findById(String id);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.supervision.vo.manage;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DiseaseTreatmentPlanTreeNode {
|
||||||
|
|
||||||
|
@ApiModelProperty("处置计划id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("节点名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("标识 0:未选择 1:已选择")
|
||||||
|
private int flag;
|
||||||
|
|
||||||
|
@ApiModelProperty("子节点")
|
||||||
|
private List<DiseaseTreatmentPlanTreeNode> child;
|
||||||
|
|
||||||
|
|
||||||
|
public DiseaseTreatmentPlanTreeNode() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
public List<DiseaseTreatmentPlanTreeNode> getOrDefaultChild(){
|
||||||
|
if (null == child){
|
||||||
|
child = new ArrayList<>();
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DiseaseTreatmentPlanTreeNode(TreatmentPlanTreeNode treatmentPlanTreeNode) {
|
||||||
|
this.id = treatmentPlanTreeNode.getId();
|
||||||
|
this.name = treatmentPlanTreeNode.getName();
|
||||||
|
List<TreatmentPlanTreeNode> child = treatmentPlanTreeNode.getChild();
|
||||||
|
if (CollUtil.isNotEmpty(child)){
|
||||||
|
for (TreatmentPlanTreeNode planTreeNode : child) {
|
||||||
|
this.getOrDefaultChild().add(new DiseaseTreatmentPlanTreeNode(planTreeNode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initFlag(List<String> ids){
|
||||||
|
if (CollUtil.isEmpty(ids)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(this.getId())){
|
||||||
|
this.setFlag(ids.stream().allMatch(i -> i.equals(this.getId())) ? 1 : 0);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(this.getChild())){
|
||||||
|
for (DiseaseTreatmentPlanTreeNode treatmentPlanTreeNode : this.getChild()) {
|
||||||
|
treatmentPlanTreeNode.initFlag(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue