-
admin
2024-04-28 3581b1687306f77b7463c4c0a23d30ddfb6e9bb7
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -35,10 +35,10 @@
    public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    //新自动工站
    public List<String> automaticList = Arrays.asList("OP280", "OP320A","OP320B", "OP340A","OP340B", "OP350A","OP350B", "OP360","OP365","OP370", "OP390", "OP470");
    public List<String> automaticList = Arrays.asList("OP280", "OP300A","OP300B", "OP320A","OP320B", "OP340A","OP340B", "OP350A","OP350B", "OP360","OP365","OP370", "OP390", "OP470");
    //采集模组工位 ModuleCode
    public List<String> moduleCodeList = Arrays.asList("OP320A","OP320B","OP340A","OP340B","OP365", "OP350A", "OP350B", "OP330");
    public List<String> moduleCodeList = Arrays.asList("OP300A","OP300B","OP320A","OP320B","OP340A","OP340B","OP365", "OP350A", "OP350B", "OP330");
    //区分模组型号工位
    public List<String> distinguishingModules = Arrays.asList("OP300","OP310", "OP340", "OP350", "OP330");
@@ -116,22 +116,22 @@
                            //plc给我们一个模组码,拿模组码校验出型号
                            if(distinguishingModules.stream().anyMatch(s -> s.equals(device))) {
                                //读模组码
                                String moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue().toString();
                                String productTye = thoroughfare + "." + device + ".ProductType";
                                if (null != moduleCode && moduleCode.length() == 24) {
                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(productTye).value(Integer.valueOf(moduleCode.substring(7, 8))).build());
                                    //进站保存数据
//                              inSaveDate(thoroughfare,device)
                                    //记录数据完成
                                    String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
                                    //请求工单
                                } else {
                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
                                }
//                                String moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue().toString();
//                                String productTye = thoroughfare + "." + device + ".ProductType";
//                                if (null != moduleCode && moduleCode.length() == 24) {
//                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(productTye).value(Integer.valueOf(moduleCode.substring(7, 8))).build());
//                                    //进站保存数据
////                              inSaveDate(thoroughfare,device)
//                                    //记录数据完成
//                                    String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
//
//                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
//
//
//                                    //请求工单
//                                } else {
//                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
//                                }
                            }else {
                                //pack 如果区分型号的话就要处理
                                //记录数据完成