public void FillOffline(Resolver resolver) { OrderHead orderHead = orderHeadMgr.LoadOrderHead(resolver.Code, true); if (orderHead == null || orderHead.OrderDetails == null || orderHead.OrderDetails.Count == 0) { throw new BusinessErrorException("Common.Business.Error.EntityNotExist", resolver.Code); } List <Transformer> newTransformerList = new List <Transformer>(); foreach (OrderDetail orderDetail in orderHead.OrderDetails) { IList <OrderLocationTransaction> orderLocationTransactions = orderLocationTransactionMgr.GetOrderLocationTransaction(orderDetail.Id, BusinessConstants.IO_TYPE_IN); if (orderLocationTransactions == null && orderLocationTransactions.Count != 1) { throw new BusinessErrorException("Common.Business.Error.EntityNotExist", resolver.Code); } Transformer transformer = Utility.TransformerHelper.ConvertOrderLocationTransactionToTransformer(orderLocationTransactions[0]); //收货批量 transformer.Qty = orderDetail.GoodsReceiptLotSize.HasValue ? orderDetail.GoodsReceiptLotSize.Value : 0;//收货批量 newTransformerList.Add(transformer); } resolver.Transformers = newTransformerList; resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMER; }
public PickList CreatePickList(List <string> orderNoList, User user) { IList <OrderLocationTransaction> orderLocTransList = orderLocationTransactionMgr.GetOrderLocationTransaction(orderNoList, BusinessConstants.IO_TYPE_OUT); if (orderLocTransList != null && orderLocTransList.Count > 0) { foreach (OrderLocationTransaction orderLocTrans in orderLocTransList) { orderLocTrans.CurrentShipQty = orderLocTrans.OrderDetail.RemainShippedQty * orderLocTrans.UnitQty;//转换成基本单位 } } return(this.CreatePickList(orderLocTransList, user)); }
public override IList <object> GetDataList(string code) { IList <object> list = new List <object>(); OrderHead orderHead = orderHeadMgr.LoadOrderHead(code, true); if (orderHead != null) { list.Add(orderHead); list.Add(orderHead.OrderDetails); IList <OrderLocationTransaction> orderLocationTransactions = orderLocationTransactionMgr.GetOrderLocationTransaction(orderHead.OrderNo); list.Add(orderLocationTransactions); } return(list); }
protected override void GetDetail(Resolver resolver) { InProcessLocation inProcessLocation = null; //订单收货 if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER) { inProcessLocation = orderMgr.ConvertOrderToInProcessLocation(resolver.Input); } //ASN收货 else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ASN) { inProcessLocation = inProcessLocationMgr.LoadInProcessLocation(resolver.Code, true); } if (inProcessLocation == null || inProcessLocation.InProcessLocationDetails == null || inProcessLocation.InProcessLocationDetails.Count == 0) { throw new BusinessErrorException("Common.Business.Error.NoDetailToReceive"); } List <Transformer> newTransformerList = TransformerHelper.ConvertInProcessLocationDetailsToTransformers(inProcessLocation.InProcessLocationDetails); if (resolver.IsScanHu) { ClearReceivedQty(newTransformerList); } resolver.Transformers = resolver.Transformers == null ? new List <Transformer>() : resolver.Transformers; resolver.Transformers.AddRange(newTransformerList); resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMER; if (resolver.Transformers != null && resolver.Transformers.Count > 0) { foreach (Transformer transformer in resolver.Transformers) { OrderLocationTransaction outOrderLocationTransaction = this.orderLocationTransactionMgr.LoadOrderLocationTransaction(transformer.OrderLocTransId); OrderLocationTransaction inOrderLocationTransaction = orderLocationTransactionMgr.GetOrderLocationTransaction(outOrderLocationTransaction.OrderDetail.Id, BusinessConstants.IO_TYPE_IN)[0]; transformer.OrderLocTransId = inOrderLocationTransaction.Id; } } }