| | |
| | | } |
| | | BaseReqData reqData = new BaseReqData(); |
| | | BaseResp resp; |
| | | for (GatewayDevice device : list) { |
| | | try{ |
| | | //如果不是粮情分机跳过 |
| | | if (!GatewayDeviceType.TYPE_07.getCode().equals(device.getType())) { |
| | | continue; |
| | | |
| | | for (int i = 0 ;i<3;i++){ |
| | | for (GatewayDevice device : list) { |
| | | try{ |
| | | //如果不是粮情分机跳过 |
| | | if (!GatewayDeviceType.TYPE_07.getCode().equals(device.getType())) { |
| | | continue; |
| | | } |
| | | if( i>0 && !(device.getDeviceId().startsWith("91510704731594658J001") ||device.getDeviceId().startsWith("91510704731594658J002") || device.getDeviceId().startsWith("91510700205404914T001"))){ |
| | | continue; |
| | | } |
| | | reqData.setDeviceId(device.getDeviceId()); |
| | | reqData.setProductId(device.getProductId()); |
| | | reqData.setDeviceName(device.getDeviceName()); |
| | | reqData.setDevice(device); |
| | | reqData.setAutoReplay(true); |
| | | GatewaySyncGranService syncGrainService = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()); |
| | | resp = syncGrainService.syncGrain(reqData); |
| | | log.info("命令发送结果:"+resp.toString()); |
| | | Thread.sleep(120000); |
| | | }catch (Exception e){ |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | } |
| | | reqData.setDeviceId(device.getDeviceId()); |
| | | reqData.setProductId(device.getProductId()); |
| | | reqData.setDeviceName(device.getDeviceName()); |
| | | reqData.setDevice(device); |
| | | reqData.setAutoReplay(true); |
| | | GatewaySyncGranService syncGrainService = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()); |
| | | resp = syncGrainService.syncGrain(reqData); |
| | | log.info("命令发送结果:"+resp.toString()); |
| | | Thread.sleep(30000); |
| | | }catch (Exception e){ |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |