|
|
@ -2,6 +2,7 @@ package com.supervision.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
|
import cn.hutool.crypto.digest.MD5;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.supervision.model.ConfigTreatmentPlan;
|
|
|
|
import com.supervision.model.ConfigTreatmentPlan;
|
|
|
|
import com.supervision.service.ConfigTreatmentPlanService;
|
|
|
|
import com.supervision.service.ConfigTreatmentPlanService;
|
|
|
@ -70,8 +71,30 @@ public class ConfigConfigTreatmentPlanServiceImpl extends ServiceImpl<ConfigTrea
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTreatmentPlanTreeNodeVirtualId(root);
|
|
|
|
return root.getChild();
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|