heshaofeng
7 天以前 461524a7a1def4532b9af4ab40733f899f360db7
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -1,6 +1,8 @@
using LogLibrary.Log;
using MailKit;
using MailKit.Net.Smtp;
using MailKit.Search;
using Microsoft.AspNetCore.Http;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Bcpg;
@@ -80,7 +82,8 @@
            _allocateOrderRepository = allocateOrderRepository;
        }
        public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
        public async Task<WebResponseContent>
            GroupPallet(GroupPalletDto palletDto)
        {
            WebResponseContent content = new WebResponseContent();
            try
@@ -152,7 +155,7 @@
                if(inboundOrder.BusinessType != "11")
                {
                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode).Select(x => x.WarehouseCode).First();
                    var warehouseType = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => (x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode)&& x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()).Select(x => x.WarehouseCode).First();
                    if (string.IsNullOrEmpty(warehouseType))
                    {
@@ -180,6 +183,20 @@
                    stockInfo = new Dt_StockInfo() { PalletType = (int)PalletTypeEnum.None, LocationType = Convert.ToInt32(palletDto.locationType) };
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
                }
                //else
                //{
                //      var allowStatus = new[]
                //  {
                //      (int)StockStatusEmun.组盘暂存,
                //      (int)StockStatusEmun.智仓入智仓组盘暂存,
                //      (int)StockStatusEmun.手动组盘暂存
                //  };
                //    if (!allowStatus.Contains(stockInfo.StockStatus))
                //    {
                //        return content.Error($"该托盘{stockInfo.PalletCode}状态不允许组盘");
                //    }
                //}
                if (inboundOrder.BusinessType != MESDocumentType.PurchaseInbound.ToString() && stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
                {
@@ -599,7 +616,7 @@
                    var response = responseModel(inboundOrder, 3, null, allocatefeedmodel);
                    if (response != null && response.IsSuccess)
                    if (response != null && response.IsSuccess && response.Data.Code == "200")
                    {
                        _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
                        .Where(it => it.OrderId == inboundOrder.Id && inbounddetailID.Contains(it.Id)).ExecuteCommand();
@@ -693,7 +710,7 @@
                    }
                    var response = responseModel(inboundOrder, 3, feedmodel);
                    if (response != null && response.IsSuccess)
                    if (response != null && response.IsSuccess && response.Data.Code == "200")
                    {
                        _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
                        .Where(it => inbounddetailID.Contains(it.Id)).ExecuteCommand();