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