From 2d564a5921cec98b2c7e6065cc8f066abd614b76 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期三, 18 九月 2024 18:40:24 +0800
Subject: [PATCH] 打印功能修改,进站校验sn

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                        |   12 ++++++------
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   18 ++++++++++++------
 2 files changed, 18 insertions(+), 12 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 298a5a5..09ebfc2 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
@@ -127,13 +127,19 @@
 
                         }
                     }else {//鑷姩宸ヤ綅
-                        //鎵�鏈夎繘绔欏皢杩涚珯鏃堕棿鍐欑粰PLC
-                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                        String currentDate = dateFormat.format(new Date());
-                        miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build());
+                        Object snCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".SNCode").getValue();
+                        if (ObjectUtil.isNull(snCodeObject)){
+                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
+                        }else{
+                            //鎵�鏈夎繘绔欏皢杩涚珯鏃堕棿鍐欑粰PLC
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                            String currentDate = dateFormat.format(new Date());
+                            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build());
 
-                        Integer recordDataDone = 11;
-                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build());
+                            Integer recordDataDone = 11;
+                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build());
+                        }
+
                     }
 
                 } else if(Constants.TWO.equals(valueString)){//鍑虹珯
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index a2a4073..41ba550 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -134,7 +134,7 @@
                      <span>缁濈紭绛夌骇锛�</span><span>H</span><br>
                    </div>
                    <div style="margin-top: 4px">
-                     <span>鍑哄巶缂栧彿锛�</span><span>2407190000002</span><br>
+                     <span>鍑哄巶缂栧彿锛�</span><span>{{headContent.sfcCode}}</span><br>
                    </div>
                  </div>
                </div>
@@ -289,7 +289,7 @@
   name: "stationTerminal",
   data() {
     return {
-      text: 'P9900200461#T2408170000004 #V993983#SSW001.001#HHW001.001#NMCU',
+      text: 'P9900200461#T2408170000004#V993983#SSW001.001#HHW001.001#NMCU',
       materialCode: '', // 鐗╂枡缂栫爜
       carCode: '',
       showInput: false,
@@ -558,7 +558,7 @@
           this.cakeLamp.InPlace = 1
           // this.test1()
           // this.test2()
-          this.text = 'P9900200461#T'+this.headContent.sfcCode+' #V993983#SSW001.001#HHW001.001#NMCU'
+          this.text = 'P9900200461#T'+this.headContent.sfcCode+'#V993983#SSW001.001#HHW001.001#NMCU'
         }
       });
     },
@@ -589,7 +589,7 @@
           let qrCode = new QRCode('canvasWrapper1',{
             width: 83,
             height: 83,
-            text: 'P9900200461#T'+this.headContent.sfcCode+' #V993983#SSW001.001#HHW001.001#NMCU',
+            text: 'P9900200461#T'+this.headContent.sfcCode+'#V993983#SSW001.001#HHW001.001#NMCU',
             colorDark: '#000',
             colorLight: '#fff'
           })
@@ -602,7 +602,7 @@
           let qrCode = new QRCode('canvasWrapper2',{
             width: 83,
             height: 83,
-            text: 'P9900200461#T'+this.headContent.sfcCode+' #V993983#SSW001.001#HHW001.001#NMCU',
+            text: 'P9900200461#T'+this.headContent.sfcCode+'#V993983#SSW001.001#HHW001.001#NMCU',
             colorDark: '#000',
             colorLight: '#fff'
           })
@@ -716,7 +716,7 @@
           if(self.headContent.processesCode === "OP165"){
             // self.test1()
             // self.test2()
-            self.text = 'P9900200461#T'+self.headContent.sfcCode+' #V993983#SSW002.005#HHW001.001#NMCU#'
+            self.text = 'P9900200461#T'+self.headContent.sfcCode+'#V993983#SSW002.005#HHW001.001#NMCU#'
           }
 
         }else if (event.data.includes("[")) {//鎷х揣

--
Gitblit v1.9.3