From 4cb4e41df7c2cc7954e09ef3751ecb24de7c06d2 Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期五, 14 三月 2025 13:28:25 +0800
Subject: [PATCH] 修改

---
 billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml        |    6 +-
 billion-ui/src/views/main/om/info/index.vue                                      |   33 ++++++++++++----
 billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java |   61 ++++++++++++++++++------------
 3 files changed, 64 insertions(+), 36 deletions(-)

diff --git a/billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java b/billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java
index 15e7766..20c97d0 100644
--- a/billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java
+++ b/billion-main/src/main/java/com/billion/main/plcServer/sub/OPCUaSubscription.java
@@ -148,10 +148,22 @@
                         omOrderScheduling.setStatus("1");
                         //鎵樼洏缁戝畾SFCCode鍜屽伐鍗曞拰浜х嚎
                         if(Constants.OP005.equals(device)){
+                            omProductionOrderInfoService.updateBodyStatus1();
                             omOrderScheduling.setRemarks("Body");
+                            sysCountService.updateSerialNumber();
+                            OmProductionOrderInfo getBodyOrder2 = omProductionOrderInfoService.getBodyOrder();
+                            if (Objects.equals(getBodyOrder2.getBodyQty(), getBodyOrder2.getPlanQty())){
+                                omProductionOrderInfoService.updateBodyStatus2();
+                            }
                         }
                         if(Constants.C005.equals(device)){
+                            omProductionOrderInfoService.updateHeadStatus1();
                             omOrderScheduling.setRemarks("Head");
+                            sysCountService.updateHeadNumber();
+                            OmProductionOrderInfo getHeadOrder2 = omProductionOrderInfoService.getHeadOrder();
+                            if (Objects.equals(getHeadOrder2.getHeadQty(), getHeadOrder2.getPlanQty())){
+                                omProductionOrderInfoService.updateHeadStatus2();
+                            }
                         }
                         omOrderSchedulingService.insertOmOrderScheduling(omOrderScheduling);
                     }else if(Constants.OFFLINE.contains(device)){
@@ -208,6 +220,13 @@
                             updateWrapper.eq("work_order_no", omProductionOrderInfoList.get(0).getWorkOrderNo());
                             updateWrapper.set("pre_status", "2");
                             omProductionOrderInfoService.update(new OmProductionOrderInfo(),updateWrapper);
+                        }
+
+                        sysCountService.updatePreNumber();
+                        omProductionOrderInfoService.updatePreStatus1();
+                        OmProductionOrderInfo getPreOrder2 = omProductionOrderInfoService.getPreOrder();
+                        if (Objects.equals(getPreOrder2.getPreQty(), getPreOrder2.getPlanQty())){
+                            omProductionOrderInfoService.updatePreStatus2();
                         }
                     }
                     //鏌ヨdescriptive瀛楁绛変簬1鐨勯噰闆嗛」淇濆瓨鍒版壂鐮佷繚瀛樺埌da_material_collection琛ㄩ噷
@@ -317,7 +336,6 @@
                                 String SFCCode = A1 + A2 + A3+ A4 + A5;
                                 miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                                 miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                                sysCountService.updateSerialNumber();
                             }else{
                                 sysCountService.clean();
                                 sysCountService.updateYear();
@@ -329,7 +347,6 @@
                                 String SFCCode = A1 + A2 + newA3+ A4 + A5;
                                 miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                                 miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                                sysCountService.updateSerialNumber();
                             }
                             // 鏇存柊 WorkOrderRequestDone 鍦板潃鍧�
                             BsBomChildInfo bsbomChildInfo= new BsBomChildInfo();
@@ -337,13 +354,13 @@
                             bsbomChildInfo.setBomCode(getBodyOrder.getWorkOrderNo());
                             //鍙戜笅宸ヨ壓閰嶆柟
                             formula(thoroughfare, device, bsbomChildInfo);
-                            omProductionOrderInfoService.updateBodyStatus1();
+//                          omProductionOrderInfoService.updateBodyStatus1();
                             //鍒ゆ柇缂镐綋宸ュ崟瀹屾垚
-                            OmProductionOrderInfo getBodyOrder2 = omProductionOrderInfoService.getBodyOrder();
-                            if (Objects.equals(getBodyOrder2.getBodyQty(), getBodyOrder2.getPlanQty())){
-                                omProductionOrderInfoService.updateBodyStatus2();
-                            }
-                            String PalletID = getBodyOrder2.getBodyQty().toString();
+//                            OmProductionOrderInfo getBodyOrder2 = omProductionOrderInfoService.getBodyOrder();
+//                            if (Objects.equals(getBodyOrder2.getBodyQty(), getBodyOrder2.getPlanQty())){
+//                                omProductionOrderInfoService.updateBodyStatus2();
+//                            }
+                            String PalletID = String.valueOf(getBodyOrder.getBodyQty() + 1);
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".PalletID").value(PalletID).build());
                             miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".WorkOrderRequestDone").value(11).build());
                     }
@@ -370,7 +387,6 @@
                             String SFCCode = A1 + A2 + A3+ A4 + A5;
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                            sysCountService.updateHeadNumber();
                         }else{
                             sysCountService.clean();
                             sysCountService.updateYear();
@@ -382,7 +398,6 @@
                             String SFCCode = A1 + A2 + newA3+ A4 + A5;
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                            sysCountService.updateHeadNumber();
                         }
                         // 鏇存柊 WorkOrderRequestDone 鍦板潃鍧�
                         BsBomChildInfo bsbomChildInfo= new BsBomChildInfo();
@@ -390,13 +405,13 @@
                         bsbomChildInfo.setBomCode(getHeadOrder.getWorkOrderNo());
                         //鍙戜笅宸ヨ壓閰嶆柟
                         formula(thoroughfare, device, bsbomChildInfo);
-                        omProductionOrderInfoService.updateHeadStatus1();
+//                        omProductionOrderInfoService.updateHeadStatus1();
                         //鍒ゆ柇缂镐綋宸ュ崟瀹屾垚
-                        OmProductionOrderInfo getHeadOrder2 = omProductionOrderInfoService.getHeadOrder();
-                        if (Objects.equals(getHeadOrder2.getHeadQty(), getHeadOrder2.getPlanQty())){
-                            omProductionOrderInfoService.updateHeadStatus2();
-                        }
-                        String PalletID = getHeadOrder2.getHeadQty().toString();
+//                        OmProductionOrderInfo getHeadOrder2 = omProductionOrderInfoService.getHeadOrder();
+//                        if (Objects.equals(getHeadOrder2.getHeadQty(), getHeadOrder2.getPlanQty())){
+//                            omProductionOrderInfoService.updateHeadStatus2();
+//                        }
+                        String PalletID = String.valueOf(getHeadOrder.getHeadQty() + 1);
                         miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".PalletID").value(PalletID).build());
                         miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".WorkOrderRequestDone").value(11).build());
                     }
@@ -422,7 +437,6 @@
                             String SFCCode = A1 + A2 + A3+ A4 + A5;
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                            sysCountService.updatePreNumber();
                         }else{
                             sysCountService.clean();
                             sysCountService.updateYear();
@@ -434,7 +448,6 @@
                             String SFCCode = A1 + A2 + newA3+ A4 + A5;
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".SFCCode").value(SFCCode).build());
                             miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MESSFCCode").value(SFCCode).build());
-                            sysCountService.updateHeadNumber();
                         }
                         // 鏇存柊 WorkOrderRequestDone 鍦板潃鍧�
                         BsBomChildInfo bsbomChildInfo= new BsBomChildInfo();
@@ -442,13 +455,13 @@
                         bsbomChildInfo.setBomCode(getPreOrder.getWorkOrderNo());
                         //鍙戜笅宸ヨ壓閰嶆柟
                         formula(thoroughfare, device, bsbomChildInfo);
-                        omProductionOrderInfoService.updatePreStatus1();
+//                        omProductionOrderInfoService.updatePreStatus1();
                         //鍒ゆ柇缂镐綋宸ュ崟瀹屾垚
-                        OmProductionOrderInfo getPreOrder2 = omProductionOrderInfoService.getPreOrder();
-                        if (Objects.equals(getPreOrder2.getPreQty(), getPreOrder2.getPlanQty())){
-                            omProductionOrderInfoService.updatePreStatus2();
-                        }
-                        String PalletID = getPreOrder2.getPreQty().toString();
+//                        OmProductionOrderInfo getPreOrder2 = omProductionOrderInfoService.getPreOrder();
+//                        if (Objects.equals(getPreOrder2.getPreQty(), getPreOrder2.getPlanQty())){
+//                            omProductionOrderInfoService.updatePreStatus2();
+//                        }
+                        String PalletID = String.valueOf(getPreOrder.getPreQty() + 1);
                         miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".PalletID").value(PalletID).build());
                         miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".WorkOrderRequestDone").value(11).build());
                     }
diff --git a/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
index f0705b9..6cabb0e 100644
--- a/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
+++ b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml
@@ -57,7 +57,7 @@
     </select>
     <select id="updateBodyStatus2" resultType="OmProductionOrderInfo">
         UPDATE om_production_order_info
-        SET body_status = 2
+        SET body_status = 4
         WHERE id = (
             SELECT TOP 1 id
             FROM om_production_order_info
@@ -85,7 +85,7 @@
     </select>
     <select id="updateHeadStatus2" resultType="OmProductionOrderInfo">
         UPDATE om_production_order_info
-        SET head_status = 2
+        SET head_status = 4
         WHERE id = (
             SELECT TOP 1 id
             FROM om_production_order_info
@@ -113,7 +113,7 @@
     </select>
     <select id="updatePreStatus2" resultType="OmProductionOrderInfo">
         UPDATE om_production_order_info
-        SET pre_status = 2
+        SET pre_status = 4
         WHERE id = (
             SELECT TOP 1 id
             FROM om_production_order_info
diff --git a/billion-ui/src/views/main/om/info/index.vue b/billion-ui/src/views/main/om/info/index.vue
index d4b3e36..ff5ab08 100644
--- a/billion-ui/src/views/main/om/info/index.vue
+++ b/billion-ui/src/views/main/om/info/index.vue
@@ -125,17 +125,17 @@
       <el-table-column label="棰勮涓婄嚎鏁伴噺" align="center" prop="preQty" />
       <el-table-column label="缂镐綋宸ュ崟鐘舵��" align="center" prop="bodyStatus" >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.status" :value="scope.row.bodyStatus"/>
+          <dict-tag :options="dict.type.order_status" :value="scope.row.bodyStatus"/>
         </template>
       </el-table-column>
       <el-table-column label="缂哥洊宸ュ崟鐘舵��" align="center" prop="headStatus" >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.status" :value="scope.row.headStatus"/>
+          <dict-tag :options="dict.type.order_status" :value="scope.row.headStatus"/>
         </template>
       </el-table-column>
       <el-table-column label="棰勮宸ュ崟鐘舵��" align="center" prop="preStatus" >
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.status" :value="scope.row.preStatus"/>
+          <dict-tag :options="dict.type.order_status" :value="scope.row.preStatus"/>
         </template>
       </el-table-column>
       <el-table-column label="澶囨敞" width="180px" show-overflow-tooltip align="center" prop="remarks" />
@@ -456,13 +456,18 @@
       getInfo(id).then(response => {
         this.form = response.data;
         if(this.form.bodyStatus === "1"){
-          this.form.bodyStatus = "3";
+          this.form.bodyStatus = "5";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("鏆傚仠鎴愬姛");
             this.getList();});
         }else if(this.form.bodyStatus === "2"){
           this.$message('璁㈠崟宸插畬鎴愮姝慨鏀�');
-        }else if(this.form.bodyStatus === "3"){
+        }else if(this.form.bodyStatus === "3") {
+          this.$message('璁㈠崟鍏抽棴绂佹淇敼');
+        }else if(this.form.bodyStatus === "4") {
+          this.$message('璁㈠崟宸插叏閮ㄤ笂绾垮畬鎴愮姝慨鏀�');
+        }
+        else if(this.form.bodyStatus === "5") {
           this.form.bodyStatus = "1";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("閲嶅惎鎴愬姛");
@@ -479,13 +484,18 @@
       getInfo(id).then(response => {
         this.form = response.data;
         if(this.form.headStatus === "1"){
-          this.form.headStatus = "3";
+          this.form.headStatus = "5";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("鏆傚仠鎴愬姛");
             this.getList();});
         }else if(this.form.headStatus === "2"){
           this.$message('璁㈠崟宸插畬鎴愮姝慨鏀�');
-        }else if(this.form.headStatus === "3"){
+        }else if(this.form.headStatus === "3") {
+          this.$message('璁㈠崟鍏抽棴绂佹淇敼');
+        }else if(this.form.headStatus === "4") {
+          this.$message('璁㈠崟宸插叏閮ㄤ笂绾垮畬鎴愮姝慨鏀�');
+        }
+        else if(this.form.headStatus === "5") {
           this.form.headStatus = "1";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("閲嶅惎鎴愬姛");
@@ -502,13 +512,18 @@
       getInfo(id).then(response => {
         this.form = response.data;
         if(this.form.preStatus === "1"){
-          this.form.preStatus = "3";
+          this.form.preStatus = "5";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("鏆傚仠鎴愬姛");
             this.getList();});
         }else if(this.form.preStatus === "2"){
           this.$message('璁㈠崟宸插畬鎴愮姝慨鏀�');
-        }else if(this.form.preStatus === "3"){
+        }else if(this.form.preStatus === "3") {
+          this.$message('璁㈠崟鍏抽棴绂佹淇敼');
+        }else if(this.form.preStatus === "4") {
+          this.$message('璁㈠崟宸插叏閮ㄤ笂绾垮畬鎴愮姝慨鏀�');
+        }
+        else if(this.form.preStatus === "5") {
           this.form.preStatus = "1";
           updateInfo(this.form).then(response => {
             this.$modal.msgSuccess("閲嶅惎鎴愬姛");

--
Gitblit v1.9.3