| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; |
| | | import com.vci.frameworkcore.enumpck.ResourceControlTypeEnum; |
| | | import com.vci.frameworkcore.pagemodel.MenuVO; |
| | | import com.vci.frameworkcore.pagemodel.SmFunctionVO; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.ISmFunctionQueryService; |
| | | import com.vci.web.enumpck.ResourceControlTypeEnum; |
| | | import com.vci.pagemodel.MenuVO; |
| | | import com.vci.pagemodel.SmFunctionVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.web.pageModel.UIContentVO; |
| | | import com.vci.pagemodel.UIContentVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private ISmFunctionQueryService functionQueryService; |
| | | |
| | | /** |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 获取当前用户的菜单 |
| | | * @param treeQueryObject 树查询对象 |
| | | * @return 树节点,出现错误会在异常处理器中统一返回Json |
| | | */ |
| | | @VciUnCheckRight |
| | | @GetMapping("/treeMyMenu") |
| | | public List<MenuVO> treeMyMenu(TreeQueryObject treeQueryObject) throws PLException { |
| | | return functionQueryService.treeCurrentUserMenu(treeQueryObject, ResourceControlTypeEnum.BS); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户的所有按钮 |
| | | * @param treeQueryObject 树查询对象 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAllButtons") |
| | | public BaseResult getAllButtons(TreeQueryObject treeQueryObject){ |
| | | return BaseResult.dataList(functionQueryService.buttons(treeQueryObject)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @VciUnCheckRight |
| | | @GetMapping("/getUIContentByBtmTypeAndId") |
| | | public UIContentVO getUIContentByBtmTypeAndId(@RequestBody TreeQueryObject treeQueryObject) throws PLException { |
| | | return functionQueryService.getUIContentByBtmTypeAndId(treeQueryObject, ResourceControlTypeEnum.BS); |
| | | public BaseResult getUIContentByBtmTypeAndId(@RequestBody TreeQueryObject treeQueryObject) { |
| | | try { |
| | | return BaseResult.success(functionQueryService.getUIContentByBtmTypeAndId(treeQueryObject, ResourceControlTypeEnum.BS)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "获取当前用户的菜单时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | return new DataGrid<>(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取当前用户的菜单 |
| | | * @param treeQueryObject 树查询对象 |
| | | * @return 树节点,出现错误会在异常处理器中统一返回Json |
| | | */ |
| | | @VciUnCheckRight |
| | | @GetMapping("/getTreeMyMenu") |
| | | @ResponseBody |
| | | public List<MenuVO> getTreeMyMenu(TreeQueryObject treeQueryObject) throws PLException { |
| | | return functionQueryService.treeCurrentUserMenu(treeQueryObject, ResourceControlTypeEnum.BS); |
| | | } |
| | | } |