| 23724 |
amit.gupta |
1 |
package com.smartdukaan.cron.scheduled;
|
| 23723 |
amit.gupta |
2 |
|
| 24121 |
govind |
3 |
import java.io.IOException;
|
|
|
4 |
import java.io.InputStream;
|
| 23739 |
amit.gupta |
5 |
import java.sql.Timestamp;
|
| 24174 |
govind |
6 |
import java.text.MessageFormat;
|
| 23724 |
amit.gupta |
7 |
import java.time.LocalDate;
|
|
|
8 |
import java.time.LocalDateTime;
|
| 24256 |
amit.gupta |
9 |
import java.time.LocalTime;
|
| 23724 |
amit.gupta |
10 |
import java.time.temporal.ChronoUnit;
|
|
|
11 |
import java.util.ArrayList;
|
|
|
12 |
import java.util.Arrays;
|
| 23723 |
amit.gupta |
13 |
import java.util.HashMap;
|
| 24241 |
amit.gupta |
14 |
import java.util.HashSet;
|
| 23724 |
amit.gupta |
15 |
import java.util.List;
|
| 23723 |
amit.gupta |
16 |
import java.util.Map;
|
| 24242 |
amit.gupta |
17 |
import java.util.Optional;
|
| 23724 |
amit.gupta |
18 |
import java.util.stream.Collectors;
|
| 23723 |
amit.gupta |
19 |
|
| 24121 |
govind |
20 |
import javax.mail.MessagingException;
|
|
|
21 |
import javax.mail.internet.InternetAddress;
|
|
|
22 |
import javax.mail.internet.MimeMessage;
|
|
|
23 |
|
|
|
24 |
import org.apache.commons.codec.CharEncoding;
|
|
|
25 |
import org.apache.commons.io.IOUtils;
|
| 23929 |
amit.gupta |
26 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| 23755 |
amit.gupta |
27 |
import org.apache.logging.log4j.LogManager;
|
|
|
28 |
import org.apache.logging.log4j.Logger;
|
| 24184 |
govind |
29 |
import org.apache.poi.EncryptedDocumentException;
|
|
|
30 |
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
| 23723 |
amit.gupta |
31 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 23933 |
amit.gupta |
32 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| 23724 |
amit.gupta |
33 |
import org.springframework.beans.factory.annotation.Value;
|
| 23929 |
amit.gupta |
34 |
import org.springframework.core.io.ByteArrayResource;
|
|
|
35 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 24121 |
govind |
36 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| 23723 |
amit.gupta |
37 |
import org.springframework.stereotype.Component;
|
| 23724 |
amit.gupta |
38 |
import org.springframework.transaction.annotation.Transactional;
|
| 23723 |
amit.gupta |
39 |
|
| 23724 |
amit.gupta |
40 |
import com.spice.profitmandi.common.enumuration.RechargeStatus;
|
| 24121 |
govind |
41 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 23929 |
amit.gupta |
42 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 23724 |
amit.gupta |
43 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
| 24002 |
amit.gupta |
44 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 23929 |
amit.gupta |
45 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
|
|
46 |
import com.spice.profitmandi.common.util.Utils;
|
| 23724 |
amit.gupta |
47 |
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
|
|
|
48 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
|
|
49 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
|
|
|
50 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
|
|
51 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| 23929 |
amit.gupta |
52 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 24249 |
amit.gupta |
53 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 24174 |
govind |
54 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 23724 |
amit.gupta |
55 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| 24174 |
govind |
56 |
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
|
| 24242 |
amit.gupta |
57 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 24241 |
amit.gupta |
58 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 23929 |
amit.gupta |
59 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 24250 |
amit.gupta |
60 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 24242 |
amit.gupta |
61 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 24249 |
amit.gupta |
62 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 24241 |
amit.gupta |
63 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| 23724 |
amit.gupta |
64 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
| 23929 |
amit.gupta |
65 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 23724 |
amit.gupta |
66 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderCreditWalletHistoryRepository;
|
|
|
67 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
|
|
68 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
|
|
69 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
| 24249 |
amit.gupta |
70 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 24174 |
govind |
71 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 23724 |
amit.gupta |
72 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| 24242 |
amit.gupta |
73 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 24241 |
amit.gupta |
74 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 23929 |
amit.gupta |
75 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
|
|
76 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 24271 |
amit.gupta |
77 |
import com.spice.profitmandi.service.order.OrderService;
|
| 23724 |
amit.gupta |
78 |
import com.spice.profitmandi.service.recharge.provider.OxigenRechargeProviderService;
|
|
|
79 |
import com.spice.profitmandi.service.recharge.provider.ThinkWalnutDigitalRechargeProviderService;
|
|
|
80 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 24121 |
govind |
81 |
import com.spice.profitmandi.service.slab.TargetSlabService;
|
| 23929 |
amit.gupta |
82 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
|
|
83 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 23739 |
amit.gupta |
84 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 23723 |
amit.gupta |
85 |
|
| 24197 |
amit.gupta |
86 |
import in.shop2020.model.v1.order.WalletReferenceType;;
|
| 23739 |
amit.gupta |
87 |
|
| 23723 |
amit.gupta |
88 |
@Component
|
| 23724 |
amit.gupta |
89 |
@Transactional(rollbackFor = Throwable.class)
|
| 23723 |
amit.gupta |
90 |
public class ScheduledTasks {
|
|
|
91 |
|
| 23724 |
amit.gupta |
92 |
@Value("${oxigen.recharge.transaction.url}")
|
|
|
93 |
private String oxigenRechargeTransactionUrl;
|
| 23723 |
amit.gupta |
94 |
|
| 23724 |
amit.gupta |
95 |
@Value("${oxigen.recharge.enquiry.url}")
|
|
|
96 |
private String oxigenRechargeEnquiryUrl;
|
| 23723 |
amit.gupta |
97 |
|
| 23724 |
amit.gupta |
98 |
@Value("${oxigen.recharge.auth.key}")
|
|
|
99 |
private String oxigenRechargeAuthKey;
|
|
|
100 |
|
|
|
101 |
@Value("${oxigen.recharge.validation.url}")
|
|
|
102 |
private String oxigenRechargeValidationUrl;
|
|
|
103 |
|
|
|
104 |
@Value("${oxigen.recharge.validation.auth.key}")
|
|
|
105 |
private String oxigenRechargeValidationAuthKey;
|
|
|
106 |
|
|
|
107 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
|
|
108 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
|
|
109 |
|
|
|
110 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
|
|
111 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
|
|
112 |
|
|
|
113 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
|
|
114 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
|
|
115 |
|
|
|
116 |
@Value("${think.walnut.digital.recharge.balance.url}")
|
|
|
117 |
private String thinkWalnutDigitalRechargeBalanceUrl;
|
|
|
118 |
|
|
|
119 |
@Value("${think.walnut.digital.recharge.username}")
|
|
|
120 |
private String thinkWalnutDigitalRechargeUserName;
|
|
|
121 |
|
|
|
122 |
@Value("${think.walnut.digital.recharge.password}")
|
|
|
123 |
private String thinkWalnutDigitalRechargePassword;
|
|
|
124 |
|
|
|
125 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
|
|
126 |
private String thinkWalnutDigitalRechargeAuthKey;
|
|
|
127 |
|
| 23723 |
amit.gupta |
128 |
@Autowired
|
| 23724 |
amit.gupta |
129 |
private PurchaseRepository purchaseRepository;
|
|
|
130 |
|
|
|
131 |
@Autowired
|
|
|
132 |
private SchemeService schemeService;
|
|
|
133 |
|
|
|
134 |
@Autowired
|
| 24271 |
amit.gupta |
135 |
private OrderService orderService;
|
|
|
136 |
|
|
|
137 |
@Autowired
|
| 24241 |
amit.gupta |
138 |
private SchemeInOutRepository schemeInOutRepository;
|
|
|
139 |
|
|
|
140 |
@Autowired
|
| 23724 |
amit.gupta |
141 |
private RechargeTransactionRepository rechargeTransactionRepository;
|
|
|
142 |
|
|
|
143 |
@Autowired
|
|
|
144 |
private RechargeProviderCreditWalletHistoryRepository rechargeProviderCreditWalletHistoryRepository;
|
|
|
145 |
|
|
|
146 |
@Autowired
|
|
|
147 |
private FofoOrderRepository fofoOrderRepository;
|
| 24250 |
amit.gupta |
148 |
|
| 24249 |
amit.gupta |
149 |
@Autowired
|
|
|
150 |
private InventoryItemRepository inventoryItemRepository;
|
| 23929 |
amit.gupta |
151 |
|
| 23739 |
amit.gupta |
152 |
@Autowired
|
|
|
153 |
private WalletService walletService;
|
| 23724 |
amit.gupta |
154 |
|
|
|
155 |
@Autowired
|
|
|
156 |
private ThinkWalnutDigitalRechargeProviderService thinkWalnutDigitalRechargeProviderService;
|
|
|
157 |
|
|
|
158 |
@Autowired
|
|
|
159 |
private OxigenRechargeProviderService oxigenRechargeProviderService;
|
|
|
160 |
|
|
|
161 |
@Autowired
|
|
|
162 |
private RechargeProviderRepository rechargeProviderRepository;
|
|
|
163 |
|
|
|
164 |
@Autowired
|
| 24242 |
amit.gupta |
165 |
private ScanRecordRepository scanRecordRepository;
|
|
|
166 |
|
|
|
167 |
@Autowired
|
| 23724 |
amit.gupta |
168 |
private DailyRechargeRepository dailyRechargeRepository;
|
|
|
169 |
|
| 23929 |
amit.gupta |
170 |
@Autowired
|
|
|
171 |
private FofoStoreRepository fofoStoreRepository;
|
| 24177 |
govind |
172 |
|
| 24121 |
govind |
173 |
@Autowired
|
|
|
174 |
private TargetSlabService targetService;
|
| 23929 |
amit.gupta |
175 |
|
| 23724 |
amit.gupta |
176 |
@Value("${prod}")
|
|
|
177 |
private boolean prod;
|
|
|
178 |
|
| 23929 |
amit.gupta |
179 |
@Autowired
|
|
|
180 |
private RetailerService retailerService;
|
|
|
181 |
|
|
|
182 |
@Autowired
|
|
|
183 |
private TransactionService transactionService;
|
| 24250 |
amit.gupta |
184 |
|
| 24249 |
amit.gupta |
185 |
@Autowired
|
|
|
186 |
private ItemRepository itemRepository;
|
| 23929 |
amit.gupta |
187 |
|
|
|
188 |
@Autowired
|
|
|
189 |
private OrderRepository orderRepository;
|
|
|
190 |
|
|
|
191 |
@Autowired
|
| 24241 |
amit.gupta |
192 |
private SchemeRepository schemeRepository;
|
|
|
193 |
|
|
|
194 |
@Autowired
|
| 23929 |
amit.gupta |
195 |
private JavaMailSender mailSender;
|
| 24177 |
govind |
196 |
|
| 24174 |
govind |
197 |
@Autowired
|
|
|
198 |
private PartnerTargetRepository partnerTargetRepository;
|
| 24002 |
amit.gupta |
199 |
|
|
|
200 |
@Autowired
|
|
|
201 |
@Qualifier(value = "googleMailSender")
|
| 23932 |
amit.gupta |
202 |
private JavaMailSender googleMailSender;
|
| 23929 |
amit.gupta |
203 |
|
|
|
204 |
@Autowired
|
|
|
205 |
private InventoryService inventoryService;
|
|
|
206 |
|
| 23755 |
amit.gupta |
207 |
private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
|
| 23724 |
amit.gupta |
208 |
|
|
|
209 |
public void generateDailyRecharge() {
|
|
|
210 |
List<RechargeProviderCreditWalletHistory> allCreditHistory = rechargeProviderCreditWalletHistoryRepository
|
|
|
211 |
.selectAll(0, 2000);
|
|
|
212 |
List<RechargeProvider> rechargeProviders = rechargeProviderRepository.selectAll();
|
|
|
213 |
rechargeProviders.stream().forEach(x -> x.setAmount(0));
|
|
|
214 |
|
|
|
215 |
rechargeProviders.stream().forEach(x -> {
|
|
|
216 |
Map<LocalDate, List<RechargeProviderCreditWalletHistory>> dateWiseProviderCreditsMap = allCreditHistory
|
|
|
217 |
.stream().filter(z -> z.getProviderId() == x.getId())
|
|
|
218 |
.collect(Collectors.groupingBy(x1 -> x1.getReceiveTimestamp().toLocalDate()));
|
|
|
219 |
|
|
|
220 |
LOGGER.info("dateWiseProviderCreditsMap -- {}", dateWiseProviderCreditsMap);
|
|
|
221 |
LocalDate endDate = LocalDate.now().plusDays(1);
|
|
|
222 |
float previousDayClosing = 0;
|
|
|
223 |
LocalDate date = LocalDate.of(2018, 4, 6);
|
|
|
224 |
while (date.isBefore(endDate)) {
|
|
|
225 |
List<RechargeTransaction> dateWiseRechargeTransactions = rechargeTransactionRepository
|
|
|
226 |
.selectAllBetweenTimestamp(Arrays.asList(RechargeStatus.values()), date.atStartOfDay(),
|
|
|
227 |
date.plusDays(1).atStartOfDay());
|
|
|
228 |
|
|
|
229 |
List<RechargeTransaction> successfulTransactions = dateWiseRechargeTransactions.stream()
|
|
|
230 |
.filter(y -> y.getStatus().equals(RechargeStatus.SUCCESS)).collect(Collectors.toList());
|
|
|
231 |
|
|
|
232 |
float dailyAmount = 0;
|
|
|
233 |
float totalCommission = 0;
|
|
|
234 |
for (RechargeTransaction rechargeTransaction : successfulTransactions) {
|
|
|
235 |
if (rechargeTransaction.getProviderId() == x.getId()) {
|
|
|
236 |
dailyAmount += rechargeTransaction.getAmount();
|
|
|
237 |
totalCommission += rechargeTransaction.getCommission();
|
|
|
238 |
}
|
|
|
239 |
}
|
|
|
240 |
|
|
|
241 |
List<RechargeProviderCreditWalletHistory> rechargeHistoryList = dateWiseProviderCreditsMap.get(date);
|
|
|
242 |
float dailyWalletRecharge = 0;
|
|
|
243 |
if (rechargeHistoryList != null) {
|
|
|
244 |
for (RechargeProviderCreditWalletHistory rechargeProviderCreditWalletHistory : rechargeHistoryList) {
|
|
|
245 |
if (rechargeProviderCreditWalletHistory.getProviderId() == x.getId()) {
|
|
|
246 |
dailyWalletRecharge += rechargeProviderCreditWalletHistory.getAmount();
|
|
|
247 |
}
|
|
|
248 |
}
|
|
|
249 |
}
|
|
|
250 |
if (dailyAmount > 0 || dailyWalletRecharge > 0) {
|
|
|
251 |
DailyRecharge dailyRecharge = null;
|
|
|
252 |
try {
|
|
|
253 |
dailyRecharge = dailyRechargeRepository.selectByProviderIdAndCreateDate(x.getId(), date);
|
|
|
254 |
} catch (Exception e) {
|
|
|
255 |
LOGGER.info("Could not find Recharge entry");
|
|
|
256 |
}
|
|
|
257 |
if (dailyRecharge == null) {
|
|
|
258 |
dailyRecharge = new DailyRecharge();
|
|
|
259 |
dailyRecharge.setCreateDate(date);
|
|
|
260 |
}
|
|
|
261 |
dailyRecharge.setOpeningBalance(previousDayClosing);
|
|
|
262 |
dailyRecharge.setProviderId(x.getId());
|
|
|
263 |
dailyRecharge.setWalletRechargeAmount(dailyWalletRecharge);
|
|
|
264 |
dailyRecharge.setTotalAmount(dailyAmount);
|
|
|
265 |
dailyRecharge.setTotalCommission(totalCommission);
|
|
|
266 |
float closingBalance = dailyRecharge.getOpeningBalance() + dailyWalletRecharge - dailyAmount;
|
|
|
267 |
dailyRecharge.setClosingBalance(closingBalance);
|
|
|
268 |
dailyRechargeRepository.persist(dailyRecharge);
|
|
|
269 |
x.setAmount(x.getAmount() + dailyRecharge.getClosingBalance() - dailyRecharge.getOpeningBalance());
|
|
|
270 |
previousDayClosing = dailyRecharge.getClosingBalance();
|
|
|
271 |
}
|
|
|
272 |
date = date.plusDays(1);
|
|
|
273 |
}
|
|
|
274 |
rechargeProviderRepository.persist(x);
|
|
|
275 |
});
|
| 23761 |
amit.gupta |
276 |
LOGGER.info("finished generating daily recharge");
|
| 23724 |
amit.gupta |
277 |
}
|
|
|
278 |
|
| 23738 |
amit.gupta |
279 |
public void reconcileRecharge() throws Exception {
|
| 23724 |
amit.gupta |
280 |
LocalDateTime fromDate = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS).minusDays(30);
|
|
|
281 |
LocalDateTime toDate = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS);
|
|
|
282 |
List<RechargeStatus> nonSuccessRechargeStatuses = new ArrayList<>(Arrays.asList(RechargeStatus.values()));
|
|
|
283 |
LOGGER.info("nonSuccessRechargeStatuses {} ", nonSuccessRechargeStatuses);
|
|
|
284 |
nonSuccessRechargeStatuses.remove(RechargeStatus.SUCCESS);
|
|
|
285 |
nonSuccessRechargeStatuses.remove(RechargeStatus.FAILED);
|
|
|
286 |
RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
|
|
287 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
|
|
288 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeUserName);
|
|
|
289 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargePassword);
|
|
|
290 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
|
|
291 |
Map<String, RechargeStatus> requestRechargeStatusChanged = new HashMap<>();
|
|
|
292 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository
|
|
|
293 |
.selectAllBetweenTimestamp(nonSuccessRechargeStatuses, fromDate, toDate);
|
|
|
294 |
for (RechargeTransaction rechargeTransaction : rechargeTransactions) {
|
|
|
295 |
try {
|
|
|
296 |
int providerId = rechargeTransaction.getProviderId();
|
|
|
297 |
if (providerId == 1) {
|
|
|
298 |
oxigenRechargeProviderService.doCheckStatusRequest(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey,
|
|
|
299 |
rechargeTransaction);
|
|
|
300 |
} else if (providerId == 2) {
|
|
|
301 |
thinkWalnutDigitalRechargeProviderService
|
|
|
302 |
.doCheckStatusRequest(thinkWalnutDigitalRechargeEnquiryCredential, rechargeTransaction);
|
|
|
303 |
}
|
|
|
304 |
if (rechargeTransaction.getStatus().equals(RechargeStatus.SUCCESS)
|
|
|
305 |
|| rechargeTransaction.getStatus().equals(RechargeStatus.FAILED)) {
|
|
|
306 |
requestRechargeStatusChanged.put(rechargeTransaction.getRequestId(),
|
|
|
307 |
rechargeTransaction.getStatus());
|
|
|
308 |
}
|
|
|
309 |
} catch (Exception e) {
|
|
|
310 |
LOGGER.info("Could not check status for Request {}", rechargeTransaction.getRequestId());
|
|
|
311 |
}
|
|
|
312 |
}
|
| 23738 |
amit.gupta |
313 |
LOGGER.info("Reconcile recharge ran successfully");
|
| 23724 |
amit.gupta |
314 |
}
|
| 24240 |
amit.gupta |
315 |
|
|
|
316 |
// TemporaryMethod
|
| 24237 |
amit.gupta |
317 |
public void migrateInvoice() {
|
|
|
318 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectFromSaleDate(LocalDateTime.now().minusDays(3));
|
|
|
319 |
Map<Integer, List<FofoOrder>> partnerOrdersMap = new HashMap<>();
|
| 24241 |
amit.gupta |
320 |
partnerOrdersMap = fofoOrders.stream()
|
|
|
321 |
.collect(Collectors.groupingBy(FofoOrder::getFofoId, Collectors.toList()));
|
| 24237 |
amit.gupta |
322 |
for (List<FofoOrder> orderList : partnerOrdersMap.values()) {
|
| 24240 |
amit.gupta |
323 |
int sequence = 0;
|
|
|
324 |
String prefix = "";
|
| 24241 |
amit.gupta |
325 |
List<FofoOrder> sortedList = orderList.stream().sorted((x1, x2) -> x1.getId() - x2.getId())
|
|
|
326 |
.collect(Collectors.toList());
|
|
|
327 |
for (FofoOrder order : sortedList) {
|
|
|
328 |
|
| 24240 |
amit.gupta |
329 |
LOGGER.info("Order Id is {}, partner Id is {}", order.getId(), order.getFofoId());
|
| 24241 |
amit.gupta |
330 |
if (!order.getInvoiceNumber().contains("SEC")) {
|
| 24240 |
amit.gupta |
331 |
sequence = Integer.parseInt(order.getInvoiceNumber().split("/")[1]);
|
|
|
332 |
prefix = order.getInvoiceNumber().split("/")[0];
|
|
|
333 |
} else {
|
|
|
334 |
sequence += 1;
|
| 24241 |
amit.gupta |
335 |
String invoiceNumber = prefix + "/" + sequence;
|
| 24240 |
amit.gupta |
336 |
order.setInvoiceNumber(invoiceNumber);
|
|
|
337 |
fofoOrderRepository.persist(order);
|
|
|
338 |
}
|
|
|
339 |
}
|
| 24241 |
amit.gupta |
340 |
|
| 24237 |
amit.gupta |
341 |
}
|
|
|
342 |
}
|
| 23724 |
amit.gupta |
343 |
|
| 24241 |
amit.gupta |
344 |
// Temporary Method
|
| 24252 |
amit.gupta |
345 |
public void evaluateExcessSchemeOut() throws Exception {
|
| 24244 |
amit.gupta |
346 |
Map<Integer, String> userNameMap = retailerService.getAllFofoRetailerIdNameMap();
|
|
|
347 |
Map<Integer, Float> userAmountMap = new HashMap<>();
|
| 24252 |
amit.gupta |
348 |
|
|
|
349 |
List<List<Object>> rows = new ArrayList<>();
|
| 24271 |
amit.gupta |
350 |
List<String> headers = Arrays.asList("Scheme", "Item", "Partner", "Amount", "Credited On", "Invoice Number",
|
|
|
351 |
"Sale On", "Scheme Start", "Scheme End", "Active On", "Expired On");
|
| 24241 |
amit.gupta |
352 |
schemeRepository.selectAll().stream().forEach(x -> {
|
| 24250 |
amit.gupta |
353 |
if (x.getType().equals(SchemeType.OUT)) {
|
|
|
354 |
List<SchemeInOut> sioList = schemeInOutRepository
|
|
|
355 |
.selectBySchemeIds(new HashSet<>(Arrays.asList(x.getId())));
|
|
|
356 |
if (x.getActiveTimestamp() != null) {
|
|
|
357 |
LocalDateTime endDateTime = x.getEndDateTime();
|
|
|
358 |
if (x.getExpireTimestamp() != null && x.getExpireTimestamp().isBefore(x.getEndDateTime())) {
|
|
|
359 |
endDateTime = x.getExpireTimestamp();
|
| 24249 |
amit.gupta |
360 |
}
|
| 24250 |
amit.gupta |
361 |
for (SchemeInOut sio : sioList) {
|
|
|
362 |
InventoryItem inventoryItem = null;
|
| 24266 |
amit.gupta |
363 |
inventoryItem = inventoryItemRepository.selectById(sio.getInventoryItemId());
|
| 24271 |
amit.gupta |
364 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndSerialNumber(
|
|
|
365 |
inventoryItem.getFofoId(), inventoryItem.getSerialNumber(), null, null, 0, 1).get(0);
|
| 24250 |
amit.gupta |
366 |
Optional<ScanRecord> record = scanRecordRepository
|
|
|
367 |
.selectByInventoryItemId(sio.getInventoryItemId()).stream()
|
|
|
368 |
.filter(y -> y.getType().equals(ScanType.SALE)).findFirst();
|
|
|
369 |
if (record.isPresent()) {
|
|
|
370 |
int fofoId = record.get().getFofoId();
|
|
|
371 |
if (record.get().getCreateTimestamp().isAfter(endDateTime)
|
|
|
372 |
|| record.get().getCreateTimestamp().isBefore(x.getStartDateTime())) {
|
|
|
373 |
if (!userAmountMap.containsKey(fofoId)) {
|
|
|
374 |
userAmountMap.put(fofoId, 0f);
|
|
|
375 |
}
|
|
|
376 |
userAmountMap.put(fofoId, sio.getAmount() + userAmountMap.get(fofoId));
|
|
|
377 |
try {
|
| 24252 |
amit.gupta |
378 |
rows.add(Arrays.asList(x.getDescription(),
|
| 24250 |
amit.gupta |
379 |
itemRepository.selectById(inventoryItem.getItemId()).getItemDescription(),
|
| 24252 |
amit.gupta |
380 |
userNameMap.get(fofoId), sio.getAmount(),
|
| 24253 |
amit.gupta |
381 |
FormattingUtils.formatDate(sio.getCreateTimestamp()),
|
|
|
382 |
fofoOrder.getInvoiceNumber(),
|
|
|
383 |
FormattingUtils.formatDate(record.get().getCreateTimestamp()),
|
|
|
384 |
FormattingUtils.formatDate(x.getStartDateTime()),
|
|
|
385 |
FormattingUtils.formatDate(x.getEndDateTime()),
|
|
|
386 |
FormattingUtils.formatDate(x.getActiveTimestamp()),
|
|
|
387 |
FormattingUtils.formatDate(x.getExpireTimestamp())));
|
| 24250 |
amit.gupta |
388 |
} catch (Exception e) {
|
|
|
389 |
e.printStackTrace();
|
|
|
390 |
}
|
| 24242 |
amit.gupta |
391 |
}
|
| 24241 |
amit.gupta |
392 |
}
|
|
|
393 |
}
|
|
|
394 |
}
|
|
|
395 |
}
|
|
|
396 |
});
|
| 24246 |
amit.gupta |
397 |
userAmountMap.entrySet().stream()
|
|
|
398 |
.forEach(x -> LOGGER.info("{} to be deducted from {}({}) for wrongly disbursed due to technical error.",
|
|
|
399 |
x.getValue(), userNameMap.get(x.getKey())));
|
| 24241 |
amit.gupta |
400 |
|
| 24252 |
amit.gupta |
401 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
| 24271 |
amit.gupta |
402 |
Utils.sendMailWithAttachment(googleMailSender,
|
|
|
403 |
new String[] { "amit.gupta@shop2020.in", "adeel.yazdani@smartdukaan.com" }, null,
|
|
|
404 |
"Partner Excess Amount", "PFA", "ListofSchemes.csv", new ByteArrayResource(baos.toByteArray()));
|
| 24252 |
amit.gupta |
405 |
|
| 24241 |
amit.gupta |
406 |
}
|
| 24271 |
amit.gupta |
407 |
|
| 24256 |
amit.gupta |
408 |
public void processScheme(int offset) throws Exception {
|
| 24271 |
amit.gupta |
409 |
LocalDateTime startDate = LocalDateTime.of(LocalDate.now(), LocalTime.MIDNIGHT).minusDays(30 * offset);
|
| 24259 |
amit.gupta |
410 |
LocalDateTime endDate = startDate.plusDays(30);
|
| 24258 |
amit.gupta |
411 |
processScheme(startDate, endDate);
|
| 24256 |
amit.gupta |
412 |
}
|
| 24271 |
amit.gupta |
413 |
|
| 23738 |
amit.gupta |
414 |
public void processScheme() throws Exception {
|
| 24256 |
amit.gupta |
415 |
LocalDateTime fromDate = LocalDateTime.now().minusDays(30);
|
|
|
416 |
processScheme(fromDate, LocalDateTime.now());
|
|
|
417 |
}
|
| 24271 |
amit.gupta |
418 |
|
| 24256 |
amit.gupta |
419 |
public void processScheme(LocalDateTime startDate, LocalDateTime endDate) throws Exception {
|
| 23724 |
amit.gupta |
420 |
LOGGER.info("Started execution at {}", LocalDateTime.now());
|
| 24256 |
amit.gupta |
421 |
List<Purchase> purchases = purchaseRepository.selectAllBetweenPurchaseDate(startDate, endDate);
|
| 23724 |
amit.gupta |
422 |
for (Purchase purchase : purchases) {
|
|
|
423 |
try {
|
|
|
424 |
schemeService.processSchemeIn(purchase.getId(), purchase.getFofoId());
|
|
|
425 |
} catch (Exception e) {
|
|
|
426 |
LOGGER.error("Error while processing purchase {} for scheme In ", purchase.getId());
|
|
|
427 |
e.printStackTrace();
|
| 24271 |
amit.gupta |
428 |
|
| 23724 |
amit.gupta |
429 |
}
|
|
|
430 |
}
|
| 24256 |
amit.gupta |
431 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectBetweenSaleDate(startDate, endDate);
|
| 23724 |
amit.gupta |
432 |
for (FofoOrder fofoOrder : fofoOrders) {
|
|
|
433 |
try {
|
|
|
434 |
schemeService.processSchemeOut(fofoOrder.getId(), fofoOrder.getFofoId());
|
|
|
435 |
} catch (Exception e) {
|
|
|
436 |
LOGGER.error("Error while processing sale order {} for scheme Out", fofoOrder.getId());
|
|
|
437 |
}
|
|
|
438 |
}
|
|
|
439 |
LOGGER.info("Schemes process successfully.");
|
|
|
440 |
}
|
| 23929 |
amit.gupta |
441 |
|
| 23739 |
amit.gupta |
442 |
public void processRechargeCashback() throws Throwable {
|
| 23761 |
amit.gupta |
443 |
LocalDateTime cashbackTime = LocalDateTime.now();
|
| 23929 |
amit.gupta |
444 |
int referenceId = (int) Timestamp.valueOf(cashbackTime).getTime() / 1000;
|
|
|
445 |
List<RechargeTransaction> pendingTransactions = rechargeTransactionRepository
|
|
|
446 |
.getPendingCashBackRehargeTransactions();
|
|
|
447 |
Map<Object, Double> totalRetailerCashbacks = pendingTransactions.stream().collect(
|
|
|
448 |
Collectors.groupingBy(x -> x.getRetailerId(), Collectors.summingDouble(x -> x.getCommission())));
|
|
|
449 |
for (Map.Entry<Object, Double> totalRetailerCashback : totalRetailerCashbacks.entrySet()) {
|
|
|
450 |
int retailerId = (Integer) totalRetailerCashback.getKey();
|
| 23739 |
amit.gupta |
451 |
float amount = totalRetailerCashback.getValue().floatValue();
|
| 23929 |
amit.gupta |
452 |
if (Math.round(amount) > 0) {
|
|
|
453 |
walletService.addAmountToWallet(retailerId, referenceId, WalletReferenceType.CASHBACK,
|
|
|
454 |
"Recharge Cashback", Math.round(amount));
|
| 23762 |
amit.gupta |
455 |
}
|
| 23739 |
amit.gupta |
456 |
}
|
| 23929 |
amit.gupta |
457 |
for (RechargeTransaction rt : pendingTransactions) {
|
| 23761 |
amit.gupta |
458 |
rt.setCashbackTimestamp(cashbackTime);
|
|
|
459 |
rt.setCashbackReference(referenceId);
|
|
|
460 |
rechargeTransactionRepository.persist(rt);
|
|
|
461 |
}
|
| 23739 |
amit.gupta |
462 |
LOGGER.info("Cashbacks for Recharge processed Successfully");
|
|
|
463 |
}
|
| 23724 |
amit.gupta |
464 |
|
| 24271 |
amit.gupta |
465 |
public void sendPartnerInvestmentDetails(List<String> sendTo) throws Exception {
|
| 23929 |
amit.gupta |
466 |
List<FofoStore> fofoStores = fofoStoreRepository.selectAll();
|
|
|
467 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService
|
|
|
468 |
.getFofoRetailers(fofoStores.stream().map(x -> x.getId()).collect(Collectors.toList()));
|
|
|
469 |
|
| 24271 |
amit.gupta |
470 |
List<String> headers = Arrays.asList("Code", "StoreName", "Email", "Mobile", "Wallet Amount",
|
|
|
471 |
"Yesterday's Sale", "In Stock Amount", "Return In Transit Stock", "Unbilled Amount",
|
|
|
472 |
"Grn Pending Amount", "Min Investment", "Investment Amount", "Investment Short");
|
| 24002 |
amit.gupta |
473 |
List<List<Object>> rows = new ArrayList<>();
|
|
|
474 |
for (FofoStore fofoStore : fofoStores) {
|
|
|
475 |
CustomRetailer retailer = customRetailerMap.get(fofoStore.getId());
|
|
|
476 |
if (retailer == null) {
|
|
|
477 |
LOGGER.info("Could not find retailer with retailer Id {}", fofoStore.getId());
|
|
|
478 |
continue;
|
|
|
479 |
}
|
|
|
480 |
float walletAmount = walletService.getUserWallet(fofoStore.getId()).getAmount();
|
|
|
481 |
float inStockAmount = inventoryService.getTotalAmountInStock(fofoStore.getId());
|
| 24271 |
amit.gupta |
482 |
float salesAmount = orderService.getSales(fofoStore.getId(), LocalDate.now().minusDays(1));
|
| 23929 |
amit.gupta |
483 |
|
| 24002 |
amit.gupta |
484 |
float unbilledStockAmount = 0;
|
|
|
485 |
List<Order> unbilledOrders = transactionService.getInTransitOrders(fofoStore.getId());
|
|
|
486 |
for (Order unBilledOrder : unbilledOrders) {
|
|
|
487 |
unbilledStockAmount += unBilledOrder.getTotalAmount();
|
| 23929 |
amit.gupta |
488 |
}
|
|
|
489 |
|
| 24002 |
amit.gupta |
490 |
float grnPendingStockAmount = 0;
|
|
|
491 |
List<Order> grnPendingOrders = orderRepository.selectPendingGrnOrders(fofoStore.getId());
|
|
|
492 |
for (Order grnPendingOrder : grnPendingOrders) {
|
|
|
493 |
LOGGER.info("Grn pending for Order {} and partner {}", grnPendingOrder.getId(),
|
|
|
494 |
grnPendingOrder.getRetailerEmailId());
|
|
|
495 |
grnPendingStockAmount += grnPendingOrder.getTotalAmount();
|
|
|
496 |
}
|
|
|
497 |
float totalInvestedAmount = walletAmount + inStockAmount + unbilledStockAmount + grnPendingStockAmount;
|
|
|
498 |
List<Object> row = Arrays.asList(fofoStore.getCode(), retailer.getBusinessName(), retailer.getEmail(),
|
| 24271 |
amit.gupta |
499 |
retailer.getMobileNumber(), salesAmount, walletAmount, inStockAmount, 0, unbilledStockAmount,
|
|
|
500 |
grnPendingStockAmount, fofoStore.getMinimumInvestment(), totalInvestedAmount,
|
| 24002 |
amit.gupta |
501 |
fofoStore.getMinimumInvestment() - totalInvestedAmount);
|
|
|
502 |
rows.add(row);
|
|
|
503 |
|
| 23929 |
amit.gupta |
504 |
}
|
| 24271 |
amit.gupta |
505 |
String fileName = "InvestmentSummary-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
| 24002 |
amit.gupta |
506 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
| 24271 |
amit.gupta |
507 |
String[] sendToArray = sendTo.toArray(new String[sendTo.size()]);
|
|
|
508 |
|
|
|
509 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Partner Investment Summary", "PFA", fileName,
|
|
|
510 |
new ByteArrayResource(baos.toByteArray()));
|
|
|
511 |
|
| 23929 |
amit.gupta |
512 |
}
|
| 24177 |
govind |
513 |
|
| 24271 |
amit.gupta |
514 |
public void sendPartnerInvestmentDetails() throws Exception {
|
|
|
515 |
List<String> sendTo = Arrays.asList("adeel.yazdani@smartdukaan.com", "amandeep.singh@smartdukaan.com",
|
|
|
516 |
"tarun.verma@smartdukaan.com", "kamini.sharma@smartdukaan.com", "dhruv.kathpal@smartdukaan.com",
|
|
|
517 |
"neeraj.gupta@smartdukaan.com");
|
|
|
518 |
this.sendPartnerInvestmentDetails(sendTo);
|
|
|
519 |
|
|
|
520 |
}
|
|
|
521 |
|
| 24177 |
govind |
522 |
private void sendMailWithAttachments(String[] email, String[] ccEmails, String body, String subject,
|
| 24187 |
govind |
523 |
Map<String, InputStream> inputStreams)
|
| 24177 |
govind |
524 |
throws MessagingException, ProfitMandiBusinessException, IOException {
|
| 24121 |
govind |
525 |
MimeMessage message = mailSender.createMimeMessage();
|
| 24177 |
govind |
526 |
MimeMessageHelper helper = new MimeMessageHelper(message, true, CharEncoding.UTF_8);
|
|
|
527 |
helper.setSubject(subject);
|
|
|
528 |
helper.setText(body);
|
|
|
529 |
if (ccEmails != null) {
|
|
|
530 |
helper.setCc(ccEmails);
|
|
|
531 |
}
|
| 24240 |
amit.gupta |
532 |
for (String attachment : inputStreams.keySet()) {
|
|
|
533 |
helper.addAttachment(attachment + "_" + LocalDate.now() + ".xls",
|
|
|
534 |
new ByteArrayResource(IOUtils.toByteArray(inputStreams.get(attachment))));
|
| 24187 |
govind |
535 |
}
|
| 24177 |
govind |
536 |
helper.setTo(email);
|
| 24195 |
govind |
537 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
| 24177 |
govind |
538 |
helper.setFrom(senderAddress);
|
|
|
539 |
mailSender.send(message);
|
| 24135 |
govind |
540 |
}
|
| 24240 |
amit.gupta |
541 |
|
|
|
542 |
private void sendMailWithAttachmentsForPartners(String email, String body, String subject, InputStream is)
|
| 24184 |
govind |
543 |
throws MessagingException, ProfitMandiBusinessException, IOException {
|
|
|
544 |
MimeMessage message = mailSender.createMimeMessage();
|
|
|
545 |
MimeMessageHelper helper = new MimeMessageHelper(message, true, CharEncoding.UTF_8);
|
|
|
546 |
helper.setSubject(subject);
|
|
|
547 |
helper.setText(body);
|
| 24240 |
amit.gupta |
548 |
helper.addAttachment("DailySaleTargetReports_" + LocalDate.now() + ".xls",
|
|
|
549 |
new ByteArrayResource(IOUtils.toByteArray(is)));
|
| 24184 |
govind |
550 |
helper.setTo(email);
|
| 24195 |
govind |
551 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
| 24184 |
govind |
552 |
helper.setFrom(senderAddress);
|
|
|
553 |
mailSender.send(message);
|
|
|
554 |
}
|
| 24177 |
govind |
555 |
|
|
|
556 |
public void sendMailToSalesHeadAboutTargetAndSales(SaleHeadDetails salesHeadDetail)
|
|
|
557 |
throws MessagingException, ProfitMandiBusinessException, IOException {
|
|
|
558 |
List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
|
|
|
559 |
.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
|
|
|
560 |
Map<String, InputStream> inputStreams = new HashMap<>();
|
|
|
561 |
for (PartnerTargetDetails partnerTargetDetail : partnerTargetDetails) {
|
|
|
562 |
InputStream is = targetService.getDailySaleReportVsTargetForSaleHead(partnerTargetDetail,
|
|
|
563 |
salesHeadDetail.getName());
|
| 24240 |
amit.gupta |
564 |
|
| 24177 |
govind |
565 |
inputStreams.put(partnerTargetDetail.getTargetName(), is);
|
|
|
566 |
|
| 24174 |
govind |
567 |
}
|
| 24240 |
amit.gupta |
568 |
// String[] ccEmails = null;
|
| 24271 |
amit.gupta |
569 |
if (partnerTargetDetails.size() > 0) {
|
| 24254 |
govind |
570 |
String[] ccEmails = { "Tarun.verma@smartdukaan.com", "Kamini.sharma@smartdukaan.com",
|
|
|
571 |
"chaitnaya.vats@smartdukaan.com", "dhruv.kathpal@smartdukaan.com" };
|
|
|
572 |
String subject = "Daily Sales Report ";
|
|
|
573 |
String message = MessageFormat.format("Sale Target summary for {0}", LocalDate.now());
|
|
|
574 |
LOGGER.info("message" + message);
|
|
|
575 |
if (salesHeadDetail.getName().equals("Kamal")) {
|
|
|
576 |
LOGGER.info("salesHeadDetail.getName()" + salesHeadDetail.getName());
|
|
|
577 |
String[] to = { salesHeadDetail.getEmail(), "mohinder.mutreja@smartdukaan.com" };
|
| 24177 |
govind |
578 |
|
| 24271 |
amit.gupta |
579 |
this.sendMailWithAttachments(to, ccEmails, message, subject, inputStreams);
|
| 24177 |
govind |
580 |
|
| 24271 |
amit.gupta |
581 |
} else {
|
|
|
582 |
LOGGER.info("salesHeadDetail.getName()" + salesHeadDetail.getName());
|
|
|
583 |
String[] to = { salesHeadDetail.getEmail() };
|
|
|
584 |
this.sendMailWithAttachments(to, ccEmails, message, subject, inputStreams);
|
|
|
585 |
}
|
| 24177 |
govind |
586 |
}
|
| 24121 |
govind |
587 |
}
|
| 24177 |
govind |
588 |
|
| 24240 |
amit.gupta |
589 |
public void sendMailToPartnerAboutTargetAndSales() throws ProfitMandiBusinessException, MessagingException,
|
|
|
590 |
IOException, EncryptedDocumentException, InvalidFormatException {
|
| 24177 |
govind |
591 |
List<Integer> fofoIds = targetService.getfofoIdsFromfofoStore();
|
|
|
592 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = retailerService
|
|
|
593 |
.getFofoRetailers(new ArrayList<>(fofoIds));
|
| 24240 |
amit.gupta |
594 |
List<InputStream> input = new ArrayList<>();
|
| 24177 |
govind |
595 |
List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
|
|
|
596 |
.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
|
|
|
597 |
for (Integer fofoId : fofoIds) {
|
| 24240 |
amit.gupta |
598 |
InputStream is = targetService.getDailySaleReportVsTargetForPartner(fofoId, partnerTargetDetails);
|
|
|
599 |
LOGGER.info("is" + is);
|
|
|
600 |
if (is == null) {
|
| 24192 |
govind |
601 |
continue;
|
|
|
602 |
}
|
| 24240 |
amit.gupta |
603 |
LOGGER.info("fofoId" + fofoId);
|
|
|
604 |
|
| 24177 |
govind |
605 |
LOGGER.info(fofoIdsAndCustomRetailer.get(fofoId).getEmail());
|
| 24240 |
amit.gupta |
606 |
String subject = "Daily Sales Report";
|
|
|
607 |
String message = MessageFormat.format("Sale Target summary for {0}", LocalDate.now());
|
| 24177 |
govind |
608 |
LOGGER.info(message);
|
| 24240 |
amit.gupta |
609 |
this.sendMailWithAttachmentsForPartners(fofoIdsAndCustomRetailer.get(fofoId).getEmail(), message, subject,
|
|
|
610 |
is);
|
|
|
611 |
|
| 24174 |
govind |
612 |
}
|
|
|
613 |
}
|
| 23929 |
amit.gupta |
614 |
|
| 23724 |
amit.gupta |
615 |
}
|