|
@@ -9,6 +9,7 @@ import cn.rankin.common.utils.api.page.Page;
|
|
import cn.rankin.common.utils.constant.PlatForm;
|
|
import cn.rankin.common.utils.constant.PlatForm;
|
|
import cn.rankin.common.utils.constant.RedisKey;
|
|
import cn.rankin.common.utils.constant.RedisKey;
|
|
import cn.rankin.common.utils.service.RedisService;
|
|
import cn.rankin.common.utils.service.RedisService;
|
|
|
|
+import cn.rankin.data.api.app.dto.DeviceLoginDTO;
|
|
import cn.rankin.data.api.app.dto.LoginInfoDTO;
|
|
import cn.rankin.data.api.app.dto.LoginInfoDTO;
|
|
import cn.rankin.data.api.app.vo.DeviceUserVo;
|
|
import cn.rankin.data.api.app.vo.DeviceUserVo;
|
|
import cn.rankin.data.api.app.vo.ItemVo;
|
|
import cn.rankin.data.api.app.vo.ItemVo;
|
|
@@ -79,27 +80,7 @@ public class UserService
|
|
return APIResult.error(ApiWebCode.LOGIN_ERROR);
|
|
return APIResult.error(ApiWebCode.LOGIN_ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
- //操作用户登录设备信息
|
|
|
|
- if (deviceName != null && !"".equals(deviceName.trim()))
|
|
|
|
- {
|
|
|
|
- String uid = userVo.getId();
|
|
|
|
- UserDeviceDTO dto = new UserDeviceDTO();
|
|
|
|
- dto.setDeviceCode(deviceCode);
|
|
|
|
- dto.setDeviceModel(deviceModel);
|
|
|
|
- dto.setDeviceType(deviceType);
|
|
|
|
- dto.setDeviceMfrs(deviceMfrs);
|
|
|
|
- dto.setDeviceName(deviceName);
|
|
|
|
|
|
|
|
- int opRet = userClient.opUserDevice(uid,dto);
|
|
|
|
- if (opRet == 0)
|
|
|
|
- {
|
|
|
|
- log.error("Failed to operated user device with[uid={},deviceCode={},deviceModel={},deviceName={}]", uid, deviceCode, deviceModel, deviceName);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- log.info("Succeed to operating user device with[uid={},deviceCode={},deviceModel={},deviceName={}]", uid, deviceCode, deviceModel, deviceName);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
String storePassword = userVo.getPassword();
|
|
String storePassword = userVo.getPassword();
|
|
if (!SecurityManager.validate(loginPassword, storePassword))
|
|
if (!SecurityManager.validate(loginPassword, storePassword))
|
|
@@ -230,7 +211,7 @@ public class UserService
|
|
return toDeviceUserVo(userVo, deviceVo);
|
|
return toDeviceUserVo(userVo, deviceVo);
|
|
}
|
|
}
|
|
|
|
|
|
- public APIResult<UserInfoVo> refresh(String deviceCode, String merchant, Boolean force)
|
|
|
|
|
|
+ public APIResult<UserInfoVo> refresh(String deviceCode, String merchant, Boolean force, DeviceLoginDTO deviceLoginDTO)
|
|
{
|
|
{
|
|
|
|
|
|
List<TerminalDeviceVo> deviceVoList = userClient.findByDeviceCode(deviceCode);
|
|
List<TerminalDeviceVo> deviceVoList = userClient.findByDeviceCode(deviceCode);
|
|
@@ -301,6 +282,32 @@ public class UserService
|
|
refreshToken(deviceUserVo);
|
|
refreshToken(deviceUserVo);
|
|
save(deviceUserVo);
|
|
save(deviceUserVo);
|
|
|
|
|
|
|
|
+ //获取设备台账
|
|
|
|
+ String deviceModel = deviceLoginDTO.getDeviceModel();
|
|
|
|
+ String deviceMfrs = deviceLoginDTO.getDeviceMfrs();
|
|
|
|
+ String deviceName = deviceLoginDTO.getDeviceName();
|
|
|
|
+ String deviceType = deviceLoginDTO.getDeviceType();
|
|
|
|
+ //操作用户登录设备信息
|
|
|
|
+ if (deviceName != null && !"".equals(deviceName.trim()))
|
|
|
|
+ {
|
|
|
|
+ UserDeviceDTO dto = new UserDeviceDTO();
|
|
|
|
+ dto.setDeviceCode(deviceCode);
|
|
|
|
+ dto.setDeviceModel(deviceModel);
|
|
|
|
+ dto.setDeviceType(deviceType);
|
|
|
|
+ dto.setDeviceMfrs(deviceMfrs);
|
|
|
|
+ dto.setDeviceName(deviceName);
|
|
|
|
+
|
|
|
|
+ int opRet = userClient.opUserDevice(uid,dto);
|
|
|
|
+ if (opRet == 0)
|
|
|
|
+ {
|
|
|
|
+ log.error("Failed to operated user device with[uid={},deviceCode={},deviceModel={},deviceName={}]", uid, deviceCode, deviceModel, deviceName);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ log.info("Succeed to operating user device with[uid={},deviceCode={},deviceModel={},deviceName={}]", uid, deviceCode, deviceModel, deviceName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
UserInfoVo userInfoVo = toUserInfoVo(deviceUserVo, true);
|
|
UserInfoVo userInfoVo = toUserInfoVo(deviceUserVo, true);
|
|
return APIResult.ok(userInfoVo);
|
|
return APIResult.ok(userInfoVo);
|
|
}
|
|
}
|