| Line 331... |
Line 331... |
| 331 |
Double todaySale = fofoOrderItemRepository
|
331 |
Double todaySale = fofoOrderItemRepository
|
| 332 |
.selectSumMopGroupByRetailer(curDate, curDate.with(LocalTime.MAX), fofoId, false).get(fofoId);
|
332 |
.selectSumMopGroupByRetailer(curDate, curDate.with(LocalTime.MAX), fofoId, false).get(fofoId);
|
| 333 |
Double mtdSale = fofoOrderItemRepository
|
333 |
Double mtdSale = fofoOrderItemRepository
|
| 334 |
.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId, false)
|
334 |
.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId, false)
|
| 335 |
.get(fofoId);
|
335 |
.get(fofoId);
|
| 336 |
Double lmtdSale = fofoOrderItemRepository
|
- |
|
| 337 |
.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1).minusMonths(1),
|
336 |
Double lmtdSale = fofoOrderItemRepository.selectSumMopGroupByRetailer(curDate.withDayOfMonth(1).minusMonths(1),
|
| 338 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId, false)
|
337 |
curDate.with(LocalTime.MAX).minusMonths(1), fofoId, false).get(fofoId);
|
| 339 |
.get(fofoId);
|
- |
|
| 340 |
|
338 |
|
| 341 |
List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
|
339 |
List<PartnerTargetDetails> partnerTargetDetails = partnerTargetRepository
|
| 342 |
.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
|
340 |
.selectAllGeEqAndLeEqStartDateAndEndDate(LocalDateTime.now());
|
| 343 |
if (partnerTargetDetails.isEmpty()) {
|
341 |
if (partnerTargetDetails.isEmpty()) {
|
| 344 |
partnerTargetDetails = partnerTargetRepository
|
342 |
partnerTargetDetails = partnerTargetRepository
|
| Line 357... |
Line 355... |
| 357 |
|
355 |
|
| 358 |
salesMap.put("todaySale", todaySale == null ? 0 : todaySale);
|
356 |
salesMap.put("todaySale", todaySale == null ? 0 : todaySale);
|
| 359 |
salesMap.put("mtdSale", mtdSale == null ? 0 : mtdSale);
|
357 |
salesMap.put("mtdSale", mtdSale == null ? 0 : mtdSale);
|
| 360 |
salesMap.put("lmtdSale", lmtdSale == null ? 0 : lmtdSale);
|
358 |
salesMap.put("lmtdSale", lmtdSale == null ? 0 : lmtdSale);
|
| 361 |
|
359 |
|
| 362 |
PartnerType currentType = partnerTypeChangeService.getPartnerTypeByAmount(currentRate*monthLength);
|
360 |
PartnerType currentType = partnerTypeChangeService.getPartnerTypeByAmount(currentRate * monthLength);
|
| 363 |
salesMap.put("currentRate", currentRate);
|
361 |
salesMap.put("currentRate", currentRate);
|
| 364 |
salesMap.put("currentType", currentType);
|
362 |
salesMap.put("currentType", currentType);
|
| 365 |
salesMap.put("currentTypeImage", PartnerType.imageMap.get(currentType));
|
363 |
salesMap.put("currentTypeImage", PartnerType.imageMap.get(currentType));
|
| 366 |
return salesMap;
|
364 |
return salesMap;
|
| 367 |
}
|
365 |
}
|
| Line 452... |
Line 450... |
| 452 |
List<OfferPartner> offerPartners = offerPartnerRepository.selectByOfferId(offer.getId());
|
450 |
List<OfferPartner> offerPartners = offerPartnerRepository.selectByOfferId(offer.getId());
|
| 453 |
|
451 |
|
| 454 |
for (OfferPartner offerPartner : offerPartners) {
|
452 |
for (OfferPartner offerPartner : offerPartners) {
|
| 455 |
|
453 |
|
| 456 |
if (offerPartner.getFofoId() == loginDetails.getFofoId()) {
|
454 |
if (offerPartner.getFofoId() == loginDetails.getFofoId()) {
|
| - |
|
455 |
/*
|
| 457 |
/* if (LocalDateTime.now().isAfter(offer.getStartDateTime())
|
456 |
* if (LocalDateTime.now().isAfter(offer.getStartDateTime()) &&
|
| 458 |
&& LocalDateTime.now().isBefore(offer.getEndDateTime())) {*/
|
457 |
* LocalDateTime.now().isBefore(offer.getEndDateTime())) {
|
| 459 |
|
458 |
*/
|
| - |
|
459 |
|
| 460 |
if (LocalDateTime.now().isBefore(offer.getEndDateTime())) {
|
460 |
if (LocalDateTime.now().isBefore(offer.getEndDateTime())) {
|
| 461 |
|
461 |
|
| 462 |
LocalDateTime cur = LocalDate.now().minusMonths(2).atStartOfDay();
|
462 |
LocalDateTime cur = LocalDate.now().minusMonths(2).atStartOfDay();
|
| 463 |
LOGGER.info("value" + cur);
|
463 |
LOGGER.info("value" + cur);
|
| 464 |
Map<Integer, Double> value = offerRepository.selectSumOfferByRetailer(
|
464 |
Map<Integer, Double> value = offerRepository.selectSumOfferByRetailer(
|
| 465 |
offer.getStartDateTime(), offer.getEndDateTime(), loginDetails.getFofoId(),
|
465 |
offer.getStartDateTime(), offer.getEndDateTime(), loginDetails.getFofoId(),
|
| 466 |
offer, true);
|
466 |
offer, true);
|
| Line 489... |
Line 489... |
| 489 |
createOfferRequest.setTargetType(offer.getTargetType());
|
489 |
createOfferRequest.setTargetType(offer.getTargetType());
|
| 490 |
createOfferRequest.setAmountType(offer.getAmountType());
|
490 |
createOfferRequest.setAmountType(offer.getAmountType());
|
| 491 |
createOfferRequest.setStartDateTime(offer.getStartDateTime().toLocalDate());
|
491 |
createOfferRequest.setStartDateTime(offer.getStartDateTime().toLocalDate());
|
| 492 |
createOfferRequest.setEndDateTime(offer.getEndDateTime().toLocalDate());
|
492 |
createOfferRequest.setEndDateTime(offer.getEndDateTime().toLocalDate());
|
| 493 |
createOfferRequest.setTotalSale(value.get(loginDetails.getFofoId()));
|
493 |
createOfferRequest.setTotalSale(value.get(loginDetails.getFofoId()));
|
| - |
|
494 |
createOfferRequest.setOfferMargin(offerMargins);
|
| 494 |
cors.add(createOfferRequest);
|
495 |
cors.add(createOfferRequest);
|
| 495 |
|
496 |
|
| 496 |
model.addAttribute("sales", value.get(loginDetails.getFofoId()));
|
497 |
model.addAttribute("sales", value.get(loginDetails.getFofoId()));
|
| 497 |
}
|
498 |
}
|
| 498 |
}
|
499 |
}
|
| Line 532... |
Line 533... |
| 532 |
}
|
533 |
}
|
| 533 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
534 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| 534 |
|
535 |
|
| 535 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
536 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| 536 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
537 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| 537 |
if(loginDetails.isReadOnly()) {
|
538 |
if (loginDetails.isReadOnly()) {
|
| 538 |
return "dashboard-readonly";
|
539 |
return "dashboard-readonly";
|
| 539 |
} else {
|
540 |
} else {
|
| 540 |
return "dashboard1";
|
541 |
return "dashboard1";
|
| 541 |
}
|
542 |
}
|
| 542 |
}
|
543 |
}
|
| Line 634... |
Line 635... |
| 634 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
635 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
| 635 |
List<Position> positions = positionRepository.selectAll(authUser.getId());
|
636 |
List<Position> positions = positionRepository.selectAll(authUser.getId());
|
| 636 |
Map<Integer, AuthUser> authIdAndAuthUserMap = null;
|
637 |
Map<Integer, AuthUser> authIdAndAuthUserMap = null;
|
| 637 |
Map<Integer, PartnerDetailModel> authIdAndallValues = null;
|
638 |
Map<Integer, PartnerDetailModel> authIdAndallValues = null;
|
| 638 |
if (positions.size() > 0) {
|
639 |
if (positions.size() > 0) {
|
| - |
|
640 |
if (positions.stream()
|
| 639 |
if (positions.stream().filter(x -> x.getEscalationType().equals(EscalationType.L3)
|
641 |
.filter(x -> x.getEscalationType().equals(EscalationType.L3)
|
| 640 |
|| x.getEscalationType().equals(EscalationType.L4)
|
642 |
|| x.getEscalationType().equals(EscalationType.L4)
|
| 641 |
|| x.getEscalationType().equals(EscalationType.L5)).count() > 0) {
|
643 |
|| x.getEscalationType().equals(EscalationType.L5))
|
| - |
|
644 |
.count() > 0) {
|
| 642 |
|
645 |
|
| 643 |
authIdAndAuthUserMap = authRepository.selectAllActiveUser().stream()
|
646 |
authIdAndAuthUserMap = authRepository.selectAllActiveUser().stream()
|
| 644 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
647 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 645 |
|
648 |
|
| 646 |
AuthUser unmappedAuthUser = new AuthUser();
|
649 |
AuthUser unmappedAuthUser = new AuthUser();
|
| Line 650... |
Line 653... |
| 650 |
|
653 |
|
| 651 |
AuthUser dummyAuthUser = new AuthUser();
|
654 |
AuthUser dummyAuthUser = new AuthUser();
|
| 652 |
dummyAuthUser.setFirstName("Total");
|
655 |
dummyAuthUser.setFirstName("Total");
|
| 653 |
dummyAuthUser.setLastName("Values");
|
656 |
dummyAuthUser.setLastName("Values");
|
| 654 |
authIdAndAuthUserMap.put(0, dummyAuthUser);
|
657 |
authIdAndAuthUserMap.put(0, dummyAuthUser);
|
| 655 |
|
658 |
|
| 656 |
authIdAndallValues = this.getL2AuthUserPartnerDetail();
|
659 |
authIdAndallValues = this.getL2AuthUserPartnerDetail();
|
| 657 |
}
|
660 |
}
|
| 658 |
}
|
661 |
}
|
| 659 |
|
662 |
|
| 660 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in").contains(email)) {
|
663 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in").contains(email)) {
|
| Line 1035... |
Line 1038... |
| 1035 |
authIdAndleadsCountMap.put(auth.getId(), 0);
|
1038 |
authIdAndleadsCountMap.put(auth.getId(), 0);
|
| 1036 |
}
|
1039 |
}
|
| 1037 |
}
|
1040 |
}
|
| 1038 |
|
1041 |
|
| 1039 |
Map<Integer, PartnerDetailModel> partnerStats = partnerStatsService.getAllPartnerStats();
|
1042 |
Map<Integer, PartnerDetailModel> partnerStats = partnerStatsService.getAllPartnerStats();
|
| 1040 |
List<Integer> unmappedPartners = partnerStats.entrySet().stream().map(x->x.getKey()).collect(Collectors.toList());
|
1043 |
List<Integer> unmappedPartners = partnerStats.entrySet().stream().map(x -> x.getKey())
|
| - |
|
1044 |
.collect(Collectors.toList());
|
| 1041 |
LOGGER.info("authIdAndleadsCountMap" + authIdAndleadsCountMap);
|
1045 |
LOGGER.info("authIdAndleadsCountMap" + authIdAndleadsCountMap);
|
| 1042 |
|
1046 |
|
| 1043 |
Map<Integer, PartnerDetailModel> authIdAndallValues = new LinkedHashMap<>();
|
1047 |
Map<Integer, PartnerDetailModel> authIdAndallValues = new LinkedHashMap<>();
|
| 1044 |
|
1048 |
|
| 1045 |
Map<Integer, List<Integer>> pp = csService.getAuthUserIdPartnerIdMapping();
|
1049 |
Map<Integer, List<Integer>> pp = csService.getAuthUserIdPartnerIdMapping();
|