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

修改校验

parent 47457c03
......@@ -605,7 +605,10 @@ public class DeviceApiController {
productVersionQuery.setProductId(deviceEntity.getProductId());
productVersionQuery.setSiteId(deviceEntity.getSiteId());
productVersionQuery.setOrderColList(Arrays.asList(new OrderCol("version", OrderCol.DESCENDING)));
ProductVersionEntity productVersionEntity = productVersionService.find(productVersionQuery).stream().filter(item -> StrUtil.endWith(item.getFilePath(), ".apk", true)).findFirst().orElseGet(() -> null);
ProductVersionEntity productVersionEntity = productVersionService.find(productVersionQuery)
.stream()
// .filter(item -> StrUtil.endWith(item.getFilePath(), ".apk", true))
.findFirst().orElseGet(() -> null);
// ProductVersionEntity productVersionEntity = productVersionService.selectOne(productVersionQuery);
if (ObjectUtils.isEmpty(productVersionEntity)) {
throw new AppException(DEVICE_VERSION_UNEXIST, DEVICE_VERSION_UNEXIST_CONTENT);
......
......@@ -71,7 +71,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
}*/
//获取所有在线设备
List<DeviceEntity> deviceList = deviceService.getCacheList().stream().filter(f->DeviceStatusEnum.在线.getValue()==f.getDeviceStatus()).collect(Collectors.toList());
List<DeviceEntity> deviceList = deviceService.getCacheList().stream().filter(f -> DeviceStatusEnum.在线.getValue() == f.getDeviceStatus()).collect(Collectors.toList());
// List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery().deviceStatus(DeviceStatusEnum.在线.getValue()));
//更新离线
......@@ -92,15 +92,15 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
log.info("修正设备数量:size:{}", deviceOfflineList.size());
// deviceService.update(deviceOfflineList);
deviceOfflineList.forEach(deviceEntity -> {
cacheService.lpush(RedisKey.KEY_DEVICE_UPDATE_QUEUE,deviceEntity);
for (DeviceEntity deviceEntity : deviceOfflineList) {
cacheService.lpush(RedisKey.KEY_DEVICE_UPDATE_QUEUE, deviceEntity);
if (ObjectUtils.isEmpty(deviceEntity.getPlatformId())) continue;
if (ObjectUtils.isEmpty(deviceEntity.getProductId())) continue;
PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId().toString());
ProductEntity productEntity = productService.getCache(deviceEntity.getProductId().toString());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
//通知第三方平台
deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.OFFLINE);
//保存业务消息为离线
BizLogPdu bizLogPdu = new BizLogPdu();
bizLogPdu.initAttrValue();
......@@ -117,7 +117,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
messageProducer.syncBizSend(bizLogPdu);
}
});
}
}
}
......
......@@ -84,6 +84,19 @@ Content-Type: application/json
{"affairCode":"abcd1234ddddd"}
###测试json提交
POST {{baseUrl}}/test/sendThirdParty
Content-Type: application/json
{}
###测试json提交
POST {{baseUrl}}/api/checkVersion
Content-Type: application/json
{"deviceCode":"8C-C5-8C-02-BC-5A"}
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