Subversion Repositories SmartDukaan

Rev

Rev 7190 | Rev 7221 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2674 vikas 1
package in.shop2020.serving.controllers;
2
 
7065 kshitij.so 3
import in.shop2020.config.ConfigException;
4689 anupam.sin 4
import in.shop2020.crm.Activity;
5
import in.shop2020.crm.ActivityType;
3578 mandeep.dh 6
import in.shop2020.crm.SearchFilter;
7
import in.shop2020.crm.Ticket;
8
import in.shop2020.crm.TicketCategory;
4689 anupam.sin 9
import in.shop2020.crm.TicketPriority;
3578 mandeep.dh 10
import in.shop2020.crm.TicketStatus;
5845 mandeep.dh 11
import in.shop2020.logistics.PickupStore;
7190 amar.kumar 12
import in.shop2020.model.v1.catalog.CatalogService;
13
import in.shop2020.model.v1.catalog.CatalogServiceException;
14
import in.shop2020.model.v1.catalog.Item;
2674 vikas 15
import in.shop2020.model.v1.order.LineItem;
16
import in.shop2020.model.v1.order.Order;
3578 mandeep.dh 17
import in.shop2020.model.v1.order.OrderStatus;
4689 anupam.sin 18
import in.shop2020.model.v1.order.TransactionServiceException;
4142 mandeep.dh 19
import in.shop2020.model.v1.user.Address;
4689 anupam.sin 20
import in.shop2020.model.v1.user.UserContextException;
2728 vikas 21
import in.shop2020.payments.Attribute;
22
import in.shop2020.payments.Constants;
2674 vikas 23
import in.shop2020.payments.Payment;
2728 vikas 24
import in.shop2020.payments.PaymentException;
4142 mandeep.dh 25
import in.shop2020.payments.PaymentService.Client;
4689 anupam.sin 26
import in.shop2020.serving.auth.CRMAuthorizingRealm;
3090 mandeep.dh 27
import in.shop2020.serving.model.ShipmentUpdate;
5845 mandeep.dh 28
import in.shop2020.serving.services.AramexTrackingService;
3090 mandeep.dh 29
import in.shop2020.serving.services.BlueDartTrackingService;
5303 phani.kuma 30
import in.shop2020.serving.services.DelhiveryTrackingService;
7200 kshitij.so 31
import in.shop2020.serving.services.RedExpressTrackingService;
3578 mandeep.dh 32
import in.shop2020.thrift.clients.CRMClient;
7190 amar.kumar 33
import in.shop2020.thrift.clients.CatalogClient;
6322 amar.kumar 34
import in.shop2020.thrift.clients.HelperClient;
5845 mandeep.dh 35
import in.shop2020.thrift.clients.LogisticsClient;
3128 rajveer 36
import in.shop2020.thrift.clients.PaymentClient;
37
import in.shop2020.thrift.clients.TransactionClient;
4142 mandeep.dh 38
import in.shop2020.thrift.clients.UserClient;
7065 kshitij.so 39
import in.shop2020.thrift.clients.config.ConfigClient;
3546 mandeep.dh 40
import in.shop2020.utils.ModelUtils;
6322 amar.kumar 41
import in.shop2020.warehouse.WarehouseService;
2674 vikas 42
 
6322 amar.kumar 43
import java.io.BufferedInputStream;
44
import java.io.File;
45
import java.io.FileInputStream;
46
import java.io.FileWriter;
47
import java.io.IOException;
48
import java.io.InputStream;
6912 anupam.sin 49
import java.text.SimpleDateFormat;
2674 vikas 50
import java.util.ArrayList;
6912 anupam.sin 51
import java.util.Calendar;
4416 mandeep.dh 52
import java.util.Collections;
6912 anupam.sin 53
import java.util.Date;
4689 anupam.sin 54
import java.util.HashSet;
2674 vikas 55
import java.util.List;
4689 anupam.sin 56
import java.util.Set;
4416 mandeep.dh 57
import java.util.concurrent.Callable;
58
import java.util.concurrent.Executors;
59
import java.util.concurrent.TimeUnit;
2674 vikas 60
 
6322 amar.kumar 61
import javax.servlet.ServletOutputStream;
62
 
4689 anupam.sin 63
import net.htmlparser.jericho.Source;
64
 
5845 mandeep.dh 65
import org.apache.commons.lang.StringUtils;
2674 vikas 66
import org.apache.log4j.Logger;
2728 vikas 67
import org.apache.thrift.TException;
4142 mandeep.dh 68
import org.apache.thrift.transport.TTransportException;
2674 vikas 69
 
70
/**
71
 * @author vikas
3578 mandeep.dh 72
 * 
2674 vikas 73
 */
74
@SuppressWarnings("serial")
75
public class UserOrderInfoController extends BaseController {
3578 mandeep.dh 76
    private static Logger                  log                     = Logger.getLogger(Class.class);
3090 mandeep.dh 77
    private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
4710 anupam.sin 78
    private static AramexTrackingService aramexTrackingService     = new AramexTrackingService();
5303 phani.kuma 79
    private static DelhiveryTrackingService delhiveryTrackingService     = new DelhiveryTrackingService();
7200 kshitij.so 80
    private static RedExpressTrackingService redexpressTrackingService = new RedExpressTrackingService();
3090 mandeep.dh 81
 
4142 mandeep.dh 82
    private long                 orderId;
83
    private Order                order;
84
    private List<Payment>        payments;
4416 mandeep.dh 85
    private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
4142 mandeep.dh 86
    private Long                 codTicketId;
87
    private List<Address>        addresses;
4689 anupam.sin 88
    private Set<OrderStatus>     setOfcancellableStates;
89
    private String               cancellationInitiator;
90
    private String               cancelReason;
91
    private String               body;
6985 anupam.sin 92
    private String               line1;
93
    private String               line2;
94
    private String               city;
95
    private String               state;
96
    private String               pin;
7190 amar.kumar 97
    private String				 freebieItem;
98
    private String				 dealText;
99
    private String 				 parentOrderIdForFreebieOrder;
100
    private String				 freebieOrderId;
2674 vikas 101
 
3578 mandeep.dh 102
    public UserOrderInfoController() {
2674 vikas 103
        super();
4689 anupam.sin 104
        setOfcancellableStates = new HashSet<OrderStatus>();
105
        setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
106
        setOfcancellableStates.add(OrderStatus.INVENTORY_LOW);
107
        setOfcancellableStates.add(OrderStatus.LOW_INV_PO_RAISED);
108
        setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
109
        setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
110
        setOfcancellableStates.add(OrderStatus.ACCEPTED);
111
        setOfcancellableStates.add(OrderStatus.BILLED);
2674 vikas 112
    }
113
 
4689 anupam.sin 114
    public String index() {
115
        try {
116
            PaymentClient paymentServiceClient = new PaymentClient();
117
            TransactionClient transactionServiceClient = new TransactionClient();
3090 mandeep.dh 118
 
3499 mandeep.dh 119
            order = transactionServiceClient.getClient().getOrder(orderId);
7190 amar.kumar 120
            if(order.getFreebieItemId()>0) {
121
            	CatalogService.Client catalogClient = new CatalogClient().getClient();
122
            	Item item = catalogClient.getItem(order.getFreebieItemId());
123
            	freebieItem = item.getBrand() + " " + item.getModelName() + " " + item.getModelNumber() + " " + item.getColor();
124
            }
125
 
126
            if(order.getLineitems().get(0).getDealText()!=null && !order.getLineitems().get(0).getDealText().isEmpty()) {
127
            	dealText = order.getLineitems().get(0).getDealText();
128
            }
129
            List<in.shop2020.model.v1.order.Attribute> attributes = 
130
            	transactionServiceClient.getClient().getAllAttributesForOrderId(orderId);
131
 
132
            for(in.shop2020.model.v1.order.Attribute attribute: attributes){
133
            	if(attribute.getName().equals("parentOrderIdForFreebie")){
134
            		parentOrderIdForFreebieOrder = attribute.getValue();
135
            	} else if (attribute.getName().equals("freebieOrderId")){
136
            		freebieOrderId = attribute.getValue();
137
            	}
138
            }
139
 
4689 anupam.sin 140
            payments = paymentServiceClient.getClient()
141
            .getPaymentForTxnId(order.getTransactionId());
3090 mandeep.dh 142
 
3578 mandeep.dh 143
 
4689 anupam.sin 144
 
145
            // Spawning a thread to capture shipment updates from Bluedart
146
            // This is done to ensure that response from Crm web app is sent
147
            // within given time limits. Also, we wont be affected in the cases 
148
            // where bluedart site is down or slow
149
            Executors.newSingleThreadExecutor().invokeAll(Collections.singletonList(new Callable<Boolean>() {
150
                public Boolean call() throws Exception {
4710 anupam.sin 151
                    if (order.getLogistics_provider_id() == 1)
152
                        shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
153
                    else if (order.getLogistics_provider_id() == 2) {
154
                        shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
155
                    }
5303 phani.kuma 156
                    else if (order.getLogistics_provider_id() == 3) {
157
                        shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
158
                    }
7200 kshitij.so 159
                    else if (order.getLogistics_provider_id() == 6) {
160
                        shipmentUpdates = redexpressTrackingService.getUpdates(order.getAirwaybill_no());
161
                    }
4710 anupam.sin 162
                    else {
5845 mandeep.dh 163
                        shipmentUpdates = new ArrayList<ShipmentUpdate>();
4710 anupam.sin 164
                        log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
165
                    }
4689 anupam.sin 166
                    return true;
167
                }
168
            }), 5, TimeUnit.SECONDS);
169
 
170
            if (order.isCod() && OrderStatus.COD_VERIFICATION_PENDING.equals(order.getStatus())) {
171
                populateCODTicketId(order.getCustomer_id());
4416 mandeep.dh 172
            }
173
 
4689 anupam.sin 174
            if (canEditOrderAddress()) {
175
                userContextServiceClient = new UserClient().getClient();
176
                addresses = userContextServiceClient.getAllAddressesForUser(order.getCustomer_id());
177
            }
3578 mandeep.dh 178
 
4689 anupam.sin 179
        } catch (TTransportException e) {
180
            log.error("Unable to create thrift Client", e);
181
        } catch (TransactionServiceException e) {
182
            addActionError("Invalid order id or no order selected.");
183
        } catch (TException e) {
184
            log.error("Unable to get thrift Client", e);
185
        } catch (PaymentException e) {
186
            log.error("Unable to get payments for transctionId : " + order.getTransactionId(), e);
187
        } catch (InterruptedException e) {
188
            log.error("Thread was interrupted", e);
189
        } catch (UserContextException e) {
190
            log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
7190 amar.kumar 191
        } catch(CatalogServiceException csex) {
192
        	log.error("Unable to get item details for itemId: " + order.getFreebieItemId(), csex);
4142 mandeep.dh 193
        }
194
        return INDEX;
2674 vikas 195
    }
196
 
4142 mandeep.dh 197
    private boolean canEditOrderAddress() {
198
        return false;
199
    }
200
 
3578 mandeep.dh 201
    private void populateCODTicketId(long customerId) {
202
        try {
203
            SearchFilter searchFilter = new SearchFilter();
204
            searchFilter.setTicketCategory(TicketCategory.COD_VERIFICATION);
205
            searchFilter.setTicketStatuses(new ArrayList<TicketStatus>());
206
            searchFilter.getTicketStatuses().add(TicketStatus.OPEN);
207
            searchFilter.getTicketStatuses().add(TicketStatus.REOPEN);
208
            searchFilter.setCustomerId(customerId);
209
            crmServiceClient = new CRMClient().getClient();
210
            List<Ticket> tickets = crmServiceClient.getTickets(searchFilter);
211
            if (tickets != null && !tickets.isEmpty()) {
212
                codTicketId = tickets.get(0).getId();
213
            }
214
        } catch (TException e) {
215
            log.error("Error fetching tickets for customerId: " + customerId, e);
216
        }
217
    }
218
 
4689 anupam.sin 219
    public String markOrderForCancellation() {
220
        try{
221
            TransactionClient transactionServiceClient = new TransactionClient();
222
            log.info("URL = " + request.getRequestURI());
223
            log.info("Initiator = " + request.getParameter("cancellationInitiator"));
224
            log.info("orderId = " + request.getParameter("orderId"));
225
            if (cancellationInitiator.equals("CUSTOMER")) {
226
                order = transactionServiceClient.getClient().getOrder(orderId);
227
                transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
228
                long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
229
                Ticket ticket = new Ticket();
230
                String plainTextbody = "";
231
                if(body!=null && !body.isEmpty()){
232
                    plainTextbody = new Source(body).getTextExtractor().toString();
233
                }
234
                ticket.setDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
235
                ticket.setCreatorId(creatorId);
236
                ticket.setStatus(TicketStatus.OPEN);
237
                ticket.setPriority(TicketPriority.HIGH);
238
                ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
239
                ticket.setOrderId(orderId);
240
 
241
                Activity activity = new Activity();
242
                activity.setDescription("Creating Ticket");
243
                activity.setType(ActivityType.OTHER);
244
                activity.setTicketPriority(TicketPriority.HIGH);
245
                activity.setTicketStatus(TicketStatus.OPEN);
246
                activity.setCreatorId(creatorId);
247
                activity.setTicketDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
248
                activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
249
 
250
                ticket.setCustomerId(order.getCustomer_id());
251
                activity.setCustomerId(order.getCustomer_id());
252
                ticket.setCustomerName(order.getCustomer_name());
253
                activity.setCustomerName(order.getCustomer_name());
254
                ticket.setCustomerEmailId(order.getCustomer_email());
255
                activity.setCustomerEmailId(order.getCustomer_email());
256
                ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
257
                activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
258
 
259
                crmServiceClient = new CRMClient().getClient();
260
                crmServiceClient.insertTicket(ticket, activity);
261
            } 
262
            else if (cancellationInitiator.equals("INTERNAL")) {
263
                String plainTextbody = "";
264
                if(body!=null && !body.isEmpty()){
265
                    plainTextbody = new Source(body).getTextExtractor().toString();
266
                }
267
                transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
268
                long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
269
                Ticket ticket = new Ticket();
270
                ticket.setDescription("Creating ticket for Order Cancellation due to Low inventory");
271
                ticket.setCreatorId(creatorId);
272
                ticket.setStatus(TicketStatus.CLOSED);
273
                ticket.setPriority(TicketPriority.MEDIUM);
274
                ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
275
                ticket.setOrderId(orderId);
276
 
277
                Activity activity = new Activity();
278
                activity.setDescription("Creating Ticket");
279
                activity.setType(ActivityType.OTHER);
280
                activity.setTicketPriority(TicketPriority.MEDIUM);
281
                activity.setTicketStatus(TicketStatus.CLOSED);
282
                activity.setCreatorId(creatorId);
283
                activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
284
                activity.setTicketDescription("Creating ticket for Order Cancellation due to Low inventory");
285
 
286
                ticket.setCustomerId(order.getCustomer_id());
287
                activity.setCustomerId(order.getCustomer_id());
288
                ticket.setCustomerName(order.getCustomer_name());
289
                activity.setCustomerName(order.getCustomer_name());
290
                ticket.setCustomerEmailId(order.getCustomer_email());
291
                activity.setCustomerEmailId(order.getCustomer_email());
292
                ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
293
                activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
294
 
295
                crmServiceClient = new CRMClient().getClient();
296
                crmServiceClient.insertTicket(ticket, activity);
297
            }
298
        } catch(Exception e) {
299
            log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
300
        }
301
        return index();
302
    }
303
 
7200 kshitij.so 304
    public void getOrderConfirmationMail() throws IOException, TException, ConfigException, TransactionServiceException {
305
    	TransactionClient transactionServiceClient = new TransactionClient();
306
    	order = transactionServiceClient.getClient().getOrder(orderId);
307
    	long source = order.getTransactionId();
7065 kshitij.so 308
    	String helper_service_server=ConfigClient.getClient().get("helper_service_server");
309
    	String helper_service_server_port=ConfigClient.getClient().get("helper_service_server_port");
310
    	HelperClient helperClient = new HelperClient(helper_service_server,helper_service_server_port);
7200 kshitij.so 311
    	String mail = helperClient.getClient().getOrderConfirmationMail(source);
6322 amar.kumar 312
    	File file = new File("temp");
7200 kshitij.so 313
 
6322 amar.kumar 314
    	FileWriter writer = new FileWriter(file);
315
    	writer.append(mail);
316
    	writer.close();
317
 
318
    	byte[] buffer = new byte[(int)file.length()];
319
        InputStream input = null;
320
    	try {
321
            int totalBytesRead = 0;
322
            input = new BufferedInputStream(new FileInputStream(file));
323
            while(totalBytesRead < buffer.length){
324
                int bytesRemaining = buffer.length - totalBytesRead;
325
                int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining); 
326
                if (bytesRead > 0){
327
                    totalBytesRead = totalBytesRead + bytesRead;
328
                }
329
            }
330
        }
331
        finally {
332
            input.close();
333
            file.delete();
334
        }
335
 
336
 
337
    	response.setHeader("Content-disposition", "inline; filename=" + "OrderDetail_"+orderId );
338
 
339
        ServletOutputStream sos;
340
        try {
341
            sos = response.getOutputStream();
342
            sos.write(buffer);
343
            sos.flush();
344
        } catch (IOException e) {
345
            System.out.println("Unable to stream the manifest file");
346
        }   
347
    }
348
 
4689 anupam.sin 349
    public boolean canOrderBeCancelled() {
350
        if (setOfcancellableStates.contains(order.getStatus())) {
351
            return true;
352
        }
353
        return false;
354
    }
355
 
4142 mandeep.dh 356
    public String getPaymentGateway(Payment payment) {
357
        String gatewayName = "";
3578 mandeep.dh 358
 
4142 mandeep.dh 359
        try {
360
            Client paymentServiceClient = new PaymentClient().getClient();
361
            gatewayName = paymentServiceClient.getPaymentGateway(payment.getGatewayId()).getName();
362
        } catch (TTransportException e) {
363
        } catch (PaymentException e) {
364
        } catch (TException e) {
2674 vikas 365
        }
4142 mandeep.dh 366
 
367
        return gatewayName;
2674 vikas 368
    }
369
 
4142 mandeep.dh 370
    public String getProductName(LineItem lineItem) {
371
        String name = ModelUtils.extractProductNameFromLineItem(lineItem);
372
 
4146 mandeep.dh 373
        if (lineItem.getColor() != null && !lineItem.getColor().isEmpty()) {
4142 mandeep.dh 374
            name += "(" + lineItem.getColor() + ")";
2674 vikas 375
        }
4142 mandeep.dh 376
 
377
        return name;
2674 vikas 378
    }
379
 
4142 mandeep.dh 380
    public int convertDouble(double value) {
381
        return (int)value;
2674 vikas 382
    }
6912 anupam.sin 383
 
384
    public String getInsuranceExpiryDate(long DeliveryDate) {
385
        if (DeliveryDate == 0) {
386
            return "N/A";
387
        }
388
        Calendar cal = Calendar.getInstance();
389
        cal.setTimeInMillis(DeliveryDate);
390
        cal.add(Calendar.YEAR, 1);
6960 anupam.sin 391
        SimpleDateFormat sdf = new SimpleDateFormat("dd MMM, yyyy");
392
        return sdf.format(cal.getTime());
6912 anupam.sin 393
    }
3578 mandeep.dh 394
 
5845 mandeep.dh 395
    public String getShippingAddressOfStore(long storeId) {
396
        try {
397
            in.shop2020.logistics.LogisticsService.Client client = new LogisticsClient().getClient();
398
            PickupStore store = client.getPickupStore(storeId);
399
            return StringUtils.join(new String[] {
400
                    store.getName(),
401
                    store.getLine1(),
402
                    store.getLine2(),
403
                    store.getPin(),
404
                    store.getCity(),
405
                    store.getState(),
406
                    store.getPhone()}, ",");
407
        } catch (Exception e) {
408
            return "";
409
        }
410
    }
411
 
4142 mandeep.dh 412
    public String getAddress(Order order) {
413
        return ModelUtils.extractAddressFromOrder(order);
414
    }
6985 anupam.sin 415
 
416
    public String changeShippingAddress() {
417
        try {
418
            TransactionClient transactionServiceClient = new TransactionClient();
419
            transactionServiceClient.getClient().changeShippingAddress(orderId, line1, line2, city, state, pin);
420
        } catch(Exception e) {
421
            log.error("Unable to update address for orderId : " + orderId + "and address : " + 
422
                    line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
423
        }
424
        return null;
425
    }
426
 
427
    public Address getShippingAddress(Order order) {
428
        Address address = new Address();
429
        address.setLine1(order.getCustomer_address1());
430
        address.setLine2(order.getCustomer_address2());
431
        address.setCity(order.getCustomer_city());
432
        address.setState(order.getCustomer_state());
433
        address.setPin(order.getCustomer_pincode());
434
        return address;
435
    }
4142 mandeep.dh 436
 
2728 vikas 437
    public String getPaymentMethod(List<Attribute> paymentAttributes) {
438
        String paymentMethod = null;
3578 mandeep.dh 439
        if (paymentAttributes == null || paymentAttributes.isEmpty()) {
2728 vikas 440
            return "N/A";
441
        }
3578 mandeep.dh 442
        for (Attribute a : paymentAttributes) {
443
            if ("payMethod".equals(a.getName())) {
2728 vikas 444
                paymentMethod = Constants.PAYMENT_METHOD.get(a.getValue());
445
                break;
446
            }
447
        }
448
        return paymentMethod != null ? paymentMethod : "N/A";
449
    }
2674 vikas 450
 
451
    public void setOrderId(String orderId) {
452
        try {
453
            this.orderId = Long.parseLong(orderId);
3578 mandeep.dh 454
        } catch (NumberFormatException e) {
2674 vikas 455
            log.error(e);
456
        }
457
    }
458
 
4142 mandeep.dh 459
    public List<Payment> getPayments() {
460
        return payments;
2674 vikas 461
    }
462
 
3090 mandeep.dh 463
    public List<ShipmentUpdate> getShipmentUpdates() {
464
        return shipmentUpdates;
465
    }
466
 
467
    public void setShipmentUpdates(List<ShipmentUpdate> shipmentUpdates) {
468
        this.shipmentUpdates = shipmentUpdates;
469
    }
3499 mandeep.dh 470
 
471
    public Order getOrder() {
472
        return order;
473
    }
474
 
475
    public void setOrder(Order order) {
476
        this.order = order;
477
    }
3578 mandeep.dh 478
 
479
    public Long getCodTicketId() {
480
        return codTicketId;
481
    }
482
 
483
    public void setCodTicketId(Long codTicketId) {
484
        this.codTicketId = codTicketId;
485
    }
4142 mandeep.dh 486
 
487
    public List<Address> getAddresses() {
488
        return addresses;
489
    }
490
 
491
    public void setAddresses(List<Address> addresses) {
492
        this.addresses = addresses;
493
    }
4241 anupam.sin 494
 
495
    public String getOrderStatusDescription(Order order) {
496
        String status = order.getStatus().getDescription();
497
 
498
        if (order.getStatus() == OrderStatus.DELIVERY_SUCCESS) {
499
            status = "Completed";
500
        }
501
 
502
        return status;
503
    }
4689 anupam.sin 504
 
505
    public String getCancellationInitiator() {
506
        return cancellationInitiator;
507
    }
508
 
509
    public void setCancellationInitiator(String cancellationInitiator) {
510
        this.cancellationInitiator = cancellationInitiator;
511
    }
512
 
513
    public String getCancelReason() {
514
        return cancelReason;
515
    }
516
 
517
    public void setCancelReason(String cancelReason) {
518
        this.cancelReason = cancelReason;
519
    }
520
 
521
    public String getBody() {
522
        return body;
523
    }
524
 
525
    public void setBody(String body) {
526
        this.body = body;
527
    }
6985 anupam.sin 528
 
529
    public String getLine1() {
530
        return line1;
531
    }
532
 
533
    public void setLine1(String line1) {
534
        this.line1 = line1;
535
    }
536
 
537
    public String getLine2() {
538
        return line2;
539
    }
540
 
541
    public void setLine2(String line2) {
542
        this.line2 = line2;
543
    }
544
 
545
    public String getCity() {
546
        return city;
547
    }
548
 
549
    public void setCity(String city) {
550
        this.city = city;
551
    }
552
 
553
    public String getState() {
554
        return state;
555
    }
556
 
557
    public void setState(String state) {
558
        this.state = state;
559
    }
560
 
561
    public String getPin() {
562
        return pin;
563
    }
564
 
565
    public void setPin(String pin) {
566
        this.pin = pin;
567
    }
7190 amar.kumar 568
 
569
	public String getFreebieItem() {
570
		return freebieItem;
571
	}
572
 
573
	public void setFreebieItem(String freebieItem) {
574
		this.freebieItem = freebieItem;
575
	}
576
 
577
	public String getDealText() {
578
		return dealText;
579
	}
580
 
581
	public void setDealText(String dealText) {
582
		this.dealText = dealText;
583
	}
584
 
585
	public String getParentOrderIdForFreebieOrder() {
586
		return parentOrderIdForFreebieOrder;
587
	}
588
 
589
	public void setParentOrderIdForFreebieOrder(String parentOrderIdForFreebieOrder) {
590
		this.parentOrderIdForFreebieOrder = parentOrderIdForFreebieOrder;
591
	}
592
 
593
	public String getFreebieOrderId() {
594
		return freebieOrderId;
595
	}
596
 
597
	public void setFreebieOrderId(String freebieOrderId) {
598
		this.freebieOrderId = freebieOrderId;
599
	}
600
 
2674 vikas 601
}