| Line 16... |
Line 16... |
| 16 |
|
16 |
|
| 17 |
|
17 |
|
| 18 |
|
18 |
|
| 19 |
public class Test {
|
19 |
public class Test {
|
| 20 |
public static void main (String[] args) throws Exception {
|
20 |
public static void main (String[] args) throws Exception {
|
| - |
|
21 |
String a = null;
|
| - |
|
22 |
try {
|
| - |
|
23 |
a.charAt(0);
|
| - |
|
24 |
} catch(Exception e){
|
| - |
|
25 |
System.out.println(" e.getMessage() - " + e.getMessage());
|
| - |
|
26 |
System.out.println("e.toString() - " + e.toString());
|
| - |
|
27 |
System.out.println("e.getLocalizedMessage() - " + e.getLocalizedMessage());
|
| - |
|
28 |
}
|
| - |
|
29 |
}
|
| - |
|
30 |
|
| - |
|
31 |
|
| - |
|
32 |
public static void assignAwbs() throws Exception{
|
| 21 |
TransactionClient client = new TransactionClient("support_transaction_service_server_host", "transaction_service_server_port");
|
33 |
TransactionClient client = new TransactionClient("support_transaction_service_server_host", "transaction_service_server_port");
|
| 22 |
Client c = client.getClient();
|
34 |
Client c = client.getClient();
|
| 23 |
List<Order> allOrdersWithMissingAwb = c.getOrderForAirwayBillNo(null);
|
35 |
List<Order> allOrdersWithMissingAwb = c.getOrderForAirwayBillNo(null);
|
| 24 |
Map<String, List<Order>> logisticsTxnOrdersMap = new HashMap<String, List<Order>>();
|
36 |
Map<String, List<Order>> logisticsTxnOrdersMap = new HashMap<String, List<Order>>();
|
| 25 |
for(Order o: allOrdersWithMissingAwb) {
|
37 |
for(Order o: allOrdersWithMissingAwb) {
|
| Line 34... |
Line 46... |
| 34 |
Order o = entry.getValue().get(0);
|
46 |
Order o = entry.getValue().get(0);
|
| 35 |
Provider logisticsProvider = ProviderFactory.getProvider(2);
|
47 |
Provider logisticsProvider = ProviderFactory.getProvider(2);
|
| 36 |
if(o.getLogistics_provider_id()==2 && o.getStatus().equals(OrderStatus.BILLED)) {
|
48 |
if(o.getLogistics_provider_id()==2 && o.getStatus().equals(OrderStatus.BILLED)) {
|
| 37 |
String airwayBill = logisticsProvider.getAirwayBillNo(entry.getValue());
|
49 |
String airwayBill = logisticsProvider.getAirwayBillNo(entry.getValue());
|
| 38 |
c.updateMasterOrderAWB(entry.getKey(), airwayBill);
|
50 |
c.updateMasterOrderAWB(entry.getKey(), airwayBill);
|
| 39 |
System.out.println("Updated logisticsTransactionId - " + entry.getKey() + " with airway bill - " + airwayBill);
|
51 |
System.out.println("Updated logisticsTransactionId - " + entry.getKey() + " with airway bill - " + airwayBill + "count ");
|
| 40 |
} else {
|
52 |
} else {
|
| 41 |
System.out.println("Ignored logisticsTransactionId - " + entry.getKey() + "Prodider id - " + o.getLogistics_provider_id() + " Status - " + o.getStatusDescription());
|
53 |
System.out.println("Ignored logisticsTransactionId - " + entry.getKey() + "Prodider id - " + o.getLogistics_provider_id() + " Status - " + o.getStatusDescription());
|
| 42 |
}
|
54 |
}
|
| 43 |
}
|
55 |
}
|
| 44 |
}
|
56 |
}
|