1
dengjunjie
2025-01-10 5ee4d66f4fef38f9d7ba38d8c3cfae7f7fc082d3
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -5,6 +5,7 @@
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
@@ -22,12 +23,13 @@
        private readonly IRecordService _recordService;
        public IOutStockLockInfoRepository Repository => BaseDal;
        public IUnitOfWorkManage _unitOfWorkManage;
        public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService) : base(BaseDal)
        public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _recordService = recordService;
            _stockService = stockService;
            _unitOfWorkManage = unitOfWorkManage;
        }
        public List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null)
@@ -66,7 +68,7 @@
                PalletCode = outStock.PalletCode,
                AssignQuantity = assignQuantity,
                MaterielCode = outboundOrderDetail.MaterielCode,
                BatchNo = outStock.Details.FirstOrDefault()?.BatchNo ?? "",
                BatchNo = outboundOrderDetail.BatchNo ?? outStock.Details.FirstOrDefault()?.BatchNo,
                LocationCode = outStock.LocationCode,
                MaterielName = outboundOrderDetail.MaterielName,
                OrderDetailId = outboundOrderDetail.Id,
@@ -76,7 +78,8 @@
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = outboundOrderDetail.OrderQuantity
                OrderQuantity = outboundOrderDetail.OrderQuantity,
                Unit=outboundOrderDetail.Unit,
            };
            return outStockLockInfo;
@@ -100,7 +103,8 @@
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = mesOutboundOrder.OrderQuantity
                OrderQuantity = mesOutboundOrder.OrderQuantity,
                Unit = mesOutboundOrder.Unit
            };
            return outStockLockInfo;
@@ -118,6 +122,10 @@
                var palletCode = saveModel.MainData["barcode"].ToString();
                var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
                Dt_StockInfo stockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode && x.WarehouseId == warehouseId).Includes(x => x.Details).First();
                if (stockInfo.StockStatus != StockStatusEmun.出库完成.ObjToInt())
                {
                    throw new Exception($"该托盘还未出库完成");
                }
                if (stockInfo == null)
                {
                    throw new Exception($"未找到库存信息");
@@ -127,7 +135,7 @@
                {
                    throw new Exception($"未找到库存详情");
                }
                List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id && x.Status < OutLockStockStatusEnum.出库完成.ObjToInt());
                List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id && x.Status == OutLockStockStatusEnum.出库完成.ObjToInt());
                return stockLockInfos;
            }
            catch (Exception ex)