1
heshaofeng
2026-01-22 51bd4ac4f323fab99ff9ac20763ca15af0e53a57
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -3,6 +3,7 @@
using MailKit.Search;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Bcpg;
using SixLabors.ImageSharp;
using SqlSugar;
using System;
@@ -54,7 +55,8 @@
        private readonly IRepository<Dt_MesReturnRecord> _mesReturnRecord;
        private readonly ILocationInfoService _locationInfoService;
        private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder;
        public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder)
        private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository;
        public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, HttpClientHelper httpClientHelper, IRepository<Dt_MesReturnRecord> mesReturnRecord,ILocationInfoService locationInfoService,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfoDetail> stockInfoDetailRepository)
        {
            _unitOfWorkManage = unitOfWorkManage;
            InboundOrderDetailService = inboundOrderDetailService;
@@ -71,6 +73,7 @@
            _mesReturnRecord = mesReturnRecord;
            _locationInfoService = locationInfoService;
            _takeStockOrder = takeStockOrder;
            _stockInfoDetailRepository = stockInfoDetailRepository;
        }
        public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
@@ -93,7 +96,11 @@
                if (details.Count() <= 0)
                {
                    var inbounddetail =_inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode);
                    var inbounddetail =_inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode);
                    if(inbounddetail == null)
                    {
                        return content.Error($"条码{palletDto.Barcode}不存在");
                    }
                    var inbound = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.Id == inbounddetail.OrderId).First();
                    if (inbound == null)
                    {
@@ -113,7 +120,13 @@
                    d.SupplyCode,
                    d.WarehouseCode
                }).ToList();
                    return content.Error("请确认是否已经组盘",detail);
                   var palletId = _stockInfoDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode);
                    if (palletId == null)
                    {
                        return content.Error($"条码条码{palletDto.Barcode}不存在");
                    }
                    var pallet =_stockInfoRepository.QueryFirst(x => x.Id == palletId.StockId);
                    return content.Error($"条码{palletDto.Barcode}已经组到{pallet.PalletCode}",detail);
                }
                inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Includes(x=>x.Details).Where(x => x.Id == details.First().OrderId).First();