Pu Zhibing
2 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java
@@ -17,6 +17,7 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.Date;
/**
@@ -34,36 +35,39 @@
    @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());