| Line 186... |
Line 186... |
| 186 |
try {
|
186 |
try {
|
| 187 |
shipDate= istFormatter.parse(order.getShipByDate());
|
187 |
shipDate= istFormatter.parse(order.getShipByDate());
|
| 188 |
} catch (ParseException e) {
|
188 |
} catch (ParseException e) {
|
| 189 |
logger.error("Could not parse order ship date from file " , e);
|
189 |
logger.error("Could not parse order ship date from file " , e);
|
| 190 |
e.printStackTrace();
|
190 |
e.printStackTrace();
|
| 191 |
sb.append(order.getSuborderId() + "Could not parse ship date" + " " + "\n");
|
191 |
sb.append(order.getSuborderId() + " Could not parse ship date" + " " + "\n");
|
| 192 |
continue;
|
192 |
continue;
|
| 193 |
}
|
193 |
}
|
| 194 |
Calendar time = Calendar.getInstance();
|
194 |
Calendar time = Calendar.getInstance();
|
| 195 |
t_order.setPromised_shipping_time(shipDate.getTime());
|
195 |
t_order.setPromised_shipping_time(shipDate.getTime());
|
| 196 |
t_order.setExpected_shipping_time(shipDate.getTime());
|
196 |
t_order.setExpected_shipping_time(shipDate.getTime());
|
| Line 198... |
Line 198... |
| 198 |
t_order.setPromised_delivery_time(time.getTimeInMillis());
|
198 |
t_order.setPromised_delivery_time(time.getTimeInMillis());
|
| 199 |
t_order.setExpected_delivery_time(time.getTimeInMillis());
|
199 |
t_order.setExpected_delivery_time(time.getTimeInMillis());
|
| 200 |
System.out.println("Dates set in transaction");
|
200 |
System.out.println("Dates set in transaction");
|
| 201 |
} catch(Exception e) {
|
201 |
} catch(Exception e) {
|
| 202 |
logger.error("Error in updating Shipping or Delivery Time for suborderid " + order.getSuborderId());
|
202 |
logger.error("Error in updating Shipping or Delivery Time for suborderid " + order.getSuborderId());
|
| 203 |
sb.append(order.getSuborderId() + "Could not update delivery time" + " " + "\n");
|
203 |
sb.append(order.getSuborderId() + " Could not update delivery time" + " " + "\n");
|
| 204 |
continue;
|
204 |
continue;
|
| 205 |
}
|
205 |
}
|
| 206 |
InventoryService.Client inventoryClient = null;
|
206 |
InventoryService.Client inventoryClient = null;
|
| 207 |
Warehouse fulfillmentWarehouse= null;
|
207 |
Warehouse fulfillmentWarehouse= null;
|
| 208 |
try {
|
208 |
try {
|
| Line 220... |
Line 220... |
| 220 |
VendorItemPricing vendorItemPricing = inventoryClient.getItemPricing(lineItem.getItem_id(), fulfillmentWarehouse.getVendor().getId());
|
220 |
VendorItemPricing vendorItemPricing = inventoryClient.getItemPricing(lineItem.getItem_id(), fulfillmentWarehouse.getVendor().getId());
|
| 221 |
t_order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
|
221 |
t_order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
|
| 222 |
t_order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
|
222 |
t_order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
|
| 223 |
} catch (InventoryServiceException e) {
|
223 |
} catch (InventoryServiceException e) {
|
| 224 |
logger.error("Error connecting inventory service for suborderid " + order.getSuborderId());
|
224 |
logger.error("Error connecting inventory service for suborderid " + order.getSuborderId());
|
| 225 |
sb.append(order.getSuborderId() + "Inventory Service Exception" + " " + "\n");
|
225 |
sb.append(order.getSuborderId() + " Inventory Service Exception" + " " + "\n");
|
| 226 |
continue;
|
226 |
continue;
|
| 227 |
} catch (TTransportException e) {
|
227 |
} catch (TTransportException e) {
|
| 228 |
logger.error("Transport Exception with Inventory Service for suborderid " + order.getSuborderId() , e);
|
228 |
logger.error("Transport Exception with Inventory Service for suborderid " + order.getSuborderId() , e);
|
| 229 |
sb.append(order.getSuborderId() + "Transport Exception with Inventory Service" + " " + "\n");
|
229 |
sb.append(order.getSuborderId() + " Transport Exception with Inventory Service" + " " + "\n");
|
| 230 |
continue;
|
230 |
continue;
|
| 231 |
} catch (TException e) {
|
231 |
} catch (TException e) {
|
| 232 |
logger.error("Exception with Inventory Service for suborderid " + order.getSuborderId() , e);
|
232 |
logger.error("Exception with Inventory Service for suborderid " + order.getSuborderId() , e);
|
| 233 |
sb.append(order.getSuborderId() + "Exception in Inventory Service" + " " + "\n");
|
233 |
sb.append(order.getSuborderId() + " Exception in Inventory Service" + " " + "\n");
|
| 234 |
continue;
|
234 |
continue;
|
| 235 |
}
|
235 |
}
|
| 236 |
if(order.getCourier().equalsIgnoreCase(FIRSTFLIGHT)) {
|
236 |
if(order.getCourier().equalsIgnoreCase(FIRSTFLIGHT)) {
|
| 237 |
t_order.setLogistics_provider_id(12);
|
237 |
t_order.setLogistics_provider_id(12);
|
| 238 |
} else if(order.getCourier().equalsIgnoreCase(DELHIVERY)) {
|
238 |
} else if(order.getCourier().equalsIgnoreCase(DELHIVERY)) {
|
| Line 333... |
Line 333... |
| 333 |
logger.error(order.getSuborderId() + " Could not create transaction " , e);
|
333 |
logger.error(order.getSuborderId() + " Could not create transaction " , e);
|
| 334 |
sb.append(order.getSuborderId() + " Could not create transaction" +"\n");
|
334 |
sb.append(order.getSuborderId() + " Could not create transaction" +"\n");
|
| 335 |
continue;
|
335 |
continue;
|
| 336 |
} catch (TException e) {
|
336 |
} catch (TException e) {
|
| 337 |
logger.error("Problem with transaction service while creating transaction", e);
|
337 |
logger.error("Problem with transaction service while creating transaction", e);
|
| 338 |
sb.append(order.getSuborderId() + "Transaction Service Exception could not create transaction" +"\n");
|
338 |
sb.append(order.getSuborderId() + " Transaction Service Exception could not create transaction" +"\n");
|
| 339 |
continue;
|
339 |
continue;
|
| 340 |
}
|
340 |
}
|
| 341 |
createPayment(user, (new Long(subOrderId)).toString(),lineItem.getTotal_price());
|
341 |
createPayment(user, (new Long(subOrderId)).toString(),lineItem.getTotal_price());
|
| 342 |
Transaction transaction = null;
|
342 |
Transaction transaction = null;
|
| 343 |
try {
|
343 |
try {
|