| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | |
| | | private ResultUtil resultUtil; |
| | | |
| | | /** |
| | | * 跳转到黑板 |
| | | */ |
| | | @RequestMapping("") |
| | | public String blackboard(Model model,Integer type) { |
| | | //查询当前用户是否有"首页"菜单的权限 |
| | | Integer id = ShiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | Integer menuNum = userService.getMenuNumByRole(user.getRoleid()); |
| | | if (menuNum > 0){ |
| | | return "/home.html"; |
| | | } else { |
| | | //查询登录次数 |
| | | int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", ShiroExtUtil.getUser().getId())); |
| | | model.addAttribute("loginNum", count); |
| | | |
| | | Role role = roleService.selectById(user.getRoleid()); |
| | | Dept dept = deptService.selectById(user.getDeptid()); |
| | | |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | |
| | | private ResultUtil resultUtil; |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | /** |
| | | * 跳转到黑板 |
| | | */ |
| | | @RequestMapping("") |
| | | public String blackboard(Model model, Integer type) { |
| | | //查询当前用户是否有"首页"菜单的权限 |
| | | Integer id = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | Integer menuNum = userService.getMenuNumByRole(user.getRoleid()); |
| | | if (menuNum > 0) { |
| | | return "/home.html"; |
| | | } else { |
| | | //查询登录次数 |
| | | int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", shiroExtUtil.getUser().getId())); |
| | | model.addAttribute("loginNum", count); |
| | | |
| | | Role role = roleService.selectById(user.getRoleid()); |
| | | Dept dept = deptService.selectById(user.getDeptid()); |
| | | |
| | | model.addAttribute("deptName",dept==null?"顶级":dept.getFullname()); |
| | | model.addAttribute("roleName", role.getName()); |