From 5732962e2fe146d81273b4b02faaec87c05f0417 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 30 十二月 2024 00:29:19 +0800
Subject: [PATCH] 1

---
 /dev/null                                                                                                    |    0 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/44e929f5-8449-4585-8dc4-9b26c8bb034f.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/IApiInfoRepository.cs                             |   14 +++++++
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/GroundStationJob_CSJ.cs                                     |    2 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/47aefde9-6b59-499f-9c3f-ebb421f4776a.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                            |   21 ++++++----
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs                                    |   13 +++++-
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs                                      |    2 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/02070301-d407-4967-8609-0a4ac8d40c96.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cb6b3c56-6f5f-41cc-b979-9f90f7ee6821.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                                         |   12 ++++--
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/ApiInfoRepository.cs                               |   18 +++++++++
 12 files changed, 64 insertions(+), 18 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/02070301-d407-4967-8609-0a4ac8d40c96.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/02070301-d407-4967-8609-0a4ac8d40c96.vsidx"
new file mode 100644
index 0000000..26d8096
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/02070301-d407-4967-8609-0a4ac8d40c96.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/44e929f5-8449-4585-8dc4-9b26c8bb034f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/44e929f5-8449-4585-8dc4-9b26c8bb034f.vsidx"
new file mode 100644
index 0000000..45e58a4
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/44e929f5-8449-4585-8dc4-9b26c8bb034f.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/47aefde9-6b59-499f-9c3f-ebb421f4776a.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/47aefde9-6b59-499f-9c3f-ebb421f4776a.vsidx"
new file mode 100644
index 0000000..63c1e24
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/47aefde9-6b59-499f-9c3f-ebb421f4776a.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6c50baee-3bfb-4ddc-bce2-3d1ecfe9273b.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6c50baee-3bfb-4ddc-bce2-3d1ecfe9273b.vsidx"
deleted file mode 100644
index 74edf39..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6c50baee-3bfb-4ddc-bce2-3d1ecfe9273b.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/ApiInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/ApiInfoRepository.cs"
new file mode 100644
index 0000000..9566b7a
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/ApiInfoRepository.cs"
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core.BaseRepository;
+using WIDESEAWCS_IBasicInfoRepository;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_BasicInfoRepository
+{
+    public class ApiInfoRepository : RepositoryBase<Dt_ApiInfo>, IApiInfoRepository
+    {
+        public ApiInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+        {
+        }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/IApiInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/IApiInfoRepository.cs"
new file mode 100644
index 0000000..98f001b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/IApiInfoRepository.cs"
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core.BaseRepository;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_IBasicInfoRepository
+{
+    public interface IApiInfoRepository : IRepository<Dt_ApiInfo>
+    {
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
index b4abb72..000b58c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs"
@@ -41,7 +41,7 @@
             agvResponseContent.ReqCode = secureApplyModel.ReqCode;
             try
             {
-                var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode.ObjToInt() == x.TaskNum);
+                var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode== x.AgvTaskNum);
                 if (task == null) throw new Exception("鏈壘鍒颁换鍔�");
                 if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                 {
@@ -127,9 +127,15 @@
                         {
                             var content = PutFinish(task.NextAddress);
                             if (!content.Status) throw new Exception(content.Message);
-                            task.CurrentAddress = task.NextAddress;
+                            Dt_StationManger dt_Station=_stationMangerRepository.QueryFirst(x=>x.AGVStationCode== task.NextAddress);
+                            if (dt_Station==null)
+                            {
+                                throw new Exception($"{task.NextAddress}AGV绔欏彴鏈畾涔�");
+                            }
+                            task.CurrentAddress = dt_Station.StationCode;
                             task.NextAddress = "";
                             task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+                            task.DeviceCode = "SC01_CSJ";
                             var up = _taskRepository.UpdateData(task);
                             agvResponseContent.Code = up ? "0" : "1";
                             agvResponseContent.Message = up ? "鎴愬姛" : "澶辫触";
@@ -312,7 +318,8 @@
 
                 OtherDevice otherDevice = (OtherDevice)device;
                 otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode);
-
+                Thread.Sleep(1000);
+                otherDevice.SetValue(GroundStationDBName.W_TakeFinish, false, stationManger.StationCode);
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
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 f218473..2080ff3 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"
@@ -34,6 +34,7 @@
 using WIDESEAWCS_Core.Enums;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_DTO.BasicInfo;
+using WIDESEAWCS_DTO.System;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_IBasicInfoRepository;
 using WIDESEAWCS_ITaskInfoRepository;
@@ -56,6 +57,7 @@
         private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
         private readonly IStationMangerRepository _stationMangerRepository;
         private readonly IRouterRepository _routerRepository;
+        private readonly IApiInfoRepository _apiInfoRepository;
         private List<Dt_ApiInfo> apiInfos;
 
         private Dictionary<string, OrderByType> _taskOrderBy = new()
@@ -72,7 +74,7 @@
 
         public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList();
 
-        public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository) : base(BaseDal)
+        public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IApiInfoRepository apiInfoRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _cacheService = cacheService;
@@ -81,6 +83,7 @@
             _taskExecuteDetailRepository = taskExecuteDetailRepository;
             _stationMangerRepository = stationMangerRepository;
             _routerRepository = routerRepository;
+            _apiInfoRepository = apiInfoRepository;
 
             string? cacheStr = _cacheService.Get(nameof(Dt_Warehouse));
             if (!string.IsNullOrEmpty(cacheStr))
@@ -102,7 +105,6 @@
                     apiInfos = infos;
                 }
             }
-
         }
 
         public WebResponseContent TaskCompleted(int taskNum)
@@ -161,7 +163,7 @@
 
                     if (string.IsNullOrEmpty(item.AGVArea))
                     {
-                        task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("YYMMDD") + item.TaskNum;
+                        //task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                         Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StackerCraneCode == item.RoadWay);
                         if (stationManger == null)
                         {
@@ -189,6 +191,7 @@
                     {
                         if (item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                         {
+                            task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                             List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi);
                             if (routers.FirstOrDefault() == null)
                             {
@@ -202,6 +205,7 @@
                         }
                         else
                         {
+                            task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                             List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
                             if (routers.FirstOrDefault() == null)
                             {
@@ -216,7 +220,7 @@
                             }
 
                             task.NextAddress = stationManger?.AGVStationCode ?? "";
-                            task.DeviceCode = "AGV";
+                            task.DeviceCode = "AGV_CSJ";
                             task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                         }
                     }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
index 6409cd3..fe4ab19 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs"
@@ -74,7 +74,7 @@
                         }
                         if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
                         {
-                            Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) && x.SourceAddress == item.StationCode);
+                            Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) && x.SourceAddress == item.StationCode || x.CurrentAddress==item.AGVStationCode);
                             if (task != null)
                             {
                                 string oldAddress = task.NextAddress;
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
index 7a42656..92aa37b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
@@ -292,7 +292,7 @@
             stackerCraneTaskCommand.Barcode = task.PalletCode;
             stackerCraneTaskCommand.TaskNum = task.TaskNum;
             stackerCraneTaskCommand.WorkType = 1;
-            stackerCraneTaskCommand.TrayType = 1;
+            stackerCraneTaskCommand.TrayType = (Int16)task.PalletType;
             if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
             {
                 string[] startCodes = task.CurrentAddress.Split("-");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/beb6af15-675b-4c7b-b13e-fb33a736cb76.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cb6b3c56-6f5f-41cc-b979-9f90f7ee6821.vsidx"
similarity index 67%
rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/beb6af15-675b-4c7b-b13e-fb33a736cb76.vsidx"
rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cb6b3c56-6f5f-41cc-b979-9f90f7ee6821.vsidx"
index aad1211..5d6ce18 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/beb6af15-675b-4c7b-b13e-fb33a736cb76.vsidx"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cb6b3c56-6f5f-41cc-b979-9f90f7ee6821.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index bdf4c84..9a267e2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -279,26 +279,29 @@
                 }
                 Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                 List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.TaskNum == taskNum);
+                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
 
                 if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString())
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撹鎯呬俊鎭�");
                 }
-
-                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
-                for (int i = 0; i < outStockLockInfos.Count; i++)
+                else
                 {
-                    Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId);
-                    if (outboundOrderDetail != null)
+                    for (int i = 0; i < outStockLockInfos.Count; i++)
                     {
-                        outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity;
-                        if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity)
+                        Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId);
+                        if (outboundOrderDetail != null)
                         {
-                            outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+                            outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity;
+                            if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity)
+                            {
+                                outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+                            }
+                            outboundOrderDetails.Add(outboundOrderDetail);
                         }
-                        outboundOrderDetails.Add(outboundOrderDetail);
                     }
                 }
+                
                 if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString())
                 {
                     //鎺ㄩ�佸嚭搴撳畬鎴�

--
Gitblit v1.9.3