| Line 433... |
Line 433... |
| 433 |
context.put("userId", userId);
|
433 |
context.put("userId", userId);
|
| 434 |
context.put("itemDetails", itemDetails);
|
434 |
context.put("itemDetails", itemDetails);
|
| 435 |
|
435 |
|
| 436 |
return getHtmlFromVelocity("templates/"+templateFile, context);
|
436 |
return getHtmlFromVelocity("templates/"+templateFile, context);
|
| 437 |
}
|
437 |
}
|
| 438 |
|
- |
|
| 439 |
|
438 |
|
| 440 |
|
439 |
|
| 441 |
|
- |
|
| 442 |
public String getOrderDetailsHtml(long orderId) {
|
440 |
public String getOrderDetailsHtml(long orderId) {
|
| 443 |
String htmlString = "";
|
441 |
String htmlString = "";
|
| 444 |
VelocityContext context = new VelocityContext();
|
442 |
VelocityContext context = new VelocityContext();
|
| 445 |
String templateFile = "templates/orderdetails.vm";
|
443 |
String templateFile = "templates/orderdetails.vm";
|
| 446 |
TransactionServiceClient transactionServiceClient = null;
|
- |
|
| 447 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
|
- |
|
| 448 |
Order order = null;
|
444 |
Order order = null;
|
| 449 |
Date orderedOn = null, deliveryEstimate = null;
|
445 |
Date orderedOn = null, deliveryEstimate = null;
|
| - |
|
446 |
Provider provider = null;
|
| 450 |
try{
|
447 |
try{
|
| 451 |
transactionServiceClient = new TransactionServiceClient();
|
448 |
TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
|
| 452 |
orderClient = transactionServiceClient.getClient();
|
449 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = transactionServiceClient.getClient();
|
| 453 |
order = orderClient.getOrder(orderId);
|
450 |
order = orderClient.getOrder(orderId);
|
| 454 |
orderedOn = new Date(order.getCreated_timestamp());
|
451 |
orderedOn = new Date(order.getCreated_timestamp());
|
| 455 |
deliveryEstimate = new Date(order.getExpected_delivery_time());
|
452 |
deliveryEstimate = new Date(order.getExpected_delivery_time());
|
| - |
|
453 |
|
| - |
|
454 |
if(order.getLogistics_provider_id() != 0){
|
| - |
|
455 |
LogisticsServiceClient logisticsServiceClient = new LogisticsServiceClient();
|
| - |
|
456 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
| - |
|
457 |
provider = logisticsClient.getProvider(order.getLogistics_provider_id());
|
| - |
|
458 |
}
|
| 456 |
}catch (Exception e){
|
459 |
}catch (Exception e){
|
| 457 |
|
460 |
|
| 458 |
}
|
461 |
}
|
| 459 |
|
462 |
|
| 460 |
SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
|
463 |
SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
|
| 461 |
SimpleDateFormat dateformat1 = new SimpleDateFormat("dd/MM/yyyy");
|
464 |
SimpleDateFormat dateformat1 = new SimpleDateFormat("dd/MM/yyyy");
|
| 462 |
context.put("order", order);
|
465 |
context.put("order", order);
|
| 463 |
context.put("orderedOn", dateformat.format(orderedOn));
|
466 |
context.put("orderedOn", dateformat.format(orderedOn));
|
| 464 |
context.put("deliveryEstimate", dateformat1.format(deliveryEstimate));
|
467 |
context.put("deliveryEstimate", dateformat1.format(deliveryEstimate));
|
| - |
|
468 |
if(provider!=null){
|
| - |
|
469 |
context.put("providerName", provider.getName());
|
| 465 |
|
470 |
}
|
| 466 |
|
471 |
|
| 467 |
htmlString = getHtmlFromVelocity(templateFile, context);
|
472 |
htmlString = getHtmlFromVelocity(templateFile, context);
|
| 468 |
return htmlString;
|
473 |
return htmlString;
|
| 469 |
}
|
474 |
}
|
| 470 |
|
475 |
|
| 471 |
public String getMyaccountDetailsHtml(long userId) {
|
476 |
public String getMyaccountDetailsHtml(long userId) {
|