dengjunjie
2024-12-24 18d1f45193e34e00fc1b6f65b8596ddb29c5267d
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -9,16 +9,25 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_IOutboundRepository;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public partial class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
    {
        private readonly IStockService _stockService;
        private readonly IRecordService _recordService;
        public IOutStockLockInfoRepository Repository => BaseDal;
        public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal) : base(BaseDal)
        public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService) : base(BaseDal)
        {
            _recordService = recordService;
            _stockService = stockService;
        }
        public List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null)
@@ -49,6 +58,30 @@
            return outStockLockInfos;
        }
        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null)
        {
            Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
            {
                PalletCode = outStock.PalletCode,
                AssignQuantity = assignQuantity,
                MaterielCode = outboundOrderDetail.MaterielCode,
                BatchNo = outboundOrderDetail.BatchNo,
                LocationCode = outStock.LocationCode,
                MaterielName = outboundOrderDetail.MaterielName,
                OrderDetailId = outboundOrderDetail.Id,
                OrderNo = outboundOrder.OrderNo,
                OrderType = outboundOrder.OrderType,
                OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity),
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = outboundOrderDetail.OrderQuantity
            };
            return outStockLockInfo;
        }
        public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus)
        {
            return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && x.Status == outStockStatus.ObjToInt());
@@ -70,7 +103,7 @@
                {
                    throw new Exception($"未找到库存详情");
                }
                List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id);
                List<Dt_OutStockLockInfo> stockLockInfos = BaseDal.QueryData(x => x.StockId == stockInfo.Id&&x.Status< OutLockStockStatusEnum.出库完成.ObjToInt());
                return stockLockInfos;
            }
            catch (Exception ex)