| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.FuncOperationInfo; |
| | | import com.vci.corba.framework.data.OnlinUserInfo; |
| | | import com.vci.corba.framework.data.OperateInfo; |
| | | import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; |
| | | import com.vci.frameworkcore.compatibility.SmHMSysModConfigServiceI; |
| | | import com.vci.dto.RoleInfoDTO; |
| | | import com.vci.dto.RoleRightParamDTO; |
| | | import com.vci.dto.RoleRightParamDTOS; |
| | | import com.vci.web.service.ISmFunctionQueryService; |
| | | import com.vci.web.service.SmHMSysModConfigServiceI; |
| | | import com.vci.pagemodel.AppConfigDetailInfoVO; |
| | | import com.vci.pagemodel.ExpExcelConditionVO; |
| | | import com.vci.pagemodel.MenuVO; |
| | |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.starter.web.util.Lcm.Func; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 首页系统模块配置控制器 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前模块下的子模块 |
| | | * @param parentId |
| | | * @param modeType |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSysModelAuthTreeMenuByPID") |
| | | public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID(String parentId, String modeType) { |
| | | public BaseResult<List<MenuVO>> getSysModelAuthTreeMenuByPID() { |
| | | try { |
| | | return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(parentId,modeType,true)); |
| | | return BaseResult.dataList(functionQueryService.getSysModelAuthTreeMenuByPID(false)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String errorMsg = "查询子模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取所授权的模块权限 |
| | | * @param roleId 角色 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSysModelAuth") |
| | | public BaseResult<List<String>> getSysModelAuth(String roleId) { |
| | | try { |
| | | return BaseResult.dataList(functionQueryService.getSysModelAuth(roleId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String errorMsg = "查询子模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 角色列表 |
| | | * @param roleName 搜索的角色 |
| | | * @return 角色列表 |
| | | */ |
| | | @GetMapping("/getRoleList") |
| | | public BaseResult<List<RoleInfoDTO>> getRoleList(String roleName) { |
| | | try { |
| | | return BaseResult.dataList(functionQueryService.getRoleList(roleName)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String errorMsg = "查询时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存授权的模块 |
| | | * @param roleDto 用户选择授权模块信息 |
| | | * @return 授权结果 |
| | | * @throws PLException |
| | | */ |
| | | @PostMapping("/saveRoleRight") |
| | | public BaseResult saveRoleRight(@RequestBody RoleRightParamDTOS roleDto) { |
| | | try { |
| | | |
| | | ArrayList<RoleRightParamDTO> roleRightDTOS = roleDto.getRoleData(); |
| | | String roleId = roleDto.getRoleId(); |
| | | if(StringUtils.isBlank(roleId)){ |
| | | return BaseResult.fail("请选择角色!"); |
| | | } |
| | | return functionQueryService.saveRoleRight(roleRightDTOS, roleId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String errorMsg = "保存模块时出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户在线人数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOnlineUsersNum") |
| | | public BaseResult getOnlineUsersNum() { |
| | | try { |
| | | long onlineUsersNum = hmSysModConfigService.getOnlineUsersNum(); |
| | | return BaseResult.success(onlineUsersNum); |
| | | } catch (Exception e) { |
| | | String errorMsg = "获取当前用户在线人数时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户在线人数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOnlinUsers") |
| | | public BaseResult<OnlinUserInfo> getOnlinUsers(){ |
| | | try { |
| | | BaseResult baseResult = BaseResult.success(); |
| | | List<OnlinUserInfo> onlineUserList = hmSysModConfigService.getOnlinUsers(); |
| | | baseResult.setData(onlineUserList); |
| | | return baseResult; |
| | | } catch (Exception e) { |
| | | String errorMsg = "获取当前在线用户时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(errorMsg); |
| | | throw new VciBaseException(errorMsg); |
| | | } |
| | | } |
| | | } |