From dd44823b3c6cc003de21ea023cea7ea8d85a873c Mon Sep 17 00:00:00 2001
From: yyt <306727702@qq.com>
Date: 星期三, 26 六月 2024 12:56:17 +0800
Subject: [PATCH] 配瓦

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   52 +++++++++++++++++++++++++++-------------------------
 1 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
index 3e1f834..0b7e813 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -99,31 +99,33 @@
                         logger.info("-------鐩戝惉鍒�,{}鐨勬壂鐮佹灙鎵爜鐨凜ODE_CHECK鐨勪俊鍙�",identifier);
                         scannerGunMessage();
                     }
-//                    if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){
-//                        Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue();
-//                        if (null == SNCodeObject){
-//                            SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue();
-//                        }
-//                        if (null != SNCodeObject){
-//                            String XT="";
-//                            String CZ="";
-//                            String SNCode = SNCodeObject.toString();
-//                            DaParamCollection ParamCollection = new DaParamCollection();
-//                            ParamCollection.setSfcCode(SNCode);
-//                            List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection);
-//                            List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList());
-//                            if (CollUtil.isNotEmpty(XTParamCollection)){
-//                                DaParamCollection lastOne = XTParamCollection.get(0);
-//                                XT = lastOne.getParamValue();
-//                            }
-//                            List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList());
-//                            if (CollUtil.isNotEmpty(CZParamCollection)){
-//                                DaParamCollection lastOne = CZParamCollection.get(0);
-//                                CZ = lastOne.getParamValue();
-//                            }
-//                            passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060");
-//                        }
-//                    }
+                    if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){
+                        Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue();
+                        if (null == SNCodeObject){
+                            SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue();
+                        }
+                        if (null != SNCodeObject){
+                            String XT=null;
+                            String CZ=null;
+                            String SNCode = SNCodeObject.toString();
+                            DaParamCollection ParamCollection = new DaParamCollection();
+                            ParamCollection.setSfcCode(SNCode);
+                            List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection);
+                            List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList());
+                            if (CollUtil.isNotEmpty(XTParamCollection)){
+                                DaParamCollection lastOne = XTParamCollection.get(0);
+                                XT = lastOne.getParamValue();
+                            }
+                            List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList());
+                            if (CollUtil.isNotEmpty(CZParamCollection)){
+                                DaParamCollection lastOne = CZParamCollection.get(0);
+                                CZ = lastOne.getParamValue();
+                            }
+                            if(null != XT&&null != CZ) {
+                                passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060");
+                            }
+                        }
+                    }
                 }
                 if (collect2.contains(identifier)){
                     if ("1".equals(value.toString())){

--
Gitblit v1.9.3