StockSyncByPd.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WdtSdk;
  7. namespace StockSyncByPd
  8. {
  9. class StockSyncByPd
  10. {
  11. static void Main(string[] args)
  12. {
  13. WdtClient client = new WdtClient();
  14. client.sid = "";
  15. client.appkey = "";
  16. client.appsecret = "";
  17. client.gatewayUrl = "http://121.41.177.115/openapi2/stock_sync_by_pd.php";
  18. var goods_list = new[]
  19. {
  20. new{
  21. spec_no = "test-ptsd-00002",
  22. stock_num = "9999"
  23. },
  24. new{
  25. spec_no = "test-ptsd-00001",
  26. stock_num = "9999"
  27. }
  28. };
  29. string json = goods_list.ToJsonString();
  30. client.putParams("warehouse_no", "api_test");
  31. client.putParams("is_adjust_stock", "1");
  32. client.putParams("goods_list", json);
  33. string result = client.wdtOpenapi();
  34. Console.WriteLine(result);
  35. Console.ReadKey();
  36. }
  37. }
  38. }