| | |
| | | } |
| | | } |
| | | if(cache == null){ |
| | | cache = info; |
| | | //此时不做任务操作,只保障cache不为空, 等待下次发来数据 |
| | | if(info.ugRtuStateList != null && info.ugRtuStateList.size() > 0){ |
| | | List<UpgradeRtu> overList = info.ugRtuStateList.stream().filter(itemVo -> itemVo.isOver).collect(Collectors.toList()) ; |
| | | if(overList != null && overList.size() > 0){ |
| | | cache = info; |
| | | this.save2Db(info.ugTaskId, overList); |
| | | } |
| | | } |
| | | }else{ |
| | | cache = info; |
| | | //当cache中有值时,进行比对存储,对比目的是防止重复操作数据库 |
| | | if(info.ugRtuStateList != null && info.ugRtuStateList.size() > 0){ |
| | | //此时保证两个集合都不为null |
| | | this.save2Db(info.ugTaskId, info.ugRtuStateList, cache.ugRtuStateList); |
| | | cache = info; |
| | | } |
| | | } |
| | | return null; |