|
@@ -64,10 +64,14 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
Long lastDataId = (Long) redisUtils.get(RedisKey.UPLOAD_IPS_LAST_ID);
|
|
|
//根据lastDataId查询基于上次上传后巡检数据
|
|
|
List<RecordTaskPoint> checkDataList = uploadMapper.queryDataAfterId(lastDataId, count);
|
|
|
+ if (!CollectionUtils.isEmpty(checkDataList)) {
|
|
|
+ checkDataList = checkDataList.stream().filter(t -> t.getTaskId() != null).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(checkDataList)) {
|
|
|
return;
|
|
|
}
|
|
|
- Long maxId =null;
|
|
|
+ Long maxId = null;
|
|
|
//lastDataId为空即为首次上传,倒叙查询最新的巡检数据取最大的一条数据id
|
|
|
if (lastDataId == null) {
|
|
|
maxId = Long.parseLong(checkDataList.get(0).getResultId());
|
|
@@ -97,8 +101,10 @@ public class CheckDataServiceImpl implements CheckDataService {
|
|
|
}
|
|
|
//未全部成功则判定全部失败 下次重新上传
|
|
|
if (uploadResult.size() != successCount) {
|
|
|
+ logger.info("some data upload fail");
|
|
|
redisUtils.set(RedisKey.UPLOAD_IPS_LAST_ID, lastDataId);
|
|
|
} else {
|
|
|
+ logger.info("data upload success");
|
|
|
//全部成功则更新redis上传的最新id
|
|
|
redisUtils.set(RedisKey.UPLOAD_IPS_LAST_ID, maxId);
|
|
|
}
|