|
|
|
@ -1,35 +1,230 @@
|
|
|
|
|
package com.logpm.factorydata.suofeiya.job; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
|
import cn.hutool.json.JSONArray; |
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
import java.net.HttpCookie; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
@Component |
|
|
|
|
@Slf4j |
|
|
|
|
public class SpiderDataJob { |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/loadingHeader/all?_dc=1739871711195&page=1&start=0&limit=100&filtersRaw=[{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-11\",\"operator\":\">=\",\"sql\":null},{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-19\",\"operator\":\"<\",\"sql\":null}]"; |
|
|
|
|
// // 发起http请求 获取返回的数据 走get请求
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
private Map<String,String> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取工厂的发送车次 |
|
|
|
|
* |
|
|
|
|
* @param param |
|
|
|
|
* @return |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
@XxlJob("factoryCarsData") |
|
|
|
|
public ReturnT<String> factoryCarsData(String param) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String date =LocalDate.now().toString();
|
|
|
|
|
//
|
|
|
|
|
// String yesterday = LocalDate.now().minusDays(1).toString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 获取当前日期
|
|
|
|
|
// String date = DateUtil.today();
|
|
|
|
|
// // 获取当前日期的前一天的日期
|
|
|
|
|
// String yesterday = DateUtil.offsetDay(DateUtil.parse(date), -1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long _dc_ = System.currentTimeMillis(); |
|
|
|
|
|
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/loadingHeader/all?_dc=" + _dc_ + "&page=1&start=0&limit=100&" + |
|
|
|
|
"filtersRaw=[{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"" + "2025-01-18" + "\",\"operator\":\">=\",\"sql\":null}," + |
|
|
|
|
"{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\""+"2025-01-19"+"\",\"operator\":\"<\",\"sql\":null}]"; |
|
|
|
|
System.out.println(url); |
|
|
|
|
|
|
|
|
|
Map<String, String> heads = new HashMap<>(); |
|
|
|
|
heads.put("Content-Type", "application/json;charset=UTF-8"); |
|
|
|
|
// heads.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36");
|
|
|
|
|
// heads.put("Host", "portal.sfygroup.com");
|
|
|
|
|
// heads.put("Accept", "*/*");
|
|
|
|
|
|
|
|
|
|
heads.put("Cookie", init()); |
|
|
|
|
// heads.put("Referer", "http://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp");
|
|
|
|
|
heads.put("Cookie", buildCookies()); |
|
|
|
|
HttpRequest get = HttpUtil.createGet(url).addHeaders(heads); |
|
|
|
|
// String s = HttpUtil.get(url);
|
|
|
|
|
HttpResponse execute = get.setReadTimeout(10000).execute(); |
|
|
|
|
String body = execute.body(); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(body); |
|
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("result"); |
|
|
|
|
|
|
|
|
|
for (Object o : jsonArray) { |
|
|
|
|
JSONObject jsonObject1 = (JSONObject) o; |
|
|
|
|
System.out.println("车次"+jsonObject1); |
|
|
|
|
// 得到车次下的订单
|
|
|
|
|
JSONArray orders = getCarOrders(jsonObject1.getStr("deliveryHeaderId")); |
|
|
|
|
System.out.println("订单"+orders); |
|
|
|
|
// // 得到订单下的包条信息
|
|
|
|
|
// for (Object o1 : orders) {
|
|
|
|
|
// JSONObject jsonObject2 = (JSONObject) o1;
|
|
|
|
|
// System.out.println("订单"+jsonObject2);
|
|
|
|
|
// // 得到订单下的包条信息
|
|
|
|
|
// JSONArray orderInfor = getOrderPackages(jsonObject2.getStr("orderNumber"));
|
|
|
|
|
// System.out.println("包件"+orderInfor);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* { |
|
|
|
|
* "total": 10000, |
|
|
|
|
* "result": [ |
|
|
|
|
* { |
|
|
|
|
* "id": null, |
|
|
|
|
* "createdBy": null, |
|
|
|
|
* "created": null, |
|
|
|
|
* "lastUpdated": null, |
|
|
|
|
* "lastUpdatedBy": null, |
|
|
|
|
* "rowVersion": 0, |
|
|
|
|
* "tableName": "SG_ORG_BALANCE", |
|
|
|
|
* "deliveryHeaderId": "4846819", |
|
|
|
|
* "deliveryNumber": "ZC2502181957", |
|
|
|
|
* "totalPackQty": 2, |
|
|
|
|
* "totalWeight": 0.0, |
|
|
|
|
* "totalVolumn": 0.0025380000000000003, |
|
|
|
|
* "waybillNo": "ZCD141250218252434", |
|
|
|
|
* "carrier": "成都-自提蓉开物流", |
|
|
|
|
* "plateNumber": "P35160", |
|
|
|
|
* "organizationId": "141", |
|
|
|
|
* "dealDate": "2025-02-18 16:48:43", |
|
|
|
|
* "customerNumber": "P35160", |
|
|
|
|
* "deliveryDate": "2025-02-18 00:00:00", |
|
|
|
|
* "orderBrandCode": "1", |
|
|
|
|
* "orderBrand": "索菲亚品牌" |
|
|
|
|
* }, |
|
|
|
|
* { |
|
|
|
|
* "id": null, |
|
|
|
|
* "createdBy": null, |
|
|
|
|
* "created": null, |
|
|
|
|
* "lastUpdated": null, |
|
|
|
|
* "lastUpdatedBy": null, |
|
|
|
|
* "rowVersion": 0, |
|
|
|
|
* "tableName": "SG_ORG_BALANCE", |
|
|
|
|
* "deliveryHeaderId": "4846818", |
|
|
|
|
* "deliveryNumber": "ZC2502181956", |
|
|
|
|
* "totalPackQty": 10, |
|
|
|
|
* "totalWeight": 40.415513000000004, |
|
|
|
|
* "totalVolumn": 0.051727999999999996, |
|
|
|
|
* "waybillNo": "ZCD141250218252435", |
|
|
|
|
* "carrier": "成都-自提蓉开物流", |
|
|
|
|
* "plateNumber": "P351688", |
|
|
|
|
* "organizationId": "141", |
|
|
|
|
* "dealDate": "2025-02-18 16:48:43", |
|
|
|
|
* "customerNumber": "P351688", |
|
|
|
|
* "deliveryDate": "2025-02-18 00:00:00", |
|
|
|
|
* "orderBrandCode": "1", |
|
|
|
|
* "orderBrand": "索菲亚品牌" |
|
|
|
|
* }, |
|
|
|
|
* { |
|
|
|
|
* "id": null, |
|
|
|
|
* "createdBy": null, |
|
|
|
|
* "created": null, |
|
|
|
|
* "lastUpdated": null, |
|
|
|
|
* "lastUpdatedBy": null, |
|
|
|
|
* "rowVersion": 0, |
|
|
|
|
* "tableName": "SG_ORG_BALANCE", |
|
|
|
|
* "deliveryHeaderId": "4846820", |
|
|
|
|
* "deliveryNumber": "ZC2502181958", |
|
|
|
|
* "totalPackQty": 363, |
|
|
|
|
* "totalWeight": 4896.438766, |
|
|
|
|
* "totalVolumn": 6.8757829999999975, |
|
|
|
|
* "waybillNo": "ZCD141250218252436", |
|
|
|
|
* "carrier": "成都-自提蓉开物流", |
|
|
|
|
* "plateNumber": "J400098", |
|
|
|
|
* "organizationId": "141", |
|
|
|
|
* "dealDate": "2025-02-18 16:48:43", |
|
|
|
|
* "customerNumber": "J400098", |
|
|
|
|
* "deliveryDate": "2025-02-18 00:00:00", |
|
|
|
|
* "orderBrandCode": "1", |
|
|
|
|
* "orderBrand": "索菲亚品牌" |
|
|
|
|
* }, |
|
|
|
|
* { |
|
|
|
|
* "id": null, |
|
|
|
|
* "createdBy": null, |
|
|
|
|
* "created": null, |
|
|
|
|
* "lastUpdated": null, |
|
|
|
|
* "lastUpdatedBy": null, |
|
|
|
|
* "rowVersion": 0, |
|
|
|
|
* "tableName": "SG_ORG_BALANCE", |
|
|
|
|
* "deliveryHeaderId": "4846817", |
|
|
|
|
* "deliveryNumber": "ZC2502181955", |
|
|
|
|
* "totalPackQty": 18, |
|
|
|
|
* "totalWeight": 106.141877, |
|
|
|
|
* "totalVolumn": 0.14108600000000002, |
|
|
|
|
* "waybillNo": "ZCD141250218252433", |
|
|
|
|
* "carrier": "成都-自提蓉开物流", |
|
|
|
|
* "plateNumber": "J40000", |
|
|
|
|
* "organizationId": "141", |
|
|
|
|
* "dealDate": "2025-02-18 16:48:43", |
|
|
|
|
* "customerNumber": "J40000", |
|
|
|
|
* "deliveryDate": "2025-01-13 00:00:00", |
|
|
|
|
* "orderBrandCode": "1", |
|
|
|
|
* "orderBrand": "索菲亚品牌" |
|
|
|
|
* } |
|
|
|
|
* ], |
|
|
|
|
* "success": true |
|
|
|
|
* } |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ReturnT.SUCCESS; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SpiderDataJob s = new SpiderDataJob(); |
|
|
|
|
s.factoryCarsData(""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Long s = System.currentTimeMillis();
|
|
|
|
|
// System.out.println(s);
|
|
|
|
|
// System.out.println(s / 1000);
|
|
|
|
|
|
|
|
|
|
HttpResponse execute = get.setReadTimeout(10000).execute(); |
|
|
|
|
String body = execute.body(); |
|
|
|
|
System.out.println(body); |
|
|
|
|
|
|
|
|
|
// String url = "https://portal.sfygroup.com/reporthome/rest/loadingHeader/all?_dc=1739871711195&page=1&start=0&limit=100&filtersRaw=[{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-11\",\"operator\":\">=\",\"sql\":null},{\"id\":null,\"property\":\"A.DEAL_DATE\",\"value\":\"2025-02-19\",\"operator\":\"<\",\"sql\":null}]";
|
|
|
|
|
//// // 发起http请求 获取返回的数据 走get请求
|
|
|
|
|
////
|
|
|
|
|
////
|
|
|
|
|
////
|
|
|
|
|
// Map<String, String> heads = new HashMap<>();
|
|
|
|
|
// heads.put("Content-Type", "application/json;charset=UTF-8");
|
|
|
|
|
//// heads.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36");
|
|
|
|
|
//// heads.put("Host", "portal.sfygroup.com");
|
|
|
|
|
//// heads.put("Accept", "*/*");
|
|
|
|
|
//
|
|
|
|
|
// heads.put("Cookie", init());
|
|
|
|
|
//// heads.put("Referer", "http://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp");
|
|
|
|
|
// HttpRequest get = HttpUtil.createGet(url).addHeaders(heads);
|
|
|
|
|
//// String s = HttpUtil.get(url);
|
|
|
|
|
//// System.out.println(s);
|
|
|
|
|
//
|
|
|
|
|
// HttpResponse execute = get.setReadTimeout(10000).execute();
|
|
|
|
|
// String body = execute.body();
|
|
|
|
|
// System.out.println(body);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// init();
|
|
|
|
@ -37,18 +232,181 @@ public class SpiderDataJob {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String init() { |
|
|
|
|
/** |
|
|
|
|
* 获取账号的cookis |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private String buildCookies() { |
|
|
|
|
String o = map.get("cookie"); |
|
|
|
|
if(StringUtil.isBlank(o)){ |
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp"; |
|
|
|
|
HttpRequest get = HttpUtil.createGet(url); |
|
|
|
|
HttpResponse execute = get.execute(); |
|
|
|
|
String cookie = execute.getCookieStr(); |
|
|
|
|
map.put("cookie", cookie); |
|
|
|
|
o=cookie; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return o; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过车次获取下面的订单 |
|
|
|
|
* {"total":10000,"result": |
|
|
|
|
* [{"id":null,"createdBy":null,"created":null,"lastUpdated":null,"lastUpdatedBy":null,"rowVersion":0,"tableName":null, |
|
|
|
|
* "deliveryHeaderId":"4846818","deliveryLineId":"2127467301","orderNumber":"P3516012400306-60","originalOrderNumber":null, |
|
|
|
|
* "packNumber":"1","itemNumber":"FS0118VA","itemDesc":"18mm收口板(VA)","colourCode":"708B","standrds":"907.0*50.0*18.0", |
|
|
|
|
* "quantity":1,"uomCode":"块","weight":0.5675,"volume":8.17E-4,"packType":"川小板件"}, |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JSONArray getCarOrders(String id) { |
|
|
|
|
JSONArray result = new JSONArray(); |
|
|
|
|
Long _dc_ = System.currentTimeMillis(); |
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/loadingLine/all?_dc=" + _dc_ + "&page=1&start=0&limit=10&filtersRaw=[{\"id\":\"headFilter\",\"property\":\"A.DELIVERY_HEADER_ID\",\"value\":\"" + id + "\",\"operator\":\"=\",\"sql\":null}]"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = getData(url); |
|
|
|
|
|
|
|
|
|
JSONArray temList = jsonObject.getJSONArray("result"); |
|
|
|
|
for (Object o : temList) { |
|
|
|
|
JSONObject jsonObject1 = (JSONObject) o; |
|
|
|
|
|
|
|
|
|
result.add(getOrderInfor(jsonObject1.getStr("orderNumber"))); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JSONObject getOrderInfor(String orderCode) { |
|
|
|
|
Long _dc_ = System.currentTimeMillis(); |
|
|
|
|
String url = "https://portal.sfygroup.com/portal/rest/sogalOrder/all?_dc="+_dc_+"&isSlave=true&methodName=orderQuery&maskPhone=true&page=1&start=0&limit=10&filtersRaw=[{\"id\":\"queryorderinfoFormorderNumberFilter\",\"property\":\"orderNumber\",\"value\":\""+orderCode+"\",\"operator\":\"=\",\"sql\":null}]"; |
|
|
|
|
// JSONObject jsonObject= getData(url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> heads = new HashMap<>(); |
|
|
|
|
heads.put("Content-Type", "application/json;charset=UTF-8"); |
|
|
|
|
heads.put("Cookie", buildBussiesCookies()); |
|
|
|
|
heads.put("Referer", "https://portal.sfygroup.com/portal/views/home.jsp"); |
|
|
|
|
HttpRequest get = HttpUtil.createGet(url).addHeaders(heads); |
|
|
|
|
HttpResponse execute = get.setReadTimeout(10000).execute(); |
|
|
|
|
String body = execute.body(); |
|
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(body); |
|
|
|
|
|
|
|
|
|
return jsonObject; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String buildBussiesCookies() { |
|
|
|
|
String s = map.get("buss_cookie"); |
|
|
|
|
if (StringUtil.isBlank(s)) { |
|
|
|
|
Map<String, Object> forms = new HashMap<>(); |
|
|
|
|
forms.put("j_username", "18166360906"); |
|
|
|
|
forms.put("j_password", "Sfy@147258369"); |
|
|
|
|
forms.put("j_validateCode", ""); |
|
|
|
|
forms.put("btnLogin", "登录"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String url = "https://portal.sfygroup.com/portal/j_spring_security_check"; |
|
|
|
|
HttpRequest get = HttpUtil.createPost(url); |
|
|
|
|
|
|
|
|
|
HttpResponse execute = get.form(forms).execute(); |
|
|
|
|
List<HttpCookie> cookies = execute.getCookies(); |
|
|
|
|
for (HttpCookie cookie : cookies) { |
|
|
|
|
if (cookie.getName().equals("JSESSIONID")) { |
|
|
|
|
|
|
|
|
|
if(cookie.getValue().contains(".")){ |
|
|
|
|
s=cookie.getValue().substring(0,cookie.getValue().indexOf(".")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s="JSESSIONID="+s+";username=18166360906;JSESSIONID="+s; |
|
|
|
|
map.put("buss_cookie", s); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONArray getOrderPackages(String orderCode) { |
|
|
|
|
|
|
|
|
|
JSONArray response = new JSONArray(); |
|
|
|
|
//获取订单对应的装箱单
|
|
|
|
|
Long _dc_ = System.currentTimeMillis(); |
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/orderPackHeader/all?_dc="+_dc_+"&page=1&start=0&limit=10000&filtersRaw=[{\"id\":\"headFilter\",\"property\":\"A.OE_HEADER_ID\",\"value\":\""+orderCode+"\",\"operator\":\"=\",\"sql\":null}]"; |
|
|
|
|
/** |
|
|
|
|
* {"total":10000,"result":[{"id":null,"createdBy":null,"created":null,"lastUpdated":null,"lastUpdatedBy":null,"rowVersion":0,"tableName":"SG_ORG_BALANCE","orderNumber":"P3516012400306-60", |
|
|
|
|
* "sourceOrderNumber":"P3516012400306-60","orderType":"CD_外部图纸单","deliveryDate":"2025-02-18 00:00:00", |
|
|
|
|
* "quotationDate":"2024-12-27 12:14:26","oeHeaderId":45757470,"organizationId":"141","customerNumber":"P351688","orderBrandCode":"1","orderBrand":"索菲亚品牌"}],"success":true} |
|
|
|
|
*/ |
|
|
|
|
JSONObject data = getData(url); |
|
|
|
|
JSONArray tempList = data.getJSONArray("result"); |
|
|
|
|
for (Object o : tempList) { |
|
|
|
|
JSONObject jsonObject = (JSONObject) o; |
|
|
|
|
String oeHeaderId = jsonObject.getStr("oeHeaderId"); |
|
|
|
|
url = "https://portal.sfygroup.com/reporthome/rest/orderPackLine/all?_dc="+_dc_+"&page=1&start=0&limit=10000&filtersRaw=[{\"id\":\"headFilter\",\"property\":\"A.OE_HEADER_ID\",\"value\":"+oeHeaderId+",\"operator\":\"=\",\"sql\":null}]"; |
|
|
|
|
JSONObject data1 = getData(url); |
|
|
|
|
/** |
|
|
|
|
* id null |
|
|
|
|
* createdBy null |
|
|
|
|
* created null |
|
|
|
|
* lastUpdated null |
|
|
|
|
* lastUpdatedBy null |
|
|
|
|
* rowVersion 0 |
|
|
|
|
* tableName null |
|
|
|
|
* lineId 2126787295 |
|
|
|
|
* oeHeaderId 45757470 |
|
|
|
|
* packNumber "1" |
|
|
|
|
* itemNumber "FL001" |
|
|
|
|
* nailFlag "N" |
|
|
|
|
* itemName "方形衣通(切割)(含胶条)" |
|
|
|
|
* standards "793.0*15.0*30.0" |
|
|
|
|
* quantity 1 |
|
|
|
|
* deliveryStatus "已发货" |
|
|
|
|
* deliveryDate "2025-02-18 00:00:00" |
|
|
|
|
* uomCode "支" |
|
|
|
|
* colourCode null |
|
|
|
|
* weight 0 |
|
|
|
|
* volume 0.00035700001171790063 |
|
|
|
|
* comments null |
|
|
|
|
* packType "川柜五金二" |
|
|
|
|
* tagNumber "PAA250211066684" |
|
|
|
|
*/ |
|
|
|
|
// 获取列表
|
|
|
|
|
JSONArray result = data1.getJSONArray("result"); |
|
|
|
|
response.addAll(result); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return response; |
|
|
|
|
|
|
|
|
|
String url = "https://portal.sfygroup.com/reporthome/rest/reporthome/reporthomeUI?username=18166360906&password=02a962f8b9dfdbe85ee37b3f9b99fd8fcb48e73a65c9009e92ab81c508dcdca261af7efc1644002d0f371e5001c30a8f&menuType=loadingheader/loadingheader.jsp"; |
|
|
|
|
HttpRequest get = HttpUtil.createGet(url); |
|
|
|
|
HttpResponse execute = get.execute(); |
|
|
|
|
String cookie = execute.getCookieStr(); |
|
|
|
|
System.out.println(cookie); |
|
|
|
|
return cookie; |
|
|
|
|
// String body = execute.body();
|
|
|
|
|
// System.out.println(body);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject getData(String url) { |
|
|
|
|
Map<String, String> heads = new HashMap<>(); |
|
|
|
|
heads.put("Content-Type", "application/json;charset=UTF-8"); |
|
|
|
|
heads.put("Cookie", buildCookies()); |
|
|
|
|
HttpRequest get = HttpUtil.createGet(url).addHeaders(heads); |
|
|
|
|
HttpResponse execute = get.setReadTimeout(10000).execute(); |
|
|
|
|
String body = execute.body(); |
|
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(body); |
|
|
|
|
return jsonObject; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|