From 871a7e1ce9a1b1925e228864baf42cafd41371f2 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期三, 03 十二月 2025 10:04:29 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs |   16 +++-------------
 1 files changed, 3 insertions(+), 13 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_TaskInfoService/TaskService_Outbound.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_TaskInfoService/TaskService_Outbound.cs"
index f3ef15f..5f04e43 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_TaskInfoService/TaskService_Outbound.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_TaskInfoService/TaskService_Outbound.cs"
@@ -31,20 +31,19 @@
         /// </summary>
         /// <param name="inTask"></param>
         /// <returns></returns>
-        public async Task<WebResponseContent> PalletOutboundTask(int num)
+        public async Task<WebResponseContent> PalletOutboundTask(int num, int locationType)
         {
             WebResponseContent content = new WebResponseContent();
             try
             {
-                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).ToList();
+                var stockInfos = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()).WhereIF(locationType != 0, x => x.LocationType == locationType).Take(num).ToList();
 
                 if (stockInfos.Count() == 0)
                 {
                     return WebResponseContent.Instance.Error("鏈壘鍒扮┖鎵樼洏搴撳瓨");
                 }
-                for (int i = 0; i < num; i++)
+                foreach (var stockInfo in stockInfos)
                 {
-                    var stockInfo = stockInfos.Where(x=>x.StockStatus != StockStatusEmun.鍑哄簱閿佸畾.ObjToInt()).FirstOrDefault();
                     Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                     if (locationInfo == null)
                     {
@@ -107,16 +106,7 @@
                     var result = await _eSSApiService.CreateTaskAsync(esstask);
 
                     _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
-                    if (result)
-                    {
-                        return WebResponseContent.Instance.OK(200);
-                    }
-                    else
-                    {
-                        return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
-                    }
                 }
-
                 return content.OK("绌烘墭鍑哄簱鎴愬姛!");
             }
             catch (Exception ex)

--
Gitblit v1.9.3