|  |  | 
 |  |  | package com.zy.asrs.common.web; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.TableField; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.zy.asrs.common.sys.entity.User; | 
 |  |  | import com.zy.asrs.common.sys.entity.UserLogin; | 
 |  |  | import com.zy.asrs.common.sys.service.UserLoginService; | 
 |  |  | import com.zy.asrs.common.sys.service.UserService; | 
 |  |  | import com.zy.asrs.common.wms.entity.Tag; | 
 |  |  | import com.zy.asrs.common.wms.service.TagService; | 
 |  |  | import com.zy.asrs.framework.common.BaseRes; | 
 |  |  | import com.zy.asrs.framework.common.Cools; | 
 |  |  | import com.zy.asrs.framework.controller.AbstractBaseController; | 
 |  |  | 
 |  |  |     protected HttpServletRequest request; | 
 |  |  |     @Autowired | 
 |  |  |     private UserService userService; | 
 |  |  |     @Autowired | 
 |  |  |     private UserLoginService userLoginService; | 
 |  |  |     @Autowired | 
 |  |  |     private TagService tagService; | 
 |  |  |  | 
 |  |  |     protected Long getHostId(){ | 
 |  |  |         if (getUserId() == 9527) { | 
 |  |  |             return null; | 
 |  |  |         } | 
 |  |  |         User user = getUser(); | 
 |  |  |         if (user.getRoleId() == 2) { | 
 |  |  |             String hostId = String.valueOf(request.getAttribute("hostId")); | 
 |  |  |             if (Cools.isEmpty(hostId)) { | 
 |  |  |                 UserLogin userLogin = userLoginService.getOne(new LambdaQueryWrapper<UserLogin>().eq(UserLogin::getUserId, user.getId())); | 
 |  |  |                 if (userLogin != null) { | 
 |  |  |                     return userLogin.getHostId(); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             return Long.parseLong(hostId); | 
 |  |  |         } else { | 
 |  |  |             return user.getHostId(); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     protected Long getUserId(){ | 
 |  |  |         return Long.parseLong(String.valueOf(request.getAttribute("userId"))); | 
 |  |  | 
 |  |  |         return page; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     protected Tag getOriginTag(){ | 
 |  |  |         return tagService.getTop(getHostId()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |