|
@@ -130,22 +130,23 @@ public class HttpUtils {
|
|
public static void main(String[] args) throws Exception {
|
|
public static void main(String[] args) throws Exception {
|
|
// String token = getAccessToken();
|
|
// String token = getAccessToken();
|
|
// System.out.println("======="+token);
|
|
// System.out.println("======="+token);
|
|
- String ACCESS_TOKEN="m4uTcejqjMj1LuJUzPi67LM7Oq48FndY";
|
|
|
|
-// JsonNode jsonNode = getDateListByUrl(ACCESS_TOKEN);
|
|
|
|
|
|
+ String ACCESS_TOKEN="lsywoSYFwf204Q7WNtuWoO47iZImsNXL";
|
|
|
|
+ JsonNode jsonNode = getDateListByUrl(ACCESS_TOKEN,null);
|
|
|
|
+ System.out.println("================1===--------------");
|
|
|
|
+ System.out.println(jsonNode.toString());
|
|
//// ObjectMapper mapper = new ObjectMapper();
|
|
//// ObjectMapper mapper = new ObjectMapper();
|
|
//////
|
|
//////
|
|
//////
|
|
//////
|
|
- JsonNode jsonNodeAll = getDateByUrl("22efb768-da48-415e-88d3-924350b6c23e",ACCESS_TOKEN);
|
|
|
|
|
|
+// JsonNode jsonNodeAll = getDateByUrl("22efb768-da48-415e-88d3-924350b6c23e",ACCESS_TOKEN);
|
|
////////
|
|
////////
|
|
-// System.out.println("================1===--------------");
|
|
|
|
-// System.out.println(jsonNode.toString());
|
|
|
|
|
|
+
|
|
////
|
|
////
|
|
- String buyerContact = jsonNodeAll.get("lineItems").toPrettyString();
|
|
|
|
|
|
+// String buyerContact = jsonNodeAll.get("lineItems").toPrettyString();
|
|
//////
|
|
//////
|
|
//////
|
|
//////
|
|
//////// JsonNode jsonNodeAll2 = mapper.readTree(buyerContact);
|
|
//////// JsonNode jsonNodeAll2 = mapper.readTree(buyerContact);
|
|
- System.out.println("==============111--------------");
|
|
|
|
- System.out.println(buyerContact);
|
|
|
|
|
|
+// System.out.println("==============111--------------");
|
|
|
|
+// System.out.println(buyerContact);
|
|
//// Map<String, Object> buyerContact2Map = mapper.readValue(buyerContact, new TypeReference<Map<String, Object>>() {
|
|
//// Map<String, Object> buyerContact2Map = mapper.readValue(buyerContact, new TypeReference<Map<String, Object>>() {
|
|
//// });
|
|
//// });
|
|
// List<Map<String, Object>> result = mapper.readValue(buyerContact, new TypeReference<List<Map<String, Object>>>() {});
|
|
// List<Map<String, Object>> result = mapper.readValue(buyerContact, new TypeReference<List<Map<String, Object>>>() {});
|
|
@@ -190,15 +191,21 @@ public class HttpUtils {
|
|
// System.out.println(totalPages);
|
|
// System.out.println(totalPages);
|
|
}
|
|
}
|
|
|
|
|
|
- public static JsonNode getDateListByUrl(String ACCESS_TOKEN ) throws Exception {
|
|
|
|
|
|
+ public static JsonNode getDateListByUrl(String ACCESS_TOKEN,String date) throws Exception {
|
|
|
|
|
|
if(StringUtils.isBlank(ACCESS_TOKEN)){
|
|
if(StringUtils.isBlank(ACCESS_TOKEN)){
|
|
ACCESS_TOKEN = getAccessToken();
|
|
ACCESS_TOKEN = getAccessToken();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(StringUtils.isBlank(date)){
|
|
|
|
+ date= DateUtils.formatDate()+" 00:00:00";
|
|
|
|
+// date= "2025-05-14 00:00:00";
|
|
|
|
+ }
|
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
|
|
|
|
|
URIBuilder uriBuilder = new URIBuilder(API_URL_LIST)
|
|
URIBuilder uriBuilder = new URIBuilder(API_URL_LIST)
|
|
|
|
+ .addParameter("type", "RequestForQuote") // 询价
|
|
|
|
+ .addParameter("submittedDate", date) // 日期开始
|
|
.addParameter("pageNumber", "1") // 页码参数
|
|
.addParameter("pageNumber", "1") // 页码参数
|
|
.addParameter("pageSize", "50"); // 每页数量
|
|
.addParameter("pageSize", "50"); // 每页数量
|
|
|
|
|