123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /*
- * 创建时间:2017-08-19 08:55
- * 项目名称:kmall_pt
- * 类名称:Test.java
- * 包名称:com.kmall.admin
- *
- * 修改履历:
- * 日期 修正者 主要内容
- *
- *
- * Copyright (c) 2016-2017 兆尹科技
- */
- package com.kmall.admin;
- import cn.hutool.http.HttpRequest;
- import cn.hutool.http.HttpUtil;
- import com.alibaba.fastjson.JSON;
- import com.google.gson.Gson;
- import com.kmall.admin.dto.GoodsProductDto;
- import com.kmall.admin.dto.PdProductDtoInfo;
- import com.kmall.admin.entity.GoodsEntity;
- import com.kmall.admin.utils.CalculateTax;
- import com.kmall.admin.utils.data.response.ResponseMessage;
- import com.kmall.admin.utils.oms.OmsSign;
- import okhttp3.Request;
- import java.math.BigDecimal;
- import java.util.*;
- /**
- * 名称:Test <br>
- * 描述:<br>
- *
- * @author Scott
- * @version 1.0
- * @since 1.0.0
- */
- public class Test {
- public static void main(String[] args) {
- // Map<String, String> sParaTemp = new TreeMap<String, String>();
- // List<GoodsProductDto> goodsProductDtoList = new ArrayList<>();
- // GoodsProductDto dto = new GoodsProductDto();
- // dto.setMerchSn("mhbs990053989883052032");
- // goodsProductDtoList.add(dto);
- // PdProductDtoInfo pdProductDtoInfo = new PdProductDtoInfo();
- // pdProductDtoInfo.setPdProductDtoList(goodsProductDtoList);
- // sParaTemp.put("data", JSON.toJSONString(pdProductDtoInfo));
- // sParaTemp.put("merchId","mhbs990053989883052032");
- // String timestamp = String.valueOf(System.currentTimeMillis()/1000);
- // sParaTemp.put("timestamp", timestamp);
- // //生成要请求给oms秘钥
- //// String sign = OmsSign.sign(sParaTemp,cus.getWaybill().get("secret-key"));
- // String sign = OmsSign.sign(sParaTemp,"IxyIvP0sJqlUZinx");
- // sParaTemp.put("sign", sign);
- // //构建Request
- // String url = "http://127.0.0.1:8680/al/product/addPdProductList";
- // Request request = com.kmall.admin.utils.oms.OkHttpUtils.buildRequest(url, JSON.toJSONString(sParaTemp));
- // String s = JSON.toJSONString(sParaTemp);
- // // 同步访问,返回结果字符串
- // String responseString = null;
- // try {
- //
- // responseString = com.kmall.admin.utils.oms.OkHttpUtils.post(request);
- //
- // } catch (Exception e) {
- // e.printStackTrace();
- // }
- //
- // //解析响应数据
- // Gson gson = new Gson();
- // ResponseMessage result = gson.fromJson(responseString, ResponseMessage.class);
- // if(result == null){
- // String info = "解析响应数据Result失败";
- // throw new RuntimeException(info);
- // }
- List<String> list = new ArrayList<>();
- for (int i = 0; i < list.size(); i++) {
- System.out.println(list.get(i));
- }
- }
- }
|