private void CreateRepack(Resolver resolver) { string[] huIdArr = resolver.Input.Split(','); List <ReceiptNote> receiptNotes = new List <ReceiptNote>(); foreach (string huId in huIdArr) { try { IList <RepackDetail> repackDetailList = new List <RepackDetail>(); LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(huId); RepackDetail inRepackDetail = new RepackDetail(); inRepackDetail.LocationLotDetail = locationLotDetail; inRepackDetail.Hu = locationLotDetail.Hu; inRepackDetail.IOType = BusinessConstants.IO_TYPE_IN; inRepackDetail.Qty = inRepackDetail.Hu.Qty * inRepackDetail.Hu.UnitQty; repackDetailList.Add(inRepackDetail); RepackDetail outRepackDetail = new RepackDetail(); outRepackDetail.itemCode = inRepackDetail.Hu.Item.Code; outRepackDetail.IOType = BusinessConstants.IO_TYPE_OUT; outRepackDetail.Qty = inRepackDetail.Qty; repackDetailList.Add(outRepackDetail); Repack repack = repackMgr.CreateDevanning(repackDetailList, userMgr.CheckAndLoadUser(resolver.UserCode)); ReceiptNote receiptNote = Repack2ReceiptNote(repack); receiptNotes.Add(receiptNote); } catch (Exception ex) { continue; } } if (resolver.ReceiptNotes == null) { resolver.ReceiptNotes = receiptNotes; } else { IListHelper.AddRange <ReceiptNote>(resolver.ReceiptNotes, receiptNotes); } }
public void CreateDevanning(Resolver resolver) { IList <RepackDetail> repackDetailList = executeMgr.ConvertTransformerListToRepackDetail(resolver.Transformers); if (repackDetailList.Count == 0) { throw new BusinessErrorException("MasterData.Inventory.Repack.Error.RepackDetailEmpty"); } //KSS 客户化需求, 拆箱并上架 foreach (RepackDetail repackDetail in repackDetailList) { repackDetail.StorageBinCode = resolver.BinCode; } Repack repack = repackMgr.CreateDevanning(repackDetailList, this.userMgr.LoadUser(resolver.UserCode, false, true)); resolver.Code = repack.RepackNo; resolver.Result = languageMgr.TranslateMessage("MasterData.Inventory.Devanning.Successfully", resolver.UserCode, resolver.Transformers[0].TransformerDetails[0].HuId); resolver.Transformers = null; }