From 430404d69be9b5d420ad12b9ac087508f1fa2aca Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期一, 23 十二月 2024 17:46:40 +0800
Subject: [PATCH] 出入库测试稳定版

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index edfd8e8..ac9c0fc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -4,10 +4,14 @@
 using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
+using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Common.Http;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
@@ -35,12 +39,11 @@
             _taskRepository = taskRepository;
             _routerService = routerService;
         }
-
+        public string url = AppSettings.Configuration["WMS"];
         public Task Execute(IJobExecutionContext context)
         {
             try
-            {
-                
+            {               
                 CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                 if (commonStackerCrane != null)
                 {
@@ -69,15 +72,17 @@
                                     bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                     if (sendFlag)
                                     {
-                                        if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)
+                                        if (task.TaskType == (int)TaskInboundTypeEnum.Inbound|| task.TaskType == (int)TaskInboundTypeEnum.InInventory)
                                         {
                                             _taskService.UpdateTaskStatus(task.TaskId, (int)TaskInStatusEnum.SC_InExecuting);
                                             _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撴墽琛屼腑");
+                                            var response = HttpHelpers.Post<WebResponseContent>(url.Replace("PDA", "Task") + "UpdateTaskStatus?taskNum=" + task.TaskNum, "", "鏇存柊浠诲姟鐘舵��");
                                         }
-                                        else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
+                                        else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound|| task.TaskType == (int)TaskOutboundTypeEnum.OutInventory)
                                         {
                                             _taskService.UpdateTaskStatus(task.TaskId, (int)TaskOutStatusEnum.SC_OutExecuting);
                                             _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撴墽琛屼腑");
+                                            var response = HttpHelpers.Post<WebResponseContent>(url.Replace("PDA", "Task") + "UpdateTaskStatus?taskNum=" + task.TaskNum, "", "鏇存柊浠诲姟鐘舵��");
                                         }
                                     }
                                 }
@@ -120,7 +125,7 @@
         private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
         {
             Dt_Task task;
-            task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
+            task = _taskService.QueryStackerCraneTask("R01");
             return task;
         }
 
@@ -168,7 +173,15 @@
             stackerCraneTaskCommand.Barcode = task.PalletCode;
             stackerCraneTaskCommand.TaskNum = task.TaskNum;
             stackerCraneTaskCommand.WorkType = 1;
-            stackerCraneTaskCommand.TrayType = 1;
+            if(task.PalletCode.Substring(0,1)=="B")
+            {
+                stackerCraneTaskCommand.TrayType = 2;
+            }
+            else
+            {
+                stackerCraneTaskCommand.TrayType = 1;
+            }
+            //stackerCraneTaskCommand.TrayType = 1;
             string[] SourceCodes = task.SourceAddress.Split("-");
             if (SourceCodes.Length == 4)
             {

--
Gitblit v1.9.3