hdy
2 天以前 1c50cb5546715fa21496fbdf2bdacb7ae8836b8a
billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java
@@ -100,7 +100,8 @@
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
                    }
                    //除首工站所有工站
                    else if(Constants.PLC1.contains(device) ||
                    else if(
                            Constants.PLC1.contains(device) ||
                            Constants.PLC2.contains(device) ||
                            Constants.PLC3.contains(device) ||
                            Constants.PLC4.contains(device) ||
@@ -109,17 +110,22 @@
                        //校验SFCCode是否存在
                        Object SFCCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".SFCCode").getValue();
                        if (SFCCode == null ) {
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(23).build());
                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(13).build());
                        } else {
                            OmOrderScheduling omOrderScheduling = new OmOrderScheduling();
                            omOrderScheduling.setSfcCode(SFCCode.toString());
                            List<OmOrderScheduling> resultList = omOrderSchedulingService.selectOmOrderSchedulingList(omOrderScheduling);
                            log.info("查询结果数量: {}", resultList);
                            BsBomChildInfo bsbomChildInfo= new BsBomChildInfo();
                            bsbomChildInfo.setLocationCode(device);
                            bsbomChildInfo.setBomCode(resultList.get(0).getWorkOrderNo());
                            //下发配方
                            formula(thoroughfare, device, bsbomChildInfo);
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
                            if(resultList != null){
                                String getWorkOrderNo = resultList.get(0).getWorkOrderNo();
                                BsBomChildInfo bsbomChildInfo= new BsBomChildInfo();
                                bsbomChildInfo.setLocationCode(device);
                                bsbomChildInfo.setBomCode(getWorkOrderNo);
                                //下发配方
                                formula(thoroughfare, device, bsbomChildInfo);
                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
                            }else {
                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(13).build());
                            }
                        }
                    }
                //出站保存数据