Upd:还原代码

master
duLingLing 7 years ago
parent 080075698a
commit bb94be2a28

@ -4,7 +4,6 @@ import au.com.royalpay.payment.manage.appclient.beans.RetailLoginInfo;
import au.com.royalpay.payment.manage.appclient.core.ManageAppService; import au.com.royalpay.payment.manage.appclient.core.ManageAppService;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo; import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
@ -62,8 +61,6 @@ public class RetailValidationController implements ApplicationEventPublisherAwar
private ApplicationEventPublisher publisher; private ApplicationEventPublisher publisher;
@Resource @Resource
private ManageAppService manageAppService; private ManageAppService manageAppService;
@Resource
private DeviceManager deviceManager;
@Override @Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
@ -98,7 +95,6 @@ public class RetailValidationController implements ApplicationEventPublisherAwar
client = JSON.parseObject(client.toJSONString()); client = JSON.parseObject(client.toJSONString());
if (loginInfo.getDevId() != null) { if (loginInfo.getDevId() != null) {
deviceSupport.validDeviceWithClient(client, loginInfo.getDevId()); deviceSupport.validDeviceWithClient(client, loginInfo.getDevId());
deviceManager.offlineNotCurrentUserByDevIdAndAccountId(loginInfo.getDevId(),client.getString("account_id"));
} }
client.put("sign_key", signKey); client.put("sign_key", signKey);
return client; return client;
@ -223,10 +219,6 @@ public class RetailValidationController implements ApplicationEventPublisherAwar
result.put("account",account); result.put("account",account);
result.put("status","success"); result.put("status","success");
result.put("bind_status", true); result.put("bind_status", true);
if (params.getString("devId") != null) {
deviceSupport.validDeviceWithClient(account, params.getString("devId"));
deviceManager.offlineNotCurrentUserByDevIdAndAccountId(params.getString("devId"),account.getString("account_id"));
}
this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "MOBILE")); this.publisher.publishEvent(new ClientLoginEvent(this, account.getIntValue("client_id"), account.getString("account_id"), RequestEnvironment.getClientIp(), "MOBILE"));
}else{ }else{
result.put("status","success"); result.put("status","success");
@ -280,10 +272,6 @@ public class RetailValidationController implements ApplicationEventPublisherAwar
deviceSupport.validDeviceWithClient(account, params.getString("app_openid")); deviceSupport.validDeviceWithClient(account, params.getString("app_openid"));
return account; return account;
} }
if (params.getString("devId") != null) {
deviceSupport.validDeviceWithClient(account, params.getString("devId"));
deviceManager.offlineNotCurrentUserByDevIdAndAccountId(params.getString("devId"),account.getString("account_id"));
}
this.publisher.publishEvent(new ClientLoginEvent(this, account.getJSONObject("account").getIntValue("client_id"), account.getJSONObject("account").getString("account_id"), RequestEnvironment.getClientIp(), "wechat")); this.publisher.publishEvent(new ClientLoginEvent(this, account.getJSONObject("account").getIntValue("client_id"), account.getJSONObject("account").getString("account_id"), RequestEnvironment.getClientIp(), "wechat"));
return account; return account;
} }

@ -17,12 +17,4 @@ public interface DeviceManager {
void deviceOffline(String accountId); void deviceOffline(String accountId);
JSONObject listDevOrders(JSONObject manager, String devId, TradeLogQuery query); JSONObject listDevOrders(JSONObject manager, String devId, TradeLogQuery query);
/**
* 离线当前设备非当前登录用户
* @param devId
* @param accountId
*/
void offlineNotCurrentUserByDevIdAndAccountId(String devId,String accountId);
} }

@ -118,17 +118,4 @@ public class DeviceManagerImp implements DeviceManager {
return result; return result;
} }
/**
* 离线当前设备非当前登录用户
* @param devId
* @param accountId
*/
@Override
public void offlineNotCurrentUserByDevIdAndAccountId(String devId, String accountId) {
//离线当前设备非当前用户
clientDeviceMapper.updateByDevIdAndAccountId(devId,accountId);
//离线当前用户以前登录的设备
clientDeviceMapper.updateAccountIdAndByDevId(devId,accountId);
}
} }

@ -45,8 +45,4 @@ public interface ClientDeviceMapper {
PageList<JSONObject> listDevices(JSONObject params, PageBounds pagination); PageList<JSONObject> listDevices(JSONObject params, PageBounds pagination);
void deviceOffline(@Param("account_id") String accountId); void deviceOffline(@Param("account_id") String accountId);
void updateByDevIdAndAccountId(@Param("client_dev_id") String devId, @Param("account_id")String accountId);
void updateAccountIdAndByDevId(@Param("client_dev_id") String devId, @Param("account_id")String accountId);
} }

@ -55,20 +55,4 @@
where where
account_id = #{account_id} account_id = #{account_id}
</update> </update>
<update id="updateByDevIdAndAccountId">
UPDATE sys_clients_devices device
LEFT JOIN sys_clients_devices_token dtoken
ON device.dev_id = dtoken.dev_id
SET device.is_offline = 1,dtoken.is_valid=0
WHERE device.client_dev_id = #{client_dev_id} AND device.account_id != #{account_id}
</update>
<update id="updateAccountIdAndByDevId">
UPDATE sys_clients_devices device
LEFT JOIN sys_clients_devices_token dtoken
ON device.dev_id = dtoken.dev_id
SET device.is_offline = 1,dtoken.is_valid=0
WHERE device.client_dev_id != #{client_dev_id} AND device.account_id = #{account_id}
</update>
</mapper> </mapper>
Loading…
Cancel
Save