cl
2024-07-08 e4f9cb3d30a5ba10f4f6390facef7cd23b610cee
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -90,6 +90,19 @@
                String device = nodes[1];//设备
                String tab = nodes[2];//标记
                String valueString = value.toString();//地址值
                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                    subHandle(thoroughfare,device,tab,valueString);
                });
            }
        } catch (Exception e) {
            log.error(e.getMessage());
        }
    }
    public void subHandle(String thoroughfare,String device,String tab,String valueString){
        try{
                if (Constants.RECORD_CHECK_CODE.equals(tab)){//电芯校验
                    if (Constants.ONE.equals(valueString)){
                        Integer scanResult = 11;
@@ -120,7 +133,6 @@
                            }else {
                                scanResult = 12;
                            }
                        }
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".ScanerResult1").value(scanResult).build());
                        log.info("写入到工位{}的ScanerResult1数据:{}",device,scanResult);
@@ -210,23 +222,11 @@
                            log.info("写入到工位{}的RecordDataDone数据:{}",device,result);
                        }
                    }
                }  /*else if (Constants.RECORD_CHECK_CODE_1.equals(tab)) {
                    if (Constants.OP100_1.equals(device)){
                        //钢带条码校验--发送给工厂mes
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".ScanerResult11").value(11).build());
                    } else if (Constants.OP100_2.equals(device)) {
                        //PET带条码校验--发送给工厂mes
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".ScanerResult12").value(11).build());
                    }
                }*/
            }
        } catch (Exception e) {
            log.error(e.getMessage());
            System.out.println(e.getMessage());
            log.info(e.getMessage());
        }
    }
    public void receivingWorkOrders(String thoroughfare ,String device)
    {
        String paramProductNum = "";
@@ -516,9 +516,9 @@
                    parentVO.setProductNum(moduleCode);
                    parentVO.setCheckList(mesList);
                    log.info("执行工厂MES方法start,传入数据:{}",parentVO);
                    log.info("执行工厂MES方法start,工位号{} 传入数据:{}",device ,parentVO);
                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                    log.info("执行工厂MES方法end,返回数据:{}",execute.body());
                    log.info("执行工厂MES方法end,工位号{} 返回数据:{}",device,execute.body());
                });
            }
@@ -595,10 +595,10 @@
                        //发送给工厂mes参数封装
                        ChildVO childVO = new ChildVO();
                        childVO.setItemCode(confColl1.get(i).getCollectParameterName());//参数
                        childVO.setItemCode(confColl1.get(i).getCollectParameterId());//参数
                        childVO.setItemType(confColl1.get(i).getItemType());
                        childVO.setItemValue(paramValue);//参数值
                        childVO.setItemText(confColl1.get(i).getParameterSetName());
                        childVO.setItemText(confColl1.get(i).getCollectParameterName());
                        childVO.setCheckResult("1");
                        childVO.setCheckTime(format.format(new Date()));
                        mesChildList1.add(childVO);
@@ -623,10 +623,10 @@
                        //发送给工厂mes参数封装
                        ChildVO childVO = new ChildVO();
                        childVO.setItemCode(confColl2.get(i).getCollectParameterName());//参数
                        childVO.setItemCode(confColl2.get(i).getCollectParameterId());//参数
                        childVO.setItemType(confColl2.get(i).getItemType());
                        childVO.setItemValue(paramValue);//参数值
                        childVO.setItemText(confColl2.get(i).getParameterSetName());
                        childVO.setItemText(confColl2.get(i).getCollectParameterName());
                        childVO.setCheckResult("1");
                        childVO.setCheckTime(format.format(new Date()));
                        mesChildList2.add(childVO);
@@ -649,10 +649,10 @@
                        //发送给工厂mes参数封装
                        ChildVO childVO = new ChildVO();
                        childVO.setItemCode(confColl3.get(i).getCollectParameterName());//参数
                        childVO.setItemCode(confColl3.get(i).getCollectParameterId());//参数
                        childVO.setItemType(confColl3.get(i).getItemType());
                        childVO.setItemValue(paramValue);//参数值
                        childVO.setItemText(confColl3.get(i).getParameterSetName());
                        childVO.setItemText(confColl3.get(i).getCollectParameterName());
                        childVO.setCheckResult("1");
                        childVO.setCheckTime(format.format(new Date()));
                        mesChildList3.add(childVO);
@@ -675,10 +675,10 @@
                        //发送给工厂mes参数封装
                        ChildVO childVO = new ChildVO();
                        childVO.setItemCode(confColl4.get(i).getCollectParameterName());//参数
                        childVO.setItemCode(confColl4.get(i).getCollectParameterId());//参数
                        childVO.setItemType(confColl4.get(i).getItemType());
                        childVO.setItemValue(paramValue);//参数值
                        childVO.setItemText(confColl4.get(i).getParameterSetName());
                        childVO.setItemText(confColl4.get(i).getCollectParameterName());
                        childVO.setCheckResult("1");
                        childVO.setCheckTime(format.format(new Date()));
                        mesChildList4.add(childVO);
@@ -708,10 +708,10 @@
                                //发送给工厂mes参数封装
                                ChildVO childVO = new ChildVO();
                                childVO.setItemCode(confColl0.get(j).getCollectParameterName());//参数
                                childVO.setItemCode(confColl0.get(j).getCollectParameterId());//参数
                                childVO.setItemType(confColl0.get(j).getItemType());
                                childVO.setItemValue(paramValue);//参数值
                                childVO.setItemText(confColl0.get(j).getParameterSetName());
                                childVO.setItemText(confColl0.get(j).getCollectParameterName());
                                childVO.setCheckResult("1");
                                childVO.setCheckTime(format.format(new Date()));
                                mesChildList0.add(childVO);