| | |
| | | using System; |
| | | using Microsoft.AspNetCore.Http; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | _recordService = recordService; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// å建åºåºéå®ä¿¡æ¯ - ä¿®å¤çæ¬ |
| | | /// å建åºåºéå® |
| | | /// </summary> |
| | | public Dt_OutStockLockInfo GetOutStockLockInfo( |
| | | Dt_OutboundOrder outboundOrder, |
| | |
| | | // 使ç¨ç¬¬ä¸ä¸ªå¯ç¨æ¡ç |
| | | var firstAvailableDetail = stockDetails |
| | | .Where(x => x.StockQuantity > x.OutboundQuantity) |
| | | .OrderBy(x => x.ProductionDate) |
| | | .OrderBy(x => x.CreateDate) |
| | | .FirstOrDefault(); |
| | | |
| | | if (firstAvailableDetail == null) |
| | |
| | | |
| | | return new Dt_OutStockLockInfo() |
| | | { |
| | | lineNo= outboundOrderDetail.lineNo, |
| | | |
| | | PalletCode = outStock.PalletCode, |
| | | AssignQuantity = assignQuantity, |
| | | MaterielCode = outboundOrderDetail.MaterielCode, |
| | |
| | | Status = (int)OutLockStockStatusEnum.å·²åé
, |
| | | StockId = outStock.Id, |
| | | Unit = outboundOrderDetail.Unit, |
| | | |
| | | SupplyCode = outboundOrderDetail.SupplyCode, |
| | | FactoryArea = outboundOrder.FactoryArea, |
| | | OrderType=outboundOrder.OrderType, |
| | | SupplyCode = outboundOrderDetail.SupplyCode, |
| | | WarehouseCode = outboundOrderDetail.WarehouseCode, |
| | | // æ°å¢å段 |
| | | CurrentBarcode = targetBarcode, |
| | |
| | | .Where(x => x.OrderDetailId == orderDetailId) |
| | | .OrderBy(x => x.Id) |
| | | .ToListAsync(); |
| | | } |
| | | |
| | | public async Task<LockInfoDetailDto> GetLockInfoDetail(int lockInfoId) |
| | | { |
| | | var lockInfo = await Db.Queryable<Dt_OutStockLockInfo>() |
| | | .LeftJoin<Dt_OutboundOrderDetail>((lockInfo, detail) => lockInfo.OrderDetailId == detail.Id) |
| | | .Where((lockInfo, detail) => lockInfo.Id == lockInfoId) |
| | | .Select((lockInfo, detail) => new LockInfoDetailDto |
| | | { |
| | | Id = lockInfo.Id, |
| | | OrderNo = lockInfo.OrderNo, |
| | | OrderDetailId = lockInfo.OrderDetailId, |
| | | BatchNo = lockInfo.BatchNo, |
| | | MaterielCode = lockInfo.MaterielCode, |
| | | StockId = lockInfo.StockId, |
| | | OrderQuantity = lockInfo.OrderQuantity, |
| | | OriginalQuantity = lockInfo.OriginalQuantity, |
| | | AssignQuantity = lockInfo.AssignQuantity, |
| | | PickedQty = lockInfo.PickedQty, |
| | | LocationCode = lockInfo.LocationCode, |
| | | PalletCode = lockInfo.PalletCode, |
| | | Status = lockInfo.Status, |
| | | IsSplitted = lockInfo.IsSplitted, |
| | | ParentLockId = lockInfo.ParentLockId, |
| | | |
| | | MaterielName = detail.MaterielName, |
| | | Unit = detail.Unit |
| | | }) |
| | | .FirstAsync(); |
| | | |
| | | return lockInfo; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum? outStockStatus) |
| | | { |
| | | return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && outStockStatus == null ? true : x.Status == outStockStatus.ObjToInt()); |
| | | } |
| | | |
| | | } |
| | | } |