|
@@ -33,12 +33,14 @@ public class DeviceValveCommondSync implements InitializingBean {
|
|
|
while (true) {
|
|
|
try {
|
|
|
List<PayValveStateInfo> payValveStateInfos = payFeeMapper.getDeviceValveStateByRecord();
|
|
|
- List<BigInteger> devices = payValveStateInfos.stream().map( d ->{
|
|
|
- payFeeService.sendValveCommond(d);
|
|
|
- return d.getMeterId();
|
|
|
- }
|
|
|
- ).collect(Collectors.toList());
|
|
|
- payFeeMapper.deleteControlValveInfoByDevice(devices);
|
|
|
+ if(payValveStateInfos.size() > 0){
|
|
|
+ List<BigInteger> devices = payValveStateInfos.stream().map( d ->{
|
|
|
+ payFeeService.sendValveCommond(d);
|
|
|
+ return d.getMeterId();
|
|
|
+ }
|
|
|
+ ).collect(Collectors.toList());
|
|
|
+ payFeeMapper.deleteControlValveInfoByDevice(devices);
|
|
|
+ }
|
|
|
} catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|