| Line 54... |
Line 54... |
| 54 |
import java.text.SimpleDateFormat;
|
54 |
import java.text.SimpleDateFormat;
|
| 55 |
import java.util.ArrayList;
|
55 |
import java.util.ArrayList;
|
| 56 |
import java.util.Calendar;
|
56 |
import java.util.Calendar;
|
| 57 |
import java.util.Collections;
|
57 |
import java.util.Collections;
|
| 58 |
import java.util.Date;
|
58 |
import java.util.Date;
|
| - |
|
59 |
import java.util.HashMap;
|
| 59 |
import java.util.HashSet;
|
60 |
import java.util.HashSet;
|
| 60 |
import java.util.List;
|
61 |
import java.util.List;
|
| - |
|
62 |
import java.util.Map;
|
| 61 |
import java.util.Set;
|
63 |
import java.util.Set;
|
| 62 |
import java.util.concurrent.Callable;
|
64 |
import java.util.concurrent.Callable;
|
| 63 |
import java.util.concurrent.Executors;
|
65 |
import java.util.concurrent.Executors;
|
| 64 |
import java.util.concurrent.TimeUnit;
|
66 |
import java.util.concurrent.TimeUnit;
|
| 65 |
|
67 |
|
| Line 106... |
Line 108... |
| 106 |
private double cashAmount;
|
108 |
private double cashAmount;
|
| 107 |
private double cardAmount;
|
109 |
private double cardAmount;
|
| 108 |
private StoreOrderDetail storeOrderDetail;
|
110 |
private StoreOrderDetail storeOrderDetail;
|
| 109 |
//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
111 |
//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 110 |
private AmazonOrder amazonOrder = null;
|
112 |
private AmazonOrder amazonOrder = null;
|
| 111 |
private Provider provider;
|
113 |
private String providerName = "N/A";
|
| 112 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
114 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 113 |
|
115 |
|
| 114 |
public UserOrderInfoController() {
|
116 |
public UserOrderInfoController() {
|
| 115 |
super();
|
117 |
super();
|
| 116 |
setOfcancellableStates = new HashSet<OrderStatus>();
|
118 |
setOfcancellableStates = new HashSet<OrderStatus>();
|
| Line 120... |
Line 122... |
| 120 |
setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
|
122 |
setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
|
| 121 |
setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
|
123 |
setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
|
| 122 |
setOfcancellableStates.add(OrderStatus.ACCEPTED);
|
124 |
setOfcancellableStates.add(OrderStatus.ACCEPTED);
|
| 123 |
setOfcancellableStates.add(OrderStatus.BILLED);
|
125 |
setOfcancellableStates.add(OrderStatus.BILLED);
|
| 124 |
}
|
126 |
}
|
| 125 |
|
127 |
|
| - |
|
128 |
public static final Map<Long, String> providerNameMap = new HashMap<Long, String>() {
|
| - |
|
129 |
{
|
| - |
|
130 |
put(1l, "BlueDart");
|
| - |
|
131 |
put(2l, "Aramex");
|
| - |
|
132 |
put(3l, "Delhivery");
|
| - |
|
133 |
put(4l, "SelfPickup");
|
| - |
|
134 |
put(5l, "Runner");
|
| - |
|
135 |
put(6l, "RedExpress");
|
| - |
|
136 |
}
|
| - |
|
137 |
};
|
| - |
|
138 |
|
| 126 |
public String index() {
|
139 |
public String index() {
|
| 127 |
try {
|
140 |
try {
|
| 128 |
PaymentClient paymentServiceClient = new PaymentClient();
|
141 |
PaymentClient paymentServiceClient = new PaymentClient();
|
| 129 |
TransactionClient transactionServiceClient = new TransactionClient();
|
142 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 130 |
LogisticsClient logisticsServiceClient = new LogisticsClient();
|
143 |
LogisticsClient logisticsServiceClient = new LogisticsClient();
|
| Line 134... |
Line 147... |
| 134 |
try {
|
147 |
try {
|
| 135 |
amazonOrder = transactionServiceClient.getClient().getAmazonOrder(orderId);
|
148 |
amazonOrder = transactionServiceClient.getClient().getAmazonOrder(orderId);
|
| 136 |
} catch (Exception e) {
|
149 |
} catch (Exception e) {
|
| 137 |
log.error("No Amazon order found with orderId " + orderId, e);
|
150 |
log.error("No Amazon order found with orderId " + orderId, e);
|
| 138 |
}
|
151 |
}
|
| - |
|
152 |
if (order.getLogistics_provider_id() > 0) {
|
| 139 |
provider = logisticsServiceClient.getClient().getProvider(order.getLogistics_provider_id());
|
153 |
setProviderName(providerNameMap.get(order.getLogistics_provider_id()));
|
| - |
|
154 |
}
|
| 140 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
155 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 141 |
if(order.getSource() == 2) {
|
156 |
if(order.getSource() == 2) {
|
| 142 |
storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
|
157 |
storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
|
| 143 |
if(order.getStatus().getValue() == 15 || order.getStatus().getValue() == 34) {
|
158 |
if(order.getStatus().getValue() == 15 || order.getStatus().getValue() == 34) {
|
| 144 |
setCashAmount(storeOrderDetail.getCashRefundAmount());
|
159 |
setCashAmount(storeOrderDetail.getCashRefundAmount());
|
| Line 220... |
Line 235... |
| 220 |
} catch (UserContextException e) {
|
235 |
} catch (UserContextException e) {
|
| 221 |
log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
|
236 |
log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
|
| 222 |
} catch(CatalogServiceException csex) {
|
237 |
} catch(CatalogServiceException csex) {
|
| 223 |
log.error("Unable to get item details for itemId: " + order.getFreebieItemId(), csex);
|
238 |
log.error("Unable to get item details for itemId: " + order.getFreebieItemId(), csex);
|
| 224 |
}
|
239 |
}
|
| 225 |
catch (LogisticsServiceException e) {
|
- |
|
| 226 |
log.error("Unable to get provider for logictics provider id : " + order.getLogistics_provider_id(), e);
|
- |
|
| 227 |
}
|
- |
|
| 228 |
return INDEX;
|
240 |
return INDEX;
|
| 229 |
}
|
241 |
}
|
| 230 |
|
242 |
|
| 231 |
private boolean canEditOrderAddress() {
|
243 |
private boolean canEditOrderAddress() {
|
| 232 |
return false;
|
244 |
return false;
|
| Line 755... |
Line 767... |
| 755 |
|
767 |
|
| 756 |
public void setAmazonOrder(AmazonOrder amazonOrder) {
|
768 |
public void setAmazonOrder(AmazonOrder amazonOrder) {
|
| 757 |
this.amazonOrder = amazonOrder;
|
769 |
this.amazonOrder = amazonOrder;
|
| 758 |
}
|
770 |
}
|
| 759 |
|
771 |
|
| 760 |
public Provider getProvider() {
|
- |
|
| 761 |
return provider;
|
- |
|
| 762 |
}
|
- |
|
| 763 |
|
- |
|
| 764 |
public void setProvider(Provider provider) {
|
- |
|
| 765 |
this.provider = provider;
|
- |
|
| 766 |
}
|
- |
|
| 767 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
772 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 768 |
|
773 |
|
| - |
|
774 |
public void setProviderName(String providerName) {
|
| - |
|
775 |
this.providerName = providerName;
|
| - |
|
776 |
}
|
| - |
|
777 |
|
| - |
|
778 |
public String getProviderName() {
|
| - |
|
779 |
return providerName;
|
| - |
|
780 |
}
|
| - |
|
781 |
|
| - |
|
782 |
public static void main(String[] args) {
|
| - |
|
783 |
System.out.println(providerNameMap.get(5l));
|
| - |
|
784 |
System.out.println(providerNameMap.get(10l));
|
| - |
|
785 |
}
|
| - |
|
786 |
|
| 769 |
}
|
787 |
}
|
| 770 |
|
788 |
|