| Line 10... |
Line 10... |
| 10 |
import in.shop2020.crm.TicketStatus;
|
10 |
import in.shop2020.crm.TicketStatus;
|
| 11 |
import in.shop2020.logistics.PickupStore;
|
11 |
import in.shop2020.logistics.PickupStore;
|
| 12 |
import in.shop2020.model.v1.catalog.CatalogService;
|
12 |
import in.shop2020.model.v1.catalog.CatalogService;
|
| 13 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
13 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| 14 |
import in.shop2020.model.v1.catalog.Item;
|
14 |
import in.shop2020.model.v1.catalog.Item;
|
| - |
|
15 |
import in.shop2020.model.v1.order.HotspotStore;
|
| 15 |
import in.shop2020.model.v1.order.LineItem;
|
16 |
import in.shop2020.model.v1.order.LineItem;
|
| 16 |
import in.shop2020.model.v1.order.Order;
|
17 |
import in.shop2020.model.v1.order.Order;
|
| 17 |
import in.shop2020.model.v1.order.OrderStatus;
|
18 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 18 |
import in.shop2020.model.v1.order.StoreOrderDetail;
|
19 |
import in.shop2020.model.v1.order.StoreOrderDetail;
|
| 19 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
20 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| Line 121... |
Line 122... |
| 121 |
TransactionClient transactionServiceClient = new TransactionClient();
|
122 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 122 |
|
123 |
|
| 123 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
124 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
| 124 |
if(order.getSource() == 2) {
|
125 |
if(order.getSource() == 2) {
|
| 125 |
storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
|
126 |
storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
|
| - |
|
127 |
if(order.getStatus().getValue() == 15 || order.getStatus().getValue() == 34) {
|
| - |
|
128 |
setCashAmount(storeOrderDetail.getCashRefundAmount());
|
| - |
|
129 |
setCardAmount(storeOrderDetail.getCardRefundAmount());
|
| - |
|
130 |
} else {
|
| 126 |
setCashAmount(storeOrderDetail.getCashAmount());
|
131 |
setCashAmount(storeOrderDetail.getCashAmount());
|
| 127 |
setCardAmount(storeOrderDetail.getCardAmount());
|
132 |
setCardAmount(storeOrderDetail.getCardAmount());
|
| - |
|
133 |
}
|
| 128 |
}
|
134 |
}
|
| 129 |
if(order.getFreebieItemId()>0) {
|
135 |
if(order.getFreebieItemId()>0) {
|
| 130 |
CatalogService.Client catalogClient = new CatalogClient().getClient();
|
136 |
CatalogService.Client catalogClient = new CatalogClient().getClient();
|
| 131 |
Item item = catalogClient.getItem(order.getFreebieItemId());
|
137 |
Item item = catalogClient.getItem(order.getFreebieItemId());
|
| 132 |
freebieItem = item.getBrand() + " " + item.getModelName() + " " + item.getModelNumber() + " " + item.getColor();
|
138 |
freebieItem = item.getBrand() + " " + item.getModelName() + " " + item.getModelNumber() + " " + item.getColor();
|
| Line 237... |
Line 243... |
| 237 |
if (order.getSource() == 2) {
|
243 |
if (order.getSource() == 2) {
|
| 238 |
String plainTextbody = "";
|
244 |
String plainTextbody = "";
|
| 239 |
if(body!=null && !body.isEmpty()){
|
245 |
if(body!=null && !body.isEmpty()){
|
| 240 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
246 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
| 241 |
}
|
247 |
}
|
| - |
|
248 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
| - |
|
249 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
| - |
|
250 |
transactionServiceClient.getClient().markOrderCancellationRequestConfirmed(orderId);
|
| - |
|
251 |
}
|
| 242 |
transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
|
252 |
transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
|
| 243 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
253 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
| 244 |
}
|
254 |
}
|
| 245 |
|
255 |
|
| 246 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
256 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
| Line 483... |
Line 493... |
| 483 |
log.error("Unable to update address for orderId : " + orderId + "and address : " +
|
493 |
log.error("Unable to update address for orderId : " + orderId + "and address : " +
|
| 484 |
line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
|
494 |
line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
|
| 485 |
}
|
495 |
}
|
| 486 |
return null;
|
496 |
return null;
|
| 487 |
}
|
497 |
}
|
| - |
|
498 |
|
| - |
|
499 |
public String getStoreDetails(long storeId) {
|
| - |
|
500 |
try {
|
| - |
|
501 |
TransactionClient tcl = new TransactionClient();
|
| - |
|
502 |
HotspotStore store = tcl.getClient().getHotspotStore(storeId, "");
|
| - |
|
503 |
return store.getHotspotId() + " - " + store.getCity();
|
| - |
|
504 |
} catch (Exception e) {
|
| - |
|
505 |
log.error("Unable to get hostspotStore for id : " + storeId, e);
|
| - |
|
506 |
}
|
| - |
|
507 |
return "N/A";
|
| - |
|
508 |
}
|
| 488 |
|
509 |
|
| 489 |
public Address getShippingAddress(Order order) {
|
510 |
public Address getShippingAddress(Order order) {
|
| 490 |
Address address = new Address();
|
511 |
Address address = new Address();
|
| 491 |
address.setLine1(order.getCustomer_address1());
|
512 |
address.setLine1(order.getCustomer_address1());
|
| 492 |
address.setLine2(order.getCustomer_address2());
|
513 |
address.setLine2(order.getCustomer_address2());
|