| Line 1... |
Line 1... |
| 1 |
package com.smartdukaan.cron.scheduled;
|
1 |
package com.smartdukaan.cron.scheduled;
|
| 2 |
|
2 |
|
| 3 |
import java.io.IOException;
|
3 |
import java.io.IOException;
|
| 4 |
import java.io.InputStream;
|
4 |
import java.io.InputStream;
|
| - |
|
5 |
import java.io.Serializable;
|
| 5 |
import java.sql.Timestamp;
|
6 |
import java.sql.Timestamp;
|
| 6 |
import java.text.MessageFormat;
|
7 |
import java.text.MessageFormat;
|
| 7 |
import java.time.Duration;
|
8 |
import java.time.Duration;
|
| 8 |
import java.time.LocalDate;
|
9 |
import java.time.LocalDate;
|
| 9 |
import java.time.LocalDateTime;
|
10 |
import java.time.LocalDateTime;
|
| Line 439... |
Line 440... |
| 439 |
// Temporary Method
|
440 |
// Temporary Method
|
| 440 |
public void evaluateExcessSchemeOut() throws Exception {
|
441 |
public void evaluateExcessSchemeOut() throws Exception {
|
| 441 |
Map<Integer, String> userNameMap = retailerService.getAllFofoRetailerIdNameMap();
|
442 |
Map<Integer, String> userNameMap = retailerService.getAllFofoRetailerIdNameMap();
|
| 442 |
Map<Integer, Float> userAmountMap = new HashMap<>();
|
443 |
Map<Integer, Float> userAmountMap = new HashMap<>();
|
| 443 |
|
444 |
|
| 444 |
List<List<?>> rows = new ArrayList<>();
|
445 |
List<List<? extends Serializable>> rows = new ArrayList<>();
|
| 445 |
List<String> headers = Arrays.asList("Scheme", "Item", "Partner", "Amount", "Credited On", "Invoice Number",
|
446 |
List<String> headers = Arrays.asList("Scheme", "Item", "Partner", "Amount", "Credited On", "Invoice Number",
|
| 446 |
"Sale On", "Scheme Start", "Scheme End", "Active On", "Expired On");
|
447 |
"Sale On", "Scheme Start", "Scheme End", "Active On", "Expired On");
|
| 447 |
schemeRepository.selectAll().stream().forEach(x -> {
|
448 |
schemeRepository.selectAll().stream().forEach(x -> {
|
| 448 |
if (x.getType().equals(SchemeType.OUT)) {
|
449 |
if (x.getType().equals(SchemeType.OUT)) {
|
| 449 |
List<SchemeInOut> sioList = schemeInOutRepository
|
450 |
List<SchemeInOut> sioList = schemeInOutRepository
|
| Line 566... |
Line 567... |
| 566 |
.getFofoRetailers(fofoStores.stream().map(x -> x.getId()).collect(Collectors.toList()));
|
567 |
.getFofoRetailers(fofoStores.stream().map(x -> x.getId()).collect(Collectors.toList()));
|
| 567 |
|
568 |
|
| 568 |
List<String> headers = Arrays.asList("Code", "StoreName", "Email", "Mobile", "Wallet Amount",
|
569 |
List<String> headers = Arrays.asList("Code", "StoreName", "Email", "Mobile", "Wallet Amount",
|
| 569 |
"Yesterday's Sale", "In Stock Amount", "Return In Transit Stock", "Unbilled Amount",
|
570 |
"Yesterday's Sale", "In Stock Amount", "Return In Transit Stock", "Unbilled Amount",
|
| 570 |
"Grn Pending Amount", "Min Investment", "Investment Amount", "Investment Short");
|
571 |
"Grn Pending Amount", "Min Investment", "Investment Amount", "Investment Short");
|
| 571 |
List<List<?>> rows = new ArrayList<>();
|
572 |
List<List<? extends Serializable>> rows = new ArrayList<>();
|
| 572 |
for (FofoStore fofoStore : fofoStores) {
|
573 |
for (FofoStore fofoStore : fofoStores) {
|
| 573 |
CustomRetailer retailer = customRetailerMap.get(fofoStore.getId());
|
574 |
CustomRetailer retailer = customRetailerMap.get(fofoStore.getId());
|
| 574 |
if (retailer == null) {
|
575 |
if (retailer == null) {
|
| 575 |
LOGGER.info("Could not find retailer with retailer Id {}", fofoStore.getId());
|
576 |
LOGGER.info("Could not find retailer with retailer Id {}", fofoStore.getId());
|
| 576 |
continue;
|
577 |
continue;
|
| Line 578... |
Line 579... |
| 578 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoStore.getId(),
|
579 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoStore.getId(),
|
| 579 |
1);
|
580 |
1);
|
| 580 |
partnerDailyInvestment.setDate(yesterDay);
|
581 |
partnerDailyInvestment.setDate(yesterDay);
|
| 581 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
582 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
| 582 |
|
583 |
|
| 583 |
List<Object> row = Arrays.asList(fofoStore.getCode(), retailer.getBusinessName(), retailer.getEmail(),
|
584 |
List<? extends Serializable> row = Arrays.asList(fofoStore.getCode(), retailer.getBusinessName(), retailer.getEmail(),
|
| 584 |
retailer.getMobileNumber(), partnerDailyInvestment.getWalletAmount(),
|
585 |
retailer.getMobileNumber(), partnerDailyInvestment.getWalletAmount(),
|
| 585 |
partnerDailyInvestment.getSalesAmount(), partnerDailyInvestment.getInStockAmount(), 0,
|
586 |
partnerDailyInvestment.getSalesAmount(), partnerDailyInvestment.getInStockAmount(), 0,
|
| 586 |
partnerDailyInvestment.getUnbilledAmount(), partnerDailyInvestment.getGrnPendingAmount(),
|
587 |
partnerDailyInvestment.getUnbilledAmount(), partnerDailyInvestment.getGrnPendingAmount(),
|
| 587 |
partnerDailyInvestment.getMinInvestment(), partnerDailyInvestment.getTotalInvestment(),
|
588 |
partnerDailyInvestment.getMinInvestment(), partnerDailyInvestment.getTotalInvestment(),
|
| 588 |
partnerDailyInvestment.getShortInvestment());
|
589 |
partnerDailyInvestment.getShortInvestment());
|