From 37f4f03c2ca91c82e59dd3f630d767cf137783a5 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 10 六月 2025 19:32:37 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index ac7efdb..ba680b1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -1,4 +1,5 @@
 锘縰sing Newtonsoft.Json;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 using System;
 using System.Collections;
@@ -749,14 +750,18 @@
                 Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString());
                 //鑾峰彇搴撳瓨璁板綍
                 List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
-                  x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList();
+                  x.WarehouseId == warehouse.WarehouseId && x.PalletCode== palletCode).Includes(x => x.Details).ToList();
+                if (stockInfos.Count > 0)
+                {
+                    return content.Error($"杞藉叿鎵樼洏宸插瓨鍦�");
+                }
                 Dt_StockInfo? stockInfoOld = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == materialLot));
                 if (stockInfoOld != null)
                 {
                     return content.Error($"搴撳瓨淇℃伅宸插瓨鍦�");
                 }
                 Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x=>x.CodeStartStr== palletType);
-                if (palletTypeInfo != null)
+                if (palletTypeInfo == null)
                 {
                     return content.Error($"鎵樼洏绫诲瀷淇℃伅涓嶅瓨鍦�");
                 }
@@ -764,7 +769,7 @@
                 WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
                 if (!requestLotInfo.Status)
                 {
-                    return content.Error($"{requestLotInfo.Message}");
+                    return content.Error($"璇锋眰闃荤剨鎵规淇℃伅澶辫触,{requestLotInfo.Message}");
                 }
                 MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
                 Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
@@ -800,14 +805,14 @@
                     Grade = 0,
                     PalletCode = palletCode,
                     NextAddress = "",
-                    Roadway = "",
+                    Roadway = "SC01_ZH",
                     SourceAddress = "AGV_ZH",
                     TargetAddress = "",
                     TaskStatus = (int)TaskStatusEnum.New,
-                    TaskType = (int)TaskTypeEnum.InZHProduct,
+                    TaskType = (int)TaskTypeEnum.InZHProductSmall,
                     TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     PalletType = palletTypeInfo.PalletType,
-                    WarehouseId = warehouse.WarehouseId,
+                    WarehouseId = warehouse.WarehouseId
                 };
                 _unitOfWorkManage.BeginTran();
                 Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
@@ -816,7 +821,7 @@
                 _unitOfWorkManage.CommitTran();
                 //灏嗕换鍔℃帹閫佸埌WCS
                 PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV_ZH"); ;
-                content.OK();
+                content.OK(data: taskIn);
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3