public List<EasyUIJsonTree> getCdtj() {
/*組織機構樹*/
List<EasyUIJsonTree> deptTree = safeMonitorService.getDepartTree();
List<Cdtj> cdtjList=statisticalDataService.getLstj();
tree(deptTree,cdtjList);
return deptTree;
}
/*遞歸遍歷組織機構,判斷id相同填入數據*/
public void tree(List<EasyUIJsonTree> list,List<Cdtj> cdtjList){
for(EasyUIJsonTree A:list){
if(!CollectionUtils.isEmpty(A.getChildren())){
List<EasyUIJsonTree> children = A.getChildren();
tree(children,cdtjList);
}else{
for(Cdtj B:cdtjList){
HashMap<String, Object> map=new HashMap<>();
map.put("cdtj", B);
if(A.getMineId().equals(B.getMineID())){
A.setAttributes(map);
}
}
}
}
}
