From d5ac97bab548d213fea89b312ddce79a8a6371a2 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 06 一月 2026 19:13:59 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 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/InboundOrderService.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/InboundOrderService.cs"
index fe908d7..6b609ac 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/InboundOrderService.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/InboundOrderService.cs"
@@ -4,6 +4,7 @@
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.LocationEnum;
 using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Core;
@@ -43,10 +44,11 @@
         private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository;
         private readonly IRepository<Dt_LocationType> _locationTypeRepository;
         private readonly IRepository<Dt_StockInfo> _stockRepository;
+        private readonly IRepository<Dt_LocationInfo> _locationInfoRepository;
         private readonly IBasicService _basicService;
         public IRepository<Dt_InboundOrder> Repository => BaseDal;
 
-        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService) : base(BaseDal)
+        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService, IBasicService basicService, IRepository<Dt_LocationInfo> locationInfoRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -62,6 +64,7 @@
             _locationTypeRepository = locationTypeRepository;
             _materielInfoService = materielInfoService;
             _basicService = basicService;
+            _locationInfoRepository = locationInfoRepository;
         }
 
         public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType)
@@ -463,10 +466,16 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+                
                 (bool, string, object?) result2 = ModelValidate.ValidateModelData(materielGroupDTO);
                 if (!result2.Item1) return content = WebResponseContent.Instance.Error(result2.Item2);
 
                 bool code = _locationTypeRepository.Db.Queryable<Dt_LocationType>().Where(x => x.LocationType == materielGroupDTO.WarehouseCode).Any();
+                bool statu = _locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationType == materielGroupDTO.WarehouseCode && x.LocationStatus == (int)LocationStatusEnum.Free && x.EnableStatus == (int)EnableStatusEnum.Normal).Any();
+                if (!statu)
+                {
+                    return content = WebResponseContent.Instance.Error($"璇ュ尯鍩熸棤璐т綅鍙垎閰�");
+                }
                 if (!code)
                 {
                     return content = WebResponseContent.Instance.Error($"鍖哄煙涓病鏈夎{materielGroupDTO.WarehouseCode}缂栧彿銆�");
@@ -835,7 +844,8 @@
                         {
                             sugarQueryable1 = sugarQueryable1.Where(x => x.InboundOrderNo.Contains(searchParameters.Value.ToString())
                             || x.UpperOrderNo.Contains(searchParameters.Value.ToString()) ||
-                            x.Details.Any(d => d.Barcode == searchParameters.Value.ToString()));
+                            x.Details.Any(d => d.Barcode == searchParameters.Value.ToString()) ||
+                            x.Details.Any(d => d.OutBoxbarcodes == searchParameters.Value.ToString()));
                         }
                         searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_InboundOrder.OrderType).FirstLetterToLower());
                         if (searchParameters != null)

--
Gitblit v1.9.3