Commit f4a43c8a authored by 赵啸非's avatar 赵啸非

解决设备下发消息

parent 166741d4
...@@ -77,7 +77,6 @@ import java.util.stream.Collectors; ...@@ -77,7 +77,6 @@ import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.*; import static com.mortals.xhx.common.key.Constant.*;
import static com.mortals.xhx.common.key.ErrorCode.*; import static com.mortals.xhx.common.key.ErrorCode.*;
import static com.mortals.xhx.common.key.RedisKey.KEY_DEVICE_DOWN_MSG_QUEUE;
import static com.mortals.xhx.common.key.RedisKey.KEY_TOKEN_API_CACHE; import static com.mortals.xhx.common.key.RedisKey.KEY_TOKEN_API_CACHE;
/** /**
...@@ -669,11 +668,11 @@ public class DeviceApiController { ...@@ -669,11 +668,11 @@ public class DeviceApiController {
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue()); rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try { try {
List<DeviceMsgReq> collect = list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).collect(Collectors.toList()); List<DeviceMsgReq> collect = list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).collect(Collectors.toList());
collect.forEach(item->{ /* collect.forEach(item->{
cacheService.lpush(KEY_DEVICE_DOWN_MSG_QUEUE,item); cacheService.lpush(KEY_DEVICE_DOWN_MSG_QUEUE,item);
}); });*/
// DownMsgTask downMsgTask = new DownMsgTask(list, platformService, productService, deviceService, deviceLogService, messageProducer); DownMsgTask downMsgTask = new DownMsgTask(list, platformService, productService, deviceService, deviceLogService, messageProducer);
// sendTaskThreadPool.execute(downMsgTask); sendTaskThreadPool.execute(downMsgTask);
} catch (AppException e) { } catch (AppException e) {
log.error("接收数据失败", e); log.error("接收数据失败", e);
rsp.setCode(e.getCode()); rsp.setCode(e.getCode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment