| Line 7... |
Line 7... |
| 7 |
import java.io.ObjectInputStream;
|
7 |
import java.io.ObjectInputStream;
|
| 8 |
import java.io.ObjectOutputStream;
|
8 |
import java.io.ObjectOutputStream;
|
| 9 |
import java.time.LocalDate;
|
9 |
import java.time.LocalDate;
|
| 10 |
import java.time.LocalDateTime;
|
10 |
import java.time.LocalDateTime;
|
| 11 |
import java.time.LocalTime;
|
11 |
import java.time.LocalTime;
|
| - |
|
12 |
import java.time.Month;
|
| 12 |
import java.time.YearMonth;
|
13 |
import java.time.YearMonth;
|
| 13 |
import java.time.ZoneOffset;
|
14 |
import java.time.ZoneOffset;
|
| 14 |
import java.time.format.DateTimeFormatter;
|
15 |
import java.time.format.DateTimeFormatter;
|
| 15 |
import java.util.ArrayList;
|
16 |
import java.util.ArrayList;
|
| 16 |
import java.util.Arrays;
|
17 |
import java.util.Arrays;
|
| Line 342... |
Line 343... |
| 342 |
model.addAttribute("brandStockPrices", this.getBrandStockPrices(fofoId));
|
343 |
model.addAttribute("brandStockPrices", this.getBrandStockPrices(fofoId));
|
| 343 |
model.addAttribute("salesMap", this.getSales(fofoId));
|
344 |
model.addAttribute("salesMap", this.getSales(fofoId));
|
| 344 |
model.addAttribute("activatedImeis", inventoryItemRepository.selectCountByActivatedNotSold(fofoId));
|
345 |
model.addAttribute("activatedImeis", inventoryItemRepository.selectCountByActivatedNotSold(fofoId));
|
| 345 |
// this.setInvestments
|
346 |
// this.setInvestments
|
| 346 |
//
|
347 |
//
|
| - |
|
348 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
| - |
|
349 |
for (int i = 0; i <= 5; i++) {
|
| - |
|
350 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| - |
|
351 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| - |
|
352 |
}
|
| - |
|
353 |
LOGGER.info("monthValueMap" + monthValueMap);
|
| - |
|
354 |
model.addAttribute("monthValueMap", monthValueMap);
|
| 347 |
model.addAttribute("investments", this.getInvestments(fofoId));
|
355 |
model.addAttribute("investments", this.getInvestments(fofoId));
|
| 348 |
model.addAttribute("isInvestmentOk",
|
356 |
model.addAttribute("isInvestmentOk",
|
| 349 |
partnerInvestmentService.isInvestmentOk(fofoId, 10, ProfitMandiConstants.CUTOFF_INVESTMENT));
|
357 |
partnerInvestmentService.isInvestmentOk(fofoId, 10, ProfitMandiConstants.CUTOFF_INVESTMENT));
|
| 350 |
} catch (ProfitMandiBusinessException e) {
|
358 |
} catch (ProfitMandiBusinessException e) {
|
| 351 |
LOGGER.error("FofoStore Code not found of fofoId {}", fofoId);
|
359 |
LOGGER.error("FofoStore Code not found of fofoId {}", fofoId);
|
| 352 |
|
360 |
|
| 353 |
}
|
361 |
}
|
| 354 |
|
362 |
|
| 355 |
LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
|
- |
|
| 356 |
LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
|
- |
|
| 357 |
double currentMonthRating = hygieneDataRepository.selectRatingAvg(fofoId, currentMonthStart, currentMonthEnd)
|
- |
|
| 358 |
/ 2;
|
363 |
return "12dashboard34";
|
| 359 |
double lastMonthRating = hygieneDataRepository.selectRatingAvg(fofoId, currentMonthStart, currentMonthEnd) / 2;
|
- |
|
| 360 |
double ratingTillDate = hygieneDataRepository.selectRatingAvg(fofoId, currentMonthStart, currentMonthEnd) / 2;
|
- |
|
| 361 |
model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
|
- |
|
| 362 |
model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
|
- |
|
| 363 |
model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
|
- |
|
| 364 |
|
364 |
}
|
| 365 |
long hygieneCount = hygieneDataRepository.selectHygieneCount(fofoId, true, currentMonthStart, currentMonthEnd);
|
- |
|
| 366 |
|
365 |
|
| 367 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(fofoId, false, currentMonthStart,
|
366 |
private Map<String, Object> getInvestments(int fofoId) throws Exception {
|
| - |
|
367 |
Map<String, Object> investments = new LinkedHashMap<>();
|
| - |
|
368 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
| 368 |
currentMonthEnd);
|
369 |
LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1);
|
| 369 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
370 |
LocalDate yesterDate = LocalDate.now().minusDays(1);
|
| - |
|
371 |
PartnerDailyInvestment yesterdayInvestment = partnerDailyInvestmentRepository.select(fofoId, yesterDate);
|
| 370 |
invalidHygieneCount = 1;
|
372 |
if (yesterdayInvestment == null) {
|
| - |
|
373 |
yesterdayInvestment = new PartnerDailyInvestment();
|
| 371 |
}
|
374 |
}
|
| 372 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
- |
|
| 373 |
|
375 |
|
| - |
|
376 |
List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId,
|
| 374 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
377 |
currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
|
| - |
|
378 |
|
| - |
|
379 |
long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10)
|
| - |
|
380 |
.collect(Collectors.counting());
|
| - |
|
381 |
investments.put("today", investment.getTotalInvestment());
|
| - |
|
382 |
investments.put("investment", investment);
|
| - |
|
383 |
investments.put("inStock", investment.getInStockAmount());
|
| - |
|
384 |
investments.put("minimum", investment.getMinInvestmentString());
|
| - |
|
385 |
investments.put("short", investment.getShortPercentage());
|
| 375 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
386 |
investments.put("activated_stock", investment.getActivatedStockAmount());
|
| - |
|
387 |
investments.put("okDays", okInvestmentDays);
|
| 376 |
return "12dashboard34";
|
388 |
return investments;
|
| 377 |
}
|
389 |
}
|
| 378 |
|
390 |
|
| 379 |
private Map<String, Object> getInvestments(int fofoId) throws Exception {
|
391 |
private Map<String, Object> getInvestmentsMonths(int fofoId, int month) throws Exception {
|
| 380 |
Map<String, Object> investments = new LinkedHashMap<>();
|
392 |
Map<String, Object> investments = new LinkedHashMap<>();
|
| 381 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
393 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
| 382 |
LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1);
|
394 |
LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1).minusMonths(month);
|
| - |
|
395 |
|
| 383 |
LocalDate yesterDate = LocalDate.now().minusDays(1);
|
396 |
LocalDate yesterDate = LocalDate.now().minusDays(1);
|
| 384 |
PartnerDailyInvestment yesterdayInvestment = partnerDailyInvestmentRepository.select(fofoId, yesterDate);
|
397 |
PartnerDailyInvestment yesterdayInvestment = partnerDailyInvestmentRepository.select(fofoId, yesterDate);
|
| 385 |
if (yesterdayInvestment == null) {
|
398 |
if (yesterdayInvestment == null) {
|
| 386 |
yesterdayInvestment = new PartnerDailyInvestment();
|
399 |
yesterdayInvestment = new PartnerDailyInvestment();
|
| 387 |
}
|
400 |
}
|
| Line 617... |
Line 630... |
| 617 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), false,
|
630 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), false,
|
| 618 |
currentMonthStart, currentMonthEnd);
|
631 |
currentMonthStart, currentMonthEnd);
|
| 619 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
632 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
| 620 |
invalidHygieneCount = 1;
|
633 |
invalidHygieneCount = 1;
|
| 621 |
}
|
634 |
}
|
| - |
|
635 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
| - |
|
636 |
for (int i = 0; i <= 5; i++) {
|
| - |
|
637 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| - |
|
638 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| - |
|
639 |
}
|
| - |
|
640 |
|
| - |
|
641 |
model.addAttribute("monthValueMap", monthValueMap);
|
| - |
|
642 |
model.addAttribute("month", 0);
|
| - |
|
643 |
|
| 622 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
644 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| 623 |
|
645 |
|
| 624 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
646 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| 625 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
647 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| 626 |
/*
|
648 |
/*
|
| 627 |
* if (loginDetails.isReadOnly()) { return "dashboard-readonly"; } else { }
|
649 |
* if (loginDetails.isReadOnly()) { return "dashboard-readonly"; } else { }
|
| 628 |
*/
|
650 |
*/
|
| - |
|
651 |
|
| - |
|
652 |
|
| 629 |
return "dashboard1";
|
653 |
return "dashboard1";
|
| - |
|
654 |
|
| - |
|
655 |
}
|
| - |
|
656 |
|
| - |
|
657 |
@RequestMapping(value = "/getMonthsInvestment", method = RequestMethod.GET)
|
| - |
|
658 |
public String getMonthsInvestment(HttpServletRequest request,
|
| - |
|
659 |
@RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model)
|
| - |
|
660 |
throws Exception {
|
| - |
|
661 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
662 |
int fofoId = loginDetails.getFofoId();
|
| - |
|
663 |
Map<String, Object> investment = getInvestmentsMonths(fofoId, month);
|
| - |
|
664 |
|
| - |
|
665 |
|
| - |
|
666 |
LocalDateTime currentMonthStart = LocalDateTime.now().withDayOfMonth(1);
|
| - |
|
667 |
LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
|
| - |
|
668 |
LocalDateTime currentMonthEnd = currentMonthStart.plusMonths(1).withDayOfMonth(1);
|
| - |
|
669 |
double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
|
| - |
|
670 |
currentMonthEnd) / 2;
|
| - |
|
671 |
double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart,
|
| - |
|
672 |
currentMonthStart) / 2;
|
| - |
|
673 |
double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN,
|
| - |
|
674 |
currentMonthEnd) / 2;
|
| - |
|
675 |
model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
|
| - |
|
676 |
model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
|
| - |
|
677 |
model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
|
| - |
|
678 |
|
| - |
|
679 |
long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart.minusMonths(month),
|
| - |
|
680 |
currentMonthEnd.minusMonths(month));
|
| - |
|
681 |
|
| - |
|
682 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), false,
|
| - |
|
683 |
currentMonthStart.minusMonths(month),
|
| - |
|
684 |
currentMonthEnd.minusMonths(month));
|
| - |
|
685 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
| - |
|
686 |
invalidHygieneCount = 1;
|
| - |
|
687 |
}
|
| - |
|
688 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
| - |
|
689 |
for (int i = 0; i <= 5; i++) {
|
| - |
|
690 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| - |
|
691 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| - |
|
692 |
}
|
| - |
|
693 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| - |
|
694 |
model.addAttribute("monthValueMap" ,monthValueMap);
|
| - |
|
695 |
model.addAttribute("investments", investment);
|
| - |
|
696 |
model.addAttribute("monthDays", LocalDate.now().minusMonths(month).lengthOfMonth());
|
| - |
|
697 |
model.addAttribute("dayOfMonth", LocalDate.now().minusMonths(month).lengthOfMonth());
|
| - |
|
698 |
model.addAttribute("month",month);
|
| - |
|
699 |
return "performance";
|
| 630 |
}
|
700 |
}
|
| 631 |
|
701 |
|
| 632 |
@RequestMapping(value = "/investmentDetails", method = RequestMethod.GET)
|
702 |
@RequestMapping(value = "/investmentDetails", method = RequestMethod.GET)
|
| 633 |
public String getInvestmentDetails(HttpServletRequest request, Model model) throws Exception {
|
703 |
public String getInvestmentDetails(HttpServletRequest request, Model model) throws Exception {
|
| 634 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
704 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| Line 644... |
Line 714... |
| 644 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
714 |
private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
|
| 645 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
715 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
|
| 646 |
|
716 |
|
| 647 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|
717 |
Map<String, Float> investmentWalletAmount = new HashMap<>();
|
| 648 |
investmentWalletAmount.put("Wallet", investment.getWalletAmount());
|
718 |
investmentWalletAmount.put("Wallet", investment.getWalletAmount());
|
| 649 |
investmentWalletAmount.put("InStocks", investment.getInStockAmount()-investment.getActivatedStockAmount());
|
719 |
investmentWalletAmount.put("InStocks", investment.getInStockAmount() - investment.getActivatedStockAmount());
|
| 650 |
investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
|
720 |
investmentWalletAmount.put("Unbilled Order", investment.getUnbilledAmount());
|
| 651 |
investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount());
|
721 |
investmentWalletAmount.put("GrnPending", investment.getGrnPendingAmount());
|
| 652 |
investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
|
722 |
investmentWalletAmount.put("ReturnInTransit", investment.getReturnInTransitAmount());
|
| 653 |
|
723 |
|
| 654 |
if (investment.getShortInvestment() > 0) {
|
724 |
if (investment.getShortInvestment() > 0) {
|
| Line 731... |
Line 801... |
| 731 |
LOGGER.info("brandwisesale" + brandwisesale);
|
801 |
LOGGER.info("brandwisesale" + brandwisesale);
|
| 732 |
|
802 |
|
| 733 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
803 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
|
| 734 |
fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
804 |
fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
| 735 |
brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
|
805 |
brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
|
| 736 |
|
806 |
|
| 737 |
Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
|
807 |
Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
|
| 738 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
|
808 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
|
| 739 |
.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
809 |
.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
| 740 |
|
810 |
|
| 741 |
activatedImeisWithSellingPriceMTD.put("Lava", brandwisesale.get("Lava"));
|
811 |
activatedImeisWithSellingPriceMTD.put("Lava", brandwisesale.get("Lava"));
|
| 742 |
|
812 |
|
| 743 |
|
- |
|
| 744 |
|
- |
|
| 745 |
|
- |
|
| 746 |
Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
|
813 |
Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
|
| 747 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
|
814 |
.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
|
| 748 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
|
815 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
|
| 749 |
.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
816 |
.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
|
| 750 |
|
817 |
|
| Line 941... |
Line 1008... |
| 941 |
if (emails.contains(authUser.getEmailId())) {
|
1008 |
if (emails.contains(authUser.getEmailId())) {
|
| 942 |
fofoIds = storeGuyMap.get("tarun.verma@smartdukaan.com");
|
1009 |
fofoIds = storeGuyMap.get("tarun.verma@smartdukaan.com");
|
| 943 |
LOGGER.info("fofoIds" + fofoIds);
|
1010 |
LOGGER.info("fofoIds" + fofoIds);
|
| 944 |
}
|
1011 |
}
|
| 945 |
|
1012 |
|
| 946 |
|
- |
|
| 947 |
if (fofoIds != null) {
|
1013 |
if (fofoIds != null) {
|
| 948 |
|
1014 |
|
| 949 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
1015 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
| 950 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
|
1016 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
|
| 951 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
1017 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
| Line 1007... |
Line 1073... |
| 1007 |
partnersBrandSaleMap.put(un.getBrand(), bpt);
|
1073 |
partnersBrandSaleMap.put(un.getBrand(), bpt);
|
| 1008 |
}
|
1074 |
}
|
| 1009 |
}
|
1075 |
}
|
| 1010 |
accessoriesBrandSales = fofoStoreRepository
|
1076 |
accessoriesBrandSales = fofoStoreRepository
|
| 1011 |
.selectGroupByBrandAccesoriesWarehousePartnerSale(new ArrayList<>(fofoIds));
|
1077 |
.selectGroupByBrandAccesoriesWarehousePartnerSale(new ArrayList<>(fofoIds));
|
| - |
|
1078 |
Set<CustomRetailer> positionRetailers = fofoIds.stream()
|
| 1012 |
Set<CustomRetailer> positionRetailers = fofoIds.stream().map(x->retailerService.getAllFofoRetailers().get(x)).filter(x->x!=null).collect(Collectors.toSet());
|
1079 |
.map(x -> retailerService.getAllFofoRetailers().get(x)).filter(x -> x != null)
|
| - |
|
1080 |
.collect(Collectors.toSet());
|
| 1013 |
model.addAttribute("retailers", gson.toJson(positionRetailers));
|
1081 |
model.addAttribute("retailers", gson.toJson(positionRetailers));
|
| 1014 |
model.addAttribute("reporticoProjectMap", ReporticoProject.salesReporticoProjectMap);
|
1082 |
model.addAttribute("reporticoProjectMap", ReporticoProject.salesReporticoProjectMap);
|
| 1015 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
1083 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
| 1016 |
}
|
1084 |
}
|
| 1017 |
|
1085 |
|
| Line 1039... |
Line 1107... |
| 1039 |
if (menuIds.size() > 0) {
|
1107 |
if (menuIds.size() > 0) {
|
| 1040 |
menus = menuRepository.selectAllByIds(menuIds);
|
1108 |
menus = menuRepository.selectAllByIds(menuIds);
|
| 1041 |
}
|
1109 |
}
|
| 1042 |
}
|
1110 |
}
|
| 1043 |
}
|
1111 |
}
|
| - |
|
1112 |
/*
|
| - |
|
1113 |
* List<Position> salesPositions = positions.stream() .filter(x ->
|
| - |
|
1114 |
* x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES)
|
| - |
|
1115 |
* .collect(Collectors.toList()); if (salesPositions.size() > 0) {
|
| - |
|
1116 |
* Set<CustomRetailer> positionRetailers = new HashSet<>();
|
| - |
|
1117 |
* csService.getPositionCustomRetailerMap(salesPositions).values().forEach(
|
| - |
|
1118 |
* customRetailers -> { positionRetailers.addAll(customRetailers); }); }
|
| - |
|
1119 |
*/
|
| - |
|
1120 |
if (fofoIds == null) {
|
| 1044 |
/*List<Position> salesPositions = positions.stream()
|
1121 |
List<Position> warehousePositions = positions.stream()
|
| 1045 |
.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES)
|
1122 |
.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_WAREHOUSE)
|
| 1046 |
.collect(Collectors.toList());
|
1123 |
.collect(Collectors.toList());
|
| 1047 |
if (salesPositions.size() > 0) {
|
1124 |
if (warehousePositions.size() > 0) {
|
| 1048 |
Set<CustomRetailer> positionRetailers = new HashSet<>();
|
1125 |
Set<CustomRetailer> positionRetailers = new HashSet<>();
|
| 1049 |
csService.getPositionCustomRetailerMap(salesPositions).values().forEach(customRetailers -> {
|
1126 |
csService.getPositionCustomRetailerMap(warehousePositions).values().forEach(customRetailers -> {
|
| 1050 |
positionRetailers.addAll(customRetailers);
|
1127 |
positionRetailers.addAll(customRetailers);
|
| 1051 |
});
|
1128 |
});
|
| 1052 |
}*/
|
- |
|
| 1053 |
if(fofoIds == null) {
|
- |
|
| 1054 |
List<Position> warehousePositions = positions.stream()
|
- |
|
| 1055 |
.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_WAREHOUSE)
|
- |
|
| 1056 |
.collect(Collectors.toList());
|
- |
|
| 1057 |
if (warehousePositions.size() > 0) {
|
- |
|
| 1058 |
Set<CustomRetailer> positionRetailers = new HashSet<>();
|
- |
|
| 1059 |
csService.getPositionCustomRetailerMap(warehousePositions).values().forEach(customRetailers -> {
|
- |
|
| 1060 |
positionRetailers.addAll(customRetailers);
|
- |
|
| 1061 |
});
|
- |
|
| 1062 |
model.addAttribute("reporticoProjectMap", ReporticoProject.warehouseReporticoMap);
|
1129 |
model.addAttribute("reporticoProjectMap", ReporticoProject.warehouseReporticoMap);
|
| 1063 |
model.addAttribute("retailers", gson.toJson(positionRetailers));
|
1130 |
model.addAttribute("retailers", gson.toJson(positionRetailers));
|
| 1064 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
1131 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
| 1065 |
}
|
- |
|
| 1066 |
}
|
1132 |
}
|
| - |
|
1133 |
}
|
| 1067 |
model.addAttribute("authId", authUser.getId());
|
1134 |
model.addAttribute("authId", authUser.getId());
|
| 1068 |
|
1135 |
|
| 1069 |
model.addAttribute("rctPartneStat", rctPartneStat);
|
1136 |
model.addAttribute("rctPartneStat", rctPartneStat);
|
| 1070 |
|
1137 |
|
| 1071 |
model.addAttribute("reporticoDate", rctSaholic);
|
1138 |
model.addAttribute("reporticoDate", rctSaholic);
|
| 1072 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|
1139 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|