|
|
@ -110,16 +110,15 @@ public class DataProcessServiceImpl implements DataProcessService { |
|
|
|
List<AdvantechDatas> list = JSON.parseObject(data.getD().toString(), new TypeReference<List<AdvantechDatas>>() {}); |
|
|
|
List<AdvantechDatas> list = JSON.parseObject(data.getD().toString(), new TypeReference<List<AdvantechDatas>>() {}); |
|
|
|
for (AdvantechDatas advantechDatas : list) { |
|
|
|
for (AdvantechDatas advantechDatas : list) { |
|
|
|
String tag = advantechDatas.getTag(); |
|
|
|
String tag = advantechDatas.getTag(); |
|
|
|
String value = advantechDatas.getValue(); |
|
|
|
String value = String.valueOf(advantechDatas.getValue()); |
|
|
|
log.info("时间: {},tag标签: {},value值: {}", formattedTime, tag, value); |
|
|
|
log.info("时间: {},tag标签: {},value值: {}", formattedTime, tag, value); |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (StringUtils.isBlank(tag)) { |
|
|
|
if (StringUtils.isBlank(tag)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
CollectionParamsManage collectionParamsManage = new CollectionParamsManage(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (CollectionParamsManage entity : registers) { |
|
|
|
for (CollectionParamsManage entity : registers) { |
|
|
|
if (tag.equals(String.valueOf(entity.getOtherName()))) { |
|
|
|
if (tag.equals(String.valueOf(entity.getOtherName()))) { |
|
|
|
|
|
|
|
CollectionParamsManage collectionParamsManage = new CollectionParamsManage(); |
|
|
|
collectionParamsManage = entity; |
|
|
|
collectionParamsManage = entity; |
|
|
|
try { |
|
|
|
try { |
|
|
|
collectionParamsManage.setCurValue(new BigDecimal(value)); |
|
|
|
collectionParamsManage.setCurValue(new BigDecimal(value)); |
|
|
@ -129,10 +128,10 @@ public class DataProcessServiceImpl implements DataProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
collectionParamsManage.setCurTime(date); |
|
|
|
collectionParamsManage.setCurTime(date); |
|
|
|
|
|
|
|
entities.add(collectionParamsManage); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
entities.add(collectionParamsManage); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("解析异常", e); |
|
|
|
log.error("解析异常", e); |
|
|
|
} |
|
|
|
} |
|
|
@ -141,7 +140,9 @@ public class DataProcessServiceImpl implements DataProcessService { |
|
|
|
redisCache.setCacheList(cacheKey, entities); |
|
|
|
redisCache.setCacheList(cacheKey, entities); |
|
|
|
|
|
|
|
|
|
|
|
threadPoolService.execute(() -> { |
|
|
|
threadPoolService.execute(() -> { |
|
|
|
collectionParamsManageService.updateCollectionParamsManages(entities); |
|
|
|
if (!entities.isEmpty()) { |
|
|
|
|
|
|
|
collectionParamsManageService.updateCollectionParamsManages(entities); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|