|
|
|
@ -2,7 +2,6 @@ package com.supervision.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.crypto.digest.MD5;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.supervision.model.ConfigTreatmentPlan;
|
|
|
|
|
import com.supervision.service.ConfigTreatmentPlanService;
|
|
|
|
@ -45,7 +44,7 @@ public class ConfigConfigTreatmentPlanServiceImpl extends ServiceImpl<ConfigTrea
|
|
|
|
|
}
|
|
|
|
|
TreatmentPlanTreeNode disposalPlanNode = root.findChildByName(disposalPlan);
|
|
|
|
|
if (null == disposalPlanNode){
|
|
|
|
|
disposalPlanNode = new TreatmentPlanTreeNode(StrUtil.isNotEmpty(firstMeasures) ? null : id, disposalPlan);
|
|
|
|
|
disposalPlanNode = new TreatmentPlanTreeNode(configTreatmentPlan.getDisposalPlanId(), disposalPlan);
|
|
|
|
|
root.getOrDefaultChild().add(disposalPlanNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -55,7 +54,7 @@ public class ConfigConfigTreatmentPlanServiceImpl extends ServiceImpl<ConfigTrea
|
|
|
|
|
}
|
|
|
|
|
TreatmentPlanTreeNode firstMeasuresNode = disposalPlanNode.findChildByName(firstMeasures);
|
|
|
|
|
if (null == firstMeasuresNode){
|
|
|
|
|
firstMeasuresNode = new TreatmentPlanTreeNode(StrUtil.isNotEmpty(secondMeasures) ? null : id,firstMeasures);
|
|
|
|
|
firstMeasuresNode = new TreatmentPlanTreeNode(configTreatmentPlan.getFirstMeasuresId(),firstMeasures);
|
|
|
|
|
disposalPlanNode.getOrDefaultChild().add(firstMeasuresNode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,30 +70,9 @@ public class ConfigConfigTreatmentPlanServiceImpl extends ServiceImpl<ConfigTrea
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTreatmentPlanTreeNodeVirtualId(root);
|
|
|
|
|
return root.getChild();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 为每一个id为空的node生成一个虚拟的id,主要是为前端组件使用
|
|
|
|
|
* @param node TreatmentPlanTreeNode
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
private void setTreatmentPlanTreeNodeVirtualId(TreatmentPlanTreeNode node){
|
|
|
|
|
if (Objects.isNull(node)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(node.getId()) && StrUtil.isNotEmpty(node.getName())){
|
|
|
|
|
node.setId(new MD5().digestHex16(node.getName()));
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(node.getChild())){
|
|
|
|
|
List<TreatmentPlanTreeNode> child = node.getChild();
|
|
|
|
|
for (TreatmentPlanTreeNode treatmentPlanTreeNode : child) {
|
|
|
|
|
setTreatmentPlanTreeNodeVirtualId(treatmentPlanTreeNode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|