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; }
protected override void SetBaseInfo(Resolver resolver) { if (resolver.BarcodeHead == BusinessConstants.BARCODE_HEAD_BIN) { setBaseMgr.FillResolverByBin(resolver); } else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER) { resolver.Transformers = null; OrderHead orderHead = orderHeadMgr.LoadOrderHead(resolver.Input); #region 校验 if (!partyMgr.CheckPartyPermission(resolver.UserCode, orderHead.PartyTo.Code)) { throw new BusinessErrorException("Common.Error.NoRegionPermission", orderHead.PartyTo.Code); } if (orderHead.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { throw new BusinessErrorException("Order.Error.StatusErrorWhenReceive", orderHead.Status, orderHead.OrderNo); } if (orderHead.Type == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION) { throw new BusinessErrorException("Order.Error.OrderShipIsNotProduction", orderHead.OrderNo, orderHead.Type); } #endregion setBaseMgr.FillResolverByOrder(resolver); } else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ASN) { resolver.Transformers = null; InProcessLocation ip = inProcessLocationMgr.LoadInProcessLocation(resolver.Input); #region 校验 if (!partyMgr.CheckPartyPermission(resolver.UserCode, ip.PartyTo.Code)) { throw new BusinessErrorException("Common.Error.NoRegionPermission", ip.PartyTo.Code); } if (ip.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE) { throw new BusinessErrorException("InProcessLocation.Error.StatusErrorWhenReceive", ip.Status, ip.IpNo); } #endregion setBaseMgr.FillResolverByASN(resolver); } else { throw new TechnicalException("Error BarcodeHead:" + resolver.BarcodeHead + " and CodePrefix:" + resolver.CodePrefix); } }
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); } return(list); }
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); }
private IList <DssExportHistory> ConvertList(IList list, DssOutboundControl dssOutboundControl) { IList <DssExportHistory> result = new List <DssExportHistory>(); if (list != null && list.Count > 0) { foreach (object obj in list) { DssExportHistory dssExportHistory = new DssExportHistory(); dssExportHistory.DssOutboundControl = dssOutboundControl; dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE; dssExportHistory.IsActive = true; dssExportHistory.CreateDate = DateTime.Now; dssExportHistory.OriginalId = (int)((object[])obj)[0]; dssExportHistory.OrderNo = (string)((object[])obj)[1]; dssExportHistory.ReceiptNo = (string)((object[])obj)[2]; dssExportHistory.Item = (string)((object[])obj)[3]; dssExportHistory.Qty = (decimal)((object[])obj)[4]; dssExportHistory.EffectiveDate = (DateTime)((object[])obj)[5]; dssExportHistory.PartyFrom = (string)((object[])obj)[6]; if ((string)((object[])obj)[8] == BusinessConstants.SYSTEM_LOCATION_REJECT) { dssExportHistory.PartyTo = (string)((object[])obj)[7]; // this.GetLoctransInfo(dssExportHistory); this.GetLoctransInfo(dssExportHistory, true);//10-15上线 dssExportHistory.KeyCode = orderHeadMgr.LoadOrderHead(dssExportHistory.OrderNo).ExternalOrderNo; } else { dssExportHistory.PartyTo = (string)((object[])obj)[6]; this.GetLoctransInfo(dssExportHistory); dssExportHistory.KeyCode = this.GetKeyCode(dssExportHistory, dssExportHistory.ReceiptNo); } result.Add(dssExportHistory); } } return(result); }
protected override void SetBaseInfo(Resolver resolver) { if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_ORDER) { bool isHasOrderNo = false; if (resolver.Transformers != null) { foreach (Transformer transformer in resolver.Transformers) { if (transformer.OrderNo == resolver.Code) { isHasOrderNo = true; break; } } } if (!isHasOrderNo) { #region 校验 OrderHead orderHead = orderHeadMgr.LoadOrderHead(resolver.Input); if (!partyMgr.CheckPartyPermission(resolver.UserCode, orderHead.PartyFrom.Code)) { throw new BusinessErrorException("Common.Error.NoRegionPermission", orderHead.PartyFrom.Code); } if (!orderHead.IsShipByOrder && resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIPORDER) { throw new BusinessErrorException("Order.Error.NotShipByOrder", orderHead.OrderNo); } if (orderHead.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { throw new BusinessErrorException("Common.Business.Error.StatusError", orderHead.OrderNo, orderHead.Status); } if (orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT && orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION && orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER) { throw new BusinessErrorException("Order.Error.OrderShipIsNotProduction", orderHead.OrderNo, orderHead.Type); } #endregion setBaseMgr.FillResolverByOrder(resolver); } } else if (resolver.CodePrefix == BusinessConstants.CODE_PREFIX_PICKLIST) { resolver.Transformers = null; PickList pickList = pickListMgr.LoadPickList(resolver.Input); if (!partyMgr.CheckPartyPermission(resolver.UserCode, pickList.PartyFrom.Code)) { throw new BusinessErrorException("Common.Error.NoRegionPermission", pickList.PartyFrom.Code); } if (pickList.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { throw new BusinessErrorException("Common.Business.Error.StatusError", pickList.PickListNo, pickList.Status); } setBaseMgr.FillResolverByPickList(resolver); } else { throw new BusinessErrorException("Common.Business.Error.BarCodeInvalid"); } }
protected override bool FillValuesImpl(String templateFileName, IList <object> list) { try { if (list == null || list.Count < 2) { return(false); } InProcessLocation inProcessLocation = (InProcessLocation)list[0]; IList <InProcessLocationDetail> inProcessLocationDetailList = (IList <InProcessLocationDetail>)list[1]; if (inProcessLocation == null || inProcessLocationDetailList == null || inProcessLocationDetailList.Count == 0) { return(false); } //this.SetRowCellBarCode(0, 2, 5); List <Transformer> transformerList = Utility.TransformerHelper.ConvertInProcessLocationDetailsToTransformers(inProcessLocationDetailList); this.barCodeFontName = this.GetBarcodeFontName(2, 5); this.CopyPage(transformerList.Count); this.FillHead(inProcessLocation); int pageIndex = 1; int rowIndex = 0; int rowTotal = 0; //ASN号: // List<Transformer> transformerList = Utility.TransformerHelper.ConvertInProcessLocationDetailsToTransformers(inProcessLocationDetailList); foreach (Transformer transformer in transformerList) { OrderHead orderHead = orderHeadMgr.LoadOrderHead(transformer.OrderNo); //订单号 (销售发运显示客户订单号,其它为订单号) if (orderHead.Type == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION) { this.SetRowCell(pageIndex, rowIndex, 0, orderHead.ExternalOrderNo); } else { this.SetRowCell(pageIndex, rowIndex, 0, orderHead.OrderNo); } //序号. this.SetRowCell(pageIndex, rowIndex, 1, transformer.Sequence.ToString()); //"零件号Item Code" this.SetRowCell(pageIndex, rowIndex, 2, transformer.ItemCode); //"参考号Ref No." //this.SetRowCell(pageIndex, rowIndex, 3, orderDetail.ReferenceItemCode); //"描述Description" this.SetRowCell(pageIndex, rowIndex, 3, transformer.ItemDescription); //"单位Unit" this.SetRowCell(pageIndex, rowIndex, 4, transformer.UomCode); //"单包装UC" this.SetRowCell(pageIndex, rowIndex, 5, transformer.UnitCount.ToString("0.########")); //发货 Delivery 包装 int UCs = (int)Math.Ceiling(transformer.Qty / transformer.UnitCount); this.SetRowCell(pageIndex, rowIndex, 6, UCs.ToString()); //发货 Delivery 发货数 this.SetRowCell(pageIndex, rowIndex, 7, transformer.Qty.ToString("0.########")); //实收 Received 包装 //this.SetRowCell(pageIndex, rowIndex, 8, ""); //实收 Received 零件数 //this.SetRowCell(pageIndex, rowIndex, 9, ""); if (this.isPageBottom(rowIndex, rowTotal))//页的最后一行 { //实际到货时间: //this.SetRowCell(pageIndex, rowIndex, , ""); pageIndex++; rowIndex = 0; } else { rowIndex++; } rowTotal++; } this.sheet.DisplayGridlines = false; this.sheet.IsPrintGridlines = false; if (inProcessLocation.IsPrinted == null || inProcessLocation.IsPrinted == false) { inProcessLocation.IsPrinted = true; } inProcessLocation.PrintCount += 1; inProcessLocationMgr.UpdateInProcessLocation(inProcessLocation); } catch (Exception) { return(false); } return(true); }