From 4bdc37291d784008cea7fb9d105077b65a12beb9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期二, 24 三月 2026 09:31:52 +0800
Subject: [PATCH] job优化

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 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 27ea2b3..f7b5dbf 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"
@@ -55,6 +55,7 @@
         private readonly IRepository<Dt_TaskExecuteDetail> _taskExecuteDetailRepository;
         private readonly IApiInfoService _apiInfoService;
         private readonly IStationMangerService _stationMangerService;
+        private readonly IStationInfoService _stationInfo;
         private readonly IMapper _mapper;
 
         private Dictionary<string, OrderByType> _taskOrderBy = new()
@@ -74,7 +75,7 @@
         /// </summary>
         public IRepository<Dt_Task> Repository => BaseDal;
 
-        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService, IStationMangerService stationMangerService, IStationInfoService stationInfo) : base(BaseDal)
         {
             _routerService = routerService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -86,6 +87,7 @@
             _apiInfoService = apiInfoService;
             _trackloginfoService = trackloginfoService;
             _stationMangerService = stationMangerService;
+            _stationInfo = stationInfo;
         }
         public WebResponseContent ReceiveWMSTask([NotNull] List<WMSTasksDTO> taskDTOs)
         {
@@ -118,7 +120,7 @@
                             continue;
                             //throw new Exception($"浠诲姟鍙枫�恵task.taskCode}銆戝凡瀛樺湪浠诲姟");
                         }
-                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode && x.TaskType == item.taskType) != null)
+                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode /*&& x.TaskType == item.taskType*/) != null)
                         {
                             objects.Add(new
                             {
@@ -128,7 +130,7 @@
                             continue;
                             //throw new Exception($"鎵樼洏鍙枫�恵task.containerCode}銆戝凡瀛樺湪浠诲姟");
                         }
-                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType) != null)
+                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType&&x.TaskState<TaskStatusEnum.TakeFinish.ObjToInt())!=null)
                         {
                             objects.Add(new
                             {
@@ -158,6 +160,10 @@
                                 break;
                             case (int)TaskTypeEnum.CPOutbound:
                                 content = CreateRGVNewOutTask(task, item.taskType);
+                                objects.Add(content.Data);
+                                break;
+                            case (int)TaskTypeEnum.CPMoveInventory:
+                                content = CreateRGVNewMoveTask(task, item.taskType);
                                 objects.Add(content.Data);
                                 break;
                             #endregion
@@ -1133,7 +1139,17 @@
                 }
                 else if (getLocationInfo.WarehouseId == 3)
                 {
-
+                    //杩欓噷鏄彁鍗囨満鐨�
+                    var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
+                    if (device == null) throw new Exception("鏈壘鍒版彁鍗囨満璁惧淇℃伅");
+                    if (!device.IsConnected) throw new Exception("PLC1鎻愬崌鏈鸿澶囪繛鎺ュけ璐�");
+                    var value = device.GetValue<HoistEnum, short>(HoistEnum.Outboundmaterialbox, "TSJ");
+                    list.Add(new
+                    {
+                        LoctionCode = value,
+                        LocationStatus = value!=0? 100 : 0,
+                        EnableStatus = 0,
+                    });
                 }
                 else if (getLocationInfo.WarehouseId == 4)
                 {

--
Gitblit v1.9.3