| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.Dept; |
| | | import com.stylefeng.guns.modular.system.model.LoginLog; |
| | | import com.stylefeng.guns.modular.system.model.Role; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 总览信息 |
| | |
| | | @RequestMapping("") |
| | | public String blackboard(Model model,Integer type) { |
| | | //查询当前用户是否有"首页"菜单的权限 |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | 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", ShiroKit.getUser().getId())); |
| | | int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", ShiroExtUtil.getUser().getId())); |
| | | model.addAttribute("loginNum", count); |
| | | |
| | | Role role = roleService.selectById(user.getRoleid()); |