多线程导入StockItem

时间:2017-02-15 13:39:43

标签: acumatica

我正在使用Github上的相同应用程序(https://github.com/Acumatica/InventoryItemImportMultiThreaded),并根据我的要求以CSV的方式自定义我需要将项目导入库存。我将近90个字段导入数据,包括许多自定义字段。我创建了基于屏幕的api并导入数据。它没有给出任何错误,但它甚至没有导入任何数据。可能是什么问题?

我正在使用Acumatica ver 6.00.1263。

这是ItemImport.cs>导入方法



public void Import(List<Item> items)
{
	Console.WriteLine("[{0}] Submitting {1} items to Acumatica...", System.Threading.Thread.CurrentThread.ManagedThreadId, items.Count);

	var commands = new IN202500.Command[]
	{
		_itemsSchema.StockItemSummary.InventoryID,
		_itemsSchema.GeneralSettingsItemDefaults.PostingClass,
		_itemsSchema.GeneralSettingsItemDefaults.LotSerialClass,
		_itemsSchema.GeneralSettingsItemDefaults.TaxCategory,
		_itemsSchema.GLAccounts.InventoryAccount,
		_itemsSchema.GLAccounts.SalesAccount,
		_itemsSchema.GLAccounts.COGSAccount,
		_itemsSchema.GLAccounts.POAccrualAccount,
		_itemsSchema.FeedControlMarketPlaces.AmazonCAActive,
		_itemsSchema.FeedControlMarketPlaces.AmazonUSActive,
		_itemsSchema.FeedControlMarketingBarcodes.MarketingUPC,
		_itemsSchema.FeedControlMarketingBarcodes.MarketingEAN,
		_itemsSchema.FeedControlMarketingBarcodes.MarketingISBN,
		_itemsSchema.FeedControlMarketingBarcodes.ASIN,
		_itemsSchema.FeedControlFeedControl.DisableAllFeeds,
		_itemsSchema.FeedControlWebsites.EQCActive,
		_itemsSchema.FeedControlWebsites.HLZActive,
		_itemsSchema.ItemHandlingAFNPrep.AFNAdditionalNotes,
		_itemsSchema.ItemHandlingAFNPrep.AFNBubbleWrap,
		_itemsSchema.ItemHandlingAFNPrep.AFNClearPolyBag,
		_itemsSchema.ItemHandlingAFNPrep.AFNExtraLabelNeeded,
		_itemsSchema.ItemHandlingAFNPrep.AFNOpaquePolyBag,
		_itemsSchema.ItemHandlingAFNPrep.AFNSuffocationLabel,
		_itemsSchema.ItemHandlingAFNPrep.AFNTaping,
		_itemsSchema.ItemHandlingAFNPrep.AFNFNSKUCA,
		_itemsSchema.ItemHandlingAFNPrep.AFNFNSKUUS,
		_itemsSchema.ItemHandlingOther.CountryOfOrigin,
		_itemsSchema.ItemHandlingOther.GenHarmCode,
		_itemsSchema.ItemHandlingOther.JustInTimeFlag,
		_itemsSchema.ItemHandlingOther.MSDSPDF,
		_itemsSchema.ItemHandlingShipmentPrep.BubbleWrap,
		_itemsSchema.ItemHandlingShipmentPrep.ClearPolyBag,
		_itemsSchema.ItemHandlingShipmentPrep.SuffocationLabel,
		_itemsSchema.ItemHandlingShipmentPrep.TapeSeal,
		_itemsSchema.JITControlsProductAvailability.OversellProtect,
		_itemsSchema.JITControlsProductAvailability.RemoteOH,
		_itemsSchema.JITControlsProductAvailability.PALastCostDate,
		_itemsSchema.JITControlsProductAvailability.PALastFeedDate,
		_itemsSchema.JITControlsPurchasing.Dropship,
		_itemsSchema.JITControlsPurchasing.PriceHoldCost,
		_itemsSchema.JITControlsPurchasing.PriceHoldDate,
		_itemsSchema.JITControlsPurchasing.PriceHoldNote,
		_itemsSchema.JITControlsPurchasing.PriceHoldPrice,
		_itemsSchema.OtherOtherCosts.ConsignRefCost,
		_itemsSchema.OtherOtherItemNumbers.BaseMaster,
		_itemsSchema.OtherOtherItemNumbers.BaseNumber,
		_itemsSchema.Other.CompositeMaster,
		_itemsSchema.Other.CostCommission,
		_itemsSchema.Other.CustNonReturnable,
		_itemsSchema.Other.ProductLifecycleStatus,
		_itemsSchema.Other.Discountable,
		_itemsSchema.Other.FirstLiveDate,
		_itemsSchema.Other.NewProdDate,
		_itemsSchema.Other.ParkStatus,
		_itemsSchema.Other.PKQFlag,
		_itemsSchema.Other.ProdId,
		_itemsSchema.Other.ShortTitle,
		_itemsSchema.Other.VendorBaseSKU,
		_itemsSchema.Other.CorpCategoryId,
		_itemsSchema.Other.ParentItemClass,
		_itemsSchema.PricingMAPMSRP.SRP,
		_itemsSchema.PricingMAPMSRP.MapPrice,
		_itemsSchema.PricingMAPMSRP.IgnoreMapPrice,
		_itemsSchema.PricingRepricer.LastRepricerWebPriceUpdate,
		_itemsSchema.PricingRepricer.SendRepricer,
		_itemsSchema.PricingRetailLocations.RetailShowPrice,
		_itemsSchema.PricingRetailLocations.RetailStorePrice,
		_itemsSchema.PricingWholesale.DistributorPrice,
		_itemsSchema.PricingWholesale.DLRQPrice,
		_itemsSchema.PricingWholesale.DLREAPrice,
		_itemsSchema.PricingRepricer.LastRepricerAzusPriceUpdate,
		_itemsSchema.PackagingDimensions.Length,
		_itemsSchema.PackagingDimensions.Height,
		_itemsSchema.StockItemSummary.Description,
		_itemsSchema.PricingWebPrice.WebPrice,
		_itemsSchema.Other.MakeOffer,
		_itemsSchema.Other.ManuBaseNumber,
		_itemsSchema.Other.FixData,
		_itemsSchema.Other.FixDataReason,
		_itemsSchema.FeedControlMarketingBarcodes.Barcode,
		_itemsSchema.Other.ManuProdNo,
		_itemsSchema.StockItemSummary.ItemStatus,
		_itemsSchema.Other.ManuId,
		_itemsSchema.VendorDetails.VendorID,
		_itemsSchema.VendorDetails.VendorInventoryID,
		_itemsSchema.VendorDetails.PurchaseUnit,
		_itemsSchema.PackagingDimensions.Weight,
		_itemsSchema.OtherOtherCosts.ReplacementCost,
		_itemsSchema.ItemHandlingShipmentPrep.ShippingNotes,
		_itemsSchema.PackagingDimensions.Width,
        new Value
            { Value = "Size", LinkedCommand = _itemsSchema.AttributesAttributes.Attribute, Commit = true },
		_itemsSchema.Actions.Save
	};

	string[][] data = new string[items.Count][];

	int count = 0;
	foreach(Item item in items)
	{
		data[count] = new string[92];
		
		data[count][0] = item.int_prod_no.ToString();
		data[count][1] = item.item_class;
		data[count][2] = "DEFAULT";
		data[count][3] = "NOTRACK";
		data[count][4] = "DEFAULT";
		data[count][5] = "12010";
		data[count][6] = "40010";
		data[count][7] = "50010";
		data[count][8] = "20265";
		data[count][9] = item.amazon_ca_active.ToString();
		data[count][10] = item.amazon_us_active.ToString();
		data[count][11] = item.marketing_upc;
		data[count][12] = item.marketing_ean;
		data[count][13] = item.marketing_isbn;
		data[count][14] = item.asin;
		data[count][15] = item.digital_quarantine.ToString();
		data[count][16] = item.eqc_active.ToString();
		data[count][17] = item.hlz_active.ToString();
		data[count][18] = item.afn_additional_notes;
		data[count][19] = item.afn_bubble_wrap.ToString();
		data[count][20] = item.afn_clear_poly_bag.ToString();
		data[count][21] = item.afn_extra_label_needed.ToString();
		data[count][22] = item.afn_opaque_poly_bag.ToString();
		data[count][23] = item.afn_suffocation_label.ToString();
		data[count][24] = item.afn_taping.ToString();
		data[count][25] = item.afn_fnsku_ca;
		data[count][26] = item.afn_fnsku_us;
		data[count][27] = item.country_of_origin;
		data[count][28] = item.gen_harm_code;
		data[count][29] = item.just_in_time_flag.ToString();
		data[count][30] = item.msds_pdf;
		data[count][31] = item.shipment_prep_bubble_wrap.ToString();
		data[count][32] = item.shipment_prep_clear_poly_bag.ToString();
		data[count][33] = item.shipment_prep_suffocation_label.ToString();
		data[count][34] = item.shipment_prep_tape_seal.ToString();
		data[count][35] = item.oversell_protect.ToString();
		data[count][36] = item.remote_oh.ToString();
		data[count][37] = item.pa_last_cost_date.ToString();
		data[count][38] = item.pa_last_feed_date.ToString();
		data[count][39] = item.dropship.ToString();
		data[count][40] = item.price_hold_cost.ToString();
		data[count][41] = item.price_hold_date.ToString();
		data[count][42] = item.price_hold_note;
		data[count][43] = item.price_hold_price.ToString();
		data[count][44] = item.consign_ref_cost.ToString();
		data[count][45] = item.base_master;
		data[count][46] = item.base_number;
		data[count][47] = item.composite_master;
		data[count][48] = item.cost_commission.ToString();
		data[count][49] = item.cust_non_returnable.ToString();
		data[count][50] = item.product_lifecycle_status;
		data[count][51] = item.discountable.ToString();
		data[count][52] = item.first_live_date.ToString();
		data[count][53] = item.new_prod_date.ToString();
		data[count][54] = item.park_status.ToString();
		data[count][55] = item.pkq_flag;
		data[count][56] = item.global_prod_id;
		data[count][57] = item.global_short_title;
		data[count][58] = item.vendor_base_sku;
		data[count][59] = item.corp_class_id.ToString();
		data[count][60] = item.attribute_class;
		data[count][61] = item.srp.ToString();
		data[count][62] = item.map_price.ToString();
		data[count][63] = item.ignore_map_price.ToString();
		data[count][64] = item.last_repricer_web_price_update.ToString();
		data[count][65] = item.send_repricer.ToString();
		data[count][66] = item.retail_show_price.ToString();
		data[count][67] = item.retail_store_price.ToString();
		data[count][68] = item.distributor_price.ToString();
		data[count][69] = item.dlr_q_price.ToString();
		data[count][70] = item.dlr_ea_price.ToString();
		data[count][71] = item.last_repricer_azus_price_update.ToString();
		data[count][72] = item.length.ToString();
		data[count][73] = item.height.ToString();
		data[count][74] = item.desc;
		data[count][75] = item.global_web_price.ToString();
		data[count][76] = item.global_make_offer;
		data[count][77] = item.manu_base_sku;
		data[count][78] = item.fix_data.ToString();
		data[count][79] = item.fix_data_reason;
		data[count][80] = item.barcode;
		data[count][81] = item.manu_prod_no;
		data[count][82] = "Active";
		data[count][83] = item.manu_id;
		data[count][84] = item.vendor_id.ToString();
		data[count][85] = item.vendor_prod_no;
		data[count][86] = "EA";
		data[count][87] = item.weight.ToString();
		data[count][88] = item.replacement_cost.ToString();
		data[count][89] = item.shipment_prep_shipping_notes;
		data[count][90] = item.width.ToString();
        data[cound][91] = item.size;

		count++;
	}

	_itemsScreen.Import(commands, null, data, false, true, true);

	Console.WriteLine("[{0}] Submitted {1} items to Acumatica.", System.Threading.Thread.CurrentThread.ManagedThreadId, items.Count);
}
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

唯一的映射需要按照正确的顺序进行纠正。