| Line 4... |
Line 4... |
| 4 |
import in.shop2020.model.v1.order.Order;
|
4 |
import in.shop2020.model.v1.order.Order;
|
| 5 |
import in.shop2020.model.v1.order.OrderStatus;
|
5 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 6 |
import in.shop2020.model.v1.user.Affiliate;
|
6 |
import in.shop2020.model.v1.user.Affiliate;
|
| 7 |
import in.shop2020.model.v1.user.MasterAffiliate;
|
7 |
import in.shop2020.model.v1.user.MasterAffiliate;
|
| 8 |
import in.shop2020.model.v1.user.TrackLog;
|
8 |
import in.shop2020.model.v1.user.TrackLog;
|
| - |
|
9 |
import in.shop2020.model.v1.user.TrackLogType;
|
| 9 |
import in.shop2020.model.v1.user.UserAffiliateException;
|
10 |
import in.shop2020.model.v1.user.UserAffiliateException;
|
| 10 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
11 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 11 |
import in.shop2020.payments.Payment;
|
12 |
import in.shop2020.payments.Payment;
|
| 12 |
import in.shop2020.support.utils.ReportsUtils;
|
13 |
import in.shop2020.support.utils.ReportsUtils;
|
| 13 |
import in.shop2020.thrift.clients.PaymentClient;
|
14 |
import in.shop2020.thrift.clients.PaymentClient;
|
| Line 158... |
Line 159... |
| 158 |
for (Affiliate aff : affiliates) {
|
159 |
for (Affiliate aff : affiliates) {
|
| 159 |
Set<Long> Payments = new HashSet<Long>(); // To deal with multiple refreshes on pay-success page.
|
160 |
Set<Long> Payments = new HashSet<Long>(); // To deal with multiple refreshes on pay-success page.
|
| 160 |
for (TrackLog tracklog : userClient.getTrackLogsByAffiliate(aff.getId(), startDate.getTime(), endDate.getTime())) {
|
161 |
for (TrackLog tracklog : userClient.getTrackLogsByAffiliate(aff.getId(), startDate.getTime(), endDate.getTime())) {
|
| 161 |
Date date = df.parse(df.format(new Date(tracklog.getAddedOn())));
|
162 |
Date date = df.parse(df.format(new Date(tracklog.getAddedOn())));
|
| 162 |
dates.add(date);
|
163 |
dates.add(date);
|
| 163 |
if (tracklog.getEvent().equals("new registration")) {
|
164 |
if (tracklog.getEventType() == TrackLogType.NEW_REGISTRATION) {
|
| 164 |
if (registerCountMap.containsKey(date)) {
|
165 |
if (registerCountMap.containsKey(date)) {
|
| 165 |
Long count = registerCountMap.get(date);
|
166 |
Long count = registerCountMap.get(date);
|
| 166 |
registerCountMap.put(date, ++count);
|
167 |
registerCountMap.put(date, ++count);
|
| 167 |
}
|
168 |
}
|
| 168 |
else {
|
169 |
else {
|
| 169 |
registerCountMap.put(date, 1l);
|
170 |
registerCountMap.put(date, 1l);
|
| 170 |
}
|
171 |
}
|
| 171 |
}
|
172 |
}
|
| 172 |
else if (tracklog.getEvent().equals("payment success")) {
|
173 |
else if (tracklog.getEventType() == TrackLogType.PAYMENT_SUCCESS) {
|
| 173 |
long paymentId = Long.parseLong(tracklog.getData().replaceAll("\\(.*\\)", ""));
|
174 |
long paymentId = Long.parseLong(tracklog.getData().replaceAll("\\(.*\\)", ""));
|
| 174 |
if (Payments.contains(paymentId)) {
|
175 |
if (Payments.contains(paymentId)) {
|
| 175 |
continue;
|
176 |
continue;
|
| 176 |
}
|
177 |
}
|
| 177 |
Payments.add(paymentId);
|
178 |
Payments.add(paymentId);
|