| Line 3495... |
Line 3495... |
| 3495 |
Set<String> airwayBillNo = orders.stream().map(x -> x.getAirwayBillNumber()).collect(Collectors.toSet());
|
3495 |
Set<String> airwayBillNo = orders.stream().map(x -> x.getAirwayBillNumber()).collect(Collectors.toSet());
|
| 3496 |
|
3496 |
|
| 3497 |
LOGGER.info("airwayBill" + airwayBillNo);
|
3497 |
LOGGER.info("airwayBill" + airwayBillNo);
|
| 3498 |
//String url = "https://api.bluedart.com/servlet/RoutingServlet?handler=tnt&action=custawbquery";
|
3498 |
//String url = "https://api.bluedart.com/servlet/RoutingServlet?handler=tnt&action=custawbquery";
|
| 3499 |
String url = "https://apigateway.bluedart.com/in/transportation/tracking/v1/shipment?scan=1";
|
3499 |
String url = "https://apigateway.bluedart.com/in/transportation/tracking/v1/shipment?scan=1";
|
| 3500 |
|
3500 |
// String dataheader="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzdWJqZWN0LXN1YmplY3QiLCJhdWQiOlsiYXVkaWVuY2UxIiwiYXVkaWVuY2UyIl0sIkNsaWVudFNlY3JldCI6IkV5SGp5OFNVcmtGNzZVc2ciLCJpc3MiOiJ1cm46XC9cL2FwaWdlZS1lZGdlLUpXVC1wb2xpY3ktdGVzdCIsIkNsaWVudElEIjoiRWJGSEdrazdOODU2R0dJZjlkclUzZ3BuRjZLbGNxUnUiLCJleHAiOjE3MDQzNjA1OTQsImlhdCI6MTcwNDI3NDE5NCwianRpIjoiNGVjZjZjMjEtYTE4MC00OGMwLThkYzUtNTM4OWRlYWFlM2JmIn0.miLZjZkqvgpr4N3eDEeahSXwK0jJSKuRMdnZRTXoF98";
|
| 3501 |
String response = restClient.get(url + "&loginid=" + loginId + "&awb=awb&numbers=" + String.join(",", airwayBillNo) + "&format=xml&lickey=" + licencekey + "&verno=1.3", null, null);
|
3501 |
String response = restClient.get(url + "&loginid=" + loginId + "&awb=awb&numbers=" + String.join(",", airwayBillNo) + "&format=xml&lickey=" + licencekey + "&verno=1.3", null, null);
|
| 3502 |
|
- |
|
| - |
|
3502 |
LOGGER.info("API Response: " + response);
|
| 3503 |
JSONObject updateJson = XML.toJSONObject(response);
|
3503 |
JSONObject updateJson = XML.toJSONObject(response);
|
| 3504 |
|
3504 |
|
| 3505 |
JSONObject shipmentData = updateJson.getJSONObject("ShipmentData");
|
3505 |
JSONObject shipmentData = updateJson.getJSONObject("ShipmentData");
|
| 3506 |
Object shipmentObject = shipmentData.get("Shipment");
|
3506 |
Object shipmentObject = shipmentData.get("Shipment");
|
| 3507 |
|
3507 |
|
| Line 3516... |
Line 3516... |
| 3516 |
String status = jsonObject.getString("Status");
|
3516 |
String status = jsonObject.getString("Status");
|
| 3517 |
|
3517 |
|
| 3518 |
if (status.equals("SHIPMENT DELIVERED")) {
|
3518 |
if (status.equals("SHIPMENT DELIVERED")) {
|
| 3519 |
airwaybillStatus.add(awb.toString());
|
3519 |
airwaybillStatus.add(awb.toString());
|
| 3520 |
}
|
3520 |
}
|
| - |
|
3521 |
System.out.println("AWB: " + awb + ", Status: " + status);
|
| 3521 |
|
3522 |
|
| 3522 |
}
|
3523 |
}
|
| 3523 |
} else {
|
3524 |
} else {
|
| 3524 |
JSONObject jsonObject = (JSONObject) shipmentObject;
|
3525 |
JSONObject jsonObject = (JSONObject) shipmentObject;
|
| 3525 |
Number awb = jsonObject.getNumber("WaybillNo");
|
3526 |
Number awb = jsonObject.getNumber("WaybillNo");
|
| 3526 |
String status = jsonObject.getString("Status");
|
3527 |
String status = jsonObject.getString("Status");
|
| 3527 |
|
3528 |
|
| 3528 |
if (status.equals("SHIPMENT DELIVERED")) {
|
3529 |
if (status.equals("SHIPMENT DELIVERED")) {
|
| 3529 |
airwaybillStatus.add(awb.toString());
|
3530 |
airwaybillStatus.add(awb.toString());
|
| 3530 |
}
|
3531 |
}
|
| - |
|
3532 |
System.out.println("AWB: " + awb + ", Status: " + status);
|
| 3531 |
|
3533 |
|
| 3532 |
}
|
3534 |
}
|
| 3533 |
|
3535 |
|
| 3534 |
LOGGER.info("airwaybillStatus" + airwaybillStatus);
|
3536 |
LOGGER.info("airwaybillStatus" + airwaybillStatus);
|
| 3535 |
|
3537 |
|