| Line 7... |
Line 7... |
| 7 |
import in.shop2020.crm.Ticket;
|
7 |
import in.shop2020.crm.Ticket;
|
| 8 |
import in.shop2020.crm.TicketCategory;
|
8 |
import in.shop2020.crm.TicketCategory;
|
| 9 |
import in.shop2020.crm.TicketStatus;
|
9 |
import in.shop2020.crm.TicketStatus;
|
| 10 |
import in.shop2020.model.v1.order.Order;
|
10 |
import in.shop2020.model.v1.order.Order;
|
| 11 |
import in.shop2020.model.v1.order.OrderStatus;
|
11 |
import in.shop2020.model.v1.order.OrderStatus;
|
| - |
|
12 |
import in.shop2020.model.v1.order.RechargeOrder;
|
| - |
|
13 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 12 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
14 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 13 |
import in.shop2020.model.v1.user.Cart;
|
15 |
import in.shop2020.model.v1.user.Cart;
|
| 14 |
import in.shop2020.model.v1.user.Line;
|
16 |
import in.shop2020.model.v1.user.Line;
|
| 15 |
import in.shop2020.model.v1.user.User;
|
17 |
import in.shop2020.model.v1.user.User;
|
| 16 |
import in.shop2020.model.v1.user.UserCommunication;
|
18 |
import in.shop2020.model.v1.user.UserCommunication;
|
| Line 38... |
Line 40... |
| 38 |
*/
|
40 |
*/
|
| 39 |
@SuppressWarnings("serial")
|
41 |
@SuppressWarnings("serial")
|
| 40 |
public class HomeController extends BaseController {
|
42 |
public class HomeController extends BaseController {
|
| 41 |
private static final Logger log = Logger.getLogger(HomeController.class);
|
43 |
private static final Logger log = Logger.getLogger(HomeController.class);
|
| 42 |
|
44 |
|
| - |
|
45 |
private String rechargeOrderId;
|
| - |
|
46 |
private String deviceNumber;
|
| 43 |
private String email;
|
47 |
private String email;
|
| 44 |
private String orderId;
|
48 |
private String orderId;
|
| 45 |
private String mobileNumber;
|
49 |
private String mobileNumber;
|
| 46 |
private User user;
|
50 |
private User user;
|
| 47 |
private long orderCount;
|
51 |
private long orderCount;
|
| Line 65... |
Line 69... |
| 65 |
private long openFailedPaymentsTicketCount;
|
69 |
private long openFailedPaymentsTicketCount;
|
| 66 |
private long openDelayedDeliveryTicketCount;
|
70 |
private long openDelayedDeliveryTicketCount;
|
| 67 |
private long openFlaggedPaymentsTicketCount;
|
71 |
private long openFlaggedPaymentsTicketCount;
|
| 68 |
private long openStorePickupTicketCount;
|
72 |
private long openStorePickupTicketCount;
|
| 69 |
private long DoaRequestCount;
|
73 |
private long DoaRequestCount;
|
| - |
|
74 |
private long failedRechargeCount = 0;
|
| - |
|
75 |
private long successfulRechargeCount = 0;
|
| 70 |
|
76 |
|
| 71 |
private long ReturnRequestCount;
|
77 |
private long ReturnRequestCount;
|
| 72 |
|
78 |
|
| 73 |
private long orderCancellationCount;
|
79 |
private long orderCancellationCount;
|
| - |
|
80 |
|
| - |
|
81 |
private long rechargeOrderCount = 0;
|
| 74 |
|
82 |
|
| 75 |
|
83 |
|
| 76 |
@Action("/")
|
84 |
@Action("/")
|
| 77 |
public String index() throws Exception {
|
85 |
public String index() throws Exception {
|
| 78 |
String returnValue = INPUT;
|
86 |
String returnValue = INPUT;
|
| Line 94... |
Line 102... |
| 94 |
transactionServiceClient = new TransactionClient().getClient();
|
102 |
transactionServiceClient = new TransactionClient().getClient();
|
| 95 |
Order order = transactionServiceClient.getOrder(Long
|
103 |
Order order = transactionServiceClient.getOrder(Long
|
| 96 |
.parseLong(orderId));
|
104 |
.parseLong(orderId));
|
| 97 |
user = userContextServiceClient.getUserById(order
|
105 |
user = userContextServiceClient.getUserById(order
|
| 98 |
.getCustomer_id());
|
106 |
.getCustomer_id());
|
| - |
|
107 |
} else if (rechargeOrderId != null && !rechargeOrderId.isEmpty()){
|
| - |
|
108 |
transactionServiceClient = new TransactionClient().getClient();
|
| - |
|
109 |
RechargeOrder rechargeOrder = transactionServiceClient.getRechargeOrder(Long
|
| - |
|
110 |
.parseLong(rechargeOrderId));
|
| - |
|
111 |
user = userContextServiceClient.getUserById(rechargeOrder.getUserId());
|
| - |
|
112 |
} else if (deviceNumber != null && !deviceNumber.isEmpty()) {
|
| - |
|
113 |
transactionServiceClient = new TransactionClient().getClient();
|
| - |
|
114 |
List<RechargeOrder> rechargeOrders = transactionServiceClient.getRechargeOrdersForDevice(deviceNumber);
|
| - |
|
115 |
user = userContextServiceClient.getUserById(rechargeOrders.get(0).getUserId());
|
| 99 |
} else if (ticketId != null && !ticketId.isEmpty()) {
|
116 |
} else if (ticketId != null && !ticketId.isEmpty()) {
|
| 100 |
SearchFilter searchFilter = new SearchFilter();
|
117 |
SearchFilter searchFilter = new SearchFilter();
|
| 101 |
searchFilter.setTicketId(Long.parseLong(ticketId));
|
118 |
searchFilter.setTicketId(Long.parseLong(ticketId));
|
| 102 |
crmServiceClient = new CRMClient().getClient();
|
119 |
crmServiceClient = new CRMClient().getClient();
|
| 103 |
List<Ticket> tickets = crmServiceClient
|
120 |
List<Ticket> tickets = crmServiceClient
|
| Line 118... |
Line 135... |
| 118 |
if (ticketId == null || ticketId.isEmpty()) {
|
135 |
if (ticketId == null || ticketId.isEmpty()) {
|
| 119 |
addActionError("Invalid input");
|
136 |
addActionError("Invalid input");
|
| 120 |
}
|
137 |
}
|
| 121 |
} else {
|
138 |
} else {
|
| 122 |
loadUserCommunicationDetails();
|
139 |
loadUserCommunicationDetails();
|
| - |
|
140 |
loadRechargeOrders();
|
| 123 |
loadOrderDetails();
|
141 |
loadOrderDetails();
|
| 124 |
loadCartDetails();
|
142 |
loadCartDetails();
|
| 125 |
loadTicketDetails();
|
143 |
loadTicketDetails();
|
| 126 |
loadActivityDetails();
|
144 |
loadActivityDetails();
|
| 127 |
returnValue = INDEX;
|
145 |
returnValue = INDEX;
|
| Line 272... |
Line 290... |
| 272 |
userContextServiceClient = new UserClient().getClient();
|
290 |
userContextServiceClient = new UserClient().getClient();
|
| 273 |
List<UserCommunication> userCommunication = userContextServiceClient
|
291 |
List<UserCommunication> userCommunication = userContextServiceClient
|
| 274 |
.getUserCommunicationByUser(user.getUserId());
|
292 |
.getUserCommunicationByUser(user.getUserId());
|
| 275 |
userCommunicationCount = userCommunication.size();
|
293 |
userCommunicationCount = userCommunication.size();
|
| 276 |
}
|
294 |
}
|
| - |
|
295 |
|
| - |
|
296 |
private void loadRechargeOrders() throws TransactionServiceException,
|
| - |
|
297 |
TException {
|
| - |
|
298 |
transactionServiceClient = new TransactionClient().getClient();
|
| - |
|
299 |
List<RechargeOrder> allRechargeOrders = transactionServiceClient.getRechargeOrders(user.getUserId());
|
| - |
|
300 |
rechargeOrderCount = allRechargeOrders.size();
|
| 277 |
|
301 |
|
| - |
|
302 |
for (RechargeOrder o : allRechargeOrders) {
|
| - |
|
303 |
if (o.getStatus() == RechargeOrderStatus.RECHARGE_SUCCESSFUL) {
|
| - |
|
304 |
successfulRechargeCount++;
|
| - |
|
305 |
} else if (CRMConstants.failedStatusList.contains(o.getStatus())) {
|
| - |
|
306 |
failedRechargeCount++;
|
| - |
|
307 |
}
|
| - |
|
308 |
}
|
| - |
|
309 |
}
|
| 278 |
private void loadOrderDetails() throws TransactionServiceException,
|
310 |
private void loadOrderDetails() throws TransactionServiceException,
|
| 279 |
TException {
|
311 |
TException {
|
| 280 |
transactionServiceClient = new TransactionClient().getClient();
|
312 |
transactionServiceClient = new TransactionClient().getClient();
|
| 281 |
List<Order> allOrders = transactionServiceClient.getOrdersForCustomer(
|
313 |
List<Order> allOrders = transactionServiceClient.getOrdersForCustomer(
|
| 282 |
user.getUserId(), 0, (new Date()).getTime(), null);
|
314 |
user.getUserId(), 0, (new Date()).getTime(), null);
|
| 283 |
orderCount = allOrders.size();
|
315 |
orderCount = allOrders.size();
|
| 284 |
|
316 |
|
| Line 530... |
Line 562... |
| 530 |
|
562 |
|
| 531 |
public void setOpenStorePickupTicketCount(long openStorePickupTicketCount) {
|
563 |
public void setOpenStorePickupTicketCount(long openStorePickupTicketCount) {
|
| 532 |
this.openStorePickupTicketCount = openStorePickupTicketCount;
|
564 |
this.openStorePickupTicketCount = openStorePickupTicketCount;
|
| 533 |
}
|
565 |
}
|
| 534 |
|
566 |
|
| - |
|
567 |
public String getDeviceNumber() {
|
| - |
|
568 |
return deviceNumber;
|
| - |
|
569 |
}
|
| - |
|
570 |
|
| - |
|
571 |
public void setDeviceNumber(String deviceNumber) {
|
| - |
|
572 |
this.deviceNumber = deviceNumber;
|
| - |
|
573 |
}
|
| - |
|
574 |
|
| - |
|
575 |
public long getFailedRechargeCount() {
|
| - |
|
576 |
return failedRechargeCount;
|
| - |
|
577 |
}
|
| - |
|
578 |
|
| - |
|
579 |
public void setFailedRechargeCount(long failedRechargeCount) {
|
| - |
|
580 |
this.failedRechargeCount = failedRechargeCount;
|
| - |
|
581 |
}
|
| - |
|
582 |
|
| - |
|
583 |
public long getSuccessfulRechargeCount() {
|
| - |
|
584 |
return successfulRechargeCount;
|
| - |
|
585 |
}
|
| - |
|
586 |
|
| - |
|
587 |
public void setSuccessfulRechargeCount(long successfulRechargeCount) {
|
| - |
|
588 |
this.successfulRechargeCount = successfulRechargeCount;
|
| - |
|
589 |
}
|
| - |
|
590 |
|
| - |
|
591 |
public long getRechargeOrderCount() {
|
| - |
|
592 |
return rechargeOrderCount;
|
| - |
|
593 |
}
|
| - |
|
594 |
|
| - |
|
595 |
public void setRechargeOrderCount(long rechargeOrderCount) {
|
| - |
|
596 |
this.rechargeOrderCount = rechargeOrderCount;
|
| - |
|
597 |
}
|
| - |
|
598 |
|
| - |
|
599 |
public String getRechargeOrderId() {
|
| - |
|
600 |
return rechargeOrderId;
|
| - |
|
601 |
}
|
| - |
|
602 |
|
| - |
|
603 |
public void setRechargeOrderId(String rechargeOrderId) {
|
| - |
|
604 |
this.rechargeOrderId = rechargeOrderId;
|
| - |
|
605 |
}
|
| - |
|
606 |
|
| 535 |
}
|
607 |
}
|
| 536 |
|
608 |
|