| Line 329... |
Line 329... |
| 329 |
if (currentDate.isAfter(currentDate.withDayOfMonth(PLANNING_OPEN_DAY))) {
|
329 |
if (currentDate.isAfter(currentDate.withDayOfMonth(PLANNING_OPEN_DAY))) {
|
| 330 |
planningMonthDate = LocalDate.now().plusMonths(1).withDayOfMonth(1);
|
330 |
planningMonthDate = LocalDate.now().plusMonths(1).withDayOfMonth(1);
|
| 331 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
331 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
| 332 |
|
332 |
|
| 333 |
confirmMonthlyPlanned(monthlyPlanned, customRetailer, fofoId);
|
333 |
confirmMonthlyPlanned(monthlyPlanned, customRetailer, fofoId);
|
| - |
|
334 |
} else if (currentDate.isBefore(currentDate.withDayOfMonth(8))) {
|
| - |
|
335 |
planningMonthDate = LocalDate.now().withDayOfMonth(1);
|
| - |
|
336 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
| - |
|
337 |
|
| - |
|
338 |
confirmMonthlyPlanned(monthlyPlanned, customRetailer, fofoId);
|
| 334 |
}
|
339 |
}
|
| 335 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
340 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 336 |
|
341 |
|
| 337 |
return "response";
|
342 |
return "response";
|
| 338 |
}
|
343 |
}
|
| Line 632... |
Line 637... |
| 632 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
637 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
| 633 |
LOGGER.info("Counter size is {}", counterSize);
|
638 |
LOGGER.info("Counter size is {}", counterSize);
|
| 634 |
LOGGER.info("Fofo Id is {}", fofoId);
|
639 |
LOGGER.info("Fofo Id is {}", fofoId);
|
| 635 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
640 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
| 636 |
|
641 |
|
| 637 |
List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
|
642 |
List<String> brands = brandsService.getBrandsToDisplay(3).stream().map(x -> x.getName()).collect(Collectors.toList());
|
| 638 |
.collect(Collectors.toList());
|
- |
|
| 639 |
|
643 |
|
| 640 |
Map<String, Object> equalsMap = new HashMap<>();
|
644 |
Map<String, Object> equalsMap = new HashMap<>();
|
| 641 |
equalsMap.put("categoryId", 10006);
|
645 |
equalsMap.put("categoryId", 10006);
|
| 642 |
equalsMap.put("brand", brands);
|
646 |
equalsMap.put("brand", brands);
|
| 643 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|
647 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|
| Line 713... |
Line 717... |
| 713 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
717 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
| 714 |
LOGGER.info("monthlyPlanned2" + monthlyPlanned);
|
718 |
LOGGER.info("monthlyPlanned2" + monthlyPlanned);
|
| 715 |
fofoOrderIds = fofoOrderRepository.selectByFofoIdBetweenCreatedTimeStamp(loginDetails.getFofoId(),
|
719 |
fofoOrderIds = fofoOrderRepository.selectByFofoIdBetweenCreatedTimeStamp(loginDetails.getFofoId(),
|
| 716 |
LocalDateTime.now().minusDays(15), LocalDateTime.now()).stream().map(x -> x.getId())
|
720 |
LocalDateTime.now().minusDays(15), LocalDateTime.now()).stream().map(x -> x.getId())
|
| 717 |
.collect(Collectors.toList());
|
721 |
.collect(Collectors.toList());
|
| 718 |
|
- |
|
| 719 |
model.addAttribute("planningMonth", LocalDate.now().plusMonths(1).getMonth());
|
722 |
model.addAttribute("planningMonth", LocalDate.now().plusMonths(1).getMonth());
|
| - |
|
723 |
} else if (LocalDate.now().isBefore(LocalDate.now().withDayOfMonth(8))) {
|
| - |
|
724 |
planningMonthDate = LocalDate.now().withDayOfMonth(8);
|
| - |
|
725 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
| - |
|
726 |
LOGGER.info("monthlyPlanned2" + monthlyPlanned);
|
| - |
|
727 |
fofoOrderIds = fofoOrderRepository.selectByFofoIdBetweenCreatedTimeStamp(loginDetails.getFofoId(),
|
| - |
|
728 |
LocalDateTime.now().minusDays(15), LocalDateTime.now()).stream().map(x -> x.getId())
|
| - |
|
729 |
.collect(Collectors.toList());
|
| - |
|
730 |
model.addAttribute("planningMonth", LocalDate.now().getMonth());
|
| 720 |
} else {
|
731 |
} else {
|
| 721 |
planningMonthDate = LocalDate.now().withDayOfMonth(1);
|
732 |
planningMonthDate = LocalDate.now().withDayOfMonth(1);
|
| 722 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
733 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 723 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
734 |
monthlyPlanned = monthlyPlannedRepository.selectByFofoIdYearMonth(fofoId, planningMonthDate);
|
| 724 |
model.addAttribute("planningMonth", planningMonthDate.getMonth());
|
735 |
model.addAttribute("planningMonth", planningMonthDate.getMonth());
|
| Line 969... |
Line 980... |
| 969 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
980 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
| 970 |
LOGGER.info("Counter size is {}", counterSize);
|
981 |
LOGGER.info("Counter size is {}", counterSize);
|
| 971 |
LOGGER.info("Fofo Id is {}", fofoId);
|
982 |
LOGGER.info("Fofo Id is {}", fofoId);
|
| 972 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
983 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
| 973 |
|
984 |
|
| 974 |
List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
|
985 |
List<String> brands = brandsService.getBrandsToDisplay(3).stream().map(x -> x.getName()).collect(Collectors.toList());
|
| 975 |
.collect(Collectors.toList());
|
- |
|
| 976 |
|
986 |
|
| 977 |
Map<String, Object> equalsMap = new HashMap<>();
|
987 |
Map<String, Object> equalsMap = new HashMap<>();
|
| 978 |
equalsMap.put("categoryId", 10006);
|
988 |
equalsMap.put("categoryId", 10006);
|
| 979 |
equalsMap.put("brand", brands);
|
989 |
equalsMap.put("brand", brands);
|
| 980 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|
990 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|
| Line 1364... |
Line 1374... |
| 1364 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
1374 |
Set<Integer> roleIds = loginDetails.getRoleIds();
|
| 1365 |
LOGGER.info("Counter size is {}", counterSize);
|
1375 |
LOGGER.info("Counter size is {}", counterSize);
|
| 1366 |
LOGGER.info("Fofo Id is {}", fofoId);
|
1376 |
LOGGER.info("Fofo Id is {}", fofoId);
|
| 1367 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
1377 |
boolean isAdmin = roleManager.isAdmin(roleIds);
|
| 1368 |
|
1378 |
|
| 1369 |
List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
|
1379 |
List<String> brands = brandsService.getBrandsToDisplay(3).stream().map(x -> x.getName()).collect(Collectors.toList());
|
| 1370 |
.collect(Collectors.toList());
|
- |
|
| 1371 |
|
1380 |
|
| 1372 |
Map<String, Object> equalsMap = new HashMap<>();
|
1381 |
Map<String, Object> equalsMap = new HashMap<>();
|
| 1373 |
equalsMap.put("categoryId", 10006);
|
1382 |
equalsMap.put("categoryId", 10006);
|
| 1374 |
equalsMap.put("brand", brands);
|
1383 |
equalsMap.put("brand", brands);
|
| 1375 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|
1384 |
Map<String, List<?>> notEqualsMap = new HashMap<>();
|