| Line 220... |
Line 220... |
| 220 |
|
220 |
|
| 221 |
@Autowired
|
221 |
@Autowired
|
| 222 |
private PositionRepository positionRepository;
|
222 |
private PositionRepository positionRepository;
|
| 223 |
|
223 |
|
| 224 |
@Autowired
|
224 |
@Autowired
|
| - |
|
225 |
private MonthlyTargetRepository monthlyTargetRepository;
|
| - |
|
226 |
@Autowired
|
| 225 |
private SamsungUpgradeOfferRepository samsungUpgradeOfferRepository;
|
227 |
private SamsungUpgradeOfferRepository samsungUpgradeOfferRepository;
|
| 226 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
228 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
| 227 |
|
229 |
|
| 228 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
230 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
| 229 |
public String dashboard1(HttpServletRequest request, Model model, @RequestParam int fofoId) throws Exception {
|
231 |
public String dashboard1(HttpServletRequest request, Model model, @RequestParam int fofoId) throws Exception {
|
| Line 474... |
Line 476... |
| 474 |
for (int i = 0; i <= 5; i++) {
|
476 |
for (int i = 0; i <= 5; i++) {
|
| 475 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
477 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| 476 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
478 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| 477 |
}
|
479 |
}
|
| 478 |
|
480 |
|
| - |
|
481 |
MonthlyTarget monthlyTarget = monthlyTargetRepository.selectByDateAndFofoId(YearMonth.now(), fofoId);
|
| - |
|
482 |
model.addAttribute("monthlyTarget", monthlyTarget);
|
| - |
|
483 |
|
| 479 |
model.addAttribute("monthValueMap", monthValueMap);
|
484 |
model.addAttribute("monthValueMap", monthValueMap);
|
| 480 |
model.addAttribute("month", 0);
|
485 |
model.addAttribute("month", 0);
|
| 481 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
486 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| 482 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
487 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| 483 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
488 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| Line 1218... |
Line 1223... |
| 1218 |
ChartInvestmentModel cm = adminUser.getAllStatePartnerType(fofoIdAndallValues);
|
1223 |
ChartInvestmentModel cm = adminUser.getAllStatePartnerType(fofoIdAndallValues);
|
| 1219 |
model.addAttribute("chartPieMap", gson.toJson(cm));
|
1224 |
model.addAttribute("chartPieMap", gson.toJson(cm));
|
| 1220 |
|
1225 |
|
| 1221 |
LOGGER.info("adminUserChart" + gson.toJson(cm));
|
1226 |
LOGGER.info("adminUserChart" + gson.toJson(cm));
|
| 1222 |
|
1227 |
|
| - |
|
1228 |
Map<Integer, MonthlyTarget> monthlyTargetMap = monthlyTargetRepository.selectByDate(YearMonth.now()).stream()
|
| - |
|
1229 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| - |
|
1230 |
|
| 1223 |
model.addAttribute("fofoIdAndallValues", fofoIdAndallValues);
|
1231 |
model.addAttribute("fofoIdAndallValues", fofoIdAndallValues);
|
| 1224 |
model.addAttribute("fofoIdAndPartnerMap", fofoIdAndPartnerMap);
|
1232 |
model.addAttribute("fofoIdAndPartnerMap", fofoIdAndPartnerMap);
|
| - |
|
1233 |
model.addAttribute("monthlyTargetMap", monthlyTargetMap);
|
| 1225 |
|
1234 |
|
| 1226 |
List<PartnerType> partnerTypes = Arrays.asList(PartnerType.values()).stream()
|
1235 |
List<PartnerType> partnerTypes = Arrays.asList(PartnerType.values()).stream()
|
| 1227 |
.filter(x -> !x.equals(PartnerType.ALL)).collect(Collectors.toList());
|
1236 |
.filter(x -> !x.equals(PartnerType.ALL)).collect(Collectors.toList());
|
| - |
|
1237 |
|
| 1228 |
model.addAttribute("partnerTypes", partnerTypes);
|
1238 |
model.addAttribute("partnerTypes", partnerTypes);
|
| 1229 |
|
1239 |
|
| 1230 |
return "auth_user_partner_detail";
|
1240 |
return "auth_user_partner_detail";
|
| 1231 |
}
|
1241 |
}
|
| 1232 |
|
1242 |
|