| Line 1591... |
Line 1591... |
| 1591 |
|
1591 |
|
| 1592 |
return responseEntity;
|
1592 |
return responseEntity;
|
| 1593 |
}
|
1593 |
}
|
| 1594 |
|
1594 |
|
| 1595 |
@RequestMapping(value = "/schemePayoutReport", method = RequestMethod.GET)
|
1595 |
@RequestMapping(value = "/schemePayoutReport", method = RequestMethod.GET)
|
| - |
|
1596 |
public String getschemePayoutReport(HttpServletRequest request, Model model,
|
| - |
|
1597 |
@RequestParam(required = false) LocalDate startDate, @RequestParam(required = false) LocalDate endDate)
|
| - |
|
1598 |
throws ProfitMandiBusinessException {
|
| 1596 |
public String getSchemePayoutReport(HttpServletRequest request, Model model) throws Exception {
|
1599 |
//public String getSchemePayoutReport(HttpServletRequest request, Model model) throws Exception {
|
| 1597 |
LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
1600 |
//LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
| 1598 |
|
- |
|
| - |
|
1601 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1602 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
1603 |
if (startDate == null) {
|
| - |
|
1604 |
startDate = LocalDate.now().minusDays(30);
|
| - |
|
1605 |
endDate = LocalDate.now();
|
| - |
|
1606 |
}model.addAttribute("startDate", startDate);
|
| - |
|
1607 |
model.addAttribute("endDate", endDate);
|
| - |
|
1608 |
model.addAttribute("isAdmin", isAdmin);
|
| 1599 |
LocalDateTime currentDate = LocalDate.now().atStartOfDay();
|
1609 |
//LocalDateTime currentDate = LocalDate.now().atStartOfDay();
|
| 1600 |
LocalDateTime startDate = currentDate.minusMonths(3).toLocalDate().atStartOfDay();
|
1610 |
// LocalDateTime startDate = currentDate.minusMonths(3).toLocalDate().atStartOfDay();
|
| 1601 |
|
1611 |
|
| - |
|
1612 |
// List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
| - |
|
1613 |
//.selectSchemePayoutReport(fofoDetails.getFofoId(), startDate, currentDate);
|
| - |
|
1614 |
//LOGGER.info("schemePayoutReports {}", schemePayoutReports);
|
| 1602 |
List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
1615 |
List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
| 1603 |
.selectSchemePayoutReport(fofoDetails.getFofoId(), startDate, currentDate);
|
1616 |
.selectSchemePayoutReport(loginDetails.getFofoId(), startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| 1604 |
LOGGER.info("schemePayoutReports {}", schemePayoutReports);
|
- |
|
| 1605 |
|
- |
|
| 1606 |
|
- |
|
| 1607 |
|
- |
|
| 1608 |
model.addAttribute("startDate", currentDate.minusMonths(3).toLocalDate());
|
- |
|
| 1609 |
model.addAttribute("endDate", LocalDate.now());
|
- |
|
| 1610 |
model.addAttribute("schemePayoutReports", schemePayoutReports);
|
1617 |
model.addAttribute("schemePayoutReports", schemePayoutReports);
|
| 1611 |
|
- |
|
| 1612 |
return "scheme-payout-report";
|
1618 |
return "scheme-payout-report";
|
| - |
|
1619 |
|
| 1613 |
}
|
1620 |
}
|
| 1614 |
@RequestMapping(value = "/schemePayoutFetchReportByDate", method = RequestMethod.GET)
|
1621 |
@RequestMapping(value = "/schemePayoutFetchReportByDate", method = RequestMethod.GET)
|
| 1615 |
public String getschemePayoutFetchReport(HttpServletRequest request,
|
1622 |
public String getschemePayoutFetchReportByDate(
|
| - |
|
1623 |
HttpServletRequest request,
|
| - |
|
1624 |
Model model,
|
| - |
|
1625 |
@RequestParam(defaultValue = "0") int fofoId,
|
| 1616 |
@RequestParam(name = "startDate", required = true, defaultValue = "") LocalDate startDate,
|
1626 |
@RequestParam(required = false) LocalDate startDate,
|
| 1617 |
@RequestParam(name = "endDate", required = true, defaultValue = "") LocalDate endDate, Model model)
|
1627 |
@RequestParam(required = false) LocalDate endDate)
|
| 1618 |
throws Exception {
|
1628 |
throws ProfitMandiBusinessException {
|
| 1619 |
LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
1629 |
//LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1630 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1631 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
1632 |
if (startDate == null) {
|
| - |
|
1633 |
startDate = LocalDate.now().minusDays(30);
|
| - |
|
1634 |
endDate = LocalDate.now();
|
| - |
|
1635 |
}
|
| - |
|
1636 |
model.addAttribute("startDate", startDate);
|
| - |
|
1637 |
model.addAttribute("endDate", endDate);
|
| - |
|
1638 |
model.addAttribute("isAdmin", isAdmin);
|
| - |
|
1639 |
|
| - |
|
1640 |
LOGGER.info("q {}, starDate - {}, endDate - {}", fofoId, startDate, endDate);
|
| - |
|
1641 |
if (isAdmin) {
|
| - |
|
1642 |
if (fofoId == 0) {
|
| - |
|
1643 |
//No need to pull any data
|
| - |
|
1644 |
model.addAttribute("schemePayoutReports", new ArrayList<>());
|
| - |
|
1645 |
return "scheme-payout-report";
|
| - |
|
1646 |
|
| - |
|
1647 |
}
|
| - |
|
1648 |
else{
|
| - |
|
1649 |
List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
| - |
|
1650 |
.selectSchemePayoutReport(fofoId, startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| 1620 |
|
1651 |
|
| - |
|
1652 |
model.addAttribute("schemePayoutReports", schemePayoutReports);
|
| - |
|
1653 |
return "scheme-payout-report";
|
| - |
|
1654 |
}
|
| - |
|
1655 |
} else {
|
| 1621 |
List<List<?>> rows = new ArrayList<>();
|
1656 |
fofoId = loginDetails.getFofoId();
|
| - |
|
1657 |
|
| - |
|
1658 |
List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
| - |
|
1659 |
.selectSchemePayoutReport(fofoId, startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| - |
|
1660 |
|
| - |
|
1661 |
model.addAttribute("schemePayoutReports", schemePayoutReports);
|
| - |
|
1662 |
return "scheme-payout-report";
|
| - |
|
1663 |
}
|
| 1622 |
|
1664 |
|
| 1623 |
LocalDateTime currentDate = LocalDate.now().atStartOfDay();
|
- |
|
| 1624 |
List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
|
- |
|
| 1625 |
.selectSchemePayoutReport(fofoDetails.getFofoId(), startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
- |
|
| 1626 |
LOGGER.info("schemePayoutReports {}", schemePayoutReports);
|
- |
|
| 1627 |
|
- |
|
| 1628 |
model.addAttribute("startDate",startDate);
|
- |
|
| 1629 |
model.addAttribute("endDate", LocalDate.now());
|
- |
|
| 1630 |
model.addAttribute("schemePayoutReports", schemePayoutReports);
|
- |
|
| 1631 |
|
- |
|
| 1632 |
return "scheme-payout-report";
|
- |
|
| 1633 |
}
|
1665 |
}
|
| 1634 |
|
1666 |
|
| 1635 |
@RequestMapping(value = "/offerPayoutReport", method = RequestMethod.GET)
|
1667 |
@RequestMapping(value = "/offerPayoutReport", method = RequestMethod.GET)
|
| 1636 |
public String getOfferPayoutReport(HttpServletRequest request, Model model) throws Exception {
|
1668 |
public String getOfferPayoutReport(HttpServletRequest request, Model model, @RequestParam(required = false) LocalDate startDate, @RequestParam(required = false) LocalDate endDate) throws Exception {
|
| 1637 |
LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
1669 |
LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1670 |
boolean isAdmin = roleManager.isAdmin(fofoDetails.getRoleIds());
|
| - |
|
1671 |
|
| - |
|
1672 |
if (startDate == null) {
|
| - |
|
1673 |
startDate = LocalDate.now().minusDays(30);
|
| - |
|
1674 |
endDate = LocalDate.now();
|
| - |
|
1675 |
}
|
| - |
|
1676 |
model.addAttribute("startDate", startDate);
|
| - |
|
1677 |
model.addAttribute("endDate", endDate);
|
| 1638 |
|
1678 |
|
| 1639 |
LocalDateTime currentDate = LocalDate.now().atStartOfDay();
|
- |
|
| 1640 |
LocalDateTime startDate = currentDate.minusMonths(3).toLocalDate().atStartOfDay();
|
- |
|
| 1641 |
|
1679 |
|
| 1642 |
List<OfferPayoutDumpReportModel> offerPayoutDumpReports = fofoOrderRepository
|
1680 |
List<OfferPayoutDumpReportModel> offerPayoutDumpReports = fofoOrderRepository
|
| 1643 |
.selectOfferPayoutDumpReport(fofoDetails.getFofoId(), startDate, currentDate);
|
1681 |
.selectOfferPayoutDumpReport(fofoDetails.getFofoId(), startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| 1644 |
LOGGER.info("offerPayoutDumpReports {}", offerPayoutDumpReports);
|
1682 |
LOGGER.info("offerPayoutDumpReports {}", offerPayoutDumpReports);
|
| 1645 |
|
1683 |
|
| 1646 |
model.addAttribute("startDate", currentDate.minusMonths(3).toLocalDate());
|
- |
|
| 1647 |
model.addAttribute("endDate", LocalDate.now());
|
- |
|
| 1648 |
model.addAttribute("offerPayoutDumpReports", offerPayoutDumpReports);
|
1684 |
model.addAttribute("offerPayoutDumpReports", offerPayoutDumpReports);
|
| - |
|
1685 |
model.addAttribute("isAdmin", isAdmin);
|
| 1649 |
|
1686 |
|
| 1650 |
return "offer-payout-dump-report";
|
1687 |
return "offer-payout-dump-report";
|
| 1651 |
}
|
1688 |
}
|
| 1652 |
@RequestMapping(value = "/offerPayoutFetchReportByDate", method = RequestMethod.GET)
|
1689 |
@RequestMapping(value = "/offerPayoutFetchReportByDate", method = RequestMethod.GET)
|
| 1653 |
public String getOfferPayoutFetchReport(HttpServletRequest request,
|
1690 |
public String getofferPayoutFetchReportByDate(HttpServletRequest request, Model model, @RequestParam(defaultValue = "0") int fofoId,
|
| 1654 |
@RequestParam(name = "startDate", required = true, defaultValue = "") LocalDate startDate,
|
1691 |
@RequestParam(required = false) LocalDate startDate, @RequestParam(required = false) LocalDate endDate)
|
| 1655 |
@RequestParam(name = "endDate", required = true, defaultValue = "") LocalDate endDate, Model model)
|
- |
|
| 1656 |
throws Exception {
|
1692 |
throws ProfitMandiBusinessException {
|
| - |
|
1693 |
|
| 1657 |
LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
|
1694 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1695 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| - |
|
1696 |
if (startDate == null) {
|
| - |
|
1697 |
startDate = LocalDate.now().minusDays(30);
|
| - |
|
1698 |
endDate = LocalDate.now();
|
| - |
|
1699 |
}
|
| - |
|
1700 |
model.addAttribute("startDate", startDate);
|
| - |
|
1701 |
model.addAttribute("endDate", endDate);
|
| - |
|
1702 |
model.addAttribute("isAdmin", isAdmin);
|
| - |
|
1703 |
LOGGER.info("q {}, starDate - {}, endDate - {}", fofoId, startDate, endDate);
|
| - |
|
1704 |
if (isAdmin) {
|
| - |
|
1705 |
if (fofoId == 0) {
|
| - |
|
1706 |
//No need to pull any data
|
| - |
|
1707 |
model.addAttribute("offerPayoutReports", new ArrayList<>());
|
| - |
|
1708 |
return "offer-payout-dump-report";
|
| - |
|
1709 |
|
| - |
|
1710 |
}
|
| - |
|
1711 |
else{
|
| - |
|
1712 |
List<OfferPayoutDumpReportModel> offerPayoutDumpReports = fofoOrderRepository
|
| - |
|
1713 |
.selectOfferPayoutDumpReport(fofoId, startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| - |
|
1714 |
|
| - |
|
1715 |
model.addAttribute("offerPayoutDumpReports", offerPayoutDumpReports);
|
| - |
|
1716 |
|
| - |
|
1717 |
|
| - |
|
1718 |
return "offer-payout-dump-report";
|
| 1658 |
|
1719 |
|
| - |
|
1720 |
}
|
| - |
|
1721 |
} else {
|
| 1659 |
List<List<?>> rows = new ArrayList<>();
|
1722 |
fofoId = loginDetails.getFofoId();
|
| - |
|
1723 |
List<OfferPayoutDumpReportModel> offerPayoutDumpReports = fofoOrderRepository
|
| - |
|
1724 |
.selectOfferPayoutDumpReport(fofoId, startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
| 1660 |
|
1725 |
|
| 1661 |
LocalDateTime currentDate = LocalDate.now().atStartOfDay();
|
- |
|
| 1662 |
List<OfferPayoutDumpReportModel> offerPayoutDumpReports = fofoOrderRepository
|
- |
|
| 1663 |
.selectOfferPayoutDumpReport(fofoDetails.getFofoId(), startDate.atStartOfDay(), endDate.atTime(LocalTime.MAX));
|
- |
|
| 1664 |
LOGGER.info("offerPayoutDumpReports {}", offerPayoutDumpReports);
|
- |
|
| 1665 |
|
- |
|
| 1666 |
model.addAttribute("startDate",startDate);
|
- |
|
| 1667 |
model.addAttribute("endDate", LocalDate.now());
|
- |
|
| 1668 |
model.addAttribute("offerPayoutDumpReports", offerPayoutDumpReports);
|
1726 |
model.addAttribute("offerPayoutDumpReports", offerPayoutDumpReports);
|
| 1669 |
|
1727 |
|
| 1670 |
|
1728 |
|
| 1671 |
return "offer-payout-dump-report";
|
1729 |
return "offer-payout-dump-report";
|
| - |
|
1730 |
}
|
| 1672 |
}
|
1731 |
}
|
| 1673 |
|
1732 |
|
| 1674 |
|
1733 |
|
| 1675 |
@RequestMapping(value = "/selectPartnerBillingSummaryReport", method = RequestMethod.GET)
|
1734 |
@RequestMapping(value = "/selectPartnerBillingSummaryReport", method = RequestMethod.GET)
|
| 1676 |
public String getselectPartnerBillingSummaryReport(HttpServletRequest request, Model model) throws Exception {
|
1735 |
public String getselectPartnerBillingSummaryReport(HttpServletRequest request, Model model) throws Exception {
|