|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import javax.servlet.http.Cookie;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
@ -52,9 +53,6 @@ public class SysIndexController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
// 取身份信息
|
|
|
|
|
SysUser user = getSysUser();
|
|
|
|
|
// 根据用户id取出菜单
|
|
|
|
|
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
|
|
|
|
mmap.put("menus", menus);
|
|
|
|
|
mmap.put("user", user);
|
|
|
|
|
mmap.put("sideTheme", configService.selectConfigByKey("sys.index.sideTheme"));
|
|
|
|
|
mmap.put("skinName", configService.selectConfigByKey("sys.index.skinName"));
|
|
|
|
@ -88,14 +86,45 @@ public class SysIndexController extends BaseController
|
|
|
|
|
return webIndex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 筛选可视化界面菜单
|
|
|
|
|
* @author WenJY
|
|
|
|
|
* @date 2022/2/28 17:55
|
|
|
|
|
* @return com.ruoyi.web.controller.system.JsonRootBean
|
|
|
|
|
*/
|
|
|
|
|
public JsonRootBean menuInfo(){
|
|
|
|
|
|
|
|
|
|
List<SysMenu> menus = menuService.selectVisualMenusByUser(getSysUser());
|
|
|
|
|
|
|
|
|
|
List<SysMenu> firstMenu = menus.stream().filter(x->x.getParentId()==1112).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
JsonRootBean jsonResult = new JsonRootBean();
|
|
|
|
|
List<List<String>> urlResult = new ArrayList<>();
|
|
|
|
|
List<MenuStr> menuStrList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
for (SysMenu menu : firstMenu){
|
|
|
|
|
List<SysMenu> menuList = menus.stream().filter(x->x.getParentId().equals(menu.getMenuId()) && menu.getMenuId() != 1112).collect(Collectors.toList());
|
|
|
|
|
if(menuList.size() > 0){
|
|
|
|
|
List<String> menuNames = new ArrayList<String>();
|
|
|
|
|
urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
menuList.forEach(x->{
|
|
|
|
|
if (x.getUrl() != "#"){
|
|
|
|
|
this.add(x.getUrl());
|
|
|
|
|
menuNames.add(x.getMenuName());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}});
|
|
|
|
|
menuStrList.add(new MenuStr(menu.getMenuName(),menuNames));
|
|
|
|
|
}else{
|
|
|
|
|
urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
this.add(menu.getUrl());
|
|
|
|
|
}});
|
|
|
|
|
menuStrList.add(new MenuStr(menu.getMenuName(),new ArrayList<String>()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
this.add("/iot/index");
|
|
|
|
|
//this.add("/sections/substation");
|
|
|
|
|
}});
|
|
|
|
|
urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
this.add("/sections/substation");
|
|
|
|
@ -104,8 +133,6 @@ public class SysIndexController extends BaseController
|
|
|
|
|
this.add("/sections/substation");
|
|
|
|
|
this.add("/sections/substation");
|
|
|
|
|
this.add("/sections/substation");
|
|
|
|
|
/*this.add("/sections/transformer-detail");
|
|
|
|
|
this.add("/iot/index");*/
|
|
|
|
|
}});
|
|
|
|
|
urlResult.add(new ArrayList<String>(){{
|
|
|
|
|
this.add("/sections/transformer-detail");
|
|
|
|
@ -135,9 +162,10 @@ public class SysIndexController extends BaseController
|
|
|
|
|
this.add("电容电抗器设备");
|
|
|
|
|
this.add("避雷器设备");
|
|
|
|
|
}}));
|
|
|
|
|
menuStrList.add(new MenuStr("传感器汇总",new ArrayList<String>()));
|
|
|
|
|
menuStrList.add(new MenuStr("传感器汇总",new ArrayList<String>()));*/
|
|
|
|
|
jsonResult.setUrl(urlResult);
|
|
|
|
|
jsonResult.setMenuStr(menuStrList);
|
|
|
|
|
System.out.println("测试:"+JSONArray.toJSONString(jsonResult));
|
|
|
|
|
return jsonResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|