| | |
| | | if(Constants.ONLINE.contains(device)){ |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build()); |
| | | } |
| | | //除首工站所有工站 |
| | | //1.2//除首工站所有工站 |
| | | else if( |
| | | Constants.PLC1.contains(device) || |
| | | Constants.PLC2.contains(device) || |
| | |
| | | updateWrapper.set("head_status", "2"); |
| | | omProductionOrderInfoService.update(new OmProductionOrderInfo(),updateWrapper); |
| | | } |
| | | } else if (Constants.OP310.equals(device)) { |
| | | } else if (Constants.OP300.equals(device)) { |
| | | omOrderScheduling.setRemarks("Body"); |
| | | omOrderScheduling.setSfcCode(SFCCode.toString()); |
| | | List<OmOrderScheduling> omOrderSchedulingList = omOrderSchedulingService.selectOmOrderSchedulingList(omOrderScheduling); |
| | |
| | | updateWrapper.set("pre_status", "2"); |
| | | omProductionOrderInfoService.update(new OmProductionOrderInfo(),updateWrapper); |
| | | } |
| | | |
| | | sysCountService.updatePreNumber(); |
| | | omProductionOrderInfoService.updatePreStatus1(); |
| | | OmProductionOrderInfo getPreOrder2 = omProductionOrderInfoService.getPreOrder(); |
| | |
| | | omProductionOrderInfoService.updatePreStatus2(); |
| | | } |
| | | } |
| | | //出站保存 |
| | | DaStationCollection daStationCollection = new DaStationCollection(); |
| | | daStationCollection.setLocationCode(device); |
| | | daStationCollection.setSfcCode(SFCCode.toString()); |
| | | Object StationStatus = miloService.readFromOpcUa(thoroughfare + "." + device + ".StationStatus").getValue(); |
| | | Date startTime = new Date(); |
| | | ReadWriteEntity startTimeRead = miloService.readFromOpcUa(thoroughfare + "." + device + ".StartTime");//进站时间 |
| | | startTime = format.parse(TimeUtil.test(TimeUtil.stringProcessing(startTimeRead.getValue().toString()))); |
| | | daStationCollection.setInboundTime( startTime); |
| | | Date stopTime = new Date(); |
| | | ReadWriteEntity stopTimeRead = miloService.readFromOpcUa(thoroughfare + "." + device + ".StopTime");//进站时间 |
| | | stopTime = format.parse(TimeUtil.test(TimeUtil.stringProcessing(stopTimeRead.getValue().toString()))); |
| | | daStationCollection.setOutboundTime( stopTime); |
| | | daStationCollection.setStatus(StationStatus.toString()); |
| | | daStationCollectionService.insertDaStationCollection(daStationCollection); |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(21).build()); |
| | | //查询descriptive字段等于1的采集项保存到扫码保存到da_material_collection表里 |
| | | DaCollectionParamConf daCollectionParamConf1 = new DaCollectionParamConf(); |
| | | daCollectionParamConf1.setProcessesCode(device); |
| | |
| | | List<DaCollectionParamConf> daCollectionParamConfList1 = daCollectionParamConfService.selectDaCollectionParamConfList(daCollectionParamConf1); |
| | | for (DaCollectionParamConf conf : daCollectionParamConfList1) { |
| | | String gatherAddress = conf.getGatherAddress(); |
| | | |
| | | String valueObj = null; |
| | | ReadWriteEntity entity = miloService.readFromOpcUa(gatherAddress); |
| | | if (entity != null) { |
| | |
| | | log.debug("采集项为空: {}", gatherAddress); |
| | | } |
| | | } |
| | | DaStationCollection daStationCollection = new DaStationCollection(); |
| | | daStationCollection.setLocationCode(device); |
| | | daStationCollection.setSfcCode(SFCCode.toString()); |
| | | Object StationStatus = miloService.readFromOpcUa(thoroughfare + "." + device + ".StationStatus").getValue(); |
| | | Date startTime = new Date(); |
| | | ReadWriteEntity startTimeRead = miloService.readFromOpcUa(thoroughfare + "." + device + ".StartTime");//进站时间 |
| | | startTime = format.parse(TimeUtil.test(TimeUtil.stringProcessing(startTimeRead.getValue().toString()))); |
| | | daStationCollection.setInboundTime( startTime); |
| | | Date stopTime = new Date(); |
| | | ReadWriteEntity stopTimeRead = miloService.readFromOpcUa(thoroughfare + "." + device + ".StopTime");//进站时间 |
| | | stopTime = format.parse(TimeUtil.test(TimeUtil.stringProcessing(stopTimeRead.getValue().toString()))); |
| | | daStationCollection.setOutboundTime( stopTime); |
| | | daStationCollection.setStatus(StationStatus.toString()); |
| | | daStationCollectionService.insertDaStationCollection(daStationCollection); |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(21).build()); |
| | | } |
| | | } |
| | | } |