|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wms.system.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.utils.IpTools; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.mapper.UserLoginMapper; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.UserLogin; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.UserLoginService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Async; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("userLoginService") | 
|---|
|  |  |  | public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Async | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void saveAsync(Long userId, String token, Integer type, Long hostId, String memo, HttpServletRequest request) { | 
|---|
|  |  |  | if (userId == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | UserLogin userLogin = new UserLogin(); | 
|---|
|  |  |  | userLogin.setUserId(userId); | 
|---|
|  |  |  | userLogin.setToken(token); | 
|---|
|  |  |  | userLogin.setType(type); | 
|---|
|  |  |  | userLogin.setIp(IpTools.gainRealIp(request)); | 
|---|
|  |  |  | userLogin.setMemo(memo); | 
|---|
|  |  |  | baseMapper.insert(userLogin); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | package com.zy.asrs.wms.system.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.domain.enums.LoginSystemType; | 
|---|
|  |  |  | import com.zy.asrs.common.utils.IpTools; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.mapper.UserLoginMapper; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.entity.UserLogin; | 
|---|
|  |  |  | import com.zy.asrs.wms.system.service.UserLoginService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Async; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("userLoginService") | 
|---|
|  |  |  | public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Async | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void saveAsync(Long userId, String token, Integer type, Long hostId, String memo, HttpServletRequest request) { | 
|---|
|  |  |  | if (userId == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | UserLogin userLogin = new UserLogin(); | 
|---|
|  |  |  | userLogin.setUserId(userId); | 
|---|
|  |  |  | userLogin.setToken(token); | 
|---|
|  |  |  | userLogin.setType(type); | 
|---|
|  |  |  | userLogin.setIp(IpTools.gainRealIp(request)); | 
|---|
|  |  |  | userLogin.setMemo(memo); | 
|---|
|  |  |  | userLogin.setSystemCode(String.valueOf(LoginSystemType.WMS)); | 
|---|
|  |  |  | userLogin.setHostId(hostId); | 
|---|
|  |  |  | baseMapper.insert(userLogin); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public UserLogin superFindByUserId(Long userId, String system) { | 
|---|
|  |  |  | return this.baseMapper.superFindByUserId(userId, system); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|