From 0c407bdcf2a26d78d2b0740f74af209977f0e7ce Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 21 一月 2026 09:58:10 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

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 1a48cda..b7e92f2 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"
@@ -18,12 +18,15 @@
 using AutoMapper;
 using SqlSugar;
 using System.Diagnostics.CodeAnalysis;
+using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_DTO.WMS;
+using WIDESEAWCS_IBasicInfoService;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_QuartzJob.Models;
@@ -35,6 +38,9 @@
     {
         private readonly IRouterService _routerService;
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
+        private readonly IHKLocationInfoService _hKLocationInfoService;
+        private readonly IKLSLocationInfoService _kLSLocationInfoService;
+        private readonly IRGVLocationInfoService _rGVLocationInfoService;
         private readonly IRepository<Dt_TaskExecuteDetail> _taskExecuteDetailRepository;
         private readonly IMapper _mapper;
 
@@ -55,12 +61,15 @@
         /// </summary>
         public IRepository<Dt_Task> Repository => BaseDal;
 
-        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService) : base(BaseDal)
         {
             _routerService = routerService;
             _taskExecuteDetailService = taskExecuteDetailService;
             _taskExecuteDetailRepository = taskExecuteDetailRepository;
             _mapper = mapper;
+            _kLSLocationInfoService = kLSLocationInfoService;
+            _rGVLocationInfoService = rGVLocationInfoService;
+            _hKLocationInfoService = hKLocationInfoService;
         }
         public WebResponseContent ReceiveWMSTask([NotNull] List<WMSTasksDTO> taskDTOs)
         {
@@ -69,18 +78,18 @@
             {
                 foreach (var item in taskDTOs)
                 {
-                    if (item.taskType == TaskTypeEnum.MLInbound.ObjToInt())
+                    foreach (var task in item.tasks)
                     {
-                        foreach (var task in item.tasks)
+                        content = TaskHelpMethods.isOkTaskInfo(task, true, true);
+                        if (!content.Status) throw new Exception(content.Message);
+                        if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode || x.PalletCode == task.containerCode) != null)
                         {
-                            content = TaskHelpMethods.isOkTaskInfo(task, true, true);
-                            if (!content.Status) throw new Exception(content.Message);
-                            if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode || x.PalletCode == task.containerCode) != null)
-                            {
-                                continue;
-                            }
-                            CreateNewInTask(task);
+                            continue;
                         }
+                        if (item.taskType == TaskTypeEnum.MLInbound.ObjToInt())
+                            CreateKLSNewInTask(task, item.taskType);
+                        else if (item.taskType == TaskTypeEnum.MLOutbound.ObjToInt())
+                            CreateKLSNewOutTask(task, item.taskType);
                     }
                 }
             }
@@ -618,5 +627,14 @@
             }
             return content;
         }
+
+        static object lock_taskNum = new object();
+        public int GetTaskNum(string sequenceName)
+        {
+            lock (lock_taskNum)
+            {
+                return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
+            }
+        }
     }
 }

--
Gitblit v1.9.3