| | |
| | | read = read + "ModuleCode"; |
| | | if(device.equals("OP365")){ |
| | | try { |
| | | result = saveStationInfo365(thoroughfare,device); |
| | | return result; |
| | | // result = saveStationInfo365(thoroughfare,device); |
| | | // return result; |
| | | saveStationInfo365(thoroughfare,device); |
| | | // return result; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }else { |
| | | read = read + "PACKCode"; |
| | | } |
| | | } |
| | | snCode = miloService.readFromOpcUa(read).getValue().toString(); |
| | | |
| | | if(null == snCode || "".equals(snCode)){ |
| | |
| | | } |
| | | result = "21"; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * 保存过站采集 |
| | | */ |
| | | public String saveStationInfo365(String thoroughfare,String device) throws Exception { |
| | | public void saveStationInfo365(String thoroughfare,String device) throws Exception { |
| | | String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone"; |
| | | String prefix = thoroughfare+"."+device+"."; |
| | | List<DaPassingStationCollection> passingStationCollections = new ArrayList<>(); |
| | |
| | | passingStationCollections.add(daPassingStationCollection); |
| | | } |
| | | daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections); |
| | | //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build()); |
| | | return "21"; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build()); |
| | | // return "21"; |
| | | }else { |
| | | //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build()); |
| | | return "22"; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build()); |
| | | // return "22"; |
| | | } |
| | | } |
| | | |