| 2674 |
vikas |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
| 4689 |
anupam.sin |
3 |
import in.shop2020.crm.Activity;
|
|
|
4 |
import in.shop2020.crm.ActivityType;
|
| 3578 |
mandeep.dh |
5 |
import in.shop2020.crm.SearchFilter;
|
|
|
6 |
import in.shop2020.crm.Ticket;
|
|
|
7 |
import in.shop2020.crm.TicketCategory;
|
| 4689 |
anupam.sin |
8 |
import in.shop2020.crm.TicketPriority;
|
| 3578 |
mandeep.dh |
9 |
import in.shop2020.crm.TicketStatus;
|
| 5845 |
mandeep.dh |
10 |
import in.shop2020.logistics.PickupStore;
|
| 2674 |
vikas |
11 |
import in.shop2020.model.v1.order.LineItem;
|
|
|
12 |
import in.shop2020.model.v1.order.Order;
|
| 3578 |
mandeep.dh |
13 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 4689 |
anupam.sin |
14 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 4142 |
mandeep.dh |
15 |
import in.shop2020.model.v1.user.Address;
|
| 4689 |
anupam.sin |
16 |
import in.shop2020.model.v1.user.UserContextException;
|
| 2728 |
vikas |
17 |
import in.shop2020.payments.Attribute;
|
|
|
18 |
import in.shop2020.payments.Constants;
|
| 2674 |
vikas |
19 |
import in.shop2020.payments.Payment;
|
| 2728 |
vikas |
20 |
import in.shop2020.payments.PaymentException;
|
| 4142 |
mandeep.dh |
21 |
import in.shop2020.payments.PaymentService.Client;
|
| 4689 |
anupam.sin |
22 |
import in.shop2020.serving.auth.CRMAuthorizingRealm;
|
| 3090 |
mandeep.dh |
23 |
import in.shop2020.serving.model.ShipmentUpdate;
|
| 5845 |
mandeep.dh |
24 |
import in.shop2020.serving.services.AramexTrackingService;
|
| 3090 |
mandeep.dh |
25 |
import in.shop2020.serving.services.BlueDartTrackingService;
|
| 5303 |
phani.kuma |
26 |
import in.shop2020.serving.services.DelhiveryTrackingService;
|
| 3578 |
mandeep.dh |
27 |
import in.shop2020.thrift.clients.CRMClient;
|
| 5845 |
mandeep.dh |
28 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 3128 |
rajveer |
29 |
import in.shop2020.thrift.clients.PaymentClient;
|
|
|
30 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 4142 |
mandeep.dh |
31 |
import in.shop2020.thrift.clients.UserClient;
|
| 3546 |
mandeep.dh |
32 |
import in.shop2020.utils.ModelUtils;
|
| 2674 |
vikas |
33 |
|
|
|
34 |
import java.util.ArrayList;
|
| 4416 |
mandeep.dh |
35 |
import java.util.Collections;
|
| 4689 |
anupam.sin |
36 |
import java.util.HashSet;
|
| 2674 |
vikas |
37 |
import java.util.List;
|
| 4689 |
anupam.sin |
38 |
import java.util.Set;
|
| 4416 |
mandeep.dh |
39 |
import java.util.concurrent.Callable;
|
|
|
40 |
import java.util.concurrent.Executors;
|
|
|
41 |
import java.util.concurrent.TimeUnit;
|
| 2674 |
vikas |
42 |
|
| 4689 |
anupam.sin |
43 |
import net.htmlparser.jericho.Source;
|
|
|
44 |
|
| 5845 |
mandeep.dh |
45 |
import org.apache.commons.lang.StringUtils;
|
| 2674 |
vikas |
46 |
import org.apache.log4j.Logger;
|
| 2728 |
vikas |
47 |
import org.apache.thrift.TException;
|
| 4142 |
mandeep.dh |
48 |
import org.apache.thrift.transport.TTransportException;
|
| 2674 |
vikas |
49 |
|
|
|
50 |
/**
|
|
|
51 |
* @author vikas
|
| 3578 |
mandeep.dh |
52 |
*
|
| 2674 |
vikas |
53 |
*/
|
|
|
54 |
@SuppressWarnings("serial")
|
|
|
55 |
public class UserOrderInfoController extends BaseController {
|
| 3578 |
mandeep.dh |
56 |
private static Logger log = Logger.getLogger(Class.class);
|
| 3090 |
mandeep.dh |
57 |
private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
|
| 4710 |
anupam.sin |
58 |
private static AramexTrackingService aramexTrackingService = new AramexTrackingService();
|
| 5303 |
phani.kuma |
59 |
private static DelhiveryTrackingService delhiveryTrackingService = new DelhiveryTrackingService();
|
| 3090 |
mandeep.dh |
60 |
|
| 4142 |
mandeep.dh |
61 |
private long orderId;
|
|
|
62 |
private Order order;
|
|
|
63 |
private List<Payment> payments;
|
| 4416 |
mandeep.dh |
64 |
private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
|
| 4142 |
mandeep.dh |
65 |
private Long codTicketId;
|
|
|
66 |
private List<Address> addresses;
|
| 4689 |
anupam.sin |
67 |
private Set<OrderStatus> setOfcancellableStates;
|
|
|
68 |
private String cancellationInitiator;
|
|
|
69 |
private String cancelReason;
|
|
|
70 |
private String body;
|
| 2674 |
vikas |
71 |
|
| 3578 |
mandeep.dh |
72 |
public UserOrderInfoController() {
|
| 2674 |
vikas |
73 |
super();
|
| 4689 |
anupam.sin |
74 |
setOfcancellableStates = new HashSet<OrderStatus>();
|
|
|
75 |
setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
|
|
|
76 |
setOfcancellableStates.add(OrderStatus.INVENTORY_LOW);
|
|
|
77 |
setOfcancellableStates.add(OrderStatus.LOW_INV_PO_RAISED);
|
|
|
78 |
setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
|
|
|
79 |
setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
|
|
|
80 |
setOfcancellableStates.add(OrderStatus.ACCEPTED);
|
|
|
81 |
setOfcancellableStates.add(OrderStatus.BILLED);
|
| 2674 |
vikas |
82 |
}
|
|
|
83 |
|
| 4689 |
anupam.sin |
84 |
public String index() {
|
|
|
85 |
try {
|
|
|
86 |
PaymentClient paymentServiceClient = new PaymentClient();
|
|
|
87 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 3090 |
mandeep.dh |
88 |
|
| 3499 |
mandeep.dh |
89 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
| 2674 |
vikas |
90 |
|
| 4689 |
anupam.sin |
91 |
payments = paymentServiceClient.getClient()
|
|
|
92 |
.getPaymentForTxnId(order.getTransactionId());
|
| 3090 |
mandeep.dh |
93 |
|
| 3578 |
mandeep.dh |
94 |
|
| 4689 |
anupam.sin |
95 |
|
|
|
96 |
// Spawning a thread to capture shipment updates from Bluedart
|
|
|
97 |
// This is done to ensure that response from Crm web app is sent
|
|
|
98 |
// within given time limits. Also, we wont be affected in the cases
|
|
|
99 |
// where bluedart site is down or slow
|
|
|
100 |
Executors.newSingleThreadExecutor().invokeAll(Collections.singletonList(new Callable<Boolean>() {
|
|
|
101 |
public Boolean call() throws Exception {
|
| 4710 |
anupam.sin |
102 |
if (order.getLogistics_provider_id() == 1)
|
|
|
103 |
shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
104 |
else if (order.getLogistics_provider_id() == 2) {
|
|
|
105 |
shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
106 |
}
|
| 5303 |
phani.kuma |
107 |
else if (order.getLogistics_provider_id() == 3) {
|
|
|
108 |
shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
109 |
}
|
| 4710 |
anupam.sin |
110 |
else {
|
| 5845 |
mandeep.dh |
111 |
shipmentUpdates = new ArrayList<ShipmentUpdate>();
|
| 4710 |
anupam.sin |
112 |
log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
|
|
|
113 |
}
|
| 4689 |
anupam.sin |
114 |
return true;
|
|
|
115 |
}
|
|
|
116 |
}), 5, TimeUnit.SECONDS);
|
|
|
117 |
|
|
|
118 |
if (order.isCod() && OrderStatus.COD_VERIFICATION_PENDING.equals(order.getStatus())) {
|
|
|
119 |
populateCODTicketId(order.getCustomer_id());
|
| 4416 |
mandeep.dh |
120 |
}
|
|
|
121 |
|
| 4689 |
anupam.sin |
122 |
if (canEditOrderAddress()) {
|
|
|
123 |
userContextServiceClient = new UserClient().getClient();
|
|
|
124 |
addresses = userContextServiceClient.getAllAddressesForUser(order.getCustomer_id());
|
|
|
125 |
}
|
| 3578 |
mandeep.dh |
126 |
|
| 4689 |
anupam.sin |
127 |
} catch (TTransportException e) {
|
|
|
128 |
log.error("Unable to create thrift Client", e);
|
|
|
129 |
} catch (TransactionServiceException e) {
|
|
|
130 |
addActionError("Invalid order id or no order selected.");
|
|
|
131 |
} catch (TException e) {
|
|
|
132 |
log.error("Unable to get thrift Client", e);
|
|
|
133 |
} catch (PaymentException e) {
|
|
|
134 |
log.error("Unable to get payments for transctionId : " + order.getTransactionId(), e);
|
|
|
135 |
} catch (InterruptedException e) {
|
|
|
136 |
log.error("Thread was interrupted", e);
|
|
|
137 |
} catch (UserContextException e) {
|
|
|
138 |
log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
|
| 4142 |
mandeep.dh |
139 |
}
|
|
|
140 |
return INDEX;
|
| 2674 |
vikas |
141 |
}
|
|
|
142 |
|
| 4142 |
mandeep.dh |
143 |
private boolean canEditOrderAddress() {
|
|
|
144 |
return false;
|
|
|
145 |
}
|
|
|
146 |
|
| 3578 |
mandeep.dh |
147 |
private void populateCODTicketId(long customerId) {
|
|
|
148 |
try {
|
|
|
149 |
SearchFilter searchFilter = new SearchFilter();
|
|
|
150 |
searchFilter.setTicketCategory(TicketCategory.COD_VERIFICATION);
|
|
|
151 |
searchFilter.setTicketStatuses(new ArrayList<TicketStatus>());
|
|
|
152 |
searchFilter.getTicketStatuses().add(TicketStatus.OPEN);
|
|
|
153 |
searchFilter.getTicketStatuses().add(TicketStatus.REOPEN);
|
|
|
154 |
searchFilter.setCustomerId(customerId);
|
|
|
155 |
crmServiceClient = new CRMClient().getClient();
|
|
|
156 |
List<Ticket> tickets = crmServiceClient.getTickets(searchFilter);
|
|
|
157 |
if (tickets != null && !tickets.isEmpty()) {
|
|
|
158 |
codTicketId = tickets.get(0).getId();
|
|
|
159 |
}
|
|
|
160 |
} catch (TException e) {
|
|
|
161 |
log.error("Error fetching tickets for customerId: " + customerId, e);
|
|
|
162 |
}
|
|
|
163 |
}
|
|
|
164 |
|
| 4689 |
anupam.sin |
165 |
public String markOrderForCancellation() {
|
|
|
166 |
try{
|
|
|
167 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
168 |
log.info("URL = " + request.getRequestURI());
|
|
|
169 |
log.info("Initiator = " + request.getParameter("cancellationInitiator"));
|
|
|
170 |
log.info("orderId = " + request.getParameter("orderId"));
|
|
|
171 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
|
|
172 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
|
|
173 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
|
|
174 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|
|
|
175 |
Ticket ticket = new Ticket();
|
|
|
176 |
String plainTextbody = "";
|
|
|
177 |
if(body!=null && !body.isEmpty()){
|
|
|
178 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
|
|
179 |
}
|
|
|
180 |
ticket.setDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
|
|
|
181 |
ticket.setCreatorId(creatorId);
|
|
|
182 |
ticket.setStatus(TicketStatus.OPEN);
|
|
|
183 |
ticket.setPriority(TicketPriority.HIGH);
|
|
|
184 |
ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
|
|
|
185 |
ticket.setOrderId(orderId);
|
|
|
186 |
|
|
|
187 |
Activity activity = new Activity();
|
|
|
188 |
activity.setDescription("Creating Ticket");
|
|
|
189 |
activity.setType(ActivityType.OTHER);
|
|
|
190 |
activity.setTicketPriority(TicketPriority.HIGH);
|
|
|
191 |
activity.setTicketStatus(TicketStatus.OPEN);
|
|
|
192 |
activity.setCreatorId(creatorId);
|
|
|
193 |
activity.setTicketDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
|
|
|
194 |
activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
|
|
|
195 |
|
|
|
196 |
ticket.setCustomerId(order.getCustomer_id());
|
|
|
197 |
activity.setCustomerId(order.getCustomer_id());
|
|
|
198 |
ticket.setCustomerName(order.getCustomer_name());
|
|
|
199 |
activity.setCustomerName(order.getCustomer_name());
|
|
|
200 |
ticket.setCustomerEmailId(order.getCustomer_email());
|
|
|
201 |
activity.setCustomerEmailId(order.getCustomer_email());
|
|
|
202 |
ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
|
|
203 |
activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
|
|
204 |
|
|
|
205 |
crmServiceClient = new CRMClient().getClient();
|
|
|
206 |
crmServiceClient.insertTicket(ticket, activity);
|
|
|
207 |
}
|
|
|
208 |
else if (cancellationInitiator.equals("INTERNAL")) {
|
|
|
209 |
String plainTextbody = "";
|
|
|
210 |
if(body!=null && !body.isEmpty()){
|
|
|
211 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
|
|
212 |
}
|
|
|
213 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
|
|
214 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|
|
|
215 |
Ticket ticket = new Ticket();
|
|
|
216 |
ticket.setDescription("Creating ticket for Order Cancellation due to Low inventory");
|
|
|
217 |
ticket.setCreatorId(creatorId);
|
|
|
218 |
ticket.setStatus(TicketStatus.CLOSED);
|
|
|
219 |
ticket.setPriority(TicketPriority.MEDIUM);
|
|
|
220 |
ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
|
|
|
221 |
ticket.setOrderId(orderId);
|
|
|
222 |
|
|
|
223 |
Activity activity = new Activity();
|
|
|
224 |
activity.setDescription("Creating Ticket");
|
|
|
225 |
activity.setType(ActivityType.OTHER);
|
|
|
226 |
activity.setTicketPriority(TicketPriority.MEDIUM);
|
|
|
227 |
activity.setTicketStatus(TicketStatus.CLOSED);
|
|
|
228 |
activity.setCreatorId(creatorId);
|
|
|
229 |
activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
|
|
|
230 |
activity.setTicketDescription("Creating ticket for Order Cancellation due to Low inventory");
|
|
|
231 |
|
|
|
232 |
ticket.setCustomerId(order.getCustomer_id());
|
|
|
233 |
activity.setCustomerId(order.getCustomer_id());
|
|
|
234 |
ticket.setCustomerName(order.getCustomer_name());
|
|
|
235 |
activity.setCustomerName(order.getCustomer_name());
|
|
|
236 |
ticket.setCustomerEmailId(order.getCustomer_email());
|
|
|
237 |
activity.setCustomerEmailId(order.getCustomer_email());
|
|
|
238 |
ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
|
|
239 |
activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
|
|
240 |
|
|
|
241 |
crmServiceClient = new CRMClient().getClient();
|
|
|
242 |
crmServiceClient.insertTicket(ticket, activity);
|
|
|
243 |
}
|
|
|
244 |
} catch(Exception e) {
|
|
|
245 |
log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
|
|
|
246 |
}
|
|
|
247 |
return index();
|
|
|
248 |
}
|
|
|
249 |
|
|
|
250 |
public boolean canOrderBeCancelled() {
|
|
|
251 |
if (setOfcancellableStates.contains(order.getStatus())) {
|
|
|
252 |
return true;
|
|
|
253 |
}
|
|
|
254 |
return false;
|
|
|
255 |
}
|
|
|
256 |
|
| 4142 |
mandeep.dh |
257 |
public String getPaymentGateway(Payment payment) {
|
|
|
258 |
String gatewayName = "";
|
| 3578 |
mandeep.dh |
259 |
|
| 4142 |
mandeep.dh |
260 |
try {
|
|
|
261 |
Client paymentServiceClient = new PaymentClient().getClient();
|
|
|
262 |
gatewayName = paymentServiceClient.getPaymentGateway(payment.getGatewayId()).getName();
|
|
|
263 |
} catch (TTransportException e) {
|
|
|
264 |
} catch (PaymentException e) {
|
|
|
265 |
} catch (TException e) {
|
| 2674 |
vikas |
266 |
}
|
| 4142 |
mandeep.dh |
267 |
|
|
|
268 |
return gatewayName;
|
| 2674 |
vikas |
269 |
}
|
|
|
270 |
|
| 4142 |
mandeep.dh |
271 |
public String getProductName(LineItem lineItem) {
|
|
|
272 |
String name = ModelUtils.extractProductNameFromLineItem(lineItem);
|
|
|
273 |
|
| 4146 |
mandeep.dh |
274 |
if (lineItem.getColor() != null && !lineItem.getColor().isEmpty()) {
|
| 4142 |
mandeep.dh |
275 |
name += "(" + lineItem.getColor() + ")";
|
| 2674 |
vikas |
276 |
}
|
| 4142 |
mandeep.dh |
277 |
|
|
|
278 |
return name;
|
| 2674 |
vikas |
279 |
}
|
|
|
280 |
|
| 4142 |
mandeep.dh |
281 |
public int convertDouble(double value) {
|
|
|
282 |
return (int)value;
|
| 2674 |
vikas |
283 |
}
|
| 3578 |
mandeep.dh |
284 |
|
| 5845 |
mandeep.dh |
285 |
public String getShippingAddressOfStore(long storeId) {
|
|
|
286 |
try {
|
|
|
287 |
in.shop2020.logistics.LogisticsService.Client client = new LogisticsClient().getClient();
|
|
|
288 |
PickupStore store = client.getPickupStore(storeId);
|
|
|
289 |
return StringUtils.join(new String[] {
|
|
|
290 |
store.getName(),
|
|
|
291 |
store.getLine1(),
|
|
|
292 |
store.getLine2(),
|
|
|
293 |
store.getPin(),
|
|
|
294 |
store.getCity(),
|
|
|
295 |
store.getState(),
|
|
|
296 |
store.getPhone()}, ",");
|
|
|
297 |
} catch (Exception e) {
|
|
|
298 |
return "";
|
|
|
299 |
}
|
|
|
300 |
}
|
|
|
301 |
|
| 4142 |
mandeep.dh |
302 |
public String getAddress(Order order) {
|
|
|
303 |
return ModelUtils.extractAddressFromOrder(order);
|
|
|
304 |
}
|
|
|
305 |
|
| 2728 |
vikas |
306 |
public String getPaymentMethod(List<Attribute> paymentAttributes) {
|
|
|
307 |
String paymentMethod = null;
|
| 3578 |
mandeep.dh |
308 |
if (paymentAttributes == null || paymentAttributes.isEmpty()) {
|
| 2728 |
vikas |
309 |
return "N/A";
|
|
|
310 |
}
|
| 3578 |
mandeep.dh |
311 |
for (Attribute a : paymentAttributes) {
|
|
|
312 |
if ("payMethod".equals(a.getName())) {
|
| 2728 |
vikas |
313 |
paymentMethod = Constants.PAYMENT_METHOD.get(a.getValue());
|
|
|
314 |
break;
|
|
|
315 |
}
|
|
|
316 |
}
|
|
|
317 |
return paymentMethod != null ? paymentMethod : "N/A";
|
|
|
318 |
}
|
| 2674 |
vikas |
319 |
|
|
|
320 |
public void setOrderId(String orderId) {
|
|
|
321 |
try {
|
|
|
322 |
this.orderId = Long.parseLong(orderId);
|
| 3578 |
mandeep.dh |
323 |
} catch (NumberFormatException e) {
|
| 2674 |
vikas |
324 |
log.error(e);
|
|
|
325 |
}
|
|
|
326 |
}
|
|
|
327 |
|
| 4142 |
mandeep.dh |
328 |
public List<Payment> getPayments() {
|
|
|
329 |
return payments;
|
| 2674 |
vikas |
330 |
}
|
|
|
331 |
|
| 3090 |
mandeep.dh |
332 |
public List<ShipmentUpdate> getShipmentUpdates() {
|
|
|
333 |
return shipmentUpdates;
|
|
|
334 |
}
|
|
|
335 |
|
|
|
336 |
public void setShipmentUpdates(List<ShipmentUpdate> shipmentUpdates) {
|
|
|
337 |
this.shipmentUpdates = shipmentUpdates;
|
|
|
338 |
}
|
| 3499 |
mandeep.dh |
339 |
|
|
|
340 |
public Order getOrder() {
|
|
|
341 |
return order;
|
|
|
342 |
}
|
|
|
343 |
|
|
|
344 |
public void setOrder(Order order) {
|
|
|
345 |
this.order = order;
|
|
|
346 |
}
|
| 3578 |
mandeep.dh |
347 |
|
|
|
348 |
public Long getCodTicketId() {
|
|
|
349 |
return codTicketId;
|
|
|
350 |
}
|
|
|
351 |
|
|
|
352 |
public void setCodTicketId(Long codTicketId) {
|
|
|
353 |
this.codTicketId = codTicketId;
|
|
|
354 |
}
|
| 4142 |
mandeep.dh |
355 |
|
|
|
356 |
public List<Address> getAddresses() {
|
|
|
357 |
return addresses;
|
|
|
358 |
}
|
|
|
359 |
|
|
|
360 |
public void setAddresses(List<Address> addresses) {
|
|
|
361 |
this.addresses = addresses;
|
|
|
362 |
}
|
| 4241 |
anupam.sin |
363 |
|
|
|
364 |
public String getOrderStatusDescription(Order order) {
|
|
|
365 |
String status = order.getStatus().getDescription();
|
|
|
366 |
|
|
|
367 |
if (order.getStatus() == OrderStatus.DELIVERY_SUCCESS) {
|
|
|
368 |
status = "Completed";
|
|
|
369 |
}
|
|
|
370 |
|
|
|
371 |
return status;
|
|
|
372 |
}
|
| 4689 |
anupam.sin |
373 |
|
|
|
374 |
public String getCancellationInitiator() {
|
|
|
375 |
return cancellationInitiator;
|
|
|
376 |
}
|
|
|
377 |
|
|
|
378 |
public void setCancellationInitiator(String cancellationInitiator) {
|
|
|
379 |
this.cancellationInitiator = cancellationInitiator;
|
|
|
380 |
}
|
|
|
381 |
|
|
|
382 |
public String getCancelReason() {
|
|
|
383 |
return cancelReason;
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
public void setCancelReason(String cancelReason) {
|
|
|
387 |
this.cancelReason = cancelReason;
|
|
|
388 |
}
|
|
|
389 |
|
|
|
390 |
public String getBody() {
|
|
|
391 |
return body;
|
|
|
392 |
}
|
|
|
393 |
|
|
|
394 |
public void setBody(String body) {
|
|
|
395 |
this.body = body;
|
|
|
396 |
}
|
| 2674 |
vikas |
397 |
}
|