| Line 59... |
Line 59... |
| 59 |
import com.spice.profitmandi.common.model.DataInvestmentModel;
|
59 |
import com.spice.profitmandi.common.model.DataInvestmentModel;
|
| 60 |
import com.spice.profitmandi.common.model.DataModel;
|
60 |
import com.spice.profitmandi.common.model.DataModel;
|
| 61 |
import com.spice.profitmandi.common.model.DatasetModel;
|
61 |
import com.spice.profitmandi.common.model.DatasetModel;
|
| 62 |
import com.spice.profitmandi.common.model.Legend;
|
62 |
import com.spice.profitmandi.common.model.Legend;
|
| 63 |
import com.spice.profitmandi.common.model.LegendModel;
|
63 |
import com.spice.profitmandi.common.model.LegendModel;
|
| 64 |
|
- |
|
| 65 |
import com.spice.profitmandi.common.model.Notification;
|
64 |
import com.spice.profitmandi.common.model.Notification;
|
| 66 |
import com.spice.profitmandi.common.model.OptionModel;
|
65 |
import com.spice.profitmandi.common.model.OptionModel;
|
| 67 |
import com.spice.profitmandi.common.model.OptionsModel;
|
66 |
import com.spice.profitmandi.common.model.OptionsModel;
|
| 68 |
import com.spice.profitmandi.common.model.PieLables;
|
67 |
import com.spice.profitmandi.common.model.PieLables;
|
| 69 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
68 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| Line 645... |
Line 644... |
| 645 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
644 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
| 646 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
645 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
| 647 |
|
646 |
|
| 648 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|
647 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|
| 649 |
investmentWalletAmount.put("Wallet", investment.getWalletAmount());
|
648 |
investmentWalletAmount.put("Wallet", investment.getWalletAmount());
|
| 650 |
investmentWalletAmount.put("InStock", investment.getInStockAmount());
|
649 |
investmentWalletAmount.put("Ex.Activated Stocks", investment.getInStockAmount()-investment.getActivatedStockAmount());
|
| 651 |
investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
|
650 |
investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
|
| 652 |
investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount());
|
651 |
investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount());
|
| 653 |
investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
|
652 |
investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
|
| 654 |
|
653 |
|
| 655 |
if (investment.getShortInvestment() > 0) {
|
654 |
if (investment.getShortInvestment() > 0) {
|
| Line 671... |
Line 670... |
| 671 |
backgroundColor.add("pink");
|
670 |
backgroundColor.add("pink");
|
| 672 |
}
|
671 |
}
|
| 673 |
if (label.equals("Short Investment")) {
|
672 |
if (label.equals("Short Investment")) {
|
| 674 |
backgroundColor.add("red");
|
673 |
backgroundColor.add("red");
|
| 675 |
}
|
674 |
}
|
| 676 |
if (label.equals("InStock")) {
|
675 |
if (label.equals("Ex.Activated Stocks")) {
|
| 677 |
backgroundColor.add("#9ACD32");
|
676 |
backgroundColor.add("#9ACD32");
|
| 678 |
}
|
677 |
}
|
| 679 |
if (label.equals("Unbilled Order")) {
|
678 |
if (label.equals("Unbilled Order")) {
|
| 680 |
backgroundColor.add("blue");
|
679 |
backgroundColor.add("blue");
|
| 681 |
}
|
680 |
}
|
| Line 732... |
Line 731... |
| 732 |
LOGGER.info("brandwisesale" + brandwisesale);
|
731 |
LOGGER.info("brandwisesale" + brandwisesale);
|
| 733 |
|
732 |
|
| 734 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
733 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
| 735 |
fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
734 |
fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
| 736 |
brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
|
735 |
brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
|
| - |
|
736 |
|
| 737 |
Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
|
737 |
Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
|
| 738 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
|
738 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
|
| 739 |
.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
739 |
.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
| 740 |
|
740 |
|
| - |
|
741 |
activatedImeisWithSellingPriceMTD.put("Lava", brandwisesale.get("Lava"));
|
| - |
|
742 |
|
| - |
|
743 |
|
| - |
|
744 |
|
| - |
|
745 |
|
| 741 |
Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
|
746 |
Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
|
| 742 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
|
747 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
|
| 743 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
|
748 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
|
| 744 |
.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
749 |
.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
| 745 |
|
750 |
|
| 746 |
Map<String, Double> lmtdBrandWiseSale = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
751 |
Map<String, Double> lmtdBrandWiseSale = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
| 747 |
curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
|
752 |
curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
|
| - |
|
753 |
activatedImeisWithSellingPriceLMTD.put("Lava", lmtdBrandWiseSale.get("Lava"));
|
| 748 |
|
754 |
|
| 749 |
Map<Integer, Double> accesorieslmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
755 |
Map<Integer, Double> accesorieslmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
| 750 |
fofoId, curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1),
|
756 |
fofoId, curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1),
|
| 751 |
Optional.of(false));
|
757 |
Optional.of(false));
|
| 752 |
|
758 |
|
| Line 844... |
Line 850... |
| 844 |
linemtdChart.setOrder(2);
|
850 |
linemtdChart.setOrder(2);
|
| 845 |
linemtdChart.setFill("false");
|
851 |
linemtdChart.setFill("false");
|
| 846 |
|
852 |
|
| 847 |
DatasetModel lineLmtdChart = new DatasetModel();
|
853 |
DatasetModel lineLmtdChart = new DatasetModel();
|
| 848 |
lineLmtdChart.setLabel("LMTD");
|
854 |
lineLmtdChart.setLabel("LMTD");
|
| 849 |
lineLmtdChart.setBackgroundColor("#006400");
|
855 |
lineLmtdChart.setBackgroundColor("hotpink");
|
| 850 |
lineLmtdChart.setData(lmtdValues);
|
856 |
lineLmtdChart.setData(lmtdValues);
|
| 851 |
lineLmtdChart.setType("line");
|
857 |
lineLmtdChart.setType("line");
|
| 852 |
lineLmtdChart.setOrder(3);
|
858 |
lineLmtdChart.setOrder(3);
|
| 853 |
lineLmtdChart.setFill("false");
|
859 |
lineLmtdChart.setFill("false");
|
| 854 |
|
860 |
|
| 855 |
List<DatasetModel> datasets = new ArrayList<>();
|
861 |
List<DatasetModel> datasets = new ArrayList<>();
|
| 856 |
datasets.add(lmtdUnActivated);
|
- |
|
| 857 |
datasets.add(LmtdActivatedImeis);
|
- |
|
| 858 |
datasets.add(dsmUnactivated);
|
- |
|
| 859 |
datasets.add(mtdActivatedImeis);
|
862 |
datasets.add(mtdActivatedImeis);
|
| 860 |
|
- |
|
| - |
|
863 |
datasets.add(dsmUnactivated);
|
| - |
|
864 |
datasets.add(LmtdActivatedImeis);
|
| - |
|
865 |
datasets.add(lmtdUnActivated);
|
| 861 |
datasets.add(linemtdChart);
|
866 |
datasets.add(linemtdChart);
|
| 862 |
datasets.add(lineLmtdChart);
|
867 |
datasets.add(lineLmtdChart);
|
| 863 |
|
868 |
|
| 864 |
DataModel dm = new DataModel();
|
869 |
DataModel dm = new DataModel();
|
| 865 |
dm.setDatasets(datasets);
|
870 |
dm.setDatasets(datasets);
|