| 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;
|
| 7826 |
manish.sha |
11 |
import in.shop2020.logistics.LogisticsServiceException;
|
| 5845 |
mandeep.dh |
12 |
import in.shop2020.logistics.PickupStore;
|
| 7826 |
manish.sha |
13 |
import in.shop2020.logistics.Provider;
|
| 7190 |
amar.kumar |
14 |
import in.shop2020.model.v1.catalog.CatalogService;
|
|
|
15 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
|
|
16 |
import in.shop2020.model.v1.catalog.Item;
|
| 9338 |
manish.sha |
17 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 7826 |
manish.sha |
18 |
import in.shop2020.model.v1.order.AmazonOrder;
|
| 7399 |
anupam.sin |
19 |
import in.shop2020.model.v1.order.HotspotStore;
|
| 2674 |
vikas |
20 |
import in.shop2020.model.v1.order.LineItem;
|
|
|
21 |
import in.shop2020.model.v1.order.Order;
|
| 8606 |
amar.kumar |
22 |
import in.shop2020.model.v1.order.OrderSource;
|
| 3578 |
mandeep.dh |
23 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 7393 |
anupam.sin |
24 |
import in.shop2020.model.v1.order.StoreOrderDetail;
|
| 4689 |
anupam.sin |
25 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 4142 |
mandeep.dh |
26 |
import in.shop2020.model.v1.user.Address;
|
| 4689 |
anupam.sin |
27 |
import in.shop2020.model.v1.user.UserContextException;
|
| 2728 |
vikas |
28 |
import in.shop2020.payments.Attribute;
|
|
|
29 |
import in.shop2020.payments.Constants;
|
| 2674 |
vikas |
30 |
import in.shop2020.payments.Payment;
|
| 2728 |
vikas |
31 |
import in.shop2020.payments.PaymentException;
|
| 4142 |
mandeep.dh |
32 |
import in.shop2020.payments.PaymentService.Client;
|
| 9235 |
manish.sha |
33 |
import in.shop2020.payments.PaymentStatus;
|
| 4689 |
anupam.sin |
34 |
import in.shop2020.serving.auth.CRMAuthorizingRealm;
|
| 3090 |
mandeep.dh |
35 |
import in.shop2020.serving.model.ShipmentUpdate;
|
| 5845 |
mandeep.dh |
36 |
import in.shop2020.serving.services.AramexTrackingService;
|
| 3090 |
mandeep.dh |
37 |
import in.shop2020.serving.services.BlueDartTrackingService;
|
| 5303 |
phani.kuma |
38 |
import in.shop2020.serving.services.DelhiveryTrackingService;
|
| 7942 |
manish.sha |
39 |
import in.shop2020.serving.services.FedExTrackingService;
|
| 7200 |
kshitij.so |
40 |
import in.shop2020.serving.services.RedExpressTrackingService;
|
| 3578 |
mandeep.dh |
41 |
import in.shop2020.thrift.clients.CRMClient;
|
| 7190 |
amar.kumar |
42 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 6322 |
amar.kumar |
43 |
import in.shop2020.thrift.clients.HelperClient;
|
| 9338 |
manish.sha |
44 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 5845 |
mandeep.dh |
45 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 3128 |
rajveer |
46 |
import in.shop2020.thrift.clients.PaymentClient;
|
|
|
47 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 4142 |
mandeep.dh |
48 |
import in.shop2020.thrift.clients.UserClient;
|
| 7065 |
kshitij.so |
49 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| 13440 |
amit.gupta |
50 |
import in.shop2020.util.CRMConstants;
|
| 7942 |
manish.sha |
51 |
import in.shop2020.utils.FedExShipAccountInfo;
|
| 3546 |
mandeep.dh |
52 |
import in.shop2020.utils.ModelUtils;
|
| 6322 |
amar.kumar |
53 |
import in.shop2020.warehouse.WarehouseService;
|
| 2674 |
vikas |
54 |
|
| 6322 |
amar.kumar |
55 |
import java.io.BufferedInputStream;
|
|
|
56 |
import java.io.File;
|
|
|
57 |
import java.io.FileInputStream;
|
|
|
58 |
import java.io.FileWriter;
|
|
|
59 |
import java.io.IOException;
|
|
|
60 |
import java.io.InputStream;
|
| 6912 |
anupam.sin |
61 |
import java.text.SimpleDateFormat;
|
| 2674 |
vikas |
62 |
import java.util.ArrayList;
|
| 8824 |
manish.sha |
63 |
import java.util.Arrays;
|
| 6912 |
anupam.sin |
64 |
import java.util.Calendar;
|
| 4416 |
mandeep.dh |
65 |
import java.util.Collections;
|
| 6912 |
anupam.sin |
66 |
import java.util.Date;
|
| 7836 |
anupam.sin |
67 |
import java.util.HashMap;
|
| 4689 |
anupam.sin |
68 |
import java.util.HashSet;
|
| 2674 |
vikas |
69 |
import java.util.List;
|
| 7836 |
anupam.sin |
70 |
import java.util.Map;
|
| 4689 |
anupam.sin |
71 |
import java.util.Set;
|
| 4416 |
mandeep.dh |
72 |
import java.util.concurrent.Callable;
|
|
|
73 |
import java.util.concurrent.Executors;
|
|
|
74 |
import java.util.concurrent.TimeUnit;
|
| 2674 |
vikas |
75 |
|
| 6322 |
amar.kumar |
76 |
import javax.servlet.ServletOutputStream;
|
|
|
77 |
|
| 4689 |
anupam.sin |
78 |
import net.htmlparser.jericho.Source;
|
|
|
79 |
|
| 5845 |
mandeep.dh |
80 |
import org.apache.commons.lang.StringUtils;
|
| 2674 |
vikas |
81 |
import org.apache.log4j.Logger;
|
| 8824 |
manish.sha |
82 |
import org.apache.shiro.SecurityUtils;
|
|
|
83 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
84 |
import org.apache.struts2.convention.annotation.Results;
|
| 2728 |
vikas |
85 |
import org.apache.thrift.TException;
|
| 4142 |
mandeep.dh |
86 |
import org.apache.thrift.transport.TTransportException;
|
| 2674 |
vikas |
87 |
|
| 7942 |
manish.sha |
88 |
import com.ShipWebServiceClient;
|
| 8941 |
manish.sha |
89 |
import com.fedex.ship.stub.AssociatedShipmentDetail;
|
| 7942 |
manish.sha |
90 |
import com.fedex.ship.stub.CompletedPackageDetail;
|
|
|
91 |
import com.fedex.ship.stub.CompletedShipmentDetail;
|
| 8941 |
manish.sha |
92 |
import com.fedex.ship.stub.OperationalInstruction;
|
|
|
93 |
import com.fedex.ship.stub.PackageOperationalDetail;
|
| 7942 |
manish.sha |
94 |
import com.fedex.ship.stub.ProcessShipmentReply;
|
| 8941 |
manish.sha |
95 |
import com.fedex.ship.stub.StringBarcode;
|
| 7942 |
manish.sha |
96 |
import com.fedex.ship.stub.TrackingId;
|
|
|
97 |
|
| 2674 |
vikas |
98 |
/**
|
|
|
99 |
* @author vikas
|
| 3578 |
mandeep.dh |
100 |
*
|
| 2674 |
vikas |
101 |
*/
|
|
|
102 |
@SuppressWarnings("serial")
|
|
|
103 |
public class UserOrderInfoController extends BaseController {
|
| 13208 |
kshitij.so |
104 |
private static Logger log = Logger.getLogger(Class.class);
|
|
|
105 |
private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
|
|
|
106 |
private static AramexTrackingService aramexTrackingService = new AramexTrackingService();
|
|
|
107 |
private static DelhiveryTrackingService delhiveryTrackingService = new DelhiveryTrackingService();
|
|
|
108 |
private static RedExpressTrackingService redexpressTrackingService = new RedExpressTrackingService();
|
|
|
109 |
private FedExTrackingService fedexTrackingService;
|
|
|
110 |
|
|
|
111 |
private long orderId;
|
|
|
112 |
private Order order;
|
|
|
113 |
private List<Payment> payments;
|
|
|
114 |
private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
|
|
|
115 |
private Long codTicketId;
|
|
|
116 |
private List<Address> addresses;
|
|
|
117 |
private Set<OrderStatus> setOfcancellableStates;
|
|
|
118 |
//Start:- Added by Manish Sharma for Physical Refunds
|
|
|
119 |
private Set<OrderStatus> setOfrefundableStates;
|
|
|
120 |
private Set<OrderStatus> setOfprepaidrefundableStates;
|
|
|
121 |
//End:- Added by Manish Sharma for Physical Refunds
|
|
|
122 |
private String cancellationInitiator;
|
|
|
123 |
private String cancelReason;
|
|
|
124 |
private String body;
|
|
|
125 |
private String line1;
|
|
|
126 |
private String line2;
|
|
|
127 |
private String city;
|
|
|
128 |
private String state;
|
|
|
129 |
private String pin;
|
|
|
130 |
private String freebieItem;
|
|
|
131 |
private String dealText;
|
|
|
132 |
private String parentOrderIdForFreebieOrder;
|
|
|
133 |
private String freebieOrderId;
|
|
|
134 |
private double cashAmount;
|
|
|
135 |
private double cardAmount;
|
| 7393 |
anupam.sin |
136 |
private StoreOrderDetail storeOrderDetail;
|
| 7826 |
manish.sha |
137 |
//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 7830 |
anupam.sin |
138 |
private AmazonOrder amazonOrder = null;
|
| 7836 |
anupam.sin |
139 |
private String providerName = "N/A";
|
| 7826 |
manish.sha |
140 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 8296 |
kshitij.so |
141 |
private long gvAmount;
|
| 8824 |
manish.sha |
142 |
//Start:- Added by Manish Sharma for Physical Refunds
|
|
|
143 |
private String rfdRadio;
|
|
|
144 |
private String couponDetails;
|
|
|
145 |
private String refundAmountCoupon;
|
|
|
146 |
private String chequeDetails;
|
|
|
147 |
private String refundAmountCheque;
|
|
|
148 |
private String refundAmountGateway;
|
|
|
149 |
private String comments;
|
| 13208 |
kshitij.so |
150 |
|
| 8824 |
manish.sha |
151 |
private String errorMsg = "";
|
| 13208 |
kshitij.so |
152 |
private String successmsg = "";
|
| 2674 |
vikas |
153 |
|
| 13208 |
kshitij.so |
154 |
private List<String> refundDetails;
|
|
|
155 |
|
|
|
156 |
private String billingWarehouseName="";
|
|
|
157 |
|
|
|
158 |
public UserOrderInfoController() {
|
|
|
159 |
super();
|
|
|
160 |
setOfcancellableStates = new HashSet<OrderStatus>();
|
|
|
161 |
setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
|
|
|
162 |
setOfcancellableStates.add(OrderStatus.INVENTORY_LOW);
|
|
|
163 |
setOfcancellableStates.add(OrderStatus.LOW_INV_PO_RAISED);
|
|
|
164 |
setOfcancellableStates.add(OrderStatus.LOW_INV_REVERSAL_IN_PROCESS);
|
|
|
165 |
setOfcancellableStates.add(OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT);
|
|
|
166 |
setOfcancellableStates.add(OrderStatus.ACCEPTED);
|
|
|
167 |
setOfcancellableStates.add(OrderStatus.BILLED);
|
|
|
168 |
|
|
|
169 |
//Start:- Added by Manish Sharma for Physical Refunds
|
|
|
170 |
setOfrefundableStates = new HashSet<OrderStatus>();
|
|
|
171 |
setOfrefundableStates.add(OrderStatus.DOA_VALID_REFUNDED);
|
|
|
172 |
setOfrefundableStates.add(OrderStatus.DOA_INVALID_REFUNDED);
|
|
|
173 |
setOfrefundableStates.add(OrderStatus.DOA_REFUNDED_RCVD_DAMAGED);
|
|
|
174 |
setOfrefundableStates.add(OrderStatus.DOA_REFUNDED_LOST_IN_TRANSIT);
|
|
|
175 |
setOfrefundableStates.add(OrderStatus.RTO_DAMAGED_REFUNDED);
|
|
|
176 |
setOfrefundableStates.add(OrderStatus.RET_PRODUCT_USABLE_REFUNDED);
|
|
|
177 |
setOfrefundableStates.add(OrderStatus.RET_PRODUCT_UNUSABLE_REFUNDED);
|
|
|
178 |
setOfrefundableStates.add(OrderStatus.RET_REFUNDED_RCVD_DAMAGED);
|
|
|
179 |
setOfrefundableStates.add(OrderStatus.RET_REFUNDED_LOST_IN_TRANSIT);
|
|
|
180 |
//End:- Added by Manish Sharma for Physical Refunds
|
|
|
181 |
|
|
|
182 |
setOfprepaidrefundableStates = new HashSet<OrderStatus>();
|
|
|
183 |
setOfprepaidrefundableStates.add(OrderStatus.RTO_REFUNDED);
|
|
|
184 |
setOfprepaidrefundableStates.add(OrderStatus.RTO_LOST_IN_TRANSIT_REFUNDED);
|
|
|
185 |
setOfprepaidrefundableStates.add(OrderStatus.LOST_IN_TRANSIT_REFUNDED);
|
|
|
186 |
setOfprepaidrefundableStates.add(OrderStatus.CANCELLED_ON_CUSTOMER_REQUEST);
|
|
|
187 |
setOfprepaidrefundableStates.add(OrderStatus.CANCELLED_DUE_TO_LOW_INVENTORY);
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
public static final Map<Long, String> providerNameMap = new HashMap<Long, String>() {
|
| 7836 |
anupam.sin |
193 |
{
|
|
|
194 |
put(1l, "BlueDart");
|
|
|
195 |
put(2l, "Aramex");
|
|
|
196 |
put(3l, "Delhivery");
|
|
|
197 |
put(4l, "SelfPickup");
|
|
|
198 |
put(5l, "Runner");
|
|
|
199 |
put(6l, "RedExpress");
|
| 8356 |
manish.sha |
200 |
put(7l, "FedEx");
|
| 7836 |
anupam.sin |
201 |
}
|
| 13208 |
kshitij.so |
202 |
};
|
|
|
203 |
|
|
|
204 |
|
|
|
205 |
public static final Map<Long,String> billingWarehouseMap = new HashMap<Long, String>() {
|
|
|
206 |
{
|
|
|
207 |
put(7l, "Mahipalpur-MMX");
|
|
|
208 |
put(12l, "Goregaon");
|
|
|
209 |
put(13l, "Bhiwandi");
|
|
|
210 |
put(1765l, "Bangalore");
|
|
|
211 |
put(1768l, "Bangalore - SR");
|
|
|
212 |
put(3298l, "TG-SORPL/Hyderabad");
|
|
|
213 |
put(3931l, "HR-SORPL/Gurgaon-S");
|
|
|
214 |
}
|
|
|
215 |
};
|
|
|
216 |
|
|
|
217 |
public String index() {
|
|
|
218 |
try {
|
|
|
219 |
PaymentClient paymentServiceClient = new PaymentClient();
|
|
|
220 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 16582 |
manish.sha |
221 |
|
| 13208 |
kshitij.so |
222 |
/*List<Provider> providerList = logisticsServiceClient.getClient().getAllProviders();
|
| 8824 |
manish.sha |
223 |
Map<Long, String> providerNameMap = new HashMap<Long, String>();
|
|
|
224 |
for(Provider provider : providerList){
|
|
|
225 |
providerNameMap.put(provider.getId(), provider.getName());
|
|
|
226 |
}*/
|
| 13208 |
kshitij.so |
227 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
|
|
228 |
|
|
|
229 |
if (billingWarehouseMap.containsKey(order.getWarehouse_id()) && order.getWarehouse_id()!=0){
|
|
|
230 |
setBillingWarehouseName(billingWarehouseMap.get(order.getWarehouse_id()));
|
|
|
231 |
}
|
|
|
232 |
|
|
|
233 |
Warehouse warehouse;
|
|
|
234 |
if (order.getLogistics_provider_id() == 7){
|
|
|
235 |
warehouse = getWareHouseForOrder(order.getWarehouse_id());
|
|
|
236 |
fedexTrackingService = new FedExTrackingService(warehouse.getLogisticsLocation());
|
|
|
237 |
}
|
|
|
238 |
//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
|
|
239 |
if(OrderSource.AMAZON == OrderSource.findByValue((int)order.getSource()) || OrderSource.JUNGLEE == OrderSource.findByValue((int)order.getSource())){
|
|
|
240 |
try {
|
|
|
241 |
amazonOrder = transactionServiceClient.getClient().getAmazonOrder(orderId);
|
|
|
242 |
} catch (Exception e) {
|
|
|
243 |
log.error("Exception : No Amazon order found with orderId " + orderId);
|
|
|
244 |
}
|
|
|
245 |
}
|
|
|
246 |
if (order.getLogistics_provider_id() > 0) {
|
|
|
247 |
setProviderName(providerNameMap.get(order.getLogistics_provider_id()));
|
|
|
248 |
}
|
|
|
249 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
|
|
250 |
if(order.getSource() == 2) {
|
|
|
251 |
storeOrderDetail = transactionServiceClient.getClient().getStoreOrderDetail(order.getId(),order.getStoreId());
|
|
|
252 |
if(order.getStatus().getValue() == 15 || order.getStatus().getValue() == 34) {
|
|
|
253 |
setCashAmount(storeOrderDetail.getCashRefundAmount());
|
| 7399 |
anupam.sin |
254 |
setCardAmount(storeOrderDetail.getCardRefundAmount());
|
| 13208 |
kshitij.so |
255 |
} else {
|
|
|
256 |
setCashAmount(storeOrderDetail.getCashAmount());
|
|
|
257 |
setCardAmount(storeOrderDetail.getCardAmount());
|
|
|
258 |
}
|
|
|
259 |
}
|
|
|
260 |
if(order.getFreebieItemId()>0) {
|
|
|
261 |
CatalogService.Client catalogClient = new CatalogClient().getClient();
|
|
|
262 |
Item item = catalogClient.getItem(order.getFreebieItemId());
|
|
|
263 |
freebieItem = item.getBrand() + " " + item.getModelName() + " " + item.getModelNumber() + " " + item.getColor();
|
|
|
264 |
}
|
| 3090 |
mandeep.dh |
265 |
|
| 13208 |
kshitij.so |
266 |
if(order.getLineitems().get(0).getDealText()!=null && !order.getLineitems().get(0).getDealText().isEmpty()) {
|
|
|
267 |
dealText = order.getLineitems().get(0).getDealText();
|
|
|
268 |
}
|
|
|
269 |
List<in.shop2020.model.v1.order.Attribute> attributes =
|
|
|
270 |
transactionServiceClient.getClient().getAllAttributesForOrderId(orderId);
|
| 3578 |
mandeep.dh |
271 |
|
| 13208 |
kshitij.so |
272 |
for(in.shop2020.model.v1.order.Attribute attribute: attributes){
|
|
|
273 |
if(attribute.getName().equals("parentOrderIdForFreebie")){
|
|
|
274 |
parentOrderIdForFreebieOrder = attribute.getValue();
|
|
|
275 |
} else if (attribute.getName().equals("freebieOrderId")){
|
|
|
276 |
freebieOrderId = attribute.getValue();
|
|
|
277 |
}
|
|
|
278 |
}
|
| 4689 |
anupam.sin |
279 |
|
| 13208 |
kshitij.so |
280 |
payments = paymentServiceClient.getClient()
|
|
|
281 |
.getPaymentForTxnId(order.getTransactionId());
|
| 4689 |
anupam.sin |
282 |
|
| 13208 |
kshitij.so |
283 |
gvAmount = order.getGvAmount();
|
| 4416 |
mandeep.dh |
284 |
|
| 3578 |
mandeep.dh |
285 |
|
| 2674 |
vikas |
286 |
|
| 13208 |
kshitij.so |
287 |
// Spawning a thread to capture shipment updates from Bluedart
|
|
|
288 |
// This is done to ensure that response from Crm web app is sent
|
|
|
289 |
// within given time limits. Also, we wont be affected in the cases
|
|
|
290 |
// where bluedart site is down or slow
|
|
|
291 |
Executors.newSingleThreadExecutor().invokeAll(Collections.singletonList(new Callable<Boolean>() {
|
|
|
292 |
public Boolean call() throws Exception {
|
|
|
293 |
if (order.getLogistics_provider_id() == 1)
|
|
|
294 |
shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
295 |
else if (order.getLogistics_provider_id() == 2) {
|
|
|
296 |
shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
297 |
}
|
|
|
298 |
else if (order.getLogistics_provider_id() == 3) {
|
|
|
299 |
shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
300 |
}
|
|
|
301 |
else if (order.getLogistics_provider_id() == 6) {
|
|
|
302 |
shipmentUpdates = redexpressTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
303 |
}
|
|
|
304 |
//Start:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
|
|
|
305 |
else if (order.getLogistics_provider_id() == 7) {
|
|
|
306 |
shipmentUpdates = fedexTrackingService.getUpdates(order.getAirwaybill_no());
|
|
|
307 |
}
|
|
|
308 |
//End:- Added by Manish Sharma for fedex Integration- Shipment Tracking on 31-Jul-2013
|
|
|
309 |
else {
|
|
|
310 |
shipmentUpdates = new ArrayList<ShipmentUpdate>();
|
|
|
311 |
log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
|
|
|
312 |
}
|
|
|
313 |
return true;
|
|
|
314 |
}
|
|
|
315 |
}), 60, TimeUnit.SECONDS);
|
| 4142 |
mandeep.dh |
316 |
|
| 13208 |
kshitij.so |
317 |
if (order.isCod() && OrderStatus.COD_VERIFICATION_PENDING.equals(order.getStatus())) {
|
|
|
318 |
populateCODTicketId(order.getCustomer_id());
|
|
|
319 |
}
|
| 3578 |
mandeep.dh |
320 |
|
| 13208 |
kshitij.so |
321 |
if (canEditOrderAddress()) {
|
|
|
322 |
userContextServiceClient = new UserClient().getClient();
|
|
|
323 |
addresses = userContextServiceClient.getAllAddressesForUser(order.getCustomer_id());
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
} catch (TTransportException e) {
|
|
|
327 |
log.error("Unable to create thrift Client", e);
|
|
|
328 |
} catch (TransactionServiceException e) {
|
|
|
329 |
addActionError("Invalid order id or no order selected.");
|
|
|
330 |
} catch (TException e) {
|
|
|
331 |
log.error("Unable to get thrift Client", e);
|
|
|
332 |
} catch (PaymentException e) {
|
|
|
333 |
log.error("Unable to get payments for transctionId : " + order.getTransactionId(), e);
|
|
|
334 |
} catch (InterruptedException e) {
|
|
|
335 |
log.error("Thread was interrupted", e);
|
|
|
336 |
} catch (UserContextException e) {
|
|
|
337 |
log.error("Unable to get addresses for user : " + order.getCustomer_id(), e);
|
|
|
338 |
} catch(CatalogServiceException csex) {
|
|
|
339 |
log.error("Unable to get item details for itemId: " + order.getFreebieItemId(), csex);
|
|
|
340 |
} /*catch (LogisticsServiceException lsex) {
|
| 8824 |
manish.sha |
341 |
log.error("Unable to get providers infromation: " , lsex);
|
|
|
342 |
}*/
|
| 13208 |
kshitij.so |
343 |
return INDEX;
|
|
|
344 |
}
|
| 4689 |
anupam.sin |
345 |
|
| 13208 |
kshitij.so |
346 |
private boolean canEditOrderAddress() {
|
|
|
347 |
return false;
|
|
|
348 |
}
|
| 4689 |
anupam.sin |
349 |
|
| 13208 |
kshitij.so |
350 |
private void populateCODTicketId(long customerId) {
|
|
|
351 |
try {
|
|
|
352 |
SearchFilter searchFilter = new SearchFilter();
|
|
|
353 |
searchFilter.setTicketCategory(TicketCategory.COD_VERIFICATION);
|
|
|
354 |
searchFilter.setTicketStatuses(new ArrayList<TicketStatus>());
|
|
|
355 |
searchFilter.getTicketStatuses().add(TicketStatus.OPEN);
|
|
|
356 |
searchFilter.getTicketStatuses().add(TicketStatus.REOPEN);
|
|
|
357 |
searchFilter.setCustomerId(customerId);
|
|
|
358 |
crmServiceClient = new CRMClient().getClient();
|
|
|
359 |
List<Ticket> tickets = crmServiceClient.getTickets(searchFilter);
|
|
|
360 |
if (tickets != null && !tickets.isEmpty()) {
|
|
|
361 |
codTicketId = tickets.get(0).getId();
|
|
|
362 |
}
|
|
|
363 |
} catch (TException e) {
|
|
|
364 |
log.error("Error fetching tickets for customerId: " + customerId, e);
|
|
|
365 |
}
|
|
|
366 |
}
|
| 4689 |
anupam.sin |
367 |
|
| 13208 |
kshitij.so |
368 |
public String markOrderForCancellation() {
|
|
|
369 |
try{
|
|
|
370 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
371 |
log.info("URL = " + request.getRequestURI());
|
|
|
372 |
log.info("Initiator = " + request.getParameter("cancellationInitiator"));
|
|
|
373 |
log.info("orderId = " + request.getParameter("orderId"));
|
|
|
374 |
|
|
|
375 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
|
|
376 |
|
|
|
377 |
/**
|
|
|
378 |
* If the order is from store then refund the order directly.
|
|
|
379 |
*/
|
|
|
380 |
if (order.getSource() == 2) {
|
|
|
381 |
String plainTextbody = "";
|
|
|
382 |
if(body!=null && !body.isEmpty()){
|
| 7393 |
anupam.sin |
383 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
|
|
384 |
}
|
| 4689 |
anupam.sin |
385 |
|
| 13208 |
kshitij.so |
386 |
if(cashAmount + cardAmount > order.getAdvanceAmount()) {
|
|
|
387 |
log.error("Could not mark order for Cancellation, OrderId : " + orderId);
|
|
|
388 |
return "index";
|
|
|
389 |
}
|
| 4689 |
anupam.sin |
390 |
|
| 13208 |
kshitij.so |
391 |
transactionServiceClient.getClient().saveRefundAmountsForStoreOrder(orderId, order.getStoreId(), cashAmount, cardAmount);
|
|
|
392 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
|
|
393 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
|
|
394 |
transactionServiceClient.getClient().markOrderCancellationRequestConfirmed(orderId);
|
|
|
395 |
}
|
|
|
396 |
transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
|
|
397 |
} else {
|
|
|
398 |
if (cancellationInitiator.equals("CUSTOMER")) {
|
|
|
399 |
transactionServiceClient.getClient().markOrderCancellationRequestReceived(orderId);
|
|
|
400 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|
|
|
401 |
Ticket ticket = new Ticket();
|
|
|
402 |
String plainTextbody = "";
|
|
|
403 |
if(body!=null && !body.isEmpty()){
|
|
|
404 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
|
|
405 |
}
|
|
|
406 |
ticket.setDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
|
|
|
407 |
ticket.setCreatorId(creatorId);
|
|
|
408 |
ticket.setStatus(TicketStatus.OPEN);
|
|
|
409 |
ticket.setPriority(TicketPriority.HIGH);
|
| 18462 |
manish.sha |
410 |
ticket.setAssigneeId(51);
|
| 13208 |
kshitij.so |
411 |
ticket.setCategory(TicketCategory.ORDER_CANCELLATION);
|
|
|
412 |
ticket.setOrderId(orderId);
|
| 4689 |
anupam.sin |
413 |
|
| 13208 |
kshitij.so |
414 |
Activity activity = new Activity();
|
|
|
415 |
activity.setDescription("Creating Ticket");
|
|
|
416 |
activity.setType(ActivityType.OTHER);
|
|
|
417 |
activity.setTicketPriority(TicketPriority.HIGH);
|
|
|
418 |
activity.setTicketStatus(TicketStatus.OPEN);
|
|
|
419 |
activity.setCreatorId(creatorId);
|
|
|
420 |
activity.setTicketDescription("Creating ticket for Cancellation Request Received, Reason : " + cancelReason + " : " + plainTextbody);
|
|
|
421 |
activity.setTicketCategory(TicketCategory.ORDER_CANCELLATION);
|
| 18462 |
manish.sha |
422 |
activity.setTicketAssigneeId(51);
|
| 6322 |
amar.kumar |
423 |
|
| 13208 |
kshitij.so |
424 |
ticket.setCustomerId(order.getCustomer_id());
|
|
|
425 |
activity.setCustomerId(order.getCustomer_id());
|
|
|
426 |
ticket.setCustomerName(order.getCustomer_name());
|
|
|
427 |
activity.setCustomerName(order.getCustomer_name());
|
|
|
428 |
ticket.setCustomerEmailId(order.getCustomer_email());
|
|
|
429 |
activity.setCustomerEmailId(order.getCustomer_email());
|
|
|
430 |
ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
|
|
431 |
activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
| 6322 |
amar.kumar |
432 |
|
| 13208 |
kshitij.so |
433 |
crmServiceClient = new CRMClient().getClient();
|
|
|
434 |
crmServiceClient.insertTicket(ticket, activity);
|
|
|
435 |
}
|
|
|
436 |
else if (cancellationInitiator.equals("INTERNAL")) {
|
|
|
437 |
String plainTextbody = "";
|
|
|
438 |
if(body!=null && !body.isEmpty()){
|
|
|
439 |
plainTextbody = new Source(body).getTextExtractor().toString();
|
|
|
440 |
}
|
|
|
441 |
boolean status_returned = transactionServiceClient.getClient().refundOrder(orderId, currentAgentEmailId, cancelReason + " : " + plainTextbody);
|
|
|
442 |
if (status_returned) {
|
|
|
443 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
|
|
444 |
long creatorId = CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId();
|
|
|
445 |
Ticket ticket = new Ticket();
|
|
|
446 |
ticket.setDescription("Creating ticket for Order Cancellation due to Low inventory");
|
|
|
447 |
ticket.setCreatorId(creatorId);
|
| 18171 |
manish.sha |
448 |
ticket.setAssigneeId(51);
|
| 13208 |
kshitij.so |
449 |
ticket.setStatus(TicketStatus.OPEN);
|
|
|
450 |
ticket.setPriority(TicketPriority.MEDIUM);
|
|
|
451 |
ticket.setCategory(TicketCategory.LOW_INVENTORY_CANCELLED_ORDERS);
|
|
|
452 |
ticket.setOrderId(orderId);
|
|
|
453 |
ticket.setCustomerId(order.getCustomer_id());
|
|
|
454 |
ticket.setCustomerName(order.getCustomer_name());
|
|
|
455 |
ticket.setCustomerEmailId(order.getCustomer_email());
|
|
|
456 |
ticket.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
| 7221 |
kshitij.so |
457 |
|
| 13208 |
kshitij.so |
458 |
Activity activity = new Activity();
|
|
|
459 |
activity.setDescription("Creating Ticket");
|
|
|
460 |
activity.setType(ActivityType.OTHER);
|
|
|
461 |
activity.setTicketPriority(TicketPriority.MEDIUM);
|
|
|
462 |
activity.setTicketStatus(TicketStatus.OPEN);
|
|
|
463 |
activity.setCreatorId(creatorId);
|
| 18171 |
manish.sha |
464 |
activity.setTicketAssigneeId(51);
|
| 13208 |
kshitij.so |
465 |
activity.setTicketCategory(TicketCategory.LOW_INVENTORY_CANCELLED_ORDERS);
|
|
|
466 |
activity.setTicketDescription("Creating ticket for Order Cancellation due to Low inventory");
|
|
|
467 |
activity.setCustomerId(order.getCustomer_id());
|
|
|
468 |
activity.setCustomerName(order.getCustomer_name());
|
|
|
469 |
activity.setCustomerEmailId(order.getCustomer_email());
|
|
|
470 |
activity.setCustomerMobileNumber(order.getCustomer_mobilenumber());
|
| 7221 |
kshitij.so |
471 |
|
| 13208 |
kshitij.so |
472 |
crmServiceClient = new CRMClient().getClient();
|
|
|
473 |
crmServiceClient.insertTicket(ticket, activity);
|
|
|
474 |
}
|
|
|
475 |
}
|
|
|
476 |
}
|
|
|
477 |
} catch(Exception e) {
|
|
|
478 |
log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
|
|
|
479 |
}
|
|
|
480 |
return index();
|
|
|
481 |
}
|
| 4689 |
anupam.sin |
482 |
|
| 13208 |
kshitij.so |
483 |
public void getOrderConfirmationMail() throws IOException, TException, ConfigException, TransactionServiceException {
|
|
|
484 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
485 |
order = transactionServiceClient.getClient().getOrder(orderId);
|
|
|
486 |
long source = order.getTransactionId();
|
|
|
487 |
HelperClient helperClient = new HelperClient("helper_service_server","helper_service_server_port");
|
|
|
488 |
String mail = helperClient.getClient().getOrderConfirmationMail(source);
|
|
|
489 |
File file = new File("/tmp/temp");
|
|
|
490 |
//Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
|
|
|
491 |
if(mail.isEmpty() || mail==null || mail=="")
|
|
|
492 |
mail="<html><body><p>Sorry, Required e-mail for mentioned order does not exist in the system !!!</p></body></html>";
|
|
|
493 |
//End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
|
| 3578 |
mandeep.dh |
494 |
|
| 13208 |
kshitij.so |
495 |
FileWriter writer = new FileWriter(file);
|
|
|
496 |
writer.append(mail);
|
|
|
497 |
writer.close();
|
| 4142 |
mandeep.dh |
498 |
|
| 13208 |
kshitij.so |
499 |
byte[] buffer = new byte[(int)file.length()];
|
|
|
500 |
InputStream input = null;
|
|
|
501 |
try {
|
|
|
502 |
int totalBytesRead = 0;
|
|
|
503 |
input = new BufferedInputStream(new FileInputStream(file));
|
|
|
504 |
while(totalBytesRead < buffer.length){
|
|
|
505 |
int bytesRemaining = buffer.length - totalBytesRead;
|
|
|
506 |
int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining);
|
|
|
507 |
if (bytesRead > 0){
|
|
|
508 |
totalBytesRead = totalBytesRead + bytesRead;
|
|
|
509 |
}
|
|
|
510 |
}
|
|
|
511 |
}
|
|
|
512 |
finally {
|
|
|
513 |
input.close();
|
|
|
514 |
file.delete();
|
|
|
515 |
}
|
| 2674 |
vikas |
516 |
|
| 4142 |
mandeep.dh |
517 |
|
| 13208 |
kshitij.so |
518 |
response.setHeader("Content-disposition", "inline; filename=" + "OrderDetail_"+orderId );
|
| 2674 |
vikas |
519 |
|
| 13208 |
kshitij.so |
520 |
ServletOutputStream sos;
|
|
|
521 |
try {
|
|
|
522 |
sos = response.getOutputStream();
|
|
|
523 |
sos.write(buffer);
|
|
|
524 |
sos.flush();
|
|
|
525 |
} catch (IOException e) {
|
|
|
526 |
System.out.println("Unable to stream the manifest file");
|
|
|
527 |
}
|
|
|
528 |
}
|
| 3578 |
mandeep.dh |
529 |
|
| 13208 |
kshitij.so |
530 |
public Warehouse getWareHouseForOrder(long warehouseId){
|
|
|
531 |
Warehouse warehouse = null;
|
|
|
532 |
try{
|
|
|
533 |
InventoryClient isc = new InventoryClient();
|
|
|
534 |
warehouse = isc.getClient().getWarehouse(warehouseId);
|
|
|
535 |
} catch(Exception e) {
|
|
|
536 |
log.error("Unable to get warehouse for id : " + warehouseId,e);
|
|
|
537 |
//TODO throw e;
|
|
|
538 |
}
|
|
|
539 |
return warehouse;
|
|
|
540 |
}
|
| 5845 |
mandeep.dh |
541 |
|
| 13208 |
kshitij.so |
542 |
public void getOrderDeliveryMail() throws IOException, TException, ConfigException, TransactionServiceException {
|
|
|
543 |
HelperClient helperClient = new HelperClient("helper_service_server","helper_service_server_port");
|
|
|
544 |
String mail = helperClient.getClient().getOrderDeliveryMail(orderId);
|
|
|
545 |
File file = new File("/tmp/temp");
|
|
|
546 |
//Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
|
|
|
547 |
if(mail.isEmpty() || mail==null || mail=="")
|
|
|
548 |
mail="<html><body><p>Sorry, Required e-mail for mentioned order does not exist in the system anymore !!!</p></body></html>";
|
|
|
549 |
//End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
|
|
|
550 |
FileWriter writer = new FileWriter(file);
|
|
|
551 |
writer.append(mail);
|
|
|
552 |
writer.close();
|
| 4142 |
mandeep.dh |
553 |
|
| 13208 |
kshitij.so |
554 |
byte[] buffer = new byte[(int)file.length()];
|
|
|
555 |
InputStream input = null;
|
|
|
556 |
try {
|
|
|
557 |
int totalBytesRead = 0;
|
|
|
558 |
input = new BufferedInputStream(new FileInputStream(file));
|
|
|
559 |
while(totalBytesRead < buffer.length){
|
|
|
560 |
int bytesRemaining = buffer.length - totalBytesRead;
|
|
|
561 |
int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining);
|
|
|
562 |
if (bytesRead > 0){
|
|
|
563 |
totalBytesRead = totalBytesRead + bytesRead;
|
|
|
564 |
}
|
|
|
565 |
}
|
|
|
566 |
}
|
|
|
567 |
finally {
|
|
|
568 |
input.close();
|
|
|
569 |
file.delete();
|
|
|
570 |
}
|
| 2674 |
vikas |
571 |
|
|
|
572 |
|
| 13208 |
kshitij.so |
573 |
response.setHeader("Content-disposition", "inline; filename=" + "OrderDetail_"+orderId );
|
| 2674 |
vikas |
574 |
|
| 13208 |
kshitij.so |
575 |
ServletOutputStream sos;
|
|
|
576 |
try {
|
|
|
577 |
sos = response.getOutputStream();
|
|
|
578 |
sos.write(buffer);
|
|
|
579 |
sos.flush();
|
|
|
580 |
} catch (IOException e) {
|
|
|
581 |
System.out.println("Unable to stream the manifest file");
|
|
|
582 |
}
|
|
|
583 |
}
|
| 3090 |
mandeep.dh |
584 |
|
| 13208 |
kshitij.so |
585 |
public boolean canOrderBeCancelled() {
|
|
|
586 |
if (setOfcancellableStates.contains(order.getStatus())) {
|
|
|
587 |
return true;
|
|
|
588 |
}
|
|
|
589 |
return false;
|
|
|
590 |
}
|
| 3499 |
mandeep.dh |
591 |
|
| 13208 |
kshitij.so |
592 |
public String getPaymentGateway(Payment payment) {
|
|
|
593 |
String gatewayName = "";
|
| 4142 |
mandeep.dh |
594 |
|
| 13208 |
kshitij.so |
595 |
try {
|
|
|
596 |
Client paymentServiceClient = new PaymentClient().getClient();
|
|
|
597 |
gatewayName = paymentServiceClient.getPaymentGateway(payment.getGatewayId()).getName();
|
|
|
598 |
} catch (TTransportException e) {
|
|
|
599 |
} catch (PaymentException e) {
|
|
|
600 |
} catch (TException e) {
|
|
|
601 |
}
|
| 4142 |
mandeep.dh |
602 |
|
| 13208 |
kshitij.so |
603 |
return gatewayName;
|
|
|
604 |
}
|
| 4241 |
anupam.sin |
605 |
|
| 13208 |
kshitij.so |
606 |
public int convertDouble(double value) {
|
|
|
607 |
return (int)value;
|
|
|
608 |
}
|
| 4241 |
anupam.sin |
609 |
|
| 13208 |
kshitij.so |
610 |
public String getInsuranceExpiryDate(long DeliveryDate) {
|
|
|
611 |
if (DeliveryDate == 0) {
|
|
|
612 |
return "N/A";
|
|
|
613 |
}
|
|
|
614 |
Calendar cal = Calendar.getInstance();
|
|
|
615 |
cal.setTimeInMillis(DeliveryDate);
|
|
|
616 |
cal.add(Calendar.YEAR, 1);
|
|
|
617 |
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM, yyyy");
|
|
|
618 |
return sdf.format(cal.getTime());
|
|
|
619 |
}
|
| 8941 |
manish.sha |
620 |
|
| 13208 |
kshitij.so |
621 |
public String getShippingAddressOfStore(long storeId) {
|
|
|
622 |
try {
|
|
|
623 |
in.shop2020.logistics.LogisticsService.Client client = new LogisticsClient().getClient();
|
|
|
624 |
PickupStore store = client.getPickupStore(storeId);
|
|
|
625 |
return StringUtils.join(new String[] {
|
|
|
626 |
store.getName(),
|
|
|
627 |
store.getLine1(),
|
|
|
628 |
store.getLine2(),
|
|
|
629 |
store.getPin(),
|
|
|
630 |
store.getCity(),
|
|
|
631 |
store.getState(),
|
|
|
632 |
store.getPhone()}, ",");
|
|
|
633 |
} catch (Exception e) {
|
|
|
634 |
return "";
|
|
|
635 |
}
|
|
|
636 |
}
|
| 4689 |
anupam.sin |
637 |
|
| 13208 |
kshitij.so |
638 |
public String getAddress(Order order) {
|
|
|
639 |
return ModelUtils.extractAddressFromOrder(order);
|
|
|
640 |
}
|
| 4689 |
anupam.sin |
641 |
|
| 13208 |
kshitij.so |
642 |
public String changeShippingAddress() {
|
|
|
643 |
try {
|
|
|
644 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
645 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient
|
|
|
646 |
= transactionServiceClient.getClient();
|
| 18070 |
manish.sha |
647 |
in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
|
| 13208 |
kshitij.so |
648 |
transactionClient.changeShippingAddress(orderId, line1, line2, city, state, pin);
|
| 18070 |
manish.sha |
649 |
/*
|
| 13208 |
kshitij.so |
650 |
Warehouse warehouse = getWareHouseForOrder(t_order.getWarehouse_id());
|
|
|
651 |
if(t_order.getLogistics_provider_id()==7L){
|
|
|
652 |
FedExShipAccountInfo fedexAccountInfo = FedExShipAccountInfo.getFedExInfo(warehouse.getLogisticsLocation());
|
|
|
653 |
ProcessShipmentReply processShipmentReply = ShipWebServiceClient.getShipmentCreationReply(t_order,fedexAccountInfo.getClientDetail(),fedexAccountInfo.getWad(),fedexAccountInfo.getEndPointAddress());
|
|
|
654 |
CompletedShipmentDetail completedShipmentDetails = processShipmentReply.getCompletedShipmentDetail();
|
|
|
655 |
CompletedPackageDetail completedPackageDetails = completedShipmentDetails.getCompletedPackageDetails(0);
|
|
|
656 |
TrackingId trackId= completedPackageDetails.getTrackingIds(0);
|
|
|
657 |
t_order = transactionClient.updateOrderAWB(t_order.getId(), trackId.getTrackingNumber());
|
|
|
658 |
//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
|
|
|
659 |
CompletedPackageDetail[] cpd= completedShipmentDetails.getCompletedPackageDetails();
|
|
|
660 |
AssociatedShipmentDetail[] asdetails = completedShipmentDetails.getAssociatedShipments();
|
|
|
661 |
List<in.shop2020.model.v1.order.Attribute> attrList = new ArrayList<in.shop2020.model.v1.order.Attribute>();
|
|
|
662 |
if(t_order.isCod()){
|
|
|
663 |
if(asdetails!=null){
|
|
|
664 |
for(AssociatedShipmentDetail as : asdetails){
|
|
|
665 |
if(as.getType().getValue().equalsIgnoreCase("COD_RETURN")){
|
|
|
666 |
PackageOperationalDetail pod = as.getPackageOperationalDetail();
|
|
|
667 |
StringBarcode[] barcodes = pod.getBarcodes().getStringBarcodes();
|
|
|
668 |
for(StringBarcode bc : barcodes){
|
|
|
669 |
in.shop2020.model.v1.order.Attribute attr3 = new in.shop2020.model.v1.order.Attribute();
|
|
|
670 |
attr3.setName("FedEx_COD_Return_BarCode");
|
|
|
671 |
attr3.setValue(bc.getValue());
|
|
|
672 |
attrList.add(attr3);
|
|
|
673 |
}
|
| 4689 |
anupam.sin |
674 |
|
| 13208 |
kshitij.so |
675 |
String codReturnTrackingNo= as.getTrackingId().getTrackingNumber();
|
|
|
676 |
in.shop2020.model.v1.order.Attribute attr4 = new in.shop2020.model.v1.order.Attribute();
|
|
|
677 |
attr4.setName("FedEx_COD_Return_Tracking_No");
|
|
|
678 |
attr4.setValue(codReturnTrackingNo);
|
|
|
679 |
attrList.add(attr4);
|
|
|
680 |
}
|
|
|
681 |
}
|
|
|
682 |
}
|
|
|
683 |
}
|
|
|
684 |
for(CompletedPackageDetail cd : cpd){
|
|
|
685 |
PackageOperationalDetail pod = cd.getOperationalDetail();
|
|
|
686 |
StringBarcode[] barcodes = pod.getBarcodes().getStringBarcodes();
|
|
|
687 |
for(StringBarcode bc : barcodes){
|
|
|
688 |
in.shop2020.model.v1.order.Attribute attr1 = new in.shop2020.model.v1.order.Attribute();
|
|
|
689 |
attr1.setName("FedEx_Package_BarCode");
|
|
|
690 |
attr1.setValue(bc.getValue());
|
|
|
691 |
attrList.add(attr1);
|
|
|
692 |
}
|
|
|
693 |
OperationalInstruction[] ois = pod.getOperationalInstructions();
|
|
|
694 |
in.shop2020.model.v1.order.Attribute attr2 = new in.shop2020.model.v1.order.Attribute();
|
|
|
695 |
for(OperationalInstruction oi : ois){
|
|
|
696 |
if(oi.getNumber().intValue()==5){
|
|
|
697 |
attr2.setName("FedEx_Location_Code");
|
|
|
698 |
attr2.setValue(oi.getContent());
|
|
|
699 |
attrList.add(attr2);
|
|
|
700 |
}
|
|
|
701 |
}
|
|
|
702 |
}
|
|
|
703 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
704 |
//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
|
| 18071 |
manish.sha |
705 |
|
|
|
706 |
}*/
|
| 13208 |
kshitij.so |
707 |
} catch(Exception e) {
|
|
|
708 |
log.error("Unable to update address for orderId : " + orderId + "and address : " +
|
|
|
709 |
line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
|
|
|
710 |
}
|
|
|
711 |
return null;
|
|
|
712 |
}
|
| 4689 |
anupam.sin |
713 |
|
| 13208 |
kshitij.so |
714 |
public String convertStoreToNormal() {
|
|
|
715 |
try{
|
|
|
716 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
717 |
transactionServiceClient.getClient().convertStoreToNormal(orderId);
|
|
|
718 |
} catch(Exception e) {
|
|
|
719 |
log.error("Unable to convert to normal order", e);
|
|
|
720 |
}
|
|
|
721 |
return null;
|
|
|
722 |
}
|
| 4689 |
anupam.sin |
723 |
|
| 13208 |
kshitij.so |
724 |
public String getStoreDetails(long storeId) {
|
|
|
725 |
try {
|
|
|
726 |
TransactionClient tcl = new TransactionClient();
|
|
|
727 |
HotspotStore store = tcl.getClient().getHotspotStore(storeId, "");
|
|
|
728 |
return store.getHotspotId() + " - " + store.getCity();
|
|
|
729 |
} catch (Exception e) {
|
|
|
730 |
log.error("Unable to get hostspotStore for id : " + storeId, e);
|
|
|
731 |
}
|
|
|
732 |
return "N/A";
|
|
|
733 |
}
|
| 6985 |
anupam.sin |
734 |
|
| 13208 |
kshitij.so |
735 |
public Address getShippingAddress(Order order) {
|
|
|
736 |
Address address = new Address();
|
|
|
737 |
address.setLine1(order.getCustomer_address1());
|
|
|
738 |
address.setLine2(order.getCustomer_address2());
|
|
|
739 |
address.setCity(order.getCustomer_city());
|
|
|
740 |
address.setState(order.getCustomer_state());
|
|
|
741 |
address.setPin(order.getCustomer_pincode());
|
|
|
742 |
return address;
|
|
|
743 |
}
|
| 6985 |
anupam.sin |
744 |
|
| 13208 |
kshitij.so |
745 |
public String getOrderSource(Order order) {
|
|
|
746 |
return OrderSource.findByValue((int)(order.getSource())).toString();
|
|
|
747 |
}
|
| 6985 |
anupam.sin |
748 |
|
| 13208 |
kshitij.so |
749 |
public String getPaymentMethod(List<Attribute> paymentAttributes) {
|
|
|
750 |
String paymentMethod = null;
|
|
|
751 |
if (paymentAttributes == null || paymentAttributes.isEmpty()) {
|
|
|
752 |
return "N/A";
|
|
|
753 |
}
|
|
|
754 |
for (Attribute a : paymentAttributes) {
|
|
|
755 |
if ("payMethod".equals(a.getName())) {
|
|
|
756 |
paymentMethod = Constants.PAYMENT_METHOD.get(a.getValue());
|
|
|
757 |
break;
|
|
|
758 |
}
|
|
|
759 |
}
|
|
|
760 |
return paymentMethod != null ? paymentMethod : "N/A";
|
|
|
761 |
}
|
|
|
762 |
//Start:- Added by Manish Sharma for Physical Refunds
|
|
|
763 |
public String refundOrderPayment(){
|
|
|
764 |
try{
|
|
|
765 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
766 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient
|
|
|
767 |
= transactionServiceClient.getClient();
|
| 6985 |
anupam.sin |
768 |
|
| 13208 |
kshitij.so |
769 |
in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
|
|
|
770 |
List<in.shop2020.model.v1.order.Attribute> attrList = new ArrayList<in.shop2020.model.v1.order.Attribute>();
|
|
|
771 |
in.shop2020.model.v1.order.Attribute attr1 = new in.shop2020.model.v1.order.Attribute();
|
|
|
772 |
attr1.setName("Refund_Option");
|
|
|
773 |
in.shop2020.model.v1.order.Attribute attr2 = new in.shop2020.model.v1.order.Attribute();
|
|
|
774 |
attr2.setName("Refund_Amount");
|
|
|
775 |
in.shop2020.model.v1.order.Attribute attr3 = new in.shop2020.model.v1.order.Attribute();
|
|
|
776 |
attr3.setName("Refund_TimeStamp");
|
|
|
777 |
SimpleDateFormat timestmapFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
|
|
|
778 |
PaymentClient paymentServiceClient = new PaymentClient();
|
|
|
779 |
List<Payment> orderPayments =null;
|
|
|
780 |
if(!t_order.isCod()){
|
|
|
781 |
orderPayments =paymentServiceClient.getClient()
|
|
|
782 |
.getPaymentForTxnId(t_order.getTransactionId());
|
|
|
783 |
}
|
| 6985 |
anupam.sin |
784 |
|
| 13208 |
kshitij.so |
785 |
if(rfdRadio.equalsIgnoreCase("rfdCoupon")){
|
|
|
786 |
if((couponDetails!=null && !("").equalsIgnoreCase(couponDetails)) || (refundAmountCoupon!=null &&!("").equalsIgnoreCase(refundAmountCoupon))){
|
|
|
787 |
if(Double.parseDouble(refundAmountCoupon) <= t_order.getTotal_amount()){
|
|
|
788 |
log.info(Double.parseDouble(refundAmountCoupon));
|
|
|
789 |
log.info(t_order.getTotal_amount());
|
|
|
790 |
attr1.setValue("Refund By Coupon: "+couponDetails);
|
|
|
791 |
attrList.add(attr1);
|
|
|
792 |
attr2.setValue(refundAmountCoupon);
|
|
|
793 |
attrList.add(attr2);
|
|
|
794 |
attr3.setValue(timestmapFormat.format(Calendar.getInstance().getTime()));
|
|
|
795 |
attrList.add(attr3);
|
|
|
796 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
797 |
successmsg = "Refund Marked Successful: Through Coupon";
|
|
|
798 |
return "physical-refund-result";
|
|
|
799 |
}
|
|
|
800 |
else if(orderPayments !=null && !orderPayments.isEmpty()){
|
|
|
801 |
Payment payment = orderPayments.get(0);
|
|
|
802 |
if(Double.parseDouble(refundAmountCoupon) <= payment.getAmount()){
|
|
|
803 |
log.info(Double.parseDouble(refundAmountCoupon));
|
|
|
804 |
log.info(payment.getAmount());
|
|
|
805 |
attr1.setValue("Refund By Coupon: "+couponDetails);
|
|
|
806 |
attrList.add(attr1);
|
|
|
807 |
attr2.setValue(refundAmountCoupon);
|
|
|
808 |
attrList.add(attr2);
|
|
|
809 |
attr3.setValue(timestmapFormat.format(Calendar.getInstance().getTime()));
|
|
|
810 |
attrList.add(attr3);
|
|
|
811 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
812 |
successmsg = "Refund Marked Successful: Through Coupon";
|
|
|
813 |
return "physical-refund-result";
|
|
|
814 |
}
|
|
|
815 |
else{
|
|
|
816 |
errorMsg ="Refund Unsuccessful: Due to coupon amount greater than Payment Gateway Amount ";
|
|
|
817 |
return "physical-refund-result";
|
|
|
818 |
}
|
|
|
819 |
}
|
|
|
820 |
errorMsg ="Refund Unsuccessful: Due to coupon amount greater than Order Total Amount ";
|
|
|
821 |
}
|
|
|
822 |
else{
|
|
|
823 |
errorMsg ="Refund Unsuccessful: Due to either coupon details or refund amount is blank ";
|
|
|
824 |
return "physical-refund-result";
|
|
|
825 |
}
|
|
|
826 |
errorMsg ="Refund Unsuccessful: Due to coupon amount greater than order total amount ";
|
|
|
827 |
}
|
|
|
828 |
if(rfdRadio.equalsIgnoreCase("rfdCheque")){
|
|
|
829 |
if((chequeDetails!=null && !("").equalsIgnoreCase(chequeDetails)) || (refundAmountCheque!=null &&!("").equalsIgnoreCase(refundAmountCheque))){
|
|
|
830 |
if(Double.parseDouble(refundAmountCheque) <= t_order.getTotal_amount()){
|
|
|
831 |
attr1.setValue("Refund By Cheque: "+chequeDetails);
|
|
|
832 |
attrList.add(attr1);
|
|
|
833 |
attr2.setValue(refundAmountCheque);
|
|
|
834 |
attrList.add(attr2);
|
|
|
835 |
attr3.setValue(timestmapFormat.format(Calendar.getInstance().getTime()));
|
|
|
836 |
attrList.add(attr3);
|
|
|
837 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
838 |
successmsg = "Refund Marked Successful: Through Cheque";
|
|
|
839 |
return "physical-refund-result";
|
|
|
840 |
}
|
|
|
841 |
}
|
|
|
842 |
else{
|
|
|
843 |
errorMsg ="Refund Unsuccessful: Due to either cheque details or refund amount is blank ";
|
|
|
844 |
return "physical-refund-result";
|
|
|
845 |
}
|
|
|
846 |
errorMsg ="Refund Unsuccessful: Due to cheque amount greater than order total amount ";
|
|
|
847 |
}
|
|
|
848 |
if(rfdRadio.equalsIgnoreCase("rfdGateway")){
|
|
|
849 |
if((comments!=null && !("").equalsIgnoreCase(comments))
|
|
|
850 |
|| (refundAmountGateway!=null &&!("").equalsIgnoreCase(refundAmountGateway))){
|
|
|
851 |
if(orderPayments !=null && !orderPayments.isEmpty()){
|
|
|
852 |
Payment payment = orderPayments.get(0);
|
|
|
853 |
if(Double.parseDouble(refundAmountGateway) <= payment.getAmount()){
|
|
|
854 |
boolean refundResult = paymentServiceClient.getClient().refundPayment(t_order.getTransactionId(), Double.parseDouble(refundAmountGateway), false);
|
|
|
855 |
if(refundResult){
|
|
|
856 |
attr1.setValue("Refund By Payment Gatway: "+comments);
|
|
|
857 |
attrList.add(attr1);
|
|
|
858 |
attr2.setValue(refundAmountGateway);
|
|
|
859 |
attrList.add(attr2);
|
|
|
860 |
attr3.setValue(timestmapFormat.format(Calendar.getInstance().getTime()));
|
|
|
861 |
attrList.add(attr3);
|
|
|
862 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
863 |
successmsg = "Refund Marked Successful: Through Gateway";
|
|
|
864 |
return "physical-refund-result";
|
|
|
865 |
}
|
|
|
866 |
else{
|
|
|
867 |
if(payment.getGatewayId()==13L){
|
|
|
868 |
attr1.setValue("Refund By Innoviti Gatway: "+comments);
|
|
|
869 |
attrList.add(attr1);
|
|
|
870 |
attr2.setValue(refundAmountGateway);
|
|
|
871 |
attrList.add(attr2);
|
|
|
872 |
attr3.setValue(timestmapFormat.format(Calendar.getInstance().getTime()));
|
|
|
873 |
attrList.add(attr3);
|
|
|
874 |
transactionClient.setOrderAttributes(t_order.getId(), attrList);
|
|
|
875 |
successmsg = "Refund Marked Successful: Through Innoviti Payment Gateway.";
|
|
|
876 |
return "physical-refund-result";
|
|
|
877 |
}
|
|
|
878 |
errorMsg ="Refund Unsuccessful: at Payment Gateway ";
|
|
|
879 |
return "physical-refund-result";
|
|
|
880 |
}
|
|
|
881 |
}
|
|
|
882 |
else{
|
|
|
883 |
errorMsg ="Refund Unsuccessful: Due to refund Amount is greater than Payment Gateway Amount ";
|
|
|
884 |
return "physical-refund-result";
|
|
|
885 |
}
|
|
|
886 |
}
|
|
|
887 |
errorMsg ="Refund Unsuccessful: There is no Payment to be refunded ";
|
|
|
888 |
}
|
|
|
889 |
else{
|
|
|
890 |
errorMsg ="Refund Unsuccessful: Due to either comments or refund amount is blank ";
|
|
|
891 |
return "physical-refund-result";
|
|
|
892 |
}
|
| 6985 |
anupam.sin |
893 |
|
| 13208 |
kshitij.so |
894 |
}
|
| 6985 |
anupam.sin |
895 |
|
| 13208 |
kshitij.so |
896 |
}
|
|
|
897 |
catch(Exception e){
|
|
|
898 |
log.error(e);
|
|
|
899 |
}
|
|
|
900 |
return "physical-refund-result";
|
|
|
901 |
}
|
| 6985 |
anupam.sin |
902 |
|
| 13208 |
kshitij.so |
903 |
public int getRefundEnabledStatus(){
|
|
|
904 |
try{
|
|
|
905 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
906 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient
|
|
|
907 |
= transactionServiceClient.getClient();
|
|
|
908 |
in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
|
|
|
909 |
if(OrderSource.WEBSITE.getValue()!=t_order.getSource()){
|
|
|
910 |
return 1;
|
|
|
911 |
}
|
|
|
912 |
String refundOption=transactionClient.getOrderAttributeValue(orderId, "Refund_Option");
|
|
|
913 |
String refundAmount=transactionClient.getOrderAttributeValue(orderId, "Refund_Amount");
|
|
|
914 |
String refundTimeStamp = transactionClient.getOrderAttributeValue(orderId, "Refund_TimeStamp");
|
|
|
915 |
List<String> details = new ArrayList<String>();
|
|
|
916 |
if(refundOption!=null && !("").equalsIgnoreCase(refundOption)){
|
|
|
917 |
details.add("Refund Option:- "+refundOption);
|
|
|
918 |
}
|
| 6985 |
anupam.sin |
919 |
|
| 13208 |
kshitij.so |
920 |
if(refundAmount!=null && !("").equalsIgnoreCase(refundAmount)){
|
|
|
921 |
details.add("Refund Amount:- "+refundAmount);
|
|
|
922 |
}
|
| 6985 |
anupam.sin |
923 |
|
| 13208 |
kshitij.so |
924 |
if(refundTimeStamp!=null && !("").equalsIgnoreCase(refundTimeStamp)){
|
|
|
925 |
details.add("Refund TimeStamp:- "+refundTimeStamp);
|
|
|
926 |
}
|
|
|
927 |
setPhysicalRefundDetails(details);
|
| 7190 |
amar.kumar |
928 |
|
| 13208 |
kshitij.so |
929 |
if((refundOption!=null && refundAmount!=null) && (!("").equalsIgnoreCase(refundOption)) && !("").equalsIgnoreCase(refundAmount)){
|
|
|
930 |
System.out.println("Into the Refund Condition");
|
|
|
931 |
return 0;
|
|
|
932 |
}
|
| 7372 |
kshitij.so |
933 |
|
| 13208 |
kshitij.so |
934 |
else if(t_order.isCod()){
|
|
|
935 |
if(setOfrefundableStates.contains(t_order.getStatus()) && SecurityUtils.getSubject().hasRole("TeamLead")){
|
|
|
936 |
System.out.println("Into the COD Status Condition");
|
|
|
937 |
return 2;
|
|
|
938 |
}
|
|
|
939 |
}
|
|
|
940 |
else{
|
|
|
941 |
if(( setOfprepaidrefundableStates.contains(t_order.getStatus()) || setOfrefundableStates.contains(t_order.getStatus()) ) && SecurityUtils.getSubject().hasRole("TeamLead") && (payments.get(0).getStatus() == PaymentStatus.SUCCESS || t_order.isSetOriginalOrderId())){
|
|
|
942 |
System.out.println("Into the Prepaid Status Condition");
|
|
|
943 |
return 2;
|
|
|
944 |
}
|
|
|
945 |
}
|
|
|
946 |
}
|
|
|
947 |
catch(Exception e){
|
|
|
948 |
log.error(e);
|
|
|
949 |
}
|
|
|
950 |
return 1;
|
|
|
951 |
}
|
| 7372 |
kshitij.so |
952 |
|
| 13208 |
kshitij.so |
953 |
public int checkForOriginalOrders(){
|
|
|
954 |
try{
|
|
|
955 |
TransactionClient transactionServiceClient = new TransactionClient();
|
|
|
956 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient
|
|
|
957 |
= transactionServiceClient.getClient();
|
|
|
958 |
in.shop2020.model.v1.order.Order t_order = transactionClient.getOrder(orderId);
|
|
|
959 |
if(t_order.getOriginalOrderId()!=0l && t_order.getOriginalOrderId() > 0l){
|
|
|
960 |
in.shop2020.model.v1.order.Order old_order = transactionClient.getOrder(t_order.getOriginalOrderId());
|
|
|
961 |
if(old_order.isCod()){
|
|
|
962 |
return 1;
|
|
|
963 |
}
|
|
|
964 |
else{
|
|
|
965 |
return 2;
|
|
|
966 |
}
|
|
|
967 |
}
|
|
|
968 |
}
|
|
|
969 |
catch(Exception e){
|
|
|
970 |
log.error(e);
|
|
|
971 |
}
|
|
|
972 |
return 0;
|
|
|
973 |
}
|
| 7372 |
kshitij.so |
974 |
|
| 13208 |
kshitij.so |
975 |
public void setPhysicalRefundDetails(List<String> details){
|
|
|
976 |
this.refundDetails = details;
|
|
|
977 |
}
|
| 7372 |
kshitij.so |
978 |
|
| 13208 |
kshitij.so |
979 |
public List<String> getPhysicalRefundDetails(){
|
|
|
980 |
return this.refundDetails;
|
|
|
981 |
}
|
|
|
982 |
//End:- Added by Manish Sharma for Physical Refunds
|
| 7372 |
kshitij.so |
983 |
|
| 13208 |
kshitij.so |
984 |
public void setOrderId(String orderId) {
|
|
|
985 |
try {
|
|
|
986 |
this.orderId = Long.parseLong(orderId);
|
|
|
987 |
} catch (NumberFormatException e) {
|
|
|
988 |
log.error(e);
|
|
|
989 |
}
|
|
|
990 |
}
|
| 7372 |
kshitij.so |
991 |
|
| 13208 |
kshitij.so |
992 |
public List<Payment> getPayments() {
|
|
|
993 |
return payments;
|
|
|
994 |
}
|
| 7372 |
kshitij.so |
995 |
|
| 13208 |
kshitij.so |
996 |
public List<ShipmentUpdate> getShipmentUpdates() {
|
|
|
997 |
return shipmentUpdates;
|
|
|
998 |
}
|
| 7372 |
kshitij.so |
999 |
|
| 13208 |
kshitij.so |
1000 |
public void setShipmentUpdates(List<ShipmentUpdate> shipmentUpdates) {
|
|
|
1001 |
this.shipmentUpdates = shipmentUpdates;
|
|
|
1002 |
}
|
| 7372 |
kshitij.so |
1003 |
|
| 13208 |
kshitij.so |
1004 |
public Order getOrder() {
|
|
|
1005 |
return order;
|
|
|
1006 |
}
|
| 7372 |
kshitij.so |
1007 |
|
| 13208 |
kshitij.so |
1008 |
public void setOrder(Order order) {
|
|
|
1009 |
this.order = order;
|
|
|
1010 |
}
|
| 7372 |
kshitij.so |
1011 |
|
| 13208 |
kshitij.so |
1012 |
public Long getCodTicketId() {
|
|
|
1013 |
return codTicketId;
|
|
|
1014 |
}
|
| 7372 |
kshitij.so |
1015 |
|
| 13208 |
kshitij.so |
1016 |
public void setCodTicketId(Long codTicketId) {
|
|
|
1017 |
this.codTicketId = codTicketId;
|
|
|
1018 |
}
|
| 7372 |
kshitij.so |
1019 |
|
| 13208 |
kshitij.so |
1020 |
public List<Address> getAddresses() {
|
|
|
1021 |
return addresses;
|
|
|
1022 |
}
|
| 7372 |
kshitij.so |
1023 |
|
| 13208 |
kshitij.so |
1024 |
public void setAddresses(List<Address> addresses) {
|
|
|
1025 |
this.addresses = addresses;
|
|
|
1026 |
}
|
| 7372 |
kshitij.so |
1027 |
|
| 13208 |
kshitij.so |
1028 |
public String getOrderStatusDescription(Order order) {
|
|
|
1029 |
String status = order.getStatus().getDescription();
|
| 7190 |
amar.kumar |
1030 |
|
| 13208 |
kshitij.so |
1031 |
if (order.getStatus() == OrderStatus.DELIVERY_SUCCESS) {
|
|
|
1032 |
status = "Completed";
|
|
|
1033 |
}
|
| 7190 |
amar.kumar |
1034 |
|
| 13208 |
kshitij.so |
1035 |
return status;
|
|
|
1036 |
}
|
| 7190 |
amar.kumar |
1037 |
|
| 13208 |
kshitij.so |
1038 |
public String getCancellationInitiator() {
|
|
|
1039 |
return cancellationInitiator;
|
|
|
1040 |
}
|
| 7190 |
amar.kumar |
1041 |
|
| 13208 |
kshitij.so |
1042 |
public void setCancellationInitiator(String cancellationInitiator) {
|
|
|
1043 |
this.cancellationInitiator = cancellationInitiator;
|
|
|
1044 |
}
|
| 7190 |
amar.kumar |
1045 |
|
| 13208 |
kshitij.so |
1046 |
public String getCancelReason() {
|
|
|
1047 |
return cancelReason;
|
|
|
1048 |
}
|
| 7190 |
amar.kumar |
1049 |
|
| 13208 |
kshitij.so |
1050 |
public void setCancelReason(String cancelReason) {
|
|
|
1051 |
this.cancelReason = cancelReason;
|
|
|
1052 |
}
|
| 7190 |
amar.kumar |
1053 |
|
| 13208 |
kshitij.so |
1054 |
public String getBody() {
|
|
|
1055 |
return body;
|
|
|
1056 |
}
|
| 7372 |
kshitij.so |
1057 |
|
| 13208 |
kshitij.so |
1058 |
public void setBody(String body) {
|
|
|
1059 |
this.body = body;
|
|
|
1060 |
}
|
|
|
1061 |
|
|
|
1062 |
public String getLine1() {
|
|
|
1063 |
return line1;
|
|
|
1064 |
}
|
|
|
1065 |
|
|
|
1066 |
public void setLine1(String line1) {
|
|
|
1067 |
this.line1 = line1;
|
|
|
1068 |
}
|
|
|
1069 |
|
|
|
1070 |
public String getLine2() {
|
|
|
1071 |
return line2;
|
|
|
1072 |
}
|
|
|
1073 |
|
|
|
1074 |
public void setLine2(String line2) {
|
|
|
1075 |
this.line2 = line2;
|
|
|
1076 |
}
|
|
|
1077 |
|
|
|
1078 |
public String getCity() {
|
|
|
1079 |
return city;
|
|
|
1080 |
}
|
|
|
1081 |
|
|
|
1082 |
public void setCity(String city) {
|
|
|
1083 |
this.city = city;
|
|
|
1084 |
}
|
|
|
1085 |
|
|
|
1086 |
public String getState() {
|
|
|
1087 |
return state;
|
|
|
1088 |
}
|
|
|
1089 |
|
|
|
1090 |
public void setState(String state) {
|
|
|
1091 |
this.state = state;
|
|
|
1092 |
}
|
|
|
1093 |
|
|
|
1094 |
public String getPin() {
|
|
|
1095 |
return pin;
|
|
|
1096 |
}
|
|
|
1097 |
|
|
|
1098 |
public void setPin(String pin) {
|
|
|
1099 |
this.pin = pin;
|
|
|
1100 |
}
|
|
|
1101 |
|
|
|
1102 |
public String getFreebieItem() {
|
|
|
1103 |
return freebieItem;
|
|
|
1104 |
}
|
|
|
1105 |
|
|
|
1106 |
public void setFreebieItem(String freebieItem) {
|
|
|
1107 |
this.freebieItem = freebieItem;
|
|
|
1108 |
}
|
|
|
1109 |
|
|
|
1110 |
public String getDealText() {
|
|
|
1111 |
return dealText;
|
|
|
1112 |
}
|
|
|
1113 |
|
|
|
1114 |
public void setDealText(String dealText) {
|
|
|
1115 |
this.dealText = dealText;
|
|
|
1116 |
}
|
|
|
1117 |
|
|
|
1118 |
public String getParentOrderIdForFreebieOrder() {
|
|
|
1119 |
return parentOrderIdForFreebieOrder;
|
|
|
1120 |
}
|
|
|
1121 |
|
|
|
1122 |
public void setParentOrderIdForFreebieOrder(String parentOrderIdForFreebieOrder) {
|
|
|
1123 |
this.parentOrderIdForFreebieOrder = parentOrderIdForFreebieOrder;
|
|
|
1124 |
}
|
|
|
1125 |
|
|
|
1126 |
public String getFreebieOrderId() {
|
|
|
1127 |
return freebieOrderId;
|
|
|
1128 |
}
|
|
|
1129 |
|
|
|
1130 |
public void setFreebieOrderId(String freebieOrderId) {
|
|
|
1131 |
this.freebieOrderId = freebieOrderId;
|
|
|
1132 |
}
|
|
|
1133 |
|
| 7393 |
anupam.sin |
1134 |
public void setCashAmount(double cashAmount) {
|
|
|
1135 |
this.cashAmount = cashAmount;
|
|
|
1136 |
}
|
|
|
1137 |
|
|
|
1138 |
public double getCashAmount() {
|
|
|
1139 |
return cashAmount;
|
|
|
1140 |
}
|
|
|
1141 |
|
|
|
1142 |
public void setCardAmount(double cardAmount) {
|
|
|
1143 |
this.cardAmount = cardAmount;
|
|
|
1144 |
}
|
|
|
1145 |
|
|
|
1146 |
public double getCardAmount() {
|
|
|
1147 |
return cardAmount;
|
|
|
1148 |
}
|
|
|
1149 |
|
|
|
1150 |
public long getOrderId() {
|
|
|
1151 |
return orderId;
|
|
|
1152 |
}
|
|
|
1153 |
|
|
|
1154 |
public void setOrderId(long orderId) {
|
|
|
1155 |
this.orderId = orderId;
|
|
|
1156 |
}
|
|
|
1157 |
|
|
|
1158 |
public StoreOrderDetail getStoreOrderDetail() {
|
|
|
1159 |
return storeOrderDetail;
|
|
|
1160 |
}
|
|
|
1161 |
|
|
|
1162 |
public void setStoreOrderDetail(StoreOrderDetail storeOrderDetail) {
|
|
|
1163 |
this.storeOrderDetail = storeOrderDetail;
|
|
|
1164 |
}
|
| 13208 |
kshitij.so |
1165 |
|
|
|
1166 |
//Start:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 7826 |
manish.sha |
1167 |
public AmazonOrder getAmazonOrder() {
|
| 13208 |
kshitij.so |
1168 |
return amazonOrder;
|
|
|
1169 |
}
|
| 7393 |
anupam.sin |
1170 |
|
| 13208 |
kshitij.so |
1171 |
public void setAmazonOrder(AmazonOrder amazonOrder) {
|
|
|
1172 |
this.amazonOrder = amazonOrder;
|
|
|
1173 |
}
|
| 7826 |
manish.sha |
1174 |
|
| 13208 |
kshitij.so |
1175 |
//End:- Added by Manish Sharma for Displaying Logistics Provider Id and Amazon Order Id on 25-Jul-2013
|
| 7826 |
manish.sha |
1176 |
|
| 7836 |
anupam.sin |
1177 |
public void setProviderName(String providerName) {
|
|
|
1178 |
this.providerName = providerName;
|
|
|
1179 |
}
|
|
|
1180 |
|
|
|
1181 |
public String getProviderName() {
|
|
|
1182 |
return providerName;
|
|
|
1183 |
}
|
| 13208 |
kshitij.so |
1184 |
|
| 7836 |
anupam.sin |
1185 |
public static void main(String[] args) {
|
| 13208 |
kshitij.so |
1186 |
|
| 7836 |
anupam.sin |
1187 |
}
|
|
|
1188 |
|
| 13208 |
kshitij.so |
1189 |
public void setGvAmount(long gvAmount) {
|
|
|
1190 |
this.gvAmount = gvAmount;
|
|
|
1191 |
}
|
| 8296 |
kshitij.so |
1192 |
|
| 13208 |
kshitij.so |
1193 |
public long getGvAmount() {
|
|
|
1194 |
return gvAmount;
|
|
|
1195 |
}
|
|
|
1196 |
//Start:- Added by Manish Sharma for Physical Refunds
|
|
|
1197 |
public String getRfdRadio() {
|
|
|
1198 |
return rfdRadio;
|
|
|
1199 |
}
|
| 8296 |
kshitij.so |
1200 |
|
| 8824 |
manish.sha |
1201 |
|
| 13208 |
kshitij.so |
1202 |
public void setRfdRadio(String rfdRadio) {
|
|
|
1203 |
this.rfdRadio = rfdRadio;
|
|
|
1204 |
}
|
| 8824 |
manish.sha |
1205 |
|
|
|
1206 |
|
| 13208 |
kshitij.so |
1207 |
public String getCouponDetails() {
|
|
|
1208 |
return couponDetails;
|
|
|
1209 |
}
|
| 8824 |
manish.sha |
1210 |
|
|
|
1211 |
|
| 13208 |
kshitij.so |
1212 |
public void setCouponDetails(String couponDetails) {
|
|
|
1213 |
this.couponDetails = couponDetails;
|
|
|
1214 |
}
|
| 8824 |
manish.sha |
1215 |
|
|
|
1216 |
|
| 13208 |
kshitij.so |
1217 |
public String getRefundAmountCoupon() {
|
|
|
1218 |
return refundAmountCoupon;
|
|
|
1219 |
}
|
| 8824 |
manish.sha |
1220 |
|
|
|
1221 |
|
| 13208 |
kshitij.so |
1222 |
public void setRefundAmountCoupon(String refundAmountCoupon) {
|
|
|
1223 |
this.refundAmountCoupon = refundAmountCoupon;
|
|
|
1224 |
}
|
| 8824 |
manish.sha |
1225 |
|
|
|
1226 |
|
| 13208 |
kshitij.so |
1227 |
public String getChequeDetails() {
|
|
|
1228 |
return chequeDetails;
|
|
|
1229 |
}
|
| 8824 |
manish.sha |
1230 |
|
|
|
1231 |
|
| 13208 |
kshitij.so |
1232 |
public void setChequeDetails(String chequeDetails) {
|
|
|
1233 |
this.chequeDetails = chequeDetails;
|
|
|
1234 |
}
|
| 8824 |
manish.sha |
1235 |
|
|
|
1236 |
|
| 13208 |
kshitij.so |
1237 |
public String getRefundAmountCheque() {
|
|
|
1238 |
return refundAmountCheque;
|
|
|
1239 |
}
|
| 8824 |
manish.sha |
1240 |
|
|
|
1241 |
|
| 13208 |
kshitij.so |
1242 |
public void setRefundAmountCheque(String refundAmountCheque) {
|
|
|
1243 |
this.refundAmountCheque = refundAmountCheque;
|
|
|
1244 |
}
|
| 8824 |
manish.sha |
1245 |
|
|
|
1246 |
|
| 13208 |
kshitij.so |
1247 |
public String getRefundAmountGateway() {
|
|
|
1248 |
return refundAmountGateway;
|
|
|
1249 |
}
|
| 8824 |
manish.sha |
1250 |
|
|
|
1251 |
|
| 13208 |
kshitij.so |
1252 |
public void setRefundAmountGateway(String refundAmountGateway) {
|
|
|
1253 |
this.refundAmountGateway = refundAmountGateway;
|
|
|
1254 |
}
|
| 8824 |
manish.sha |
1255 |
|
|
|
1256 |
|
| 13208 |
kshitij.so |
1257 |
public String getComments() {
|
|
|
1258 |
return comments;
|
|
|
1259 |
}
|
| 8824 |
manish.sha |
1260 |
|
|
|
1261 |
|
| 13208 |
kshitij.so |
1262 |
public void setComments(String comments) {
|
|
|
1263 |
this.comments = comments;
|
|
|
1264 |
}
|
|
|
1265 |
|
|
|
1266 |
public String getErrorMsg(){
|
| 8824 |
manish.sha |
1267 |
return this.errorMsg;
|
|
|
1268 |
}
|
| 13208 |
kshitij.so |
1269 |
|
|
|
1270 |
public String getSuccessMessage(){
|
|
|
1271 |
return this.successmsg ;
|
|
|
1272 |
}
|
|
|
1273 |
|
|
|
1274 |
public void setBillingWarehouseName(String billingWarehouseName) {
|
|
|
1275 |
this.billingWarehouseName = billingWarehouseName;
|
|
|
1276 |
}
|
|
|
1277 |
|
|
|
1278 |
public String getBillingWarehouseName() {
|
|
|
1279 |
return billingWarehouseName;
|
|
|
1280 |
}
|
|
|
1281 |
|
| 13440 |
amit.gupta |
1282 |
|
|
|
1283 |
public String getGatewayName(Payment payment){
|
|
|
1284 |
return CRMConstants.PAYMENT_GATEWAYS.get(payment.getGatewayId());
|
|
|
1285 |
}
|
| 13208 |
kshitij.so |
1286 |
|
| 13440 |
amit.gupta |
1287 |
|
| 2674 |
vikas |
1288 |
}
|