|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.annotation.*; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
|---|
|  |  |  | import com.zy.asrs.common.domain.enums.LoginSystemType; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.Cools; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.SpringUtils; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.DeptService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.HostService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.UserRoleService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.UserService; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.*; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  | import net.sf.jsqlparser.expression.LongValue; | 
|---|
|  |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
|---|
|  |  |  | import org.springframework.security.core.userdetails.UserDetails; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Long getHostId() { | 
|---|
|  |  |  | boolean root = false; | 
|---|
|  |  |  | UserRoleService userRoleService = SpringUtils.getBean(UserRoleService.class); | 
|---|
|  |  |  | UserLoginService userLoginService = SpringUtils.getBean(UserLoginService.class); | 
|---|
|  |  |  | List<Role> roles = userRoleService.listByUserId(this.id); | 
|---|
|  |  |  | for (Role role : roles) { | 
|---|
|  |  |  | if (role.getId() == 1) { | 
|---|
|  |  |  | root = true; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (root) { | 
|---|
|  |  |  | UserLogin userLogin = userLoginService.superFindByUserId(this.id, String.valueOf(LoginSystemType.WMS)); | 
|---|
|  |  |  | if (userLogin != null) { | 
|---|
|  |  |  | return userLogin.getHostId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return this.hostId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|