| | |
| | | package com.fzzy.sys.controller; |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import com.ruoyi.common.constant.ShiroConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.text.Convert; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.shiro.service.SysPasswordService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | /** |
| | | * 首页 业务处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Controller |
| | | public class SysIndexController extends BaseController { |
| | | @Autowired |
| | | @Resource |
| | | private ISysMenuService menuService; |
| | | @Autowired |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | @Resource |
| | | private SysPasswordService passwordService; |
| | | @Resource |
| | | private ISysDeptService iSysDeptService; |
| | | |
| | | /** |
| | | * 页面路由 |
| | | * |
| | | * @param mmap |
| | | * @return |
| | | */ |
| | | @GetMapping("/index-gateway") |
| | | public String indexGateway(ModelMap mmap) { |
| | | //获取登录人信息 |
| | | SysUser user = getSysUser(); |
| | | |
| | | //单库区主页 |
| | | return "redirect:index?deptId=" + user.getDeptId(); |
| | | } |
| | | |
| | | // 系统首页 |
| | | @GetMapping("/index") |
| | | public String index(@RequestParam(value = "bizType", required = false) String bizType, |
| | | public String index(@RequestParam(value = "deptId", required = true) String deptId, |
| | | ModelMap mmap) { |
| | | // 取身份信息 |
| | | SysUser user = getSysUser(); |
| | | mmap.put("user", user); |
| | | mmap.put("sysName", FrameworkConfig.getName()); |
| | | |
| | | //判断是否显示库区选择弹窗 |
| | | String showDeptList = "Y"; |
| | | SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId()); |
| | | if (Constant.DEPT_TYPE_20.equals(userDept.getType())) { |
| | | showDeptList = "N"; |
| | | } |
| | | mmap.put("showDeptList", showDeptList); |
| | | |
| | | ContextUtil.updateSubDept(user.getLoginName(), deptId); |
| | | SysDept dept = iSysDeptService.selectDeptById(Long.valueOf(deptId)); |
| | | mmap.put("dept", dept); |
| | | mmap.put("deptId", deptId); |
| | | |
| | | //后台默认页面 |
| | | String welcomeUrl = "/group/gis"; |
| | | mmap.put("welcomeUrl", welcomeUrl); |
| | | |
| | | // 根据用户id取出菜单 |
| | | List<SysMenu> menus = menuService.selectMenusByUser(user); |