1. 异步更新在线状态
This commit is contained in:
parent
8fe5ebda0a
commit
36dabe0e30
|
@ -129,6 +129,9 @@ public class ReceiveController {
|
|||
String msg = (String) obj.getMsg();
|
||||
log.info("receive方法-获取到消息体: msg---" +msg);
|
||||
JSONObject jsonObject = JSONObject.parseObject(msg, JSONObject.class);
|
||||
String devName = (String)jsonObject.get("dev_name");
|
||||
/*异步更新在线状态*/
|
||||
asynchronousUpdateOnlineStatus(devName);
|
||||
if(IotConstants.ONENET_LOCATION.equals(jsonObject.get("ds_id")) && ObjectUtil.isNotNull(jsonObject.get("value"))){
|
||||
LogEntry logEntry = JSONObject.parseObject(msg, LogEntry.class);
|
||||
log.info("logEntry转换后的对象: logEntry---【{}】" , JSON.toJSONString(logEntry));
|
||||
|
@ -314,6 +317,22 @@ public class ReceiveController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步更新在线状态
|
||||
*/
|
||||
private void asynchronousUpdateOnlineStatus(String mac) {
|
||||
AsDevice device = asDeviceService.selectAsDeviceByMac(mac);
|
||||
//开异步线程保存回调参数
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
log.info("【接收onenet推送】异步更新在线状态"+JSON.toJSONString(device));
|
||||
device.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_ONLINE);
|
||||
int i = asDeviceService.updateAsDevice(device);
|
||||
if(i>0){
|
||||
log.info("【接收onenet推送】异步保存在线状态成功");
|
||||
}
|
||||
}, 0, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private boolean isLastPointSame(JSONArray jsonArray, BigDecimal lon, BigDecimal lat) {
|
||||
if (jsonArray.size() > 0) {
|
||||
JSONArray lastPoint = (JSONArray) jsonArray.get(jsonArray.size() - 1);
|
||||
|
|
|
@ -102,6 +102,7 @@ public class EtTask {
|
|||
* ②根据用户查询最后一次押金充值记录
|
||||
*/
|
||||
List<EtOrder> orders = etOrderMapper.selectUserListFinishOrder();
|
||||
log.info("已完成的订单未退还押金的的订单 = " + JSON.toJSONString(orders));
|
||||
for(EtOrder order:orders){
|
||||
EtFeeRule rule = etFeeRuleService.selectEtFeeRuleByRuleId(order.getRuleId());
|
||||
if(ObjectUtil.isNull(rule)){
|
||||
|
|
Loading…
Reference in New Issue
Block a user