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