From 0b5ccdca6263cf7a2cee460f30c76ef1efea2811 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期六, 27 四月 2024 17:47:27 +0800
Subject: [PATCH] 人工出库,人工入库,人工移库,PDA扫码确认外协物料已被取走接口

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
index 55d93e2..9c9d9dc 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
@@ -32,14 +32,14 @@
             {
                 VOLContext Context = new VOLContext();
                 Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
-
+                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
                 Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                 var tasks = agvtaskService.Find(x => x.agv_taskstate == "Queue").OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).ToList();
                 foreach (var task in tasks)
                 {
                     if (task.agv_tasktype == "TaskType_EmptyPallet")//绌烘墭浠诲姟
                     {
-                        if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(10))
+                        if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(2))
                         {
                             if (task.agv_tasknum.Contains("_"))
                             {
@@ -103,15 +103,16 @@
                             #endregion
                         }
                     }
-                    else if (task.agv_tasktype == "TaskType_OutsourceInbound")//涓嬫枡鍘诲鍗忓彛
+                    else if (task.agv_tasktype == "TaskType_OutsourceInbound" || task.agv_tasktype == "TaskType_Inbound")//澶栧崗搴撳叆搴�/AB搴撳叆搴�
                     {
                         if (task.agv_toaddress == "")
                         {
-                            var TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository);
+                            var stationinfo = stationinfoRepository.Find(x => x.stationCode == task.agv_fromaddress).FirstOrDefault();
+                            var work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.drawingNo == stationinfo.stationType && x.heatID == stationinfo.heatNumber && x.processCode == "17").FirstOrDefault();
+                            var TargetLocation = task.agv_tasktype == "TaskType_Inbound" ? GetLocation.GetEmptyLocation(stationinfoRepository, work, stationinfo) : StationTask.GetEmptyLocation(stationinfoRepository);
                             if (TargetLocation != null)
                             {
                                 if (agvtaskService.Find(x => x.agv_toaddress == TargetLocation.stationCode).Any()) continue;
-                                var stationinfo = stationinfoRepository.Find(x => x.stationCode == task.agv_fromaddress).FirstOrDefault();
                                 task.agv_taskstate = "Create";
                                 task.agv_toaddress = TargetLocation.stationCode;
                                 TargetLocation.location_state = LocationStateEnum.InBusy.ToString();
@@ -142,7 +143,7 @@
                             }
                         }
                     }
-                    else if (task.agv_tasktype == "TaskType_OutsourceCarry")//澶栧崗绉诲簱
+                    else if (task.agv_tasktype == "TaskType_OutsourceCarry")//绉诲簱澶栧崗
                     {
                         if (task.agv_toaddress == "")
                         {

--
Gitblit v1.9.3