From 696edbff3c8812e4b820f624d66a02ae6ddb1a06 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:40:18 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs |   35 +++++++++++++++++++++++++++--------
 1 files changed, 27 insertions(+), 8 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
index 62d871e..abfb087 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
@@ -30,6 +30,7 @@
 using WIDESEA_DTO.CalcOut;
 using Newtonsoft.Json.Serialization;
 using Newtonsoft.Json;
+using WIDESEA_DTO.Basic;
 
 namespace WIDESEA_InboundService
 {
@@ -50,7 +51,8 @@
         private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository;
         private readonly IOutboundService _outboundService;
         private readonly IFeedbackMesService _feedbackMesService;
-        public TakeStockOrderService(IRepository<Dt_TakeStockOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfo> stockInfoRepository,IRepository<Dt_TakeStockOrderDetail> takeStockOrderDetail,IRepository<Dt_Task> taskRepository,ILocationInfoService locationInfoService, IRepository<Dt_InboundOrder> inboundOrderRepository,IRepository<Dt_OutboundOrder> outboundOrderRepository,IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, IOutboundPickingService outboundPickingService, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IOutboundService outboundService,IFeedbackMesService feedbackMesService) : base(BaseDal)
+        private readonly IESSApiService _eSSApiService;
+        public TakeStockOrderService(IRepository<Dt_TakeStockOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfo> stockInfoRepository,IRepository<Dt_TakeStockOrderDetail> takeStockOrderDetail,IRepository<Dt_Task> taskRepository,ILocationInfoService locationInfoService, IRepository<Dt_InboundOrder> inboundOrderRepository,IRepository<Dt_OutboundOrder> outboundOrderRepository,IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, IOutboundPickingService outboundPickingService, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IOutboundService outboundService,IFeedbackMesService feedbackMesService,IESSApiService eSSApiService) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _takeStockOrder = takeStockOrder;
@@ -66,8 +68,20 @@
             _stockInfoDetailRepository = stockInfoDetailRepository;
             _outboundService = outboundService;
             _feedbackMesService = feedbackMesService;
+            _eSSApiService = eSSApiService;
         }
 
+        private Dictionary<string, string> stations = new Dictionary<string, string>
+        {
+            {"2-1","2-9" },
+            {"3-1","3-9" },
+        };
+
+        private Dictionary<string, string> movestations = new Dictionary<string, string>
+        {
+            {"2-1","2-5" },
+            {"3-1","3-5" },
+        };
         public WebResponseContent ValidateBoxNo(string orderNo, string boxNo)
         {
             try
@@ -210,7 +224,7 @@
                 {
                     return content.Error("鏈壘鍒拌鐩樼偣鍗曟嵁");
                 }
-                var stock = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == boxNo).First();
+                var stock = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == boxNo).Includes(x=>x.Details).First();
 
                 if (stock == null)
                 {
@@ -245,6 +259,11 @@
                 // 鍒嗛厤鏂拌揣浣�
                 var newLocation = _locationInfoService.AssignLocation(stock.LocationType);
 
+                if (newLocation == null)
+                {
+                    return WebResponseContent.Instance.Error("娌℃湁绌洪棽搴撲綅鍙洖搴�");
+                }
+
                 var newTask = new Dt_Task()
                 {
                     CurrentAddress = takeStockOrder.Remark,
@@ -253,7 +272,7 @@
                     NextAddress = "",
                     OrderNo = takeStockOrder.OrderNo,
                     Roadway = newLocation.RoadwayNo,
-                    SourceAddress = sourceAddress,
+                    SourceAddress = stations.GetValueOrDefault(sourceAddress)??"",
                     TargetAddress = newLocation.LocationCode,
                     TaskStatus = (int)TaskStatusEnum.New,
                     TaskType = TaskTypeEnum.InInventory.ObjToInt(),
@@ -271,11 +290,11 @@
                 _taskRepository.AddData(newTask);
                 _unitOfWorkManage.CommitTran();
 
-                //var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest
-                //{
-                //    slotCode = movestations[station],
-                //    containerCode = palletCode
-                //});
+                var moveResult = _eSSApiService.MoveContainerAsync(new MoveContainerRequest
+                {
+                    slotCode = movestations[sourceAddress],
+                    containerCode = boxNo
+                });
                 return content.OK();
 
             }

--
Gitblit v1.9.3