Commit 2501ac3d231fd8feb06e6658d957f2078e0cc91a

Authored by yiming
1 parent 488c669a

bf

bsthLineProfiles/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java
... ... @@ -71,7 +71,8 @@ public class UserRealm extends AuthorizingRealm
71 71 else
72 72 {
73 73 roles = roleService.selectRoleKeys(user.getUserId());
74   - menus = menuService.selectPermsByUserId(user.getUserId());
  74 + menus=user.getPermissions();
  75 + //menus = menuService.selectPermsByUserId(user.getUserId());
75 76 // 角色加入AuthorizationInfo认证对象
76 77 info.setRoles(roles);
77 78 // 权限加入AuthorizationInfo认证对象
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineAddController.java
... ... @@ -14,6 +14,7 @@ import com.ruoyi.project.system.line.service.IBsthTLineService;
14 14 import com.ruoyi.project.system.user.domain.User;
15 15 import com.ruoyi.project.system.user.service.IUserService;
16 16 import org.apache.shiro.authz.annotation.RequiresPermissions;
  17 +import org.apache.shiro.authz.annotation.RequiresRoles;
17 18 import org.springframework.beans.factory.annotation.Autowired;
18 19 import org.springframework.stereotype.Controller;
19 20 import org.springframework.ui.ModelMap;
... ... @@ -52,7 +53,7 @@ public class BsthTLineAddController extends BaseController
52 53 @Autowired
53 54 private IUserService userService;
54 55  
55   - @RequiresPermissions("system:line:view")
  56 + @RequiresPermissions("system:lineAdd:view")
56 57 @GetMapping()
57 58 public ModelAndView line()
58 59 {
... ... @@ -62,17 +63,11 @@ public class BsthTLineAddController extends BaseController
62 63 mv.addObject("companyList",companyList);
63 64 return mv;
64 65 }
65   -
66   - @GetMapping("/map")
67   - public String map()
68   - {
69   - return prefix + "/map";
70   - }
  66 +
71 67  
72 68 /**
73 69 * 线路新增分页
74 70 */
75   - @RequiresPermissions("system:line:list")
76 71 @PostMapping("/list")
77 72 @ResponseBody
78 73 public TableDataInfo list(BsthTLine bsthTLine)
... ... @@ -98,7 +93,7 @@ public class BsthTLineAddController extends BaseController
98 93 /**
99 94 * 线路新增
100 95 */
101   - @RequiresPermissions("system:line:add")
  96 + @RequiresPermissions("system:lineAdd:add")
102 97 @Log(title = "线路新增", businessType = BusinessType.INSERT)
103 98 @PostMapping("/add")
104 99 @ResponseBody
... ... @@ -145,7 +140,7 @@ public class BsthTLineAddController extends BaseController
145 140 /**
146 141 * 线路修改
147 142 */
148   - @RequiresPermissions("system:line:edit")
  143 + @RequiresPermissions("system:lineAdd:add")
149 144 @Log(title = "线路修改", businessType = BusinessType.UPDATE)
150 145 @PostMapping("/edit")
151 146 @ResponseBody
... ... @@ -159,7 +154,7 @@ public class BsthTLineAddController extends BaseController
159 154  
160 155  
161 156  
162   - @RequiresPermissions("system:line:remove")
  157 + @RequiresPermissions("system:lineAdd:add")
163 158 @Log(title = "线路删除", businessType = BusinessType.DELETE)
164 159 @PostMapping( "/remove")
165 160 @ResponseBody
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineController.java
... ... @@ -55,12 +55,11 @@ public class BsthTLineController extends BaseController
55 55 */
56 56 @RequiresPermissions("system:line:view")
57 57 @GetMapping()
58   - public ModelAndView line(String type)
  58 + public ModelAndView line()
59 59 {
60 60 ModelAndView mv=new ModelAndView(prefix + "/line");
61 61 List<Map> companyList=bsthTLineService.selectCompany();
62 62 mv.addObject("companyList",companyList);
63   - mv.addObject("type",type);
64 63 return mv;
65 64 }
66 65  
... ... @@ -68,7 +67,6 @@ public class BsthTLineController extends BaseController
68 67 /**
69 68 * 线路分页
70 69 */
71   - @RequiresPermissions("system:line:list")
72 70 @PostMapping("/list")
73 71 @ResponseBody
74 72 public TableDataInfo list(BsthTLine bsthTLine)
... ... @@ -89,7 +87,7 @@ public class BsthTLineController extends BaseController
89 87 return prefix + "/detail";
90 88 }
91 89  
92   - @RequiresPermissions("system:line:export")
  90 +
93 91 @Log(title = "线路导出", businessType = BusinessType.EXPORT)
94 92 @PostMapping("/export")
95 93 @ResponseBody
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineExamineController.java
... ... @@ -56,16 +56,9 @@ public class BsthTLineExamineController extends BaseController
56 56 return mv;
57 57 }
58 58  
59   - @GetMapping("/map")
60   - public String map()
61   - {
62   - return prefix + "/map";
63   - }
64   -
65 59 /**
66 60 * 审核分页
67 61 */
68   - @RequiresPermissions("system:line:list")
69 62 @PostMapping("/list")
70 63 @ResponseBody
71 64 public TableDataInfo list(BsthTLine bsthTLine)
... ... @@ -92,6 +85,7 @@ public class BsthTLineExamineController extends BaseController
92 85 /**
93 86 * 审核
94 87 */
  88 + @RequiresPermissions("system:lineExamine:examine")
95 89 @PostMapping("/examine")
96 90 @ResponseBody
97 91 public AjaxResult examine(BsthTLine bsthTLine) {
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineHistoryController.java
1 1 package com.ruoyi.project.system.line.controller;
2 2  
3   -import java.lang.reflect.Field;
4   -import java.lang.reflect.Method;
5   -import java.util.ArrayList;
6   -import java.util.HashMap;
  3 +
7 4 import java.util.List;
8 5 import java.util.Map;
9 6  
... ... @@ -18,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
18 15 import org.springframework.web.bind.annotation.ResponseBody;
19 16 import com.ruoyi.framework.aspectj.lang.annotation.Log;
20 17 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
21   -import com.ruoyi.project.system.dict.domain.DictData;
22 18 import com.ruoyi.project.system.dict.service.IDictDataService;
23 19 import com.ruoyi.project.system.line.domain.BsthTLine;
24 20 import com.ruoyi.project.system.line.service.IBsthTLineService;
... ... @@ -26,8 +22,6 @@ import com.ruoyi.project.system.user.domain.User;
26 22 import com.ruoyi.project.system.user.service.IUserService;
27 23 import com.ruoyi.framework.web.controller.BaseController;
28 24 import com.ruoyi.framework.web.domain.AjaxResult;
29   -import com.ruoyi.common.utils.ServletUtils;
30   -import com.ruoyi.common.utils.poi.ExcelUtil;
31 25 import com.ruoyi.common.utils.security.ShiroUtils;
32 26 import com.ruoyi.framework.web.page.TableDataInfo;
33 27 import org.springframework.web.servlet.ModelAndView;
... ... @@ -69,7 +63,6 @@ public class BsthTLineHistoryController extends BaseController
69 63 /**
70 64 * 变更分页
71 65 */
72   - @RequiresPermissions("system:lineHistory:list")
73 66 @PostMapping("/list")
74 67 @ResponseBody
75 68 public TableDataInfo list(BsthTLine bsthTLine)
... ... @@ -127,7 +120,7 @@ public class BsthTLineHistoryController extends BaseController
127 120 }
128 121  
129 122  
130   - @RequiresPermissions("system:lineHistory:view")
  123 + @RequiresPermissions("system:lineHistory:historyCompare")
131 124 @GetMapping("/historyCompare")
132 125 public String historyCompare()
133 126 {
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineHistoryReportController.java
... ... @@ -5,7 +5,6 @@ import java.lang.reflect.Constructor;
5 5 import java.lang.reflect.Field;
6 6 import java.text.SimpleDateFormat;
7 7 import java.util.ArrayList;
8   -import java.util.Date;
9 8 import java.util.HashMap;
10 9 import java.util.List;
11 10 import java.util.Map;
... ... @@ -51,7 +50,7 @@ public class BsthTLineHistoryReportController extends BaseController
51 50 @Autowired
52 51 private IUserService userService;
53 52  
54   - @RequiresPermissions("system:HistoryReport:view")
  53 + @RequiresPermissions("system:historyReport:view")
55 54 @GetMapping()
56 55 public String line()
57 56 {
... ... @@ -61,7 +60,6 @@ public class BsthTLineHistoryReportController extends BaseController
61 60 /**
62 61 * 查询【请填写功能名称】列表
63 62 */
64   - @RequiresPermissions("system:HistoryReport:list")
65 63 @PostMapping("/list")
66 64 @ResponseBody
67 65 public TableDataInfo list(BsthTLine bsthTLine)
... ... @@ -71,7 +69,7 @@ public class BsthTLineHistoryReportController extends BaseController
71 69 return getDataTable(list);
72 70 }
73 71  
74   - @RequiresPermissions("system:HistoryReport:export")
  72 +
75 73 @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
76 74 @PostMapping("/export")
77 75 @ResponseBody
... ... @@ -183,8 +181,7 @@ public class BsthTLineHistoryReportController extends BaseController
183 181 }
184 182  
185 183  
186   -
187   - @RequiresPermissions("system:HistoryReport:export2")
  184 +
188 185 @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
189 186 @RequestMapping("/export2")
190 187 @ResponseBody
... ...
bsthLineProfiles/src/main/java/com/ruoyi/project/system/menu/service/MenuServiceImpl.java
... ... @@ -48,14 +48,14 @@ public class MenuServiceImpl implements IMenuService
48 48 {
49 49 List<Menu> menus = new LinkedList<Menu>();
50 50 // 管理员显示所有菜单信息
51   -// if (user.isAdmin())
52   -// {
  51 + if (user.isAdmin())
  52 + {
53 53 menus = menuMapper.selectMenuNormalAll();
54   -// }
55   -// else
56   -// {
57   -// menus = menuMapper.selectMenusByUserId(user.getUserId());
58   -// }
  54 + }
  55 + else
  56 + {
  57 + menus = menuMapper.selectMenusByUserId(user.getUserId());
  58 + }
59 59 return TreeUtils.getChildPerms(menus, 0);
60 60 }
61 61 @Override
... ...
bsthLineProfiles/src/main/resources/application-druid.yml
... ... @@ -9,7 +9,7 @@ spring:
9 9 url: jdbc:mysql://192.168.101.111:3306/bsth_line_profiles?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
10 10 username: xldasys
11 11 password: bsth@pj2021
12   -# # 主库数据源
  12 + # 主库数据源
13 13 # master:
14 14 # url: jdbc:mysql://localhost:3306/bsth_line_profiles?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
15 15 # username: root
... ...
bsthLineProfiles/src/main/resources/templates/system/line/line.html
... ... @@ -276,11 +276,11 @@
276 276 $('#company').on('change.select2', function (e) {
277 277 fCompanySelect()
278 278 });
279   - if(type==2){
  279 +/* if(type==2){
280 280 $('#export').css("display", "show");
281 281 }else {
282 282 $('#export').css("display", "none");
283   - }
  283 + }*/
284 284 });
285 285  
286 286 function companySelect(){
... ...
bsthLineProfiles/src/main/resources/templates/system/lineAdd/line.html
... ... @@ -34,7 +34,7 @@
34 34  
35 35 <div class="btn-group-sm" id="toolbar" role="group">
36 36  
37   - <el-button plain size="mini" type="primary" icon="el-icon-plus" onClick="add(this);" shiro:hasPermission="system:line:add">新增</el-button>
  37 + <el-button plain size="mini" type="primary" icon="el-icon-plus" onClick="add(this);" shiro:hasPermission="system:lineAdd:add">新增</el-button>
38 38  
39 39 </div>
40 40  
... ...