|
|
@@ -1,6 +1,11 @@
|
|
|
package com.xintong.visualinspection.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -14,6 +19,9 @@ import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.xintong.system.err.BusinessException;
|
|
|
import com.xintong.visualinspection.bean.Menu;
|
|
|
+import com.xintong.visualinspection.bean.Permission;
|
|
|
+import com.xintong.visualinspection.bean.User;
|
|
|
+import com.xintong.visualinspection.dao.master.PermissionDao;
|
|
|
import com.xintong.visualinspection.service.MenuService;
|
|
|
|
|
|
/**
|
|
|
@@ -32,6 +40,7 @@ public class MenuController extends BaseController {
|
|
|
private MenuService menuService;
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 添加菜单
|
|
|
* @return
|
|
|
@@ -90,10 +99,10 @@ public class MenuController extends BaseController {
|
|
|
*/
|
|
|
|
|
|
@RequestMapping(value = "/get/all",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
|
|
|
- public String getAllMenu(){
|
|
|
+ public String getAllMenu(HttpServletRequest request){
|
|
|
try{
|
|
|
-
|
|
|
- List<Menu> menus= menuService.getMenus(new Menu());
|
|
|
+ User u = getCurrentUser(request);
|
|
|
+ List<Menu> menus= menuService.getMenus(new Menu(),u);
|
|
|
return returnResult(0, "获取成功", menus);
|
|
|
}catch(Exception e){
|
|
|
throw new BusinessException(20001);
|
|
|
@@ -115,13 +124,13 @@ public class MenuController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getMenuById/{menuid}",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
|
|
|
- public String getMenuById(@PathVariable Integer menuid){
|
|
|
+ public String getMenuById(@PathVariable Integer menuid,HttpServletRequest request){
|
|
|
try{
|
|
|
-
|
|
|
+ User u = getCurrentUser(request);
|
|
|
Menu menu = new Menu();
|
|
|
menu.setId(menuid);
|
|
|
|
|
|
- List<Menu> menus = menuService.getMenus(menu);
|
|
|
+ List<Menu> menus = menuService.getMenus(menu,u);
|
|
|
if(menus==null||menus.size()<1 ) throw new BusinessException(20001);
|
|
|
return returnResult(0, "获取成功", menus.get(0));
|
|
|
}catch(Exception e){
|
|
|
@@ -130,6 +139,8 @@ public class MenuController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|