From 0c0ac28fc5784ac64612811c65be7dca8318d8c6 Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期二, 26 十一月 2024 21:23:19 +0800
Subject: [PATCH] 前端更新货位状态修改

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |  242 ++++++++++++++++++++++------------------
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Basic/Dt_LocationInfo.cs          |    4 
 代码管理/WCS/WIDESEAWCS_Client/src/extension/basic/extend/updateStatus.vue               |   16 +
 代码管理/WCS/WIDESEAWCS_Client/src/views/basic/locationInfo.vue                          |   45 +++++--
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                        |    4 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs        |    8 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                 |    2 
 7 files changed, 185 insertions(+), 136 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/extension/basic/extend/updateStatus.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/extension/basic/extend/updateStatus.vue"
index ad27536..1cc1df3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/extension/basic/extend/updateStatus.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/extension/basic/extend/updateStatus.vue"
@@ -12,15 +12,16 @@
           <el-input v-model="form.locationCode" disabled></el-input>
         </el-form-item>
         <el-form-item label="璐т綅鐘舵��">
-          <el-select v-model="form.locationStatus" placeholder="璇烽�夋嫨璐т綅鐘舵��">
+          <el-select v-model="form.locationStatus" placeholder="璇烽�夋嫨璐т綅鐘舵��" @change="showStatus">
             <el-option
               v-for="item in options"
               :key="item.value"
               :label="item.label"
               :value="item.value"
             >
-            </el-option> </el-select
-        ></el-form-item>
+            </el-option> 
+          </el-select>
+          </el-form-item>
       </el-form>
       <template #footer>
         <el-button type="primary" size="small" @click="updateLocationStatus"
@@ -52,6 +53,9 @@
     };
   },
   methods: {
+    showStatus(){
+      console.log(this.form.locationStatus);
+    },
     open(row) {
       this.row = row;
       this.showDetialBox = true;
@@ -63,8 +67,8 @@
         .post("/api/LocationInfo/GetLocationStatusDic", {}, true)
         .then((x) => {
           if (!x.status) return this.$message.error(x.message);
-
           this.options = x.data;
+          console.log(this.options);
         });
     },
     updateLocationStatus() {
@@ -73,7 +77,7 @@
           "/api/LocationInfo/UpdateLocationStatus?key=" +
             this.row.id +
             "&locationStatus=" +
-            this.row.locationStatus,
+            this.form.locationStatus,
           {},
           "鏁版嵁澶勭悊涓�"
         )
@@ -81,6 +85,8 @@
           if (!x.status) return this.$message.error(x.message);
           this.$message.success("鎿嶄綔鎴愬姛");
           this.showDetialBox = false;
+          this.form.locationStatus='';
+          this.$parent.refresh()
         });
     },
   },
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/basic/locationInfo.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/basic/locationInfo.vue"
index ed2cca7..639d4de 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/basic/locationInfo.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Client/src/views/basic/locationInfo.vue"
@@ -56,19 +56,38 @@
           field: "layer",
           type: "string",
         },
-        {
-          title: "璐т綅娣卞害",
-          required: true,
-          field: "depth",
-          type: "string",
-        },
+        // {
+        //   title: "璐т綅娣卞害",
+        //   required: true,
+        //   field: "depth",
+        //   type: "string",
+        // },
       ],
       [
         {
           title: "璐т綅绫诲瀷",
           required: true,
           field: "locationType",
-          type: "string",
+          type: "select",
+          dataKey:"",
+          data:[
+            {key:1,value:'姝e父璐т綅'},
+            {key:2,value:'鏆傚瓨浣�'},
+            {key:3,value:'鎻愬崌鏈�'},
+            {key:4,value:'杈撻�佺嚎'},
+            {key:5,value:'缁勭珛鏈�'},
+          ]
+        },
+         {
+          title: "绂佺敤鐘舵��",
+          required: true,
+          field: "enableStatus",
+          type: "select",
+          dataKey:"",
+          data:[
+            {key:0,value:'姝e父'},
+            {key:1,value:'绂佺敤'},
+          ]
         },
         {
           title: "鍖哄煙涓婚敭",
@@ -77,12 +96,12 @@
           type: "string",
           hidden:true,
         },
-        {
-          title: "宸烽亾缂栧彿",
-          required: true,
-          field: "roadwayNo",
-          type: "string",
-        },
+        // {
+        //   title: "宸烽亾缂栧彿",
+        //   required: true,
+        //   field: "roadwayNo",
+        //   type: "string",
+        // },
       ],
     ]);
     const searchFormFields = ref({
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs"
index a7e0826..b6e4576 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs"
@@ -18,14 +18,14 @@
         /// <summary>
         /// 鍙叆
         /// </summary>
-        [Description("鍙叆")]
-        OnlyIn = 1,
+        //[Description("鍙叆")]
+        //OnlyIn = 1,
 
         /// <summary>
         /// 鍙嚭
         /// </summary>
-        [Description("鍙嚭")]
-        OnlyOut = 2,
+        //[Description("鍙嚭")]
+        //OnlyOut = 2,
 
         /// <summary>
         /// 绂佺敤
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Basic/Dt_LocationInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Basic/Dt_LocationInfo.cs"
index b89e4e5..07e8613 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Basic/Dt_LocationInfo.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Basic/Dt_LocationInfo.cs"
@@ -14,8 +14,8 @@
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
         public int Id { get; set; }
 
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍖哄煙涓婚敭")]
-        public int AreaId {  get; set; }
+        [SugarColumn(ColumnDescription = "鍖哄煙涓婚敭")]
+        public int AreaId {  get; set; }=0;
 
         [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璐т綅缂栧彿")]
         public string LocationCode {  get; set; }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index 1e5a355..970dade 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -12,8 +12,8 @@
   "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
   //杩炴帴瀛楃涓�
 
-  //"ConnectionString": "Data Source=10.0.250.20;Initial Catalog=WIDESEAWCS_GD;User ID=sa;Password=STC@123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
-  "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEAWCS_GD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  "ConnectionString": "Data Source=10.0.250.20;Initial Catalog=WIDESEAWCS_GD;User ID=sa;Password=STC@123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEAWCS_GD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
   //璺ㄥ煙
   "Cors": {
     "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 64dd609..72477fb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -183,7 +183,7 @@
                             return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}");
                         }
                         break;
-                    case 3001://AGV鏀捐揣瀹屾垚 WMS鍙�3001鐨勫悓鏃朵細鍐欐彁鍗囦俊鍙�
+                    case 3001://AGV鏀捐揣瀹屾垚 WMS鍙�3001鐨勫悓鏃禬CS闇�鍦╦ob涓啓鎻愬崌淇″彿
                         if (BaseDal.QueryFirst(x => x.TaskNum == taskDTO.task_id) == null)//鎵嬪姩鍏ュ簱鐩存帴鍙�3001锛岄渶瑕佺敓鎴愪换鍔★紝鍥犱负娌℃湁1001鐜妭
                         {
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 2d2c8a0..6250472 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -110,116 +110,140 @@
             //鏌ヨ鎻愬崌鏈�/缁勭珛鏈轰俊鍙�
             //Task.Run(delegate
             //{
-                try
+            try
+            {
+                if (commonStackerCrane != null)
                 {
-                    if (commonStackerCrane != null)
+
+                    Dt_Task? task1001 = _taskService.QueryStackerCraneTaskByAGVRequest("SC01");
+                    if (task1001 != null)
                     {
-                       
-                        Dt_Task? task1001 = _taskService.QueryStackerCraneTaskByAGVRequest("SC01");
-                        if (task1001 != null)
+                        //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鍙互杩涘叆
+                        int IsAllow = 0;
+                        if (task1001.SourceAddress == "SC01-002-000-001")//WMS 1001绔欑偣
                         {
-                            //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鍙互杩涘叆
-                            int IsAllow = 0;
-                            if (task1001.SourceAddress == "SC01-002-000-001")//WMS 1001绔欑偣
+                            IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
+                        }
+                        else if (task1001.SourceAddress == "SC01-002-000-002")//WMS 1002绔欑偣
+                        {
+                            IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.8.0");
+                        }
+                        if (IsAllow == 1)//濡傛灉涓�1锛屽垯鍏佽AGV杩涘叆锛屽洖浼燱MS
+                        {
+                            MESSendCMD sendcmd = new MESSendCMD { cmd = 2001, task_id = task1001.TaskNum, status = 6 };
+                            MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
+                            if (res != null && res.code != 0)
                             {
-                                IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鍏佽AGV杩涘叆鎻愬崌鏈猴紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task1001.TaskNum}");
                             }
-                            else if (task1001.SourceAddress == "SC01-002-000-002")//WMS 1002绔欑偣
+                            else
                             {
-                                IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.8.0");
-                            }
-                            if (IsAllow == 1)//濡傛灉涓�1锛屽垯鍏佽AGV杩涘叆锛屽洖浼燱MS
-                            {
-                                MESSendCMD sendcmd = new MESSendCMD { cmd = 2001, task_id = task1001.TaskNum, status = 6 };
-                                MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
-                                if (res != null && res.code != 0)
-                                {
-                                    WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task1001.TaskNum}");
-                                }
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鍏佽AGV杩涘叆鎻愬崌鏈猴紝鍥炰紶WMS鎴愬姛锛佷换鍔″彿{task1001.TaskNum}");
                             }
                         }
-                        Dt_Task? task3001 = _taskService.QueryStackerCraneTaskByAGVPutFinish("SC01");
-                        if (task3001 != null)
+                        else
                         {
-                            int IsFinish = 0;
-                            int IsWriteOne = 0;
-                            int IsWriteTwo = 0;
-                            if (task3001.SourceAddress == "SC01-002-000-001")//WMS 1001绔欑偣
+                            WriteDebug(nameof(CommonStackerCraneJob), $"鏈鍙栧埌鎻愬崌鏈哄厑璁¤繘鍏ヤ俊鍙凤紝鏆備笉鍏佽AGV杩涘叆鎻愬崌鏈猴紝浠诲姟鍙穥task1001.TaskNum}");
+                        }
+                    }
+                    Dt_Task? task3001 = _taskService.QueryStackerCraneTaskByAGVPutFinish("SC01");
+                    if (task3001 != null)
+                    {
+                        int IsFinish = 0;
+                        int IsWriteOne = 0;
+                        int IsWriteTwo = 0;
+                        if (task3001.SourceAddress == "SC01-002-000-001")//WMS 1001绔欑偣
+                        {
+                            //鎻愬崌鏈烘槸鍚﹀浜庡氨缁姸鎬�
+                          
+                            int IsReady = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
+                            WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈虹姸鎬侊細{IsReady}浠诲姟鍙凤細{task3001.TaskNum}");
+                            //鍐欏叆鎻愬崌淇℃伅
+                            IsWriteOne = commonStackerCrane.Communicator.Read<short>("DB1.0.0");
+                            if (IsWriteOne == 0 && IsReady == 1)
                             {
-                                //鎻愬崌鏈烘槸鍚﹀浜庡氨缁姸鎬�
-                                int IsReady= commonStackerCrane.Communicator.Read<short>("DB2.0.0");
-                                //鍐欏叆鎻愬崌淇℃伅
-                                IsWriteOne = commonStackerCrane.Communicator.Read<short>("DB1.0.0");
-                                if(IsWriteOne == 0&& IsReady == 1) 
-                                {
-                                   commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1);
-                                }
-                                //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鎻愬崌瀹屾垚
-                               
-                              IsFinish=  commonStackerCrane.Communicator.Read<short>("DB2.2.0");
+                                commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1);
                             }
-                            else if (task3001.SourceAddress == "SC01-002-000-002")//WMS 1002绔欑偣
+                            else
                             {
-                                //鎻愬崌鏈烘槸鍚﹀浜庡氨缁姸鎬�
-                                int IsReady = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
-                                //鍐欏叆鎻愬崌淇℃伅
-                                IsWriteTwo = commonStackerCrane.Communicator.Read<short>("DB1.6.0");
-                                if (IsWriteTwo == 0 && IsReady == 1)
-                                {
-                                    commonStackerCrane.Communicator.Write<short>("DB1.6.0", 1);
-                                }    
-                                //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鎻愬崌瀹屾垚
-                                IsFinish = commonStackerCrane.Communicator.Read<short>("DB2.10.0");
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鏈啓鍏ユ彁鍗囦俊鍙凤紝鍙兘鏄凡鍐欏叆鎴栬�呮彁鍗囨満鏈鐞嗗氨缁姸鎬�,浠诲姟鍙凤細{task3001.TaskNum}");
                             }
-                            if (IsFinish == 1)//濡傛灉涓�1锛屽垯琛ㄧず鎻愬崌瀹屾垚锛屽洖浼燱MS
-                            {
-                                MESSendCMD sendcmd = new MESSendCMD { cmd = 2002, task_id = task3001.TaskNum, status = 6 };
-                                MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
-                                string inparam = JsonConvert.SerializeObject(sendcmd);
-                                WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS,鍏ュ弬锛歿inparam}");
+                            //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鎻愬崌瀹屾垚
 
-                                if (res != null && res.code != 0)
-                                {
-                                    WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task3001.TaskNum}");
-                                }
+                            IsFinish = commonStackerCrane.Communicator.Read<short>("DB2.2.0");
+                        }
+                        else if (task3001.SourceAddress == "SC01-002-000-002")//WMS 1002绔欑偣
+                        {
+                            //鎻愬崌鏈烘槸鍚﹀浜庡氨缁姸鎬�
+                         
+                            int IsReady = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
+                            WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈虹姸鎬侊細{IsReady}浠诲姟鍙凤細{task3001.TaskNum}");
+                            //鍐欏叆鎻愬崌淇℃伅
+                            IsWriteTwo = commonStackerCrane.Communicator.Read<short>("DB1.6.0");
+                            if (IsWriteTwo == 0 && IsReady == 1)
+                            {
+                                commonStackerCrane.Communicator.Write<short>("DB1.6.0", 1);
+                            }
+                            else
+                            {
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鏈啓鍏ユ彁鍗囦俊鍙凤紝鍙兘鏄俊鍙峰凡鍐欏叆鎴栬�呮彁鍗囨満鏈鐞嗗氨缁姸鎬侊紝浠诲姟鍙凤細{task3001.TaskNum}");
+                            }
+                            //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鎻愬崌瀹屾垚
+                            IsFinish = commonStackerCrane.Communicator.Read<short>("DB2.10.0");
+                        }
+                        if (IsFinish == 1)//濡傛灉涓�1锛屽垯琛ㄧず鎻愬崌瀹屾垚锛屽洖浼燱MS
+                        {
+                            MESSendCMD sendcmd = new MESSendCMD { cmd = 2002, task_id = task3001.TaskNum, status = 6 };
+                            MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
+                            string inparam = JsonConvert.SerializeObject(sendcmd);
+                            WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS,鍏ュ弬锛歿inparam}");
+
+                            if (res != null && res.code != 0)
+                            {
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task3001.TaskNum}");
                             }
                         }
-
-                        //灏忓爢鍨涙満鍑哄簱瀹屾垚浠诲姟
-                        Dt_Task? taskSmall = _taskService.QueryStackerCraneFinishTask();
-                        if(taskSmall != null)
+                        else
                         {
-                            //鏍规嵁浠诲姟婧愬湴鍧�纭畾鍐欏叆PLC浣嶇疆 Depth
-                            Dt_LocationInfo location = _locationInfoRepository.QueryFirst(x=>x.LocationCode==taskSmall.SourceAddress);
-                            if(location != null)
+                            WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囦腑...锛屼换鍔″彿锛歿task3001.TaskNum}");
+                        }
+                    }
+
+                    //灏忓爢鍨涙満鍑哄簱瀹屾垚浠诲姟
+                    Dt_Task? taskSmall = _taskService.QueryStackerCraneFinishTask();
+                    if (taskSmall != null)
+                    {
+                        //鏍规嵁浠诲姟婧愬湴鍧�纭畾鍐欏叆PLC浣嶇疆 Depth
+                        Dt_LocationInfo location = _locationInfoRepository.QueryFirst(x => x.LocationCode == taskSmall.SourceAddress);
+                        if (location != null)
+                        {
+                            string[] Levels = taskSmall.Remark.Split("-");
+                            if (Levels.Length == 2)
                             {
-                                string[] Levels = taskSmall.Remark.Split("-");
-                                if (Levels.Length == 2)
+                                if (!string.IsNullOrEmpty(Levels[0]) && !string.IsNullOrEmpty(Levels[1]))
                                 {
-                                    if (!string.IsNullOrEmpty(Levels[0]) && !string.IsNullOrEmpty(Levels[1]))
+                                    int level = Convert.ToInt16(Levels[0]) - Convert.ToInt16(Levels[1]);
+
+                                    //鍓╀綑灞傛暟鍐欏叆
+                                    bool issuccess = commonStackerCrane.Communicator.Write<short>("DB28." + location.Depth + ".0", Convert.ToInt16(level));
+                                    WriteDebug(nameof(CommonStackerCraneJob), $"鍓╀綑灞傛暟淇″彿鍐欏叆{level}-浠诲姟鍙穥taskSmall.TaskNum}");
+
+
+                                    //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏁帮紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
+                                    if (level == 0)
                                     {
-                                        int level = Convert.ToInt16(Levels[0]) - Convert.ToInt16(Levels[1]);
-
-                                        //鍓╀綑灞傛暟鍐欏叆
-                                        bool issuccess = commonStackerCrane.Communicator.Write<short>("DB28." + location.Depth + ".0", Convert.ToInt16(level));
-                                        WriteDebug(nameof(CommonStackerCraneJob), $"鍓╀綑灞傛暟淇″彿鍐欏叆{level}-浠诲姟鍙穥taskSmall.TaskNum}");
-
-
-                                        //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏁帮紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
-                                        if (level == 0)
+                                        //婧愬湴鍧�锛堟殏瀛樹綅锛夊搴旂殑鐩爣鍦板潃锛堢粍绔嬫満锛塴ocation.Remark 
+                                        if (!string.IsNullOrEmpty(location.Remark))
                                         {
-                                            //婧愬湴鍧�锛堟殏瀛樹綅锛夊搴旂殑鐩爣鍦板潃锛堢粍绔嬫満锛塴ocation.Remark 
-                                            if (!string.IsNullOrEmpty(location.Remark))
-                                            {
-                                                //鏍规嵁鐩爣鍦板潃鏌ヨ缁勭珛鏈虹珯鐐逛俊鎭紝鑾峰彇鍐欏叆鏁磋溅瀹屾垚鐨凞B鍧� Depth
-                                                Dt_LocationInfo location2 = _locationInfoRepository.QueryFirst(x => x.LocationCode == location.Remark);
+                                            //鏍规嵁鐩爣鍦板潃鏌ヨ缁勭珛鏈虹珯鐐逛俊鎭紝鑾峰彇鍐欏叆鏁磋溅瀹屾垚鐨凞B鍧� Depth
+                                            Dt_LocationInfo location2 = _locationInfoRepository.QueryFirst(x => x.LocationCode == location.Remark);
                                             //鏁磋溅瀹屾垚鍐欏叆灞傛暟
                                             int sn = 0;
-                                            if(taskSmall.SourceAddress== "SC01-001-006-001"|| taskSmall.SourceAddress == "SC01-001-012-001"|| taskSmall.SourceAddress == "SC01-001-018-001" || taskSmall.SourceAddress == "SC01-001-022-001"|| taskSmall.SourceAddress == "SC01-001-026-001")
+                                            if (taskSmall.SourceAddress == "SC01-001-006-001" || taskSmall.SourceAddress == "SC01-001-012-001" || taskSmall.SourceAddress == "SC01-001-018-001" || taskSmall.SourceAddress == "SC01-001-022-001" || taskSmall.SourceAddress == "SC01-001-026-001")
                                             {
                                                 sn = 1;
                                             }
-                                            else if(taskSmall.SourceAddress == "SC01-001-007-001" || taskSmall.SourceAddress == "SC01-001-013-001" || taskSmall.SourceAddress == "SC01-001-019-001" || taskSmall.SourceAddress == "SC01-001-023-001" || taskSmall.SourceAddress == "SC01-001-027-001")
+                                            else if (taskSmall.SourceAddress == "SC01-001-007-001" || taskSmall.SourceAddress == "SC01-001-013-001" || taskSmall.SourceAddress == "SC01-001-019-001" || taskSmall.SourceAddress == "SC01-001-023-001" || taskSmall.SourceAddress == "SC01-001-027-001")
                                             {
                                                 sn = 2;
                                             }
@@ -227,45 +251,45 @@
                                             {
                                                 sn = 3;
                                             }
-                                            bool issuccess2 = commonStackerCrane.Communicator.Write<short>("DB28." + location2.Depth+".0", Convert.ToInt16(sn));
-                                                if (issuccess2&&issuccess)
-                                                {
-                                                    _taskService.UpdateTaskStatus(taskSmall.TaskId, (int)TaskOutStatusEnum.OutFinish);
-                                                    _taskExecuteDetailService.AddTaskExecuteDetail(taskSmall.TaskId, $"鍑哄簱浠诲姟瀹屾垚");
-                                                }
-                                                else
-                                                {
-                                                    WriteDebug(nameof(CommonStackerCraneJob), $"鏁磋溅瀹屾垚淇″彿鍐欏叆澶辫触锛佷换鍔″彿{taskSmall.TaskNum}");
-                                                }
-                                            }
-
-                                        }
-                                        else
-                                        {
-
-                                            if (issuccess)
+                                            bool issuccess2 = commonStackerCrane.Communicator.Write<short>("DB28." + location2.Depth + ".0", Convert.ToInt16(sn));
+                                            if (issuccess2 && issuccess)
                                             {
                                                 _taskService.UpdateTaskStatus(taskSmall.TaskId, (int)TaskOutStatusEnum.OutFinish);
                                                 _taskExecuteDetailService.AddTaskExecuteDetail(taskSmall.TaskId, $"鍑哄簱浠诲姟瀹屾垚");
                                             }
                                             else
                                             {
-                                                WriteDebug(nameof(CommonStackerCraneJob), $"鍓╀綑灞傛暟淇″彿鍐欏叆澶辫触锛佷换鍔″彿{taskSmall.TaskNum}");
+                                                WriteDebug(nameof(CommonStackerCraneJob), $"鏁磋溅瀹屾垚淇″彿鍐欏叆澶辫触锛佷换鍔″彿{taskSmall.TaskNum}");
                                             }
                                         }
 
                                     }
+                                    else
+                                    {
+
+                                        if (issuccess)
+                                        {
+                                            _taskService.UpdateTaskStatus(taskSmall.TaskId, (int)TaskOutStatusEnum.OutFinish);
+                                            _taskExecuteDetailService.AddTaskExecuteDetail(taskSmall.TaskId, $"鍑哄簱浠诲姟瀹屾垚");
+                                        }
+                                        else
+                                        {
+                                            WriteDebug(nameof(CommonStackerCraneJob), $"鍓╀綑灞傛暟淇″彿鍐欏叆澶辫触锛佷换鍔″彿{taskSmall.TaskNum}");
+                                        }
+                                    }
+
                                 }
                             }
-                            
                         }
-                   
+
+                    }
+
                 }
-                }
-                catch (Exception ex)
-                {
-                    WriteError(nameof(CommonStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex);
-                }
+            }
+            catch (Exception ex)
+            {
+                WriteError(nameof(CommonStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex);
+            }
             WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now);
             //});
             return Task.CompletedTask;

--
Gitblit v1.9.3