From 9bae33c85d698987a6c9cf8ba8edbe9497b101dc Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期二, 15 四月 2025 17:05:56 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhuHaiChuangZhi/GanFengLiYeNew --- 代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" index 598f89d..0412eed 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" @@ -18,14 +18,7 @@ #endregion << 鐗� 鏈� 娉� 閲� >> using AutoMapper; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using Quartz; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core; using WIDESEAWCS_Core.Helper; @@ -33,7 +26,6 @@ using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; -using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.Service; using WIDESEAWCS_Tasks.ConveyorLineJob; @@ -60,6 +52,7 @@ } public Task Execute(IJobExecutionContext context) + { try { @@ -73,8 +66,8 @@ // 瀹氫箟绾夸綋瀹炵洏鍏ュ簱璇锋眰鐨勫湴鍧�鍜屼换鍔$被鍨� var requests = new Dictionary<string, string> { - { "DB1002.1093.0", "ZJXL-WLX002" }, - { "DB1002.1493.0", "FJXL-WLX002" } + { "DB1002.693.0", "ZJXL-WLX002" }, + { "DB1002.1093.0", "FJXL-WLX002" } }; // 瀹氫箟绾夸綋绌虹洏鍥炴祦璇锋眰鐨勫湴鍧�鍜屼换鍔$被鍨� @@ -120,7 +113,7 @@ string taskType = request.Value.Contains("ZJXL") ? "姝f瀬" : "璐熸瀬"; // 鏌ヨ鏄惁瀛樺湪宸茬敓鎴愮殑鏂颁换鍔� - var task = _taskRepository.QueryFirst(x => x.SourceAddress == fromAdd && x.TaskState == (int)TaskInStatusEnum.InNew); + var task = _taskRepository.QueryFirst(x => x.SourceAddress == fromAdd);//&& x.TaskState == (int)TaskInStatusEnum.InNew if (task != null) { ConsoleHelper.WriteInfoLine($"{nameof(CommonConveyorLineJob)}: {taskType}{requestType},浠诲姟宸茬敓鎴愬瓨鍦紝绋嶅悗閲嶈瘯......"); @@ -128,7 +121,7 @@ } // 鏌ヨ浠诲姟绫诲瀷瀵瑰簲鐨刢zTask - DtCZTask czTask = _taskCZRepository.QueryFirst(x => x.TaskType == taskType); + DtCZTask czTask = _taskCZRepository.QueryFirst(x => x.TaskType == taskType && x.TaskStatus == TaskInStatusEnum.InFinish.ToString()); if (czTask == null) { ConsoleHelper.WriteInfoLine($"{nameof(CommonConveyorLineJob)}: {taskType}{requestType},{taskType}浠诲姟涓嶅瓨鍦紝绋嶅悗閲嶈瘯......"); @@ -136,7 +129,7 @@ } // 鍒涘缓骞舵坊鍔犳柊浠诲姟鍒颁换鍔′粨搴� - task = CreateTask(fromAdd, czTask.TaskEndAddress, czTask.TaskOrderNo, czTask.TaskProductCode, taskType); + task = CreateTask(fromAdd, czTask.TaskEndAddress, czTask.TaskOrderNo, czTask.TaskProductCode, taskType, czTask.Id); _taskRepository.AddData(task); ConsoleHelper.WriteInfoLine($"{nameof(CommonConveyorLineJob)}: {taskType}{requestType},浠诲姟宸茬敓鎴愶紝绛夊緟鎵ц......"); } @@ -153,7 +146,7 @@ } string fromAdd = request.Value; - string taskType = request.Value.Contains("ZJXL") ? "姝f瀬" : "璐熸瀬"; + string taskType = "璐熸瀬"; //request.Value.Contains("ZJXL") ? "姝f瀬" : // 鏍规嵁浠诲姟绫诲瀷纭畾璇锋眰鍦板潃 (string upRequest, string gmRequest, string gmState) = GetRequestAddresses(taskType); @@ -196,8 +189,13 @@ } // 杈呭姪鏂规硶锛氬垱寤轰换鍔″璞� - private Dt_Task CreateTask(string currentAddress, string targetAddress, string remark, string palletCode, string taskType) + private Dt_Task CreateTask(string currentAddress, string targetAddress, string remark, string palletCode, string taskType, int czTaskID = 0) { + Dt_Task dt_Task = _taskRepository.QueryFirst(x => x.SourceAddress == currentAddress); + if (dt_Task != null) + { + return null; + } return new Dt_Task { TaskNum = _taskService.GetTaskNum(), @@ -205,14 +203,15 @@ Creater = "system", CurrentAddress = currentAddress, SourceAddress = currentAddress, - TaskState = (int)TaskInStatusEnum.InNew, - TaskType = (int)TaskInboundTypeEnum.Inbound, + TaskState = targetAddress != "WaitBind" ? (int)TaskInStatusEnum.InNew : (int)TaskInStatusEnum.InPending, + TaskType = (int)TaskOutboundTypeEnum.Outbound, Grade = 1, PalletCode = palletCode, TargetAddress = targetAddress, NextAddress = targetAddress, + Barcode = "", Roadway = $"{taskType}AGV", - WMSId = 0, + WMSId = czTaskID > 0 ? czTaskID : 0, Remark = remark }; } -- Gitblit v1.9.3