| Line 61... |
Line 61... |
| 61 |
import com.spice.profitmandi.common.model.DataModel;
|
61 |
import com.spice.profitmandi.common.model.DataModel;
|
| 62 |
import com.spice.profitmandi.common.model.DatasetModel;
|
62 |
import com.spice.profitmandi.common.model.DatasetModel;
|
| 63 |
import com.spice.profitmandi.common.model.Legend;
|
63 |
import com.spice.profitmandi.common.model.Legend;
|
| 64 |
import com.spice.profitmandi.common.model.LegendModel;
|
64 |
import com.spice.profitmandi.common.model.LegendModel;
|
| 65 |
import com.spice.profitmandi.common.model.Notification;
|
65 |
import com.spice.profitmandi.common.model.Notification;
|
| - |
|
66 |
import com.spice.profitmandi.common.model.OnlineDeliveredOrderSum;
|
| 66 |
import com.spice.profitmandi.common.model.OptionModel;
|
67 |
import com.spice.profitmandi.common.model.OptionModel;
|
| 67 |
import com.spice.profitmandi.common.model.OptionsModel;
|
68 |
import com.spice.profitmandi.common.model.OptionsModel;
|
| 68 |
import com.spice.profitmandi.common.model.PieLables;
|
69 |
import com.spice.profitmandi.common.model.PieLables;
|
| 69 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
70 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 70 |
import com.spice.profitmandi.common.model.ScalesModel;
|
71 |
import com.spice.profitmandi.common.model.ScalesModel;
|
| Line 82... |
Line 83... |
| 82 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
83 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 83 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
84 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 84 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
85 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 85 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
86 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 86 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
87 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| - |
|
88 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
|
| - |
|
89 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
|
| 87 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
90 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
| 88 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
91 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 89 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
92 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 90 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
93 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 91 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
94 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
| - |
|
95 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 92 |
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
|
96 |
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
|
| 93 |
import com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel;
|
97 |
import com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel;
|
| 94 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
98 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| 95 |
import com.spice.profitmandi.dao.model.InStockBrandItemModel;
|
99 |
import com.spice.profitmandi.dao.model.InStockBrandItemModel;
|
| 96 |
import com.spice.profitmandi.dao.model.InStockBrandModel;
|
100 |
import com.spice.profitmandi.dao.model.InStockBrandModel;
|
| Line 135... |
Line 139... |
| 135 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
139 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 136 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
140 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 137 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
141 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 138 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
142 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
| 139 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
143 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| - |
|
144 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
|
| - |
|
145 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
|
| 140 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
146 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
| 141 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
|
147 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
|
| 142 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
148 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
| 143 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
149 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 144 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
150 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| Line 173... |
Line 179... |
| 173 |
@Value("${web.api.root}")
|
179 |
@Value("${web.api.root}")
|
| 174 |
private String webApiRoot;
|
180 |
private String webApiRoot;
|
| 175 |
|
181 |
|
| 176 |
@Value("${web.api.port}")
|
182 |
@Value("${web.api.port}")
|
| 177 |
private int webApiPort;
|
183 |
private int webApiPort;
|
| 178 |
|
184 |
|
| 179 |
@Autowired
|
185 |
@Autowired
|
| 180 |
private CookiesProcessor cookiesProcessor;
|
186 |
private CookiesProcessor cookiesProcessor;
|
| 181 |
|
187 |
|
| 182 |
@Autowired
|
188 |
@Autowired
|
| - |
|
189 |
private PendingOrderRepository pendingOrderRepository;
|
| - |
|
190 |
|
| - |
|
191 |
@Autowired
|
| 183 |
private PartnerStatsService partnerStatsService;
|
192 |
private PartnerStatsService partnerStatsService;
|
| 184 |
|
193 |
|
| 185 |
@Autowired
|
194 |
@Autowired
|
| 186 |
private MenuRepository menuRepository;
|
195 |
private MenuRepository menuRepository;
|
| 187 |
|
196 |
|
| Line 220... |
Line 229... |
| 220 |
|
229 |
|
| 221 |
@Autowired
|
230 |
@Autowired
|
| 222 |
InventoryService inventoryService;
|
231 |
InventoryService inventoryService;
|
| 223 |
|
232 |
|
| 224 |
@Autowired
|
233 |
@Autowired
|
| - |
|
234 |
private PendingOrderItemRepository pendingOrderItemRepository;
|
| - |
|
235 |
|
| - |
|
236 |
|
| - |
|
237 |
@Autowired
|
| 225 |
private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
|
238 |
private CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
|
| 226 |
|
239 |
|
| 227 |
@Autowired
|
240 |
@Autowired
|
| 228 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
241 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
| 229 |
|
242 |
|
| Line 550... |
Line 563... |
| 550 |
|
563 |
|
| 551 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
564 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
| 552 |
public String dashboard(HttpServletRequest request, Model model) throws Exception {
|
565 |
public String dashboard(HttpServletRequest request, Model model) throws Exception {
|
| 553 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
566 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 554 |
String email = loginDetails.getEmailId();
|
567 |
String email = loginDetails.getEmailId();
|
| - |
|
568 |
int fofoId = loginDetails.getFofoId();
|
| - |
|
569 |
|
| - |
|
570 |
LocalDateTime startDate = LocalDate.now().withDayOfYear(1).atStartOfDay();
|
| - |
|
571 |
LocalDateTime endtDate = LocalDateTime.now();
|
| - |
|
572 |
LOGGER.info("startDate"+startDate);
|
| - |
|
573 |
LOGGER.info("endtDate"+endtDate);
|
| - |
|
574 |
|
| - |
|
575 |
|
| - |
|
576 |
OnlineDeliveredOrderSum onlineDeliveredOrderSum= pendingOrderItemRepository.selectSumSellingPriceOnlineOrder(fofoId, startDate, endtDate);
|
| - |
|
577 |
|
| - |
|
578 |
LOGGER.info("onlineDeliveredOrderSum"+onlineDeliveredOrderSum.getSellingPrice());
|
| - |
|
579 |
|
| - |
|
580 |
|
| - |
|
581 |
long countOrder = pendingOrderRepository.pendingOrderCount(fofoId, OrderStatus.PROCESSING);
|
| - |
|
582 |
LOGGER.info("countOrder"+countOrder);
|
| - |
|
583 |
|
| - |
|
584 |
model.addAttribute("countOrder", countOrder);
|
| - |
|
585 |
model.addAttribute("onlineDeliveredOrderSum", onlineDeliveredOrderSum.getSellingPrice());
|
| 555 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
586 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| 556 |
model.addAttribute("isAdmin", isAdmin);
|
587 |
model.addAttribute("isAdmin", isAdmin);
|
| 557 |
|
588 |
|
| 558 |
model.addAttribute("webApiHost", webApiHost);
|
589 |
model.addAttribute("webApiHost", webApiHost);
|
| 559 |
model.addAttribute("webApiPort", webApiPort);
|
590 |
model.addAttribute("webApiPort", webApiPort);
|
| Line 635... |
Line 666... |
| 635 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
666 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
| 636 |
for (int i = 0; i <= 5; i++) {
|
667 |
for (int i = 0; i <= 5; i++) {
|
| 637 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
668 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| 638 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
669 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| 639 |
}
|
670 |
}
|
| - |
|
671 |
|
| - |
|
672 |
|
| 640 |
|
673 |
|
| 641 |
model.addAttribute("monthValueMap", monthValueMap);
|
674 |
model.addAttribute("monthValueMap", monthValueMap);
|
| 642 |
model.addAttribute("month", 0);
|
675 |
model.addAttribute("month", 0);
|
| 643 |
|
676 |
|
| 644 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
677 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| Line 708... |
Line 741... |
| 708 |
|
741 |
|
| 709 |
LOGGER.info("InvestmentChart" + gson.toJson(cm));
|
742 |
LOGGER.info("InvestmentChart" + gson.toJson(cm));
|
| 710 |
LOGGER.info("InvestmentChart" + cm);
|
743 |
LOGGER.info("InvestmentChart" + cm);
|
| 711 |
return "investmentdetails";
|
744 |
return "investmentdetails";
|
| 712 |
}
|
745 |
}
|
| - |
|
746 |
|
| 713 |
|
747 |
|
| 714 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
748 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
| 715 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
749 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
| 716 |
|
750 |
|
| 717 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|
751 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|