| | |
| | | package com.taoke.autopay.utils.order; |
| | | |
| | | import com.taoke.autopay.dto.DYOrderDto; |
| | | import com.taoke.autopay.exception.KeyOrderException; |
| | | import com.taoke.autopay.utils.HttpUtil; |
| | | import com.taoke.autopay.utils.JsonUtil; |
| | | import net.sf.json.JSONObject; |
| | |
| | | return result; |
| | | } |
| | | |
| | | public static DYOrderDto getOrderDetail(String orderNo) throws Exception { |
| | | public static DYOrderDto getOrderDetail(String orderNo) throws KeyOrderException { |
| | | String result = requestByOrderNo1(orderNo); |
| | | System.out.println(result); |
| | | JSONObject root = JSONObject.fromObject(result); |
| | | if (root.optInt("code") != 1000) { |
| | | logger.error(String.format("抖音订单查询出错:%s - %s",orderNo, result)); |
| | | throw new Exception(root.optString("message")); |
| | | throw new KeyOrderException(root.optString("message")); |
| | | } |
| | | JSONObject data = root.optJSONObject("data"); |
| | | return JsonUtil.getSimpleGson().fromJson(data.toString(),DYOrderDto.class); |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | DYOrderDto dto = (DYOrderApi.getOrderDetail("6930867557709059751")); |
| | | DYOrderDto dto = (DYOrderApi.getOrderDetail("6931373743528482165")); |
| | | System.out.println("123123"); |
| | | } |
| | | |
| | | } |