Pu Zhibing
6 天以前 f2530067b6cd16a87b76190cf524d2ed75bf9592
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.core.util.ToolUtil;
@@ -34,23 +35,8 @@
@Controller
@RequestMapping("/blackboard")
public class BlackboardController extends BaseController {
    @Autowired
    private ILoginLogService loginLogService;
    @Autowired
    private IUserService userService;
    @Autowired
    private IRoleService roleService;
    @Autowired
    private IDeptService deptService;
    @Autowired
    private ITCompanyService companyService;
    @Autowired
    private ITAgentService tAgentService;
    @Autowired
    private ITBranchOfficeService branchOfficeService;
    @Autowired
@@ -60,11 +46,12 @@
    @Autowired
    private ITRevenueService tRevenueService;
    @Autowired
    private ITDriverWorkService tDriverWorkService;
    @Autowired
    private RedisUtil redisUtil;
    private ResultUtil resultUtil;
    @Autowired
    private ShiroExtUtil shiroExtUtil;
    /**
     * 跳转到黑板
@@ -72,14 +59,14 @@
    @RequestMapping("")
    public String blackboard(Model model,Integer type,Integer agentId,String dayDate,String yearDate,String monthDate) {
        //查询当前用户是否有"首页"菜单的权限
        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());
@@ -93,8 +80,8 @@
            if(Objects.isNull(type)){
                type = 1;
            }
            Integer objectId = ShiroKit.getUser().getObjectId();
            Integer roleType = ShiroKit.getUser().getRoleType();
            Integer objectId = shiroExtUtil.getUser().getObjectId();
            Integer roleType = shiroExtUtil.getUser().getRoleType();
            if(roleType != 1){
                if(roleType == 2 && Objects.nonNull(objectId)){
                    // 查询所有分公司
@@ -113,7 +100,7 @@
                model.addAttribute("agentList",agentList);
            }
            model.addAttribute("txt",new SimpleDateFormat("yyyy年MM月dd日").format(new Date()) + DateUtil.getWeekDay(new Date()) + ",欢迎" +
                    Objects.requireNonNull(ShiroKit.getUser()).getName() + "登录");
                    Objects.requireNonNull(shiroExtUtil.getUser()).getName() + "登录");
            Map<String, Object> map = new HashMap<>();
            if(Objects.nonNull(agentId)){
                // 统计分公司