public void TestSaveBusData_PostBuyoffer() { AliBuyofferHandle buyoffer = new AliBuyofferHandle(); string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"0a54c693-6ca2-4765-abdf-c52b768dafbe\",\"subject\":\"test地址4\",\"phone\":\"13978766543\",\"contact\":\"联系人\",\"description\":\"描述1\",\"gmtQuotationExpire\":\"2018-12-12 12:12:12\",\"subBizType\":\"singlepurchase\",\"processTemplateCode\":\"assureTradeBusinessBuy\",\"transToolType\":\"3\",\"invoiceRequirement\":\"vat\",\"visibleAfterEndQuote\":\"false\",\"sourceMethodType\":\"open\",\"ngid\":\"\",\"receiveStreetAddress\":\"古林镇\",\"includeTax\":\"true\",\"quoteHasPostFee\":\"false\",\"allowPartOffer\":\"false\",\"certificateIds\":[\"542\",\"1\",\"2\",\"3\",\"400\",\"548\",\"549\"],\"otherCertificateNames\":[\"合格证\",\"检测报告\"],items:[{\"prItemId\":\"1001\",\"productCode\":\"a001\",\"purchaseAmount\":100,\"subject\":\"资源名称\",\"desc\":\"资源描述\",\"unit\":\"千克\",\"brandName\":\"品牌\",\"modelNumber\":\"型号1\"}]}"; buyoffer.analyseBussdata("PostBuyoffer", data); string ret = "{\"id\":297650670727}";//buyoffer.doPost(); AliDataAccess ada = new AliDataAccess(); ada.SaveBusData(buyoffer, ret); }
public void TestSaveBusData_GetBuyoffer() { AliBuyofferHandle buyoffer = new AliBuyofferHandle(); string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"aa3cbd3b-de0c-4779-8596-6724864d7a13\",\"offerid\":\"297650670727\"}"; buyoffer.analyseBussdata("GetBuyoffer", data); string ret = "{\"buyOffer\":{\"processTemplateCode\":\"accountPeriod\",\"attachments\":[],\"contactInfo\":{\"phone\":\"18305811642\",\"contact\":\"小张\"},\"allowPartQuote\":false,\"gmtQuotationExpire\":\"20190331015209000+0800\",\"prId\":\"xj82\",\"isVisibleAfterEndQuote\":false,\"title\":\"330ht(20190330-0001-XJCG)\",\"gmtCreate\":\"20190330135359000+0800\",\"quoteHasPostFee\":true,\"purchaseNoteId\":297650670727,\"includeTax\":true,\"sourceMethodType\":\"selectedmysupplier\",\"subBizType\":\"singlepurchase\",\"onlineShoppingAttachList\":[],\"transToolType\":\"3\",\"openToPortal\":false,\"purchaseNoteItems\":[{\"attachments\":[],\"purchaseCount\":10,\"subject\":\"苹果\",\"purchaseId\":297650670727,\"purchaseNoteItemId\":1132333900728,\"prItemId\":\"10087\",\"brandName\":\"\",\"purchaseAmount\":10,\"productFeature\":\"\",\"purchaseItemSign\":{\"sign\":0,\"addedIntoProductedDeport\":false},\"unit\":\"台\",\"productCode\":\"006001\",\"lineNum\":\"1\",\"modelNumber\":\"\",\"category\":{\"topCategoryId\":130822002,\"topCategoryName\":\"餐饮生鲜\",\"secondCategoryName\":\"水果\",\"thirdCategoryName\":\"苹果\",\"leafCategoryId\":1036642,\"secondCategoryId\":10037,\"categorylist\":[130822002,10037,1036642],\"thirdCategoryId\":1036642,\"leafCategoryName\":\"苹果\"},\"categoryId\":1036642},{\"attachments\":[],\"purchaseCount\":20,\"subject\":\"菠萝\",\"purchaseId\":297650670727,\"purchaseNoteItemId\":1132333910727,\"prItemId\":\"10088\",\"brandName\":\"\",\"purchaseAmount\":50,\"productFeature\":\"\",\"purchaseItemSign\":{\"sign\":0,\"addedIntoProductedDeport\":false},\"unit\":\"台\",\"productCode\":\"006002\",\"lineNum\":\"2\",\"modelNumber\":\"\",\"category\":{\"topCategoryId\":130822002,\"topCategoryName\":\"餐饮生鲜\",\"secondCategoryName\":\"水果\",\"thirdCategoryName\":\"菠萝/凤梨\",\"leafCategoryId\":125062004,\"secondCategoryId\":10037,\"categorylist\":[130822002,10037,125062004],\"thirdCategoryId\":125062004,\"leafCategoryName\":\"菠萝/凤梨\"},\"categoryId\":125062004}],\"invoiceType\":\"vat\",\"subUserId\":2200593250128,\"status\":\"sent\"}}"; AliDataAccess ada = new AliDataAccess(); ada.SaveBusData(buyoffer, ret); }
public void TestPostBuyoffer() { AliBuyofferHandle buyoffer = new AliBuyofferHandle(); string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"0a54c693-6ca2-4765-abdf-c52b768dafbe\",\"subject\":\"test地址4\",\"phone\":\"13978766543\",\"contact\":\"联系人\",\"description\":\"描述1\",\"gmtQuotationExpire\":\"2018-12-12 12:12:12\",\"subBizType\":\"singlepurchase\",\"open\":true,\"openToPortal\":true,\"processTemplateCode\":\"assureTradeBusinessBuy\",\"transToolType\":\"3\",\"invoiceRequirement\":\"vat\",\"visibleAfterEndQuote\":\"false\",\"sourceMethodType\":\"open\",\"ngid\":\"\",\"receiveStreetAddress\":\"古林镇\",\"includeTax\":\"true\",\"quoteHasPostFee\":\"false\",\"allowPartOffer\":\"false\",\"certificateIds\":[\"542\",\"1\",\"2\",\"3\",\"400\",\"548\",\"549\"],\"otherCertificateNames\":[\"合格证\",\"检测报告\"],items:[{\"prItemId\":\"1001\",\"productCode\":\"a001\",\"purchaseAmount\":100,\"subject\":\"资源名称\",\"desc\":\"资源描述\",\"unit\":\"千克\",\"brandName\":\"品牌\",\"modelNumber\":\"型号1\"}]}"; //\"supplierMemberIds\":[\"331010\",\"678908\"], buyoffer.analyseBussdata("PostBuyoffer", data); string ret = buyoffer.doPost();// "{\"id\":123456789}"; // //AliDataAccess ada = new AliDataAccess(); //ada.SaveBusData(buyoffer, ret); JObject obj = JsonConvert.DeserializeObject <JObject>(ret); Assert.IsNotNull(obj, "返回值空对象引用"); Assert.IsTrue(!string.IsNullOrWhiteSpace(obj.Value <string>("id")), "发布失败"); }