Test.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * 创建时间:2017-08-19 08:55
  3. * 项目名称:kmall_pt
  4. * 类名称:Test.java
  5. * 包名称:com.kmall.admin
  6. *
  7. * 修改履历:
  8. * 日期 修正者 主要内容
  9. *
  10. *
  11. * Copyright (c) 2016-2017 兆尹科技
  12. */
  13. package com.kmall.admin;
  14. import cn.hutool.http.HttpRequest;
  15. import cn.hutool.http.HttpUtil;
  16. import com.alibaba.fastjson.JSON;
  17. import java.math.BigDecimal;
  18. import java.util.ArrayList;
  19. import java.util.HashMap;
  20. import java.util.List;
  21. import java.util.Map;
  22. /**
  23. * 名称:Test <br>
  24. * 描述:<br>
  25. *
  26. * @author Scott
  27. * @version 1.0
  28. * @since 1.0.0
  29. */
  30. public class Test {
  31. public static void main(String[] args) {
  32. Map params = new HashMap();
  33. // Map header = new HashMap();
  34. // header.put("Content-Type", "application/json");
  35. List<String> skuList = new ArrayList<String>();
  36. skuList.add("ISGDKK175117");
  37. skuList.add("ISTH01000185");
  38. params.put("skuList",skuList);
  39. //
  40. // String result = HttpUtil.URLPost("http://127.0.0.1:8080/oms-controller-mgt/pdProductRecord/hsCodeMapBySkuList",header, params, "UTF-8");
  41. //
  42. // System.out.println(result);
  43. // System.out.println();
  44. // String result = HttpUtil.post("http://127.0.0.1:8080/oms-controller-mgt/pdProductRecord/hsCodeMapBySkuList", JSON.toJSONString(params));
  45. // HttpRequest post = HttpUtil.createPost();
  46. String result = HttpUtil.get("http://127.0.0.1:8080/oms-controller-mgt/taxBill/queryGoodsRate?thirdPartyMerchCode=ZDF01");
  47. Map<String,String> map = JSON.parseObject(result, Map.class);
  48. String goodsRate = map.get("1901101000");
  49. String s = map.get(null);
  50. System.out.println(s);
  51. System.out.println(new BigDecimal(goodsRate));
  52. System.out.println(result);
  53. }
  54. }