| 4207 |
mandeep.dh |
1 |
/**
|
|
|
2 |
*
|
|
|
3 |
*/
|
|
|
4 |
package in.shop2020.support.controllers;
|
|
|
5 |
|
| 22451 |
amit.gupta |
6 |
import in.shop2020.logistics.PickUpType;
|
| 5945 |
mandeep.dh |
7 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| 4207 |
mandeep.dh |
8 |
import in.shop2020.model.v1.catalog.Item;
|
|
|
9 |
import in.shop2020.model.v1.order.LineItem;
|
|
|
10 |
import in.shop2020.model.v1.order.Order;
|
| 7293 |
anupam.sin |
11 |
import in.shop2020.model.v1.order.OrderSource;
|
| 4207 |
mandeep.dh |
12 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 5527 |
anupam.sin |
13 |
import in.shop2020.model.v1.order.OrderType;
|
| 8925 |
amar.kumar |
14 |
import in.shop2020.model.v1.order.ProductCondition;
|
| 4207 |
mandeep.dh |
15 |
import in.shop2020.model.v1.order.Transaction;
|
|
|
16 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
|
|
17 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
|
|
18 |
import in.shop2020.model.v1.order.TransactionStatus;
|
|
|
19 |
import in.shop2020.model.v1.user.Address;
|
| 22451 |
amit.gupta |
20 |
import in.shop2020.model.v1.user.ItemPriceQuantity;
|
| 4207 |
mandeep.dh |
21 |
import in.shop2020.model.v1.user.User;
|
|
|
22 |
import in.shop2020.model.v1.user.UserContextException;
|
|
|
23 |
import in.shop2020.payments.Attribute;
|
|
|
24 |
import in.shop2020.payments.Payment;
|
|
|
25 |
import in.shop2020.payments.PaymentException;
|
|
|
26 |
import in.shop2020.payments.PaymentStatus;
|
|
|
27 |
import in.shop2020.thrift.clients.CatalogClient;
|
|
|
28 |
import in.shop2020.thrift.clients.PaymentClient;
|
|
|
29 |
import in.shop2020.thrift.clients.TransactionClient;
|
|
|
30 |
import in.shop2020.thrift.clients.UserClient;
|
|
|
31 |
import in.shop2020.utils.ModelUtils;
|
|
|
32 |
|
|
|
33 |
import java.text.SimpleDateFormat;
|
|
|
34 |
import java.util.ArrayList;
|
|
|
35 |
import java.util.Collections;
|
|
|
36 |
import java.util.Date;
|
|
|
37 |
import java.util.List;
|
|
|
38 |
import java.util.Map;
|
|
|
39 |
|
|
|
40 |
import org.apache.commons.logging.Log;
|
|
|
41 |
import org.apache.commons.logging.LogFactory;
|
|
|
42 |
import org.apache.thrift.TException;
|
|
|
43 |
|
|
|
44 |
import com.opensymphony.xwork2.ValidationAwareSupport;
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
* @author mandeep
|
|
|
48 |
*
|
|
|
49 |
*/
|
|
|
50 |
@SuppressWarnings("serial")
|
|
|
51 |
public class BulkOrderController extends ValidationAwareSupport {
|
| 22451 |
amit.gupta |
52 |
private static final int RTGS_GATEWAY_ID = 6;
|
|
|
53 |
private static final int WALLET_GATEWAY_ID = 8;
|
| 4207 |
mandeep.dh |
54 |
|
| 22451 |
amit.gupta |
55 |
private static Log log = LogFactory.getLog(BulkOrderController.class);
|
|
|
56 |
private SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| 4207 |
mandeep.dh |
57 |
|
| 22451 |
amit.gupta |
58 |
private static final String IFSC_CODE = "ifscCode";
|
|
|
59 |
private static final String RTGS_BRANCH = "rtgsBranch";
|
|
|
60 |
private static final String RTGS_BANK = "rtgsBank";
|
|
|
61 |
private static final String RTGS_ID = "rtgsId";
|
|
|
62 |
private static final String PAY_METHOD = "payMethod";
|
| 4207 |
mandeep.dh |
63 |
|
| 22451 |
amit.gupta |
64 |
private String id;
|
|
|
65 |
private String transactionId;
|
|
|
66 |
private String customerEmailId;
|
|
|
67 |
private String rtgsId;
|
|
|
68 |
private String rtgsBank;
|
|
|
69 |
private String rtgsBranch;
|
|
|
70 |
private String ifscCode;
|
|
|
71 |
private String amount;
|
|
|
72 |
private String itemId;
|
|
|
73 |
private String output;
|
|
|
74 |
private String pickUp;
|
|
|
75 |
private String orderType;
|
|
|
76 |
private String tinNumber;
|
|
|
77 |
private String poRefNumber;
|
|
|
78 |
private int productCondition;
|
|
|
79 |
private Transaction transaction;
|
|
|
80 |
private Payment payment;
|
|
|
81 |
private long userWalletAmount;
|
|
|
82 |
private int userId;
|
| 4207 |
mandeep.dh |
83 |
|
| 22451 |
amit.gupta |
84 |
private Map<Transaction, Double> transactions;
|
|
|
85 |
private List<LineItem> lineItems;
|
| 4207 |
mandeep.dh |
86 |
|
| 22451 |
amit.gupta |
87 |
public String index() {
|
|
|
88 |
// transactions = new HashMap<Transaction, Double>();
|
| 4207 |
mandeep.dh |
89 |
|
| 22451 |
amit.gupta |
90 |
/*
|
|
|
91 |
* try { Client transactionClient = new TransactionClient().getClient();
|
|
|
92 |
* in.shop2020.payments.PaymentService.Client paymentClient = new
|
|
|
93 |
* PaymentClient().getClient(); List<Payment> payments =
|
|
|
94 |
* paymentClient.getPayments(0, new Date().getTime(),
|
|
|
95 |
* PaymentStatus.SUCCESS, RTGS_GATEWAY_ID);
|
|
|
96 |
*
|
|
|
97 |
* log.info("Loaded " + payments.size() + " payments"); for (Payment
|
|
|
98 |
* payment : payments) { Transaction txn =
|
|
|
99 |
* transactionClient.getTransaction(payment.getMerchantTxnId());
|
|
|
100 |
* log.info("Got " + txn); transactions.put(txn, payment.getAmount()); }
|
|
|
101 |
* } catch (TTransportException e) {
|
|
|
102 |
* log.error("Could not create transaction client", e); } catch
|
|
|
103 |
* (TransactionServiceException e) {
|
|
|
104 |
* log.error("Could not lookup transaction", e); } catch (TException e)
|
|
|
105 |
* { log.error("Could not find payment", e); } catch (PaymentException
|
|
|
106 |
* e) { log.error("Could not find payment", e); }
|
|
|
107 |
*/
|
| 4207 |
mandeep.dh |
108 |
|
| 22451 |
amit.gupta |
109 |
return "index";
|
|
|
110 |
}
|
| 4207 |
mandeep.dh |
111 |
|
| 22451 |
amit.gupta |
112 |
public String editNew() throws Throwable {
|
|
|
113 |
in.shop2020.model.v1.user.UserContextService.Client userClient = new UserClient().getClient();
|
|
|
114 |
User user = userClient.getUserByEmail(customerEmailId);
|
|
|
115 |
Client transactionClient = new TransactionClient().getClient();
|
|
|
116 |
this.userWalletAmount = transactionClient.getUserWallet(user.getUserId()).getAmount();
|
|
|
117 |
return "editNew";
|
|
|
118 |
}
|
| 4207 |
mandeep.dh |
119 |
|
| 22451 |
amit.gupta |
120 |
public String show() {
|
|
|
121 |
try {
|
|
|
122 |
transactionId = id;
|
| 4207 |
mandeep.dh |
123 |
|
| 22451 |
amit.gupta |
124 |
Client transactionClient = new TransactionClient().getClient();
|
|
|
125 |
transaction = transactionClient.getTransaction(Long.valueOf(transactionId));
|
| 4207 |
mandeep.dh |
126 |
|
| 22451 |
amit.gupta |
127 |
in.shop2020.payments.PaymentService.Client paymentClient = new PaymentClient().getClient();
|
|
|
128 |
payment = paymentClient.getPaymentForTxnId(Long.valueOf(transactionId)).get(0);
|
| 4207 |
mandeep.dh |
129 |
|
| 22451 |
amit.gupta |
130 |
} catch (NumberFormatException e) {
|
|
|
131 |
log.error("Could not lookup transaction Id: " + transactionId, e);
|
|
|
132 |
} catch (TransactionServiceException e) {
|
|
|
133 |
log.error("Could not lookup transaction Id: " + transactionId, e);
|
|
|
134 |
} catch (TException e) {
|
|
|
135 |
log.error("Could not lookup transaction Id: " + transactionId, e);
|
|
|
136 |
} catch (PaymentException e) {
|
|
|
137 |
log.error("Could not lookup payment for transaction Id: " + transactionId, e);
|
|
|
138 |
}
|
| 4207 |
mandeep.dh |
139 |
|
| 22451 |
amit.gupta |
140 |
return "show";
|
|
|
141 |
}
|
| 4207 |
mandeep.dh |
142 |
|
| 22451 |
amit.gupta |
143 |
public String create() {
|
|
|
144 |
log.info("Creating orders for " + lineItems);
|
|
|
145 |
boolean hasError = true;
|
| 4207 |
mandeep.dh |
146 |
|
| 22451 |
amit.gupta |
147 |
try {
|
|
|
148 |
in.shop2020.model.v1.user.UserContextService.Client userClient = new UserClient().getClient();
|
|
|
149 |
User user = userClient.getUserByEmail(customerEmailId);
|
|
|
150 |
Client transactionClient = new TransactionClient().getClient();
|
|
|
151 |
List<ItemPriceQuantity> ipqList = new ArrayList<ItemPriceQuantity>();
|
|
|
152 |
double totalAmount = 0;
|
| 4207 |
mandeep.dh |
153 |
|
| 22451 |
amit.gupta |
154 |
if (user == null) {
|
|
|
155 |
addActionError("Could not find user by email: " + customerEmailId);
|
|
|
156 |
} else {
|
|
|
157 |
double walletAmount = transactionClient.getUserWallet(user.getUserId()).getAmount();
|
|
|
158 |
for (LineItem li : lineItems) {
|
|
|
159 |
ItemPriceQuantity ipq = new ItemPriceQuantity();
|
|
|
160 |
ipq.setQty((long) li.getQuantity());
|
|
|
161 |
ipq.setItemId(li.getItemId());
|
|
|
162 |
ipq.setPrice(li.getUnit_price());
|
|
|
163 |
ipqList.add(ipq);
|
|
|
164 |
totalAmount = li.getUnit_price() * li.getQuantity();
|
|
|
165 |
}
|
|
|
166 |
if (totalAmount > walletAmount) {
|
|
|
167 |
addActionError("Total Amount not be greater than wallet amount");
|
|
|
168 |
} else if (!userClient.addItemPricingToCart(user.getActiveCartId(), ipqList)) {
|
|
|
169 |
addActionError("Total Amount not be greater than wallet amount");
|
|
|
170 |
} else {
|
|
|
171 |
log.info("Setting wallet amount in cart");
|
|
|
172 |
userClient.setWalletAmountInCart(user.getActiveCartId(), walletAmount);
|
|
|
173 |
transactionId = String.valueOf(userClient.createOrders(user.getActiveCartId(), "", 0, "", 0, user.getUserId(), 7890,
|
|
|
174 |
OrderSource.WEBSITE.getValue(), true));
|
|
|
175 |
log.info("Creating wallet payment for transactionId - " + transactionId);
|
|
|
176 |
createPayment(user);
|
| 4207 |
mandeep.dh |
177 |
|
| 22451 |
amit.gupta |
178 |
in.shop2020.model.v1.order.Attribute orderAttribute1 = new in.shop2020.model.v1.order.Attribute();
|
|
|
179 |
orderAttribute1.setName("poRefNumber");
|
|
|
180 |
orderAttribute1.setValue(poRefNumber);
|
| 4207 |
mandeep.dh |
181 |
|
| 22451 |
amit.gupta |
182 |
if (!poRefNumber.equals("") && !(poRefNumber == null)) {
|
|
|
183 |
transactionClient.setOrderAttributeForTransaction(Long.parseLong(transactionId), orderAttribute1);
|
|
|
184 |
}
|
|
|
185 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.AUTHORIZED,
|
|
|
186 |
"Payment received for the order", PickUpType.valueOf(pickUp).getValue(), OrderType.valueOf(orderType),
|
|
|
187 |
OrderSource.WEBSITE);
|
|
|
188 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.IN_PROCESS,
|
|
|
189 |
"RTGS Payment accepted", PickUpType.valueOf(pickUp).getValue(), OrderType.valueOf(orderType),
|
|
|
190 |
OrderSource.WEBSITE);
|
|
|
191 |
log.info("Successfully created transaction: " + transactionId + " for amount: " + amount);
|
|
|
192 |
hasError = false;
|
|
|
193 |
}
|
|
|
194 |
}
|
|
|
195 |
} catch (Exception e) {
|
|
|
196 |
addActionError("Error occerred" + e.getMessage());
|
|
|
197 |
e.printStackTrace();
|
|
|
198 |
}
|
|
|
199 |
if (hasError) {
|
|
|
200 |
return "error";
|
|
|
201 |
}
|
| 4207 |
mandeep.dh |
202 |
|
| 22451 |
amit.gupta |
203 |
id = transactionId;
|
|
|
204 |
return show();
|
|
|
205 |
}
|
| 4207 |
mandeep.dh |
206 |
|
| 22451 |
amit.gupta |
207 |
public String getModelName() {
|
|
|
208 |
output = "Invalid Item Id: " + itemId;
|
| 4207 |
mandeep.dh |
209 |
|
| 22451 |
amit.gupta |
210 |
try {
|
|
|
211 |
in.shop2020.model.v1.catalog.CatalogService.Client client = new CatalogClient().getClient();
|
|
|
212 |
Item item = client.getItem(Long.parseLong(itemId));
|
|
|
213 |
if (item != null && item.getId() != 0) {
|
|
|
214 |
output = ModelUtils.extractProductNameFromItem(item);
|
|
|
215 |
}
|
|
|
216 |
} catch (NumberFormatException e) {
|
|
|
217 |
log.error("Could not parse itemId: " + itemId, e);
|
|
|
218 |
} catch (CatalogServiceException e) {
|
|
|
219 |
log.error("Could not lookup itemId: " + itemId, e);
|
|
|
220 |
} catch (TException e) {
|
|
|
221 |
log.error("Could not find itemId: " + itemId, e);
|
|
|
222 |
}
|
| 4207 |
mandeep.dh |
223 |
|
| 22451 |
amit.gupta |
224 |
return "output";
|
|
|
225 |
}
|
|
|
226 |
/**
|
|
|
227 |
As it is always going to be wallet
|
|
|
228 |
**/
|
|
|
229 |
private void createPayment(User user) throws NumberFormatException, PaymentException, TException {
|
|
|
230 |
List<Attribute> paymentAttributes = new ArrayList<Attribute>();
|
|
|
231 |
paymentAttributes.add(new Attribute(PAY_METHOD, "7890"));
|
|
|
232 |
/*
|
|
|
233 |
* paymentAttributes.add(new Attribute(RTGS_ID, rtgsId));
|
|
|
234 |
* paymentAttributes.add(new Attribute(RTGS_BANK, rtgsBank));
|
|
|
235 |
* paymentAttributes.add(new Attribute(RTGS_BRANCH, rtgsBranch));
|
|
|
236 |
* paymentAttributes.add(new Attribute(IFSC_CODE, ifscCode));
|
|
|
237 |
*/
|
| 4207 |
mandeep.dh |
238 |
|
| 22451 |
amit.gupta |
239 |
in.shop2020.payments.PaymentService.Client client = new PaymentClient().getClient();
|
|
|
240 |
long paymentId = client.createPayment(user.getUserId(), Double.valueOf(amount), WALLET_GATEWAY_ID, Long.valueOf(transactionId),
|
|
|
241 |
false);
|
|
|
242 |
client.updatePaymentDetails(paymentId, null, null, null, null, null, null, null, null, PaymentStatus.SUCCESS, null,
|
|
|
243 |
paymentAttributes);
|
|
|
244 |
}
|
| 4207 |
mandeep.dh |
245 |
|
| 22451 |
amit.gupta |
246 |
/*
|
|
|
247 |
* private long createTransaction(User user) throws
|
|
|
248 |
* TransactionServiceException, TException, CatalogServiceException {
|
|
|
249 |
* Transaction txn = new Transaction();
|
|
|
250 |
* txn.setShoppingCartid(user.getActiveCartId());
|
|
|
251 |
* txn.setCustomer_id(user.getUserId()); txn.setCreatedOn(new
|
|
|
252 |
* Date().getTime()); txn.setTransactionStatus(TransactionStatus.INIT);
|
|
|
253 |
* txn.setStatusDescription("New Order"); txn.setOrders(createOrders(user));
|
|
|
254 |
* Client transaction_client = new TransactionClient().getClient(); return
|
|
|
255 |
* transaction_client.createTransaction(txn); }
|
|
|
256 |
*/
|
| 4207 |
mandeep.dh |
257 |
|
| 22451 |
amit.gupta |
258 |
private List<Order> createOrders(User user) throws CatalogServiceException, TException {
|
|
|
259 |
List<Order> orders = new ArrayList<Order>();
|
| 4207 |
mandeep.dh |
260 |
|
| 22451 |
amit.gupta |
261 |
// Extracting default address
|
|
|
262 |
Address defaultAddress = null;
|
|
|
263 |
for (Address address : user.getAddresses()) {
|
|
|
264 |
if (address.getId() == user.getDefaultAddressId()) {
|
|
|
265 |
defaultAddress = address;
|
|
|
266 |
break;
|
|
|
267 |
}
|
|
|
268 |
}
|
| 4207 |
mandeep.dh |
269 |
|
| 22451 |
amit.gupta |
270 |
for (LineItem lineItem : lineItems) {
|
|
|
271 |
enrichLineItem(lineItem);
|
| 4207 |
mandeep.dh |
272 |
|
| 22451 |
amit.gupta |
273 |
Order t_order = new Order();
|
|
|
274 |
t_order.setCustomer_id(user.getUserId());
|
|
|
275 |
t_order.setCustomer_email(user.getEmail());
|
|
|
276 |
t_order.setCustomer_name(defaultAddress.getName());
|
|
|
277 |
t_order.setCustomer_pincode(defaultAddress.getPin());
|
|
|
278 |
t_order.setCustomer_address1(defaultAddress.getLine1());
|
|
|
279 |
t_order.setCustomer_address2(defaultAddress.getLine2());
|
|
|
280 |
t_order.setCustomer_city(defaultAddress.getCity());
|
|
|
281 |
t_order.setCustomer_state(defaultAddress.getState());
|
|
|
282 |
t_order.setCustomer_mobilenumber(defaultAddress.getPhone());
|
|
|
283 |
t_order.setTotal_amount(lineItem.getTotal_price());
|
|
|
284 |
t_order.setTotal_weight(lineItem.getTotal_weight());
|
|
|
285 |
t_order.setLineitems(Collections.singletonList(lineItem));
|
|
|
286 |
t_order.setStatus(OrderStatus.PAYMENT_PENDING);
|
|
|
287 |
t_order.setStatusDescription("Payment Pending");
|
|
|
288 |
t_order.setCreated_timestamp(new Date().getTime());
|
|
|
289 |
t_order.setSource(1);// Source : Website
|
|
|
290 |
t_order.setProductCondition(ProductCondition.findByValue(productCondition));
|
|
|
291 |
// t_order.setProductCondition(ProductCondition.findByValue(productCondition.intValue()));
|
| 4207 |
mandeep.dh |
292 |
|
| 22451 |
amit.gupta |
293 |
orders.add(t_order);
|
|
|
294 |
}
|
| 4207 |
mandeep.dh |
295 |
|
| 22451 |
amit.gupta |
296 |
return orders;
|
|
|
297 |
}
|
| 4207 |
mandeep.dh |
298 |
|
| 22451 |
amit.gupta |
299 |
private LineItem enrichLineItem(LineItem lineItem) throws CatalogServiceException, TException {
|
|
|
300 |
in.shop2020.model.v1.catalog.CatalogService.Client client = new CatalogClient().getClient();
|
| 4207 |
mandeep.dh |
301 |
|
| 22451 |
amit.gupta |
302 |
Item item = client.getItem(lineItem.getItem_id());
|
| 4207 |
mandeep.dh |
303 |
|
| 22451 |
amit.gupta |
304 |
lineItem.setProductGroup(item.getProductGroup());
|
|
|
305 |
lineItem.setBrand(item.getBrand());
|
|
|
306 |
lineItem.setModel_number(item.getModelNumber());
|
|
|
307 |
lineItem.setModel_name(item.getModelName());
|
|
|
308 |
lineItem.setExtra_info(item.getFeatureDescription());
|
|
|
309 |
lineItem.setItem_id(item.getId());
|
|
|
310 |
lineItem.setUnit_weight(item.getWeight());
|
|
|
311 |
lineItem.setTotal_weight(item.getWeight() * lineItem.getQuantity());
|
|
|
312 |
lineItem.setDealText(item.getBestDealText());
|
|
|
313 |
lineItem.setTotal_price(lineItem.getUnit_price() * lineItem.getQuantity());
|
| 4207 |
mandeep.dh |
314 |
|
| 22451 |
amit.gupta |
315 |
if (item.getColor() == null || "NA".equals(item.getColor())) {
|
|
|
316 |
lineItem.setColor("");
|
|
|
317 |
} else {
|
|
|
318 |
lineItem.setColor(item.getColor());
|
|
|
319 |
}
|
| 4207 |
mandeep.dh |
320 |
|
| 22451 |
amit.gupta |
321 |
return lineItem;
|
|
|
322 |
}
|
| 4207 |
mandeep.dh |
323 |
|
| 22451 |
amit.gupta |
324 |
private boolean validate() {
|
|
|
325 |
return false;
|
|
|
326 |
}
|
| 4207 |
mandeep.dh |
327 |
|
| 22451 |
amit.gupta |
328 |
public String convertDate(long date) {
|
|
|
329 |
return SDF.format(new Date(date));
|
|
|
330 |
}
|
| 4207 |
mandeep.dh |
331 |
|
| 22451 |
amit.gupta |
332 |
public String extractProductName(LineItem lineItem) {
|
|
|
333 |
if (lineItem == null) {
|
|
|
334 |
return "N/A";
|
|
|
335 |
}
|
| 4207 |
mandeep.dh |
336 |
|
| 22451 |
amit.gupta |
337 |
return ModelUtils.extractProductNameFromLineItem(lineItem);
|
|
|
338 |
}
|
| 4207 |
mandeep.dh |
339 |
|
| 22451 |
amit.gupta |
340 |
// Getters and Setters
|
|
|
341 |
public String getCustomerEmailId() {
|
|
|
342 |
return customerEmailId;
|
|
|
343 |
}
|
| 4207 |
mandeep.dh |
344 |
|
| 22451 |
amit.gupta |
345 |
public void setCustomerEmailId(String customerEmailId) {
|
|
|
346 |
this.customerEmailId = customerEmailId;
|
|
|
347 |
}
|
| 4207 |
mandeep.dh |
348 |
|
| 22451 |
amit.gupta |
349 |
public String getRtgsId() {
|
|
|
350 |
return rtgsId;
|
|
|
351 |
}
|
| 4207 |
mandeep.dh |
352 |
|
| 22451 |
amit.gupta |
353 |
public void setRtgsId(String rtgsId) {
|
|
|
354 |
this.rtgsId = rtgsId;
|
|
|
355 |
}
|
| 4207 |
mandeep.dh |
356 |
|
| 22451 |
amit.gupta |
357 |
public String getRtgsBank() {
|
|
|
358 |
return rtgsBank;
|
|
|
359 |
}
|
| 4207 |
mandeep.dh |
360 |
|
| 22451 |
amit.gupta |
361 |
public void setRtgsBank(String rtgsBank) {
|
|
|
362 |
this.rtgsBank = rtgsBank;
|
|
|
363 |
}
|
| 4207 |
mandeep.dh |
364 |
|
| 22451 |
amit.gupta |
365 |
public String getRtgsBranch() {
|
|
|
366 |
return rtgsBranch;
|
|
|
367 |
}
|
| 4207 |
mandeep.dh |
368 |
|
| 22451 |
amit.gupta |
369 |
public void setRtgsBranch(String rtgsBranch) {
|
|
|
370 |
this.rtgsBranch = rtgsBranch;
|
|
|
371 |
}
|
| 4207 |
mandeep.dh |
372 |
|
| 22451 |
amit.gupta |
373 |
public String getIfscCode() {
|
|
|
374 |
return ifscCode;
|
|
|
375 |
}
|
| 4207 |
mandeep.dh |
376 |
|
| 22451 |
amit.gupta |
377 |
public void setIfscCode(String ifscCode) {
|
|
|
378 |
this.ifscCode = ifscCode;
|
|
|
379 |
}
|
| 4207 |
mandeep.dh |
380 |
|
| 22451 |
amit.gupta |
381 |
public String getAmount() {
|
|
|
382 |
return amount;
|
|
|
383 |
}
|
| 4207 |
mandeep.dh |
384 |
|
| 22451 |
amit.gupta |
385 |
public void setAmount(String amount) {
|
|
|
386 |
this.amount = amount;
|
|
|
387 |
}
|
| 4207 |
mandeep.dh |
388 |
|
| 22451 |
amit.gupta |
389 |
public List<LineItem> getLineItems() {
|
|
|
390 |
return lineItems;
|
|
|
391 |
}
|
| 4207 |
mandeep.dh |
392 |
|
| 22451 |
amit.gupta |
393 |
public void setLineItems(List<LineItem> lineItems) {
|
|
|
394 |
this.lineItems = lineItems;
|
|
|
395 |
}
|
| 4207 |
mandeep.dh |
396 |
|
| 22451 |
amit.gupta |
397 |
public Map<Transaction, Double> getTransactions() {
|
|
|
398 |
return transactions;
|
|
|
399 |
}
|
| 4207 |
mandeep.dh |
400 |
|
| 22451 |
amit.gupta |
401 |
public void setTransactions(Map<Transaction, Double> transactions) {
|
|
|
402 |
this.transactions = transactions;
|
|
|
403 |
}
|
| 4207 |
mandeep.dh |
404 |
|
| 22451 |
amit.gupta |
405 |
public String getTransactionId() {
|
|
|
406 |
return transactionId;
|
|
|
407 |
}
|
| 4207 |
mandeep.dh |
408 |
|
| 22451 |
amit.gupta |
409 |
public void setTransactionId(String transactionId) {
|
|
|
410 |
this.transactionId = transactionId;
|
|
|
411 |
}
|
| 4207 |
mandeep.dh |
412 |
|
| 22451 |
amit.gupta |
413 |
public Transaction getTransaction() {
|
|
|
414 |
return transaction;
|
|
|
415 |
}
|
| 4207 |
mandeep.dh |
416 |
|
| 22451 |
amit.gupta |
417 |
public void setTransaction(Transaction transaction) {
|
|
|
418 |
this.transaction = transaction;
|
|
|
419 |
}
|
| 4207 |
mandeep.dh |
420 |
|
| 22451 |
amit.gupta |
421 |
public Payment getPayment() {
|
|
|
422 |
return payment;
|
|
|
423 |
}
|
| 4207 |
mandeep.dh |
424 |
|
| 22451 |
amit.gupta |
425 |
public void setPayment(Payment payment) {
|
|
|
426 |
this.payment = payment;
|
|
|
427 |
}
|
| 4207 |
mandeep.dh |
428 |
|
| 22451 |
amit.gupta |
429 |
public String getId() {
|
|
|
430 |
return id;
|
|
|
431 |
}
|
| 4207 |
mandeep.dh |
432 |
|
| 22451 |
amit.gupta |
433 |
public void setId(String id) {
|
|
|
434 |
this.id = id;
|
|
|
435 |
}
|
| 4207 |
mandeep.dh |
436 |
|
| 22451 |
amit.gupta |
437 |
public String getItemId() {
|
|
|
438 |
return itemId;
|
|
|
439 |
}
|
| 4207 |
mandeep.dh |
440 |
|
| 22451 |
amit.gupta |
441 |
public void setItemId(String itemId) {
|
|
|
442 |
this.itemId = itemId;
|
|
|
443 |
}
|
| 4207 |
mandeep.dh |
444 |
|
| 22451 |
amit.gupta |
445 |
public String getOutput() {
|
|
|
446 |
return output;
|
|
|
447 |
}
|
| 4207 |
mandeep.dh |
448 |
|
| 22451 |
amit.gupta |
449 |
public void setOutput(String output) {
|
|
|
450 |
this.output = output;
|
|
|
451 |
}
|
| 4207 |
mandeep.dh |
452 |
|
| 22451 |
amit.gupta |
453 |
public String getPickUp() {
|
|
|
454 |
return pickUp;
|
|
|
455 |
}
|
| 4207 |
mandeep.dh |
456 |
|
| 22451 |
amit.gupta |
457 |
public void setPickUp(String pickUp) {
|
|
|
458 |
this.pickUp = pickUp;
|
|
|
459 |
}
|
| 4207 |
mandeep.dh |
460 |
|
| 22451 |
amit.gupta |
461 |
public String getOrderType() {
|
|
|
462 |
return orderType;
|
|
|
463 |
}
|
| 4207 |
mandeep.dh |
464 |
|
| 22451 |
amit.gupta |
465 |
public void setOrderType(String orderType) {
|
|
|
466 |
this.orderType = orderType;
|
|
|
467 |
}
|
| 5387 |
rajveer |
468 |
|
| 22451 |
amit.gupta |
469 |
public String getTinNumber() {
|
|
|
470 |
return tinNumber;
|
|
|
471 |
}
|
| 5387 |
rajveer |
472 |
|
| 22451 |
amit.gupta |
473 |
public void setTinNumber(String tinNumber) {
|
|
|
474 |
this.tinNumber = tinNumber;
|
|
|
475 |
}
|
| 5527 |
anupam.sin |
476 |
|
| 8925 |
amar.kumar |
477 |
public int getProductCondition() {
|
|
|
478 |
return productCondition;
|
|
|
479 |
}
|
|
|
480 |
|
|
|
481 |
public void setProductCondition(int productCondition) {
|
|
|
482 |
this.productCondition = productCondition;
|
|
|
483 |
}
|
| 9416 |
amar.kumar |
484 |
|
| 12653 |
manish.sha |
485 |
public String getPoRefNumber() {
|
|
|
486 |
return poRefNumber;
|
|
|
487 |
}
|
|
|
488 |
|
|
|
489 |
public void setPoRefNumber(String poRefNumber) {
|
|
|
490 |
this.poRefNumber = poRefNumber;
|
|
|
491 |
}
|
|
|
492 |
|
|
|
493 |
public static void main(String[] args) {
|
|
|
494 |
BulkOrderController blc = new BulkOrderController();
|
|
|
495 |
blc.setCustomerEmailId("neavins@amazon.com");
|
|
|
496 |
blc.setRtgsId("rtgsId");
|
|
|
497 |
blc.setRtgsBank("rtgsBank");
|
|
|
498 |
blc.setRtgsBranch("rtgsBranch");
|
|
|
499 |
blc.setIfscCode("ifscCode");
|
|
|
500 |
blc.setAmount("3400");
|
|
|
501 |
blc.setItemId("10661");
|
| 22451 |
amit.gupta |
502 |
// blc.setOutput();
|
| 12653 |
manish.sha |
503 |
blc.setPickUp("COURIER");
|
|
|
504 |
blc.setOrderType("B2Cbulk");
|
| 22451 |
amit.gupta |
505 |
// blc.setTinNumber();
|
|
|
506 |
blc.setProductCondition(ProductCondition.GOOD.getValue());
|
|
|
507 |
|
| 12653 |
manish.sha |
508 |
blc.index();
|
|
|
509 |
/*
|
| 22451 |
amit.gupta |
510 |
* = "ifscCode"; private static final String RTGS_BRANCH = "rtgsBranch";
|
|
|
511 |
* private static final String RTGS_BANK = "rtgsBank"; private static
|
|
|
512 |
* final String RTGS_ID = "rtgsId"; private String customerEmailId;
|
|
|
513 |
* private String rtgsId; private String rtgsBank; private String
|
|
|
514 |
* rtgsBranch; private String ifscCode; private String amount; private
|
|
|
515 |
* String itemId; private String output; private String pickUp; private
|
|
|
516 |
* String orderType; private String tinNumber; private int
|
|
|
517 |
* productCondition; private int taxType;
|
|
|
518 |
*/
|
|
|
519 |
// blc.set
|
| 12653 |
manish.sha |
520 |
}
|
| 22451 |
amit.gupta |
521 |
|
|
|
522 |
public double getWalletAmount() {
|
|
|
523 |
return this.userWalletAmount;
|
|
|
524 |
}
|
|
|
525 |
|
| 4207 |
mandeep.dh |
526 |
}
|