| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | |
| | | public IRepository<Dt_OutStockLockInfo> Repository => BaseDal; |
| | | public IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public OutStockLockInfoService(IRepository<Dt_OutStockLockInfo> BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | private readonly IStockService _stockService; |
| | | private readonly IRecordService _recordService; |
| | | |
| | | public OutStockLockInfoService(IRepository<Dt_OutStockLockInfo> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockService stockService, IRecordService recordService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockService = stockService; |
| | | _recordService = recordService; |
| | | } |
| | | |
| | | public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null) |
| | | { |
| | | |
| | | Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo() |
| | | { |
| | | PalletCode = outStock.PalletCode, |
| | | AssignQuantity = assignQuantity, |
| | | MaterielCode = outboundOrderDetail.MaterielCode, |
| | | BatchNo = outboundOrderDetail.BatchNo ?? outStock.Details.FirstOrDefault()?.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, |
| | | Unit = outboundOrderDetail.Unit, |
| | | //ProductionDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | //EffectiveDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | | } |
| | | } |
| | | } |