| Line 132... |
Line 132... |
| 132 |
import java.util.Map.Entry;
|
132 |
import java.util.Map.Entry;
|
| 133 |
import java.util.stream.Collector;
|
133 |
import java.util.stream.Collector;
|
| 134 |
import java.util.stream.Collectors;
|
134 |
import java.util.stream.Collectors;
|
| 135 |
import java.util.stream.Stream;
|
135 |
import java.util.stream.Stream;
|
| 136 |
|
136 |
|
| - |
|
137 |
import static java.util.stream.Collectors.groupingBy;
|
| - |
|
138 |
import static java.util.stream.Collectors.mapping;
|
| - |
|
139 |
|
| 137 |
@Component
|
140 |
@Component
|
| 138 |
@Transactional(rollbackFor = Throwable.class)
|
141 |
@Transactional(rollbackFor = Throwable.class)
|
| 139 |
public class ScheduledTasks {
|
142 |
public class ScheduledTasks {
|
| 140 |
|
143 |
|
| 141 |
@Value("${oxigen.recharge.transaction.url}")
|
144 |
@Value("${oxigen.recharge.transaction.url}")
|
| Line 484... |
Line 487... |
| 484 |
rechargeProviders.stream().forEach(x -> x.setAmount(0));
|
487 |
rechargeProviders.stream().forEach(x -> x.setAmount(0));
|
| 485 |
|
488 |
|
| 486 |
rechargeProviders.stream().forEach(x -> {
|
489 |
rechargeProviders.stream().forEach(x -> {
|
| 487 |
Map<LocalDate, List<RechargeProviderCreditWalletHistory>> dateWiseProviderCreditsMap = allCreditHistory
|
490 |
Map<LocalDate, List<RechargeProviderCreditWalletHistory>> dateWiseProviderCreditsMap = allCreditHistory
|
| 488 |
.stream().filter(z -> z.getProviderId() == x.getId())
|
491 |
.stream().filter(z -> z.getProviderId() == x.getId())
|
| 489 |
.collect(Collectors.groupingBy(x1 -> x1.getReceiveTimestamp().toLocalDate()));
|
492 |
.collect(groupingBy(x1 -> x1.getReceiveTimestamp().toLocalDate()));
|
| 490 |
|
493 |
|
| 491 |
LOGGER.info("dateWiseProviderCreditsMap -{}", dateWiseProviderCreditsMap);
|
494 |
LOGGER.info("dateWiseProviderCreditsMap -{}", dateWiseProviderCreditsMap);
|
| 492 |
LocalDate endDate = LocalDate.now().plusDays(1);
|
495 |
LocalDate endDate = LocalDate.now().plusDays(1);
|
| 493 |
float previousDayClosing = 0;
|
496 |
float previousDayClosing = 0;
|
| 494 |
LocalDate date = LocalDate.of(2018, 4, 6);
|
497 |
LocalDate date = LocalDate.of(2018, 4, 6);
|
| Line 591... |
Line 594... |
| 591 |
// TemporaryMethod
|
594 |
// TemporaryMethod
|
| 592 |
public void migrateInvoice() {
|
595 |
public void migrateInvoice() {
|
| 593 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectFromSaleDate(LocalDateTime.now().minusDays(3));
|
596 |
List<FofoOrder> fofoOrders = fofoOrderRepository.selectFromSaleDate(LocalDateTime.now().minusDays(3));
|
| 594 |
Map<Integer, List<FofoOrder>> partnerOrdersMap = new HashMap<>();
|
597 |
Map<Integer, List<FofoOrder>> partnerOrdersMap = new HashMap<>();
|
| 595 |
partnerOrdersMap = fofoOrders.stream()
|
598 |
partnerOrdersMap = fofoOrders.stream()
|
| 596 |
.collect(Collectors.groupingBy(FofoOrder::getFofoId, Collectors.toList()));
|
599 |
.collect(groupingBy(FofoOrder::getFofoId, Collectors.toList()));
|
| 597 |
for (List<FofoOrder> orderList : partnerOrdersMap.values()) {
|
600 |
for (List<FofoOrder> orderList : partnerOrdersMap.values()) {
|
| 598 |
int sequence = 0;
|
601 |
int sequence = 0;
|
| 599 |
String prefix = "";
|
602 |
String prefix = "";
|
| 600 |
List<FofoOrder> sortedList = orderList.stream().sorted((x1, x2) -> x1.getId() - x2.getId())
|
603 |
List<FofoOrder> sortedList = orderList.stream().sorted((x1, x2) -> x1.getId() - x2.getId())
|
| 601 |
.collect(Collectors.toList());
|
604 |
.collect(Collectors.toList());
|
| Line 688... |
Line 691... |
| 688 |
LocalDateTime cashbackTime = LocalDateTime.now();
|
691 |
LocalDateTime cashbackTime = LocalDateTime.now();
|
| 689 |
int referenceId = (int) Timestamp.valueOf(cashbackTime).getTime() / 1000;
|
692 |
int referenceId = (int) Timestamp.valueOf(cashbackTime).getTime() / 1000;
|
| 690 |
List<RechargeTransaction> pendingTransactions = rechargeTransactionRepository
|
693 |
List<RechargeTransaction> pendingTransactions = rechargeTransactionRepository
|
| 691 |
.getPendingCashBackRehargeTransactions();
|
694 |
.getPendingCashBackRehargeTransactions();
|
| 692 |
Map<Object, Double> totalRetailerCashbacks = pendingTransactions.stream().collect(
|
695 |
Map<Object, Double> totalRetailerCashbacks = pendingTransactions.stream().collect(
|
| 693 |
Collectors.groupingBy(x -> x.getRetailerId(), Collectors.summingDouble(x -> x.getCommission())));
|
696 |
groupingBy(x -> x.getRetailerId(), Collectors.summingDouble(x -> x.getCommission())));
|
| 694 |
for (Map.Entry<Object, Double> totalRetailerCashback : totalRetailerCashbacks.entrySet()) {
|
697 |
for (Map.Entry<Object, Double> totalRetailerCashback : totalRetailerCashbacks.entrySet()) {
|
| 695 |
int retailerId = (Integer) totalRetailerCashback.getKey();
|
698 |
int retailerId = (Integer) totalRetailerCashback.getKey();
|
| 696 |
float amount = totalRetailerCashback.getValue().floatValue();
|
699 |
float amount = totalRetailerCashback.getValue().floatValue();
|
| 697 |
if (Math.round(amount) > 0) {
|
700 |
if (Math.round(amount) > 0) {
|
| 698 |
walletService.addAmountToWallet(retailerId, referenceId, WalletReferenceType.CASHBACK,
|
701 |
walletService.addAmountToWallet(retailerId, referenceId, WalletReferenceType.CASHBACK,
|
| Line 1037... |
Line 1040... |
| 1037 |
Map<Integer, List<?>> partnerRowsMap = new HashMap<>();
|
1040 |
Map<Integer, List<?>> partnerRowsMap = new HashMap<>();
|
| 1038 |
|
1041 |
|
| 1039 |
Map<Integer, FofoReportingModel> partnerIdSalesHeaderMap = this.getPartnerIdSalesHeaders();
|
1042 |
Map<Integer, FofoReportingModel> partnerIdSalesHeaderMap = this.getPartnerIdSalesHeaders();
|
| 1040 |
|
1043 |
|
| 1041 |
Map<Integer, Integer> shortDaysMap = partnerDailyInvestmentRepository
|
1044 |
Map<Integer, Integer> shortDaysMap = partnerDailyInvestmentRepository
|
| 1042 |
.selectAll(LocalDate.now().withDayOfMonth(1), LocalDate.now()).stream().collect(Collectors.groupingBy(
|
1045 |
.selectAll(LocalDate.now().withDayOfMonth(1), LocalDate.now()).stream().collect(groupingBy(
|
| 1043 |
x -> x.getFofoId(), Collectors.summingInt(x -> x.getShortPercentage() > 10 ? 1 : 0)));
|
1046 |
x -> x.getFofoId(), Collectors.summingInt(x -> x.getShortPercentage() > 10 ? 1 : 0)));
|
| 1044 |
|
1047 |
|
| 1045 |
for (FofoStore fofoStore : fofoStores) {
|
1048 |
for (FofoStore fofoStore : fofoStores) {
|
| 1046 |
LOGGER.info("Fofo Store {}, {}", fofoStore.getId(), fofoStore.getCode());
|
1049 |
LOGGER.info("Fofo Store {}, {}", fofoStore.getId(), fofoStore.getCode());
|
| 1047 |
int fofoId = fofoStore.getId();
|
1050 |
int fofoId = fofoStore.getId();
|
| Line 1255... |
Line 1258... |
| 1255 |
|
1258 |
|
| 1256 |
List<EmployeeAttendance> employeeAttendances = employeeAttendanceRepository
|
1259 |
List<EmployeeAttendance> employeeAttendances = employeeAttendanceRepository
|
| 1257 |
.selectAllByDatesBetween(LocalDate.now().atStartOfDay(), LocalDateTime.now());
|
1260 |
.selectAllByDatesBetween(LocalDate.now().atStartOfDay(), LocalDateTime.now());
|
| 1258 |
|
1261 |
|
| 1259 |
Map<Integer, Optional<EmployeeAttendance>> employeeMorningAttendance = employeeAttendances.stream()
|
1262 |
Map<Integer, Optional<EmployeeAttendance>> employeeMorningAttendance = employeeAttendances.stream()
|
| 1260 |
.collect(Collectors.groupingBy(EmployeeAttendance::getUserId,
|
1263 |
.collect(groupingBy(EmployeeAttendance::getUserId,
|
| 1261 |
Collectors.minBy(Comparator.comparing(EmployeeAttendance::getCreateTimestamp))));
|
1264 |
Collectors.minBy(Comparator.comparing(EmployeeAttendance::getCreateTimestamp))));
|
| 1262 |
for (AuthUser authUser : authUsers) {
|
1265 |
for (AuthUser authUser : authUsers) {
|
| 1263 |
User user = userMap.get(authUser.getEmailId());
|
1266 |
User user = userMap.get(authUser.getEmailId());
|
| 1264 |
Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
|
1267 |
Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
|
| 1265 |
LOGGER.info("AuthUser - {}, employeeAttendanceOptional {}", authUser.getName(), employeeAttendanceOptional);
|
1268 |
LOGGER.info("AuthUser - {}, employeeAttendanceOptional {}", authUser.getName(), employeeAttendanceOptional);
|
| Line 1297... |
Line 1300... |
| 1297 |
List<User> users = dtrUserRepository.selectAllByEmailIds(new ArrayList<>(authUserEmailMap.keySet()));
|
1300 |
List<User> users = dtrUserRepository.selectAllByEmailIds(new ArrayList<>(authUserEmailMap.keySet()));
|
| 1298 |
Map<String, User> userMap = users.stream().collect(Collectors.toMap(x -> x.getEmailId(), x -> x));
|
1301 |
Map<String, User> userMap = users.stream().collect(Collectors.toMap(x -> x.getEmailId(), x -> x));
|
| 1299 |
|
1302 |
|
| 1300 |
Map<Integer, List<EmployeeAttendance>> employeeAttendancesMap = employeeAttendanceRepository
|
1303 |
Map<Integer, List<EmployeeAttendance>> employeeAttendancesMap = employeeAttendanceRepository
|
| 1301 |
.selectAllByDatesBetween(LocalDate.now().atStartOfDay(), LocalDateTime.now()).stream()
|
1304 |
.selectAllByDatesBetween(LocalDate.now().atStartOfDay(), LocalDateTime.now()).stream()
|
| 1302 |
.collect(Collectors.groupingBy(x -> x.getUserId()));
|
1305 |
.collect(groupingBy(x -> x.getUserId()));
|
| 1303 |
|
1306 |
|
| 1304 |
for (AuthUser authUser : authUsers) {
|
1307 |
for (AuthUser authUser : authUsers) {
|
| 1305 |
User user = userMap.get(authUser.getEmailId());
|
1308 |
User user = userMap.get(authUser.getEmailId());
|
| 1306 |
String body = null;
|
1309 |
String body = null;
|
| 1307 |
List<EmployeeAttendance> employeeAttendances = employeeAttendancesMap.get(user.getId());
|
1310 |
List<EmployeeAttendance> employeeAttendances = employeeAttendancesMap.get(user.getId());
|
| Line 1500... |
Line 1503... |
| 1500 |
walletReferenceTypes);
|
1503 |
walletReferenceTypes);
|
| 1501 |
double schemeAmountWalletTotal = history.stream().mapToDouble(x -> x.getAmount()).sum();
|
1504 |
double schemeAmountWalletTotal = history.stream().mapToDouble(x -> x.getAmount()).sum();
|
| 1502 |
if (Math.abs(netSchemeDisbursed - schemeAmountWalletTotal) > 10d) {
|
1505 |
if (Math.abs(netSchemeDisbursed - schemeAmountWalletTotal) > 10d) {
|
| 1503 |
LOGGER.info("Scheme Amount mismatched for Date {}", date);
|
1506 |
LOGGER.info("Scheme Amount mismatched for Date {}", date);
|
| 1504 |
|
1507 |
|
| 1505 |
Map<Integer, Double> inventoryItemSchemeIO = siosCreated.stream().collect(Collectors
|
- |
|
| 1506 |
.groupingBy(x -> x.getInventoryItemId(), Collectors.summingDouble(SchemeInOut::getAmount)));
|
1508 |
Map<Integer, Double> inventoryItemSchemeIO = siosCreated.stream().collect(groupingBy(x -> x.getInventoryItemId(), Collectors.summingDouble(SchemeInOut::getAmount)));
|
| 1507 |
|
1509 |
|
| 1508 |
Map<Integer, Double> userSchemeMap = inventoryItemRepository.selectByIds(inventoryItemSchemeIO.keySet())
|
1510 |
Map<Integer, Double> userSchemeMap = inventoryItemRepository.selectByIds(inventoryItemSchemeIO.keySet())
|
| 1509 |
.stream().collect(Collectors.groupingBy(x -> x.getFofoId(),
|
1511 |
.stream().collect(groupingBy(x -> x.getFofoId(),
|
| 1510 |
Collectors.summingDouble(x -> inventoryItemSchemeIO.get(x.getId()))));
|
1512 |
Collectors.summingDouble(x -> inventoryItemSchemeIO.get(x.getId()))));
|
| 1511 |
|
1513 |
|
| 1512 |
Map<Integer, Double> inventoryItemSchemeIORefunded = siosRefunded.stream().collect(Collectors
|
- |
|
| 1513 |
.groupingBy(x -> x.getInventoryItemId(), Collectors.summingDouble(SchemeInOut::getAmount)));
|
1514 |
Map<Integer, Double> inventoryItemSchemeIORefunded = siosRefunded.stream().collect(groupingBy(x -> x.getInventoryItemId(), Collectors.summingDouble(SchemeInOut::getAmount)));
|
| 1514 |
|
1515 |
|
| 1515 |
Map<Integer, Double> userSchemeRefundedMap = inventoryItemRepository
|
1516 |
Map<Integer, Double> userSchemeRefundedMap = inventoryItemRepository
|
| 1516 |
.selectByIds(inventoryItemSchemeIORefunded.keySet()).stream()
|
1517 |
.selectByIds(inventoryItemSchemeIORefunded.keySet()).stream()
|
| 1517 |
.collect(Collectors.groupingBy(x -> x.getFofoId(),
|
1518 |
.collect(groupingBy(x -> x.getFofoId(),
|
| 1518 |
Collectors.summingDouble(x -> inventoryItemSchemeIORefunded.get(x.getId()))));
|
1519 |
Collectors.summingDouble(x -> inventoryItemSchemeIORefunded.get(x.getId()))));
|
| 1519 |
|
1520 |
|
| 1520 |
Map<Integer, Double> finalUserSchemeAmountMap = new HashMap<>();
|
1521 |
Map<Integer, Double> finalUserSchemeAmountMap = new HashMap<>();
|
| 1521 |
|
1522 |
|
| 1522 |
for (Map.Entry<Integer, Double> schemeAmount : userSchemeRefundedMap.entrySet()) {
|
1523 |
for (Map.Entry<Integer, Double> schemeAmount : userSchemeRefundedMap.entrySet()) {
|
| Line 1529... |
Line 1530... |
| 1529 |
}
|
1530 |
}
|
| 1530 |
Map<Integer, Integer> userWalletMap = userWalletRepository
|
1531 |
Map<Integer, Integer> userWalletMap = userWalletRepository
|
| 1531 |
.selectByRetailerIds(finalUserSchemeAmountMap.keySet()).stream()
|
1532 |
.selectByRetailerIds(finalUserSchemeAmountMap.keySet()).stream()
|
| 1532 |
.collect(Collectors.toMap(UserWallet::getUserId, UserWallet::getId));
|
1533 |
.collect(Collectors.toMap(UserWallet::getUserId, UserWallet::getId));
|
| 1533 |
|
1534 |
|
| 1534 |
Map<Integer, Double> walletAmountMap = history.stream().collect(Collectors.groupingBy(
|
1535 |
Map<Integer, Double> walletAmountMap = history.stream().collect(groupingBy(
|
| 1535 |
UserWalletHistory::getWalletId, Collectors.summingDouble((UserWalletHistory::getAmount))));
|
1536 |
UserWalletHistory::getWalletId, Collectors.summingDouble((UserWalletHistory::getAmount))));
|
| 1536 |
for (Map.Entry<Integer, Double> userAmount : walletAmountMap.entrySet()) {
|
1537 |
for (Map.Entry<Integer, Double> userAmount : walletAmountMap.entrySet()) {
|
| 1537 |
double diff = Math.abs(finalUserSchemeAmountMap.get(userAmount.getKey()) - userAmount.getValue());
|
1538 |
double diff = Math.abs(finalUserSchemeAmountMap.get(userAmount.getKey()) - userAmount.getValue());
|
| 1538 |
if (diff > 5) {
|
1539 |
if (diff > 5) {
|
| 1539 |
LOGGER.info("Partner scheme mismatched for Userid {}", userWalletMap.get(userAmount.getKey()));
|
1540 |
LOGGER.info("Partner scheme mismatched for Userid {}", userWalletMap.get(userAmount.getKey()));
|
| Line 1790... |
Line 1791... |
| 1790 |
.filter(x -> schemeTypeMap.get(x.getSchemeId()).equals(SchemeType.OUT))
|
1791 |
.filter(x -> schemeTypeMap.get(x.getSchemeId()).equals(SchemeType.OUT))
|
| 1791 |
.collect(Collectors.toList());
|
1792 |
.collect(Collectors.toList());
|
| 1792 |
LOGGER.info("Found {} duplicate schemeouts for Orderid {}", sios.size(), fofoOrder.getId());
|
1793 |
LOGGER.info("Found {} duplicate schemeouts for Orderid {}", sios.size(), fofoOrder.getId());
|
| 1793 |
UserWalletHistory uwh = new UserWalletHistory();
|
1794 |
UserWalletHistory uwh = new UserWalletHistory();
|
| 1794 |
Map<Integer, List<SchemeInOut>> inventoryIdSouts = sios.stream()
|
1795 |
Map<Integer, List<SchemeInOut>> inventoryIdSouts = sios.stream()
|
| 1795 |
.collect(Collectors.groupingBy(SchemeInOut::getInventoryItemId, Collectors.toList()));
|
1796 |
.collect(groupingBy(SchemeInOut::getInventoryItemId, Collectors.toList()));
|
| 1796 |
for (Map.Entry<Integer, List<SchemeInOut>> inventorySioEntry : inventoryIdSouts.entrySet()) {
|
1797 |
for (Map.Entry<Integer, List<SchemeInOut>> inventorySioEntry : inventoryIdSouts.entrySet()) {
|
| 1797 |
List<SchemeInOut> outList = inventorySioEntry.getValue();
|
1798 |
List<SchemeInOut> outList = inventorySioEntry.getValue();
|
| 1798 |
if (outList.size() > 1) {
|
1799 |
if (outList.size() > 1) {
|
| 1799 |
|
1800 |
|
| 1800 |
}
|
1801 |
}
|
| Line 1891... |
Line 1892... |
| 1891 |
model.setTotalQty(partnerOrderQtyMap.containsKey(fofoId) ? partnerOrderQtyMap.get(fofoId) : 0);
|
1892 |
model.setTotalQty(partnerOrderQtyMap.containsKey(fofoId) ? partnerOrderQtyMap.get(fofoId) : 0);
|
| 1892 |
model.setPast3daysSale(
|
1893 |
model.setPast3daysSale(
|
| 1893 |
spPartner3DaysOrderValMap.containsKey(fofoId) ? spPartner3DaysOrderValMap.get(fofoId) : 0);
|
1894 |
spPartner3DaysOrderValMap.containsKey(fofoId) ? spPartner3DaysOrderValMap.get(fofoId) : 0);
|
| 1894 |
model.setFofoId(fofoId);
|
1895 |
model.setFofoId(fofoId);
|
| 1895 |
model.setCode(fofoStoreMap.get(fofoId).getCode());
|
1896 |
model.setCode(fofoStoreMap.get(fofoId).getCode());
|
| - |
|
1897 |
model.setActivationType(fofoStoreMap.get(fofoId).getActivationType());
|
| 1896 |
saleTargetReportModelMap.put(fofoId, model);
|
1898 |
saleTargetReportModelMap.put(fofoId, model);
|
| 1897 |
}
|
1899 |
}
|
| 1898 |
|
1900 |
|
| 1899 |
Map<Integer, FofoReportingModel> partnerSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
1901 |
Map<Integer, FofoReportingModel> partnerSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
| 1900 |
for (Integer fofoId : fofoIds) {
|
1902 |
for (Integer fofoId : fofoIds) {
|
| Line 2004... |
Line 2006... |
| 2004 |
private double totalSale;
|
2006 |
private double totalSale;
|
| 2005 |
private long totalQty;
|
2007 |
private long totalQty;
|
| 2006 |
private double past3daysSale;
|
2008 |
private double past3daysSale;
|
| 2007 |
private int fofoId;
|
2009 |
private int fofoId;
|
| 2008 |
private String code;
|
2010 |
private String code;
|
| - |
|
2011 |
private ActivationType activationType;
|
| - |
|
2012 |
|
| - |
|
2013 |
|
| - |
|
2014 |
|
| - |
|
2015 |
@Override
|
| - |
|
2016 |
public boolean equals(Object o) {
|
| - |
|
2017 |
if (this == o) return true;
|
| - |
|
2018 |
if (o == null || getClass() != o.getClass()) return false;
|
| - |
|
2019 |
SaleTargetReportModel that = (SaleTargetReportModel) o;
|
| - |
|
2020 |
return Double.compare(that.totalSale, totalSale) == 0 && totalQty == that.totalQty && Double.compare(that.past3daysSale, past3daysSale) == 0 && fofoId == that.fofoId && Double.compare(that.secondary, secondary) == 0 && Double.compare(that.smartphoneSale, smartphoneSale) == 0 && smartphoneQty == that.smartphoneQty && Double.compare(that.insuranceSale, insuranceSale) == 0 && insruanceQty == that.insruanceQty && Objects.equals(code, that.code) && activationType == that.activationType;
|
| - |
|
2021 |
}
|
| - |
|
2022 |
|
| - |
|
2023 |
@Override
|
| - |
|
2024 |
public int hashCode() {
|
| - |
|
2025 |
return Objects.hash(totalSale, totalQty, past3daysSale, fofoId, code, activationType, secondary, smartphoneSale, smartphoneQty, insuranceSale, insruanceQty);
|
| - |
|
2026 |
}
|
| - |
|
2027 |
|
| - |
|
2028 |
public ActivationType getActivationType() {
|
| - |
|
2029 |
return activationType;
|
| - |
|
2030 |
}
|
| - |
|
2031 |
|
| - |
|
2032 |
public void setActivationType(ActivationType activationType) {
|
| - |
|
2033 |
this.activationType = activationType;
|
| - |
|
2034 |
}
|
| 2009 |
|
2035 |
|
| 2010 |
public double getSecondary() {
|
2036 |
public double getSecondary() {
|
| 2011 |
return secondary;
|
2037 |
return secondary;
|
| 2012 |
}
|
2038 |
}
|
| 2013 |
|
2039 |
|
| Line 2035... |
Line 2061... |
| 2035 |
", insuranceSale=" + insuranceSale +
|
2061 |
", insuranceSale=" + insuranceSale +
|
| 2036 |
", insruanceQty=" + insruanceQty +
|
2062 |
", insruanceQty=" + insruanceQty +
|
| 2037 |
'}';
|
2063 |
'}';
|
| 2038 |
}
|
2064 |
}
|
| 2039 |
|
2065 |
|
| 2040 |
@Override
|
- |
|
| 2041 |
public boolean equals(Object o) {
|
- |
|
| 2042 |
if (this == o) return true;
|
- |
|
| 2043 |
if (o == null || getClass() != o.getClass()) return false;
|
- |
|
| 2044 |
SaleTargetReportModel that = (SaleTargetReportModel) o;
|
- |
|
| 2045 |
return Double.compare(that.totalSale, totalSale) == 0 && totalQty == that.totalQty && Double.compare(that.past3daysSale, past3daysSale) == 0 && fofoId == that.fofoId && Double.compare(that.secondary, secondary) == 0 && Double.compare(that.smartphoneSale, smartphoneSale) == 0 && smartphoneQty == that.smartphoneQty && Double.compare(that.insuranceSale, insuranceSale) == 0 && insruanceQty == that.insruanceQty && Objects.equals(code, that.code);
|
- |
|
| 2046 |
}
|
- |
|
| 2047 |
|
- |
|
| 2048 |
@Override
|
- |
|
| 2049 |
public int hashCode() {
|
- |
|
| 2050 |
return Objects.hash(totalSale, totalQty, past3daysSale, fofoId, code, secondary, smartphoneSale, smartphoneQty, insuranceSale, insruanceQty);
|
- |
|
| 2051 |
}
|
- |
|
| 2052 |
|
- |
|
| 2053 |
public String getCode() {
|
2066 |
public String getCode() {
|
| 2054 |
return code;
|
2067 |
return code;
|
| 2055 |
}
|
2068 |
}
|
| 2056 |
|
2069 |
|
| 2057 |
public void setCode(String code) {
|
2070 |
public void setCode(String code) {
|
| Line 2147... |
Line 2160... |
| 2147 |
|
2160 |
|
| 2148 |
if (!fofoIds.isEmpty()) {
|
2161 |
if (!fofoIds.isEmpty()) {
|
| 2149 |
List<FofoStore> stores = fofoStoreRepository
|
2162 |
List<FofoStore> stores = fofoStoreRepository
|
| 2150 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds));
|
2163 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds));
|
| 2151 |
|
2164 |
|
| 2152 |
Map<String, List<Integer>> stateMap = stores.stream().collect(Collectors.groupingBy(
|
2165 |
Map<String, List<Integer>> stateMap = stores.stream().collect(groupingBy(
|
| 2153 |
x -> x.getCode().substring(0, 2), Collectors.mapping(x -> x.getId(), Collectors.toList())));
|
2166 |
x -> x.getCode().substring(0, 2), mapping(x -> x.getId(), Collectors.toList())));
|
| 2154 |
List<List<Serializable>> stateWiseSales = new ArrayList<>();
|
2167 |
List<List<Serializable>> stateWiseSales = new ArrayList<>();
|
| 2155 |
for (Map.Entry<String, List<Integer>> stateMapEntry : stateMap.entrySet()) {
|
2168 |
for (Map.Entry<String, List<Integer>> stateMapEntry : stateMap.entrySet()) {
|
| 2156 |
long totalQty = stateMapEntry.getValue().stream()
|
2169 |
long totalQty = stateMapEntry.getValue().stream()
|
| 2157 |
.collect(Collectors.summingLong(x -> saleTargetReportModelMap.get(x).getTotalQty()));
|
2170 |
.collect(Collectors.summingLong(x -> saleTargetReportModelMap.get(x).getTotalQty()));
|
| 2158 |
double totalSale = stateMapEntry.getValue().stream()
|
2171 |
double totalSale = stateMapEntry.getValue().stream()
|
| Line 2204... |
Line 2217... |
| 2204 |
.sorted(Comparator.comparing(SaleTargetReportModel::getCode).thenComparing(SaleTargetReportModel::getSecondary))
|
2217 |
.sorted(Comparator.comparing(SaleTargetReportModel::getCode).thenComparing(SaleTargetReportModel::getSecondary))
|
| 2205 |
.map(SaleTargetReportModel::getFofoId).collect(Collectors.toList());
|
2218 |
.map(SaleTargetReportModel::getFofoId).collect(Collectors.toList());
|
| 2206 |
|
2219 |
|
| 2207 |
String subject = String.format("Sale till %s", String.format(timeString, now.format(timeFormatter)));
|
2220 |
String subject = String.format("Sale till %s", String.format(timeString, now.format(timeFormatter)));
|
| 2208 |
|
2221 |
|
| 2209 |
List<String> headers = Arrays.asList("Store Id", "Store Code", "Store Name", "BDM Name", "Regional Manager", "Territory Manager",
|
2222 |
List<String> headers = Arrays.asList("Store Id", "Store Code", "Store Name", "Activation Type", "BDM Name", "Regional Manager", "Territory Manager",
|
| 2210 |
"Secondary(4 days)", "Sale", "Smartphone Value", "Smartphone Qty");
|
2223 |
"Secondary(4 days)", "Sale", "Smartphone Value", "Smartphone Qty");
|
| 2211 |
List<List<?>> rows = new ArrayList<>();
|
2224 |
List<List<?>> rows = new ArrayList<>();
|
| 2212 |
for (Integer fofoId : sortedSaleTargetReport) {
|
2225 |
for (Integer fofoId : sortedSaleTargetReport) {
|
| 2213 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
- |
|
| 2214 |
FofoReportingModel fofoReportingModel = partnerSalesHeadersMap.get(fofoId);
|
2226 |
FofoReportingModel fofoReportingModel = partnerSalesHeadersMap.get(fofoId);
|
| 2215 |
rows.add(Arrays.asList(fofoId, fofoReportingModel.getCode(), fofoReportingModel.getBusinessName(),
|
2227 |
rows.add(Arrays.asList(fofoId, fofoReportingModel.getCode(), fofoReportingModel.getBusinessName(), saleTargetReportModelMap.get(fofoId).getActivationType(),
|
| 2216 |
fofoReportingModel.getBusinessManager(), fofoReportingModel.getRegionalManager(), fofoReportingModel.getTerritoryManager(),
|
2228 |
fofoReportingModel.getBusinessManager(), fofoReportingModel.getRegionalManager(), fofoReportingModel.getTerritoryManager(),
|
| 2217 |
saleTargetReportModelMap.get(fofoId).getSecondary(), saleTargetReportModelMap.get(fofoId).getTotalSale(),
|
2229 |
saleTargetReportModelMap.get(fofoId).getSecondary(), saleTargetReportModelMap.get(fofoId).getTotalSale(),
|
| 2218 |
saleTargetReportModelMap.get(fofoId).getSmartphoneSale(), saleTargetReportModelMap.get(fofoId).getSmartphoneQty()
|
2230 |
saleTargetReportModelMap.get(fofoId).getSmartphoneSale(), saleTargetReportModelMap.get(fofoId).getSmartphoneQty()
|
| 2219 |
));
|
2231 |
));
|
| 2220 |
|
2232 |
|
| 2221 |
|
- |
|
| - |
|
2233 |
//Now try to populate html rows
|
| 2222 |
if (!fofoStore.getActivationType().equals(ActivationType.ACTIVE)) {
|
2234 |
if (!saleTargetReportModelMap.get(fofoId).getActivationType().equals(ActivationType.ACTIVE)) {
|
| 2223 |
continue;
|
2235 |
continue;
|
| 2224 |
}
|
2236 |
}
|
| 2225 |
if (saleTargetReportModelMap.get(fofoId).getSecondary() == 0) {
|
2237 |
if (saleTargetReportModelMap.get(fofoId).getSecondary() == 0) {
|
| 2226 |
sb.append("<tr style='background-color:#D21F3C;color:white'>");
|
2238 |
sb.append("<tr style='background-color:#D21F3C;color:white'>");
|
| 2227 |
} else {
|
2239 |
} else {
|
| Line 2484... |
Line 2496... |
| 2484 |
Map<Integer, Integer> currentInventorySnapshot = currentInventorySnapshotRepository.selectByFofoId(fofoId)
|
2496 |
Map<Integer, Integer> currentInventorySnapshot = currentInventorySnapshotRepository.selectByFofoId(fofoId)
|
| 2485 |
.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> x.getAvailability()));
|
2497 |
.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> x.getAvailability()));
|
| 2486 |
|
2498 |
|
| 2487 |
if (!currentInventorySnapshot.isEmpty()) {
|
2499 |
if (!currentInventorySnapshot.isEmpty()) {
|
| 2488 |
catalogIdAndQtyMap = itemRepository.selectByIds(currentInventorySnapshot.keySet()).stream()
|
2500 |
catalogIdAndQtyMap = itemRepository.selectByIds(currentInventorySnapshot.keySet()).stream()
|
| 2489 |
.collect(Collectors.groupingBy(x -> x.getCatalogItemId(),
|
2501 |
.collect(groupingBy(x -> x.getCatalogItemId(),
|
| 2490 |
Collectors.summingInt(x -> currentInventorySnapshot.get(x.getId()))));
|
2502 |
Collectors.summingInt(x -> currentInventorySnapshot.get(x.getId()))));
|
| 2491 |
|
2503 |
|
| 2492 |
}
|
2504 |
}
|
| 2493 |
|
2505 |
|
| 2494 |
Map<Integer, Integer> grnPendingOrders = orderRepository.selectPendingGrnOrders(fofoId).stream()
|
2506 |
Map<Integer, Integer> grnPendingOrders = orderRepository.selectPendingGrnOrders(fofoId).stream()
|
| 2495 |
.collect(Collectors.groupingBy(x -> x.getLineItem().getItemId(),
|
2507 |
.collect(groupingBy(x -> x.getLineItem().getItemId(),
|
| 2496 |
Collectors.summingInt(x -> x.getLineItem().getQuantity())));
|
2508 |
Collectors.summingInt(x -> x.getLineItem().getQuantity())));
|
| 2497 |
if (!grnPendingOrders.isEmpty()) {
|
2509 |
if (!grnPendingOrders.isEmpty()) {
|
| 2498 |
grnPendingOrdersMap = itemRepository.selectByIds(grnPendingOrders.keySet()).stream()
|
2510 |
grnPendingOrdersMap = itemRepository.selectByIds(grnPendingOrders.keySet()).stream()
|
| 2499 |
.collect(Collectors.groupingBy(x -> x.getCatalogItemId(),
|
2511 |
.collect(groupingBy(x -> x.getCatalogItemId(),
|
| 2500 |
Collectors.summingInt(x -> grnPendingOrders.get(x.getId()))));
|
2512 |
Collectors.summingInt(x -> grnPendingOrders.get(x.getId()))));
|
| 2501 |
|
2513 |
|
| 2502 |
}
|
2514 |
}
|
| 2503 |
|
2515 |
|
| 2504 |
Map<Integer, Integer> processingOrder = orderRepository.selectOrders(fofoId, orderStatusList).stream()
|
2516 |
Map<Integer, Integer> processingOrder = orderRepository.selectOrders(fofoId, orderStatusList).stream()
|
| 2505 |
.collect(Collectors.groupingBy(x -> x.getLineItem().getItemId(),
|
2517 |
.collect(groupingBy(x -> x.getLineItem().getItemId(),
|
| 2506 |
Collectors.summingInt(x -> x.getLineItem().getQuantity())));
|
2518 |
Collectors.summingInt(x -> x.getLineItem().getQuantity())));
|
| 2507 |
if (!processingOrder.isEmpty()) {
|
2519 |
if (!processingOrder.isEmpty()) {
|
| 2508 |
processingOrderMap = itemRepository.selectByIds(processingOrder.keySet()).stream()
|
2520 |
processingOrderMap = itemRepository.selectByIds(processingOrder.keySet()).stream()
|
| 2509 |
.collect(Collectors.groupingBy(x -> x.getCatalogItemId(),
|
2521 |
.collect(groupingBy(x -> x.getCatalogItemId(),
|
| 2510 |
Collectors.summingInt(x -> processingOrder.get(x.getId()))));
|
2522 |
Collectors.summingInt(x -> processingOrder.get(x.getId()))));
|
| 2511 |
|
2523 |
|
| 2512 |
}
|
2524 |
}
|
| 2513 |
|
2525 |
|
| 2514 |
List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
|
2526 |
List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
|
| Line 2520... |
Line 2532... |
| 2520 |
if (regionIds.size() == 0) {
|
2532 |
if (regionIds.size() == 0) {
|
| 2521 |
LOGGER.info("No region found for partner {}", fofoId);
|
2533 |
LOGGER.info("No region found for partner {}", fofoId);
|
| 2522 |
continue;
|
2534 |
continue;
|
| 2523 |
}
|
2535 |
}
|
| 2524 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = focusedModelRepository
|
2536 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = focusedModelRepository
|
| 2525 |
.selectAllByRegionIds(regionIds).stream().collect(Collectors.groupingBy(FocusedModel::getCatalogId,
|
2537 |
.selectAllByRegionIds(regionIds).stream().collect(groupingBy(FocusedModel::getCatalogId,
|
| 2526 |
Collectors.mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
2538 |
mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
| 2527 |
|
2539 |
|
| 2528 |
LOGGER.info("focusedCatalogIdAndQtyMap" + focusedCatalogIdAndQtyMap);
|
2540 |
LOGGER.info("focusedCatalogIdAndQtyMap" + focusedCatalogIdAndQtyMap);
|
| 2529 |
|
2541 |
|
| 2530 |
for (Map.Entry<Integer, Optional<Integer>> entry : focusedCatalogIdAndQtyMap.entrySet()) {
|
2542 |
for (Map.Entry<Integer, Optional<Integer>> entry : focusedCatalogIdAndQtyMap.entrySet()) {
|
| 2531 |
int minQty = entry.getValue().get();
|
2543 |
int minQty = entry.getValue().get();
|
| Line 3253... |
Line 3265... |
| 3253 |
*/
|
3265 |
*/
|
| 3254 |
if (inventoryItem.getLastScanType().equals(ScanType.SALE)
|
3266 |
if (inventoryItem.getLastScanType().equals(ScanType.SALE)
|
| 3255 |
|| inventoryItem.getLastScanType().equals(ScanType.SALE_RET)) {
|
3267 |
|| inventoryItem.getLastScanType().equals(ScanType.SALE_RET)) {
|
| 3256 |
Map<String, Double> map = schemeInOuts.stream()
|
3268 |
Map<String, Double> map = schemeInOuts.stream()
|
| 3257 |
.collect(
|
3269 |
.collect(
|
| 3258 |
Collectors.groupingBy(
|
3270 |
groupingBy(
|
| 3259 |
x -> DateTimeFormatter.ofPattern("yyyyMMddHH")
|
3271 |
x -> DateTimeFormatter.ofPattern("yyyyMMddHH")
|
| 3260 |
.format(x.getCreateTimestamp()) + "- " + x.getSchemeId(),
|
3272 |
.format(x.getCreateTimestamp()) + "- " + x.getSchemeId(),
|
| 3261 |
Collectors.summingDouble(x -> x.getAmount())));
|
3273 |
Collectors.summingDouble(x -> x.getAmount())));
|
| 3262 |
for (Map.Entry<String, Double> entry : map.entrySet()) {
|
3274 |
for (Map.Entry<String, Double> entry : map.entrySet()) {
|
| 3263 |
LOGGER.info("{} = {}", entry.getKey(), entry.getValue());
|
3275 |
LOGGER.info("{} = {}", entry.getKey(), entry.getValue());
|
| Line 3562... |
Line 3574... |
| 3562 |
|
3574 |
|
| 3563 |
for (Loan loan : loans) {
|
3575 |
for (Loan loan : loans) {
|
| 3564 |
|
3576 |
|
| 3565 |
List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(loan.getId());
|
3577 |
List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(loan.getId());
|
| 3566 |
|
3578 |
|
| 3567 |
Map<LoanReferenceType, Double> loanStatusAmount = loanStatements.stream().collect(Collectors.groupingBy(
|
3579 |
Map<LoanReferenceType, Double> loanStatusAmount = loanStatements.stream().collect(groupingBy(
|
| 3568 |
x -> x.getLoanReferenceType(), Collectors.summingDouble(x -> x.getAmount().doubleValue())));
|
3580 |
x -> x.getLoanReferenceType(), Collectors.summingDouble(x -> x.getAmount().doubleValue())));
|
| 3569 |
|
3581 |
|
| 3570 |
if (loan.getFreeDays() > 0) {
|
3582 |
if (loan.getFreeDays() > 0) {
|
| 3571 |
LocalDateTime freeDaysLimitDate = loan.getCreatedOn().plusDays(loan.getFreeDays() - 1);
|
3583 |
LocalDateTime freeDaysLimitDate = loan.getCreatedOn().plusDays(loan.getFreeDays() - 1);
|
| 3572 |
|
3584 |
|
| Line 3652... |
Line 3664... |
| 3652 |
List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(loan.getId());
|
3664 |
List<LoanStatement> loanStatements = loanStatementRepository.selectByLoanId(loan.getId());
|
| 3653 |
|
3665 |
|
| 3654 |
LOGGER.info("loanStatements {}", loanStatements);
|
3666 |
LOGGER.info("loanStatements {}", loanStatements);
|
| 3655 |
|
3667 |
|
| 3656 |
Map<LoanReferenceType, Double> loanStatusAmount = loanStatements.stream()
|
3668 |
Map<LoanReferenceType, Double> loanStatusAmount = loanStatements.stream()
|
| 3657 |
.collect(Collectors.groupingBy(x -> x.getLoanReferenceType(),
|
3669 |
.collect(groupingBy(x -> x.getLoanReferenceType(),
|
| 3658 |
Collectors.summingDouble(x -> FormattingUtils.serialize(x.getAmount()))));
|
3670 |
Collectors.summingDouble(x -> FormattingUtils.serialize(x.getAmount()))));
|
| 3659 |
|
3671 |
|
| 3660 |
LOGGER.info("loanStatusAmount {}", loanStatusAmount);
|
3672 |
LOGGER.info("loanStatusAmount {}", loanStatusAmount);
|
| 3661 |
Double interestAmount = loanStatusAmount.get(LoanReferenceType.INTEREST);
|
3673 |
Double interestAmount = loanStatusAmount.get(LoanReferenceType.INTEREST);
|
| 3662 |
|
3674 |
|
| Line 3761... |
Line 3773... |
| 3761 |
|
3773 |
|
| 3762 |
LOGGER.info("allOrders {}", allOrders);
|
3774 |
LOGGER.info("allOrders {}", allOrders);
|
| 3763 |
|
3775 |
|
| 3764 |
if (!allOrders.isEmpty()) {
|
3776 |
if (!allOrders.isEmpty()) {
|
| 3765 |
Map<Integer, List<Order>> transactionOrdersMap = allOrders.stream()
|
3777 |
Map<Integer, List<Order>> transactionOrdersMap = allOrders.stream()
|
| 3766 |
.collect(Collectors.groupingBy(Order::getTransactionId, Collectors.toList()));
|
3778 |
.collect(groupingBy(Order::getTransactionId, Collectors.toList()));
|
| 3767 |
LinkedHashMap<Integer, List<Order>> sortedTransactionOrdersMap = new LinkedHashMap<>();
|
3779 |
LinkedHashMap<Integer, List<Order>> sortedTransactionOrdersMap = new LinkedHashMap<>();
|
| 3768 |
transactionOrdersMap.entrySet().stream().sorted(Map.Entry.comparingByKey())
|
3780 |
transactionOrdersMap.entrySet().stream().sorted(Map.Entry.comparingByKey())
|
| 3769 |
.forEachOrdered(x -> sortedTransactionOrdersMap.put(x.getKey(), x.getValue()));
|
3781 |
.forEachOrdered(x -> sortedTransactionOrdersMap.put(x.getKey(), x.getValue()));
|
| 3770 |
LOGGER.info("sortedTransactionOrdersMap {}", sortedTransactionOrdersMap);
|
3782 |
LOGGER.info("sortedTransactionOrdersMap {}", sortedTransactionOrdersMap);
|
| 3771 |
|
3783 |
|
| Line 4312... |
Line 4324... |
| 4312 |
remarks);
|
4324 |
remarks);
|
| 4313 |
|
4325 |
|
| 4314 |
if (!hygieneData.isEmpty()) {
|
4326 |
if (!hygieneData.isEmpty()) {
|
| 4315 |
|
4327 |
|
| 4316 |
Map<Integer, List<HygieneData>> partnerHygieneDataMap = hygieneData.stream()
|
4328 |
Map<Integer, List<HygieneData>> partnerHygieneDataMap = hygieneData.stream()
|
| 4317 |
.collect(Collectors.groupingBy(x -> x.getFofoId()));
|
4329 |
.collect(groupingBy(x -> x.getFofoId()));
|
| 4318 |
|
4330 |
|
| 4319 |
for (Entry<Integer, List<HygieneData>> partnerHygieneDataMapEntry : partnerHygieneDataMap.entrySet()) {
|
4331 |
for (Entry<Integer, List<HygieneData>> partnerHygieneDataMapEntry : partnerHygieneDataMap.entrySet()) {
|
| 4320 |
|
4332 |
|
| 4321 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(partnerHygieneDataMapEntry.getKey());
|
4333 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(partnerHygieneDataMapEntry.getKey());
|
| 4322 |
|
4334 |
|
| Line 4386... |
Line 4398... |
| 4386 |
|
4398 |
|
| 4387 |
Map<Integer, List<HygieneData>> partnerHygieneDataRecentMonth = null;
|
4399 |
Map<Integer, List<HygieneData>> partnerHygieneDataRecentMonth = null;
|
| 4388 |
|
4400 |
|
| 4389 |
if (!hygieneDataLastThreeMonth.isEmpty()) {
|
4401 |
if (!hygieneDataLastThreeMonth.isEmpty()) {
|
| 4390 |
partnerHygieneLastThreeMonthMap = hygieneDataLastThreeMonth.stream()
|
4402 |
partnerHygieneLastThreeMonthMap = hygieneDataLastThreeMonth.stream()
|
| 4391 |
.collect(Collectors.groupingBy(x -> x.getFofoId()));
|
4403 |
.collect(groupingBy(x -> x.getFofoId()));
|
| 4392 |
|
4404 |
|
| 4393 |
}
|
4405 |
}
|
| 4394 |
|
4406 |
|
| 4395 |
if (!hygieneDataRecentMonth.isEmpty()) {
|
4407 |
if (!hygieneDataRecentMonth.isEmpty()) {
|
| 4396 |
partnerHygieneDataRecentMonth = hygieneDataRecentMonth.stream()
|
4408 |
partnerHygieneDataRecentMonth = hygieneDataRecentMonth.stream()
|
| 4397 |
.collect(Collectors.groupingBy(x -> x.getFofoId()));
|
4409 |
.collect(groupingBy(x -> x.getFofoId()));
|
| 4398 |
}
|
4410 |
}
|
| 4399 |
|
4411 |
|
| 4400 |
for (Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
|
4412 |
for (Entry<String, Set<Integer>> storeGuyEntry : storeGuyMap.entrySet()) {
|
| 4401 |
|
4413 |
|
| 4402 |
String email = storeGuyEntry.getKey();
|
4414 |
String email = storeGuyEntry.getKey();
|
| Line 4412... |
Line 4424... |
| 4412 |
if (!partnerHygieneLastThreeMonthMap.isEmpty()) {
|
4424 |
if (!partnerHygieneLastThreeMonthMap.isEmpty()) {
|
| 4413 |
List<HygieneData> hygienes = partnerHygieneLastThreeMonthMap.get(fofoId);
|
4425 |
List<HygieneData> hygienes = partnerHygieneLastThreeMonthMap.get(fofoId);
|
| 4414 |
|
4426 |
|
| 4415 |
if (hygienes != null) {
|
4427 |
if (hygienes != null) {
|
| 4416 |
Map<YearMonth, List<HygieneData>> yearMonthData = hygienes.stream()
|
4428 |
Map<YearMonth, List<HygieneData>> yearMonthData = hygienes.stream()
|
| 4417 |
.collect(Collectors.groupingBy(x -> YearMonth.from(x.getDisposedTimestamp())));
|
4429 |
.collect(groupingBy(x -> YearMonth.from(x.getDisposedTimestamp())));
|
| 4418 |
|
4430 |
|
| 4419 |
partnerYearMonthData.put(fofoId, yearMonthData);
|
4431 |
partnerYearMonthData.put(fofoId, yearMonthData);
|
| 4420 |
|
4432 |
|
| 4421 |
}
|
4433 |
}
|
| 4422 |
List<HygieneData> dateWiseHygienes = partnerHygieneDataRecentMonth.get(fofoId);
|
4434 |
List<HygieneData> dateWiseHygienes = partnerHygieneDataRecentMonth.get(fofoId);
|
| 4423 |
|
4435 |
|
| 4424 |
if (dateWiseHygienes != null) {
|
4436 |
if (dateWiseHygienes != null) {
|
| 4425 |
|
4437 |
|
| 4426 |
Map<LocalDate, List<HygieneData>> dateWiseData = hygienes.stream()
|
4438 |
Map<LocalDate, List<HygieneData>> dateWiseData = hygienes.stream()
|
| 4427 |
.collect(Collectors.groupingBy(x -> (x.getDisposedTimestamp()).toLocalDate()));
|
4439 |
.collect(groupingBy(x -> (x.getDisposedTimestamp()).toLocalDate()));
|
| 4428 |
|
4440 |
|
| 4429 |
partnerDateWiseData.put(fofoId, dateWiseData);
|
4441 |
partnerDateWiseData.put(fofoId, dateWiseData);
|
| 4430 |
|
4442 |
|
| 4431 |
}
|
4443 |
}
|
| 4432 |
|
4444 |
|