|
@@ -159,26 +159,29 @@ public class DragTableServiceImpl implements IDragTableService {
|
|
|
dragTableStyle.setTableKey(dragTable.getTableKey());
|
|
|
List<DragTableStyle> dragTableStyleList = dragTableStyleMapper.selectDragTableStyleList(dragTableStyle);
|
|
|
resultMap.put("style",dragTableStyleList);
|
|
|
+ CommonEntity commonEntity = new CommonEntity();
|
|
|
// 动态表格按钮信息
|
|
|
//根据tableKey获取根节点信息
|
|
|
List<String> btnKeys = dragTableBtnRelevanceMapper.selectBtnKeyByTableKey(dragTable.getTableKey());
|
|
|
//获取根节点数据
|
|
|
System.err.println(btnKeys.toString());
|
|
|
- List<DragTableBtn> rootNodes = dragTableBtnMapper.selectDragTableBtnListByBtnKey(btnKeys);
|
|
|
- System.err.println(rootNodes.toString());
|
|
|
- //查询子节点
|
|
|
- List<Long> ids = rootNodes.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
|
- if (ids.isEmpty()){
|
|
|
- resultMap.put("button",rootNodes);
|
|
|
- }else {
|
|
|
- List<DragTableBtn> childNodes = dragTableBtnMapper.selectChildNodeById(ids);
|
|
|
- List<DragTableBtn> btnList = rootNodes.stream().peek(
|
|
|
- root -> root.setChildren(getChildrenList(root, childNodes))
|
|
|
- ).collect(Collectors.toList());
|
|
|
- resultMap.put("button",btnList);
|
|
|
+ if(btnKeys.size() > 0){
|
|
|
+ List<DragTableBtn> rootNodes = dragTableBtnMapper.selectDragTableBtnListByBtnKey(btnKeys);
|
|
|
+ System.err.println(rootNodes.toString());
|
|
|
+ //查询子节点
|
|
|
+ List<Long> ids = rootNodes.stream().map(m -> m.getId()).collect(Collectors.toList());
|
|
|
+ if (ids.isEmpty()){
|
|
|
+ resultMap.put("button",rootNodes);
|
|
|
+ }else {
|
|
|
+ List<DragTableBtn> childNodes = dragTableBtnMapper.selectChildNodeById(ids);
|
|
|
+ List<DragTableBtn> btnList = rootNodes.stream().peek(
|
|
|
+ root -> root.setChildren(getChildrenList(root, childNodes))
|
|
|
+ ).collect(Collectors.toList());
|
|
|
+ resultMap.put("button",btnList);
|
|
|
+ }
|
|
|
+
|
|
|
+ commonEntity.setResultMap(resultMap);
|
|
|
}
|
|
|
- CommonEntity commonEntity = new CommonEntity();
|
|
|
- commonEntity.setResultMap(resultMap);
|
|
|
return commonEntity;
|
|
|
}
|
|
|
|