|
|
@@ -71,24 +71,25 @@ public class DataAnalyseService {
|
|
|
//数据写入
|
|
|
ProductPara productPara;
|
|
|
List<ProductPara> list = new ArrayList<>();
|
|
|
- for (Map.Entry<String, PropertyDto> map : modData.entrySet()) {
|
|
|
- map.getValue().setTime(LocalDateTimeUtil.formatNormal(LocalDateTime.now()));
|
|
|
- productPara = new ProductPara();
|
|
|
- productPara.setCode(productVo.getCode());
|
|
|
- productPara.setGuid(productVo.getGuid());
|
|
|
- productPara.setLine(map.getKey());
|
|
|
- productPara.setReserve("");
|
|
|
- productPara.setVal(map.getValue().getVal());
|
|
|
- productPara.setMsgId(msgId);
|
|
|
- productPara.setTs(TsUtil.getAndIncrement());
|
|
|
- productPara.setOriginTime(new Date());//todo 有则获取
|
|
|
- list.add(productPara);
|
|
|
- cacheService.setHashKey(String.format(CacheConstant.D_DATA_CACHE, productVo.getGuid()), map.getKey(), map.getValue());
|
|
|
- if (CollUtil.isNotEmpty(list)) {
|
|
|
- taosMapper.batchInsert(list, productVo.getGuid(), productVo.getCode());
|
|
|
+ if(CollUtil.isNotEmpty(modData)){
|
|
|
+ for (Map.Entry<String, PropertyDto> map : modData.entrySet()) {
|
|
|
+ map.getValue().setTime(LocalDateTimeUtil.formatNormal(LocalDateTime.now()));
|
|
|
+ productPara = new ProductPara();
|
|
|
+ productPara.setCode(productVo.getCode());
|
|
|
+ productPara.setGuid(productVo.getGuid());
|
|
|
+ productPara.setLine(map.getKey());
|
|
|
+ productPara.setReserve("");
|
|
|
+ productPara.setVal(map.getValue().getVal());
|
|
|
+ productPara.setMsgId(msgId);
|
|
|
+ productPara.setTs(TsUtil.getAndIncrement());
|
|
|
+ productPara.setOriginTime(new Date());//todo 有则获取
|
|
|
+ list.add(productPara);
|
|
|
+ cacheService.setHashKey(String.format(CacheConstant.D_DATA_CACHE, productVo.getGuid()), map.getKey(), map.getValue());
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
|
+ taosMapper.batchInsert(list, productVo.getGuid(), productVo.getCode());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void tableCheck(ProductVo productVo) {
|