| Line 87... |
Line 87... |
| 87 |
|
87 |
|
| 88 |
import javax.servlet.http.HttpServletRequest;
|
88 |
import javax.servlet.http.HttpServletRequest;
|
| 89 |
import java.time.LocalDate;
|
89 |
import java.time.LocalDate;
|
| 90 |
import java.time.LocalDateTime;
|
90 |
import java.time.LocalDateTime;
|
| 91 |
import java.time.LocalTime;
|
91 |
import java.time.LocalTime;
|
| - |
|
92 |
import java.time.YearMonth;
|
| 92 |
import java.util.*;
|
93 |
import java.util.*;
|
| 93 |
import java.util.Map.Entry;
|
94 |
import java.util.Map.Entry;
|
| 94 |
import java.util.function.Function;
|
95 |
import java.util.function.Function;
|
| 95 |
import java.util.stream.Collectors;
|
96 |
import java.util.stream.Collectors;
|
| 96 |
|
97 |
|
| Line 1705... |
Line 1706... |
| 1705 |
|
1706 |
|
| 1706 |
Brand_Amount_Limit.put("accessories", 10000.00);
|
1707 |
Brand_Amount_Limit.put("accessories", 10000.00);
|
| 1707 |
Brand_Amount_Limit.put("TV", 27000.00);
|
1708 |
Brand_Amount_Limit.put("TV", 27000.00);
|
| 1708 |
}
|
1709 |
}
|
| 1709 |
|
1710 |
|
| - |
|
1711 |
@Autowired
|
| - |
|
1712 |
MonthlyTargetRepository monthlyTargetRepository;
|
| - |
|
1713 |
|
| 1710 |
@RequestMapping(value = "/getPartnersBrandWiseDetail", method = RequestMethod.GET)
|
1714 |
@RequestMapping(value = "/getPartnersBrandWiseDetail", method = RequestMethod.GET)
|
| 1711 |
public String getPartnersBrandWiseDetail(HttpServletRequest request, Model model) throws Exception {
|
1715 |
public String getPartnersBrandWiseDetail(HttpServletRequest request, Model model) throws Exception {
|
| 1712 |
|
1716 |
|
| 1713 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1717 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1714 |
String email = loginDetails.getEmailId();
|
1718 |
String email = loginDetails.getEmailId();
|
| Line 1837... |
Line 1841... |
| 1837 |
partnerDailyInvestmentMap = partnerDailyInvestments.stream()
|
1841 |
partnerDailyInvestmentMap = partnerDailyInvestments.stream()
|
| 1838 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
1842 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| 1839 |
}
|
1843 |
}
|
| 1840 |
|
1844 |
|
| 1841 |
}
|
1845 |
}
|
| - |
|
1846 |
Map<Integer, MonthlyTarget> fofoIdMonthlyTargetMap = monthlyTargetRepository.selectByDateAndFofoIds(YearMonth.now(), new ArrayList<>(fofoIds)).stream()
|
| - |
|
1847 |
.collect(Collectors.toMap(MonthlyTarget::getFofoId, x -> x,
|
| - |
|
1848 |
(existing, replacement) -> replacement // Keep the last entry
|
| - |
|
1849 |
));
|
| - |
|
1850 |
|
| - |
|
1851 |
Map<Integer, Float> fofoMTDSaleMap = fofoOrderRepository.selectSaleSumGroupByFofoIds(YearMonth.now().atDay(1).atStartOfDay(), LocalDateTime.now());
|
| - |
|
1852 |
|
| - |
|
1853 |
Map<Integer, Double> currentMonthTillDateRetailerPOValueMap = orderRepository.selectOrderValueBetweenDatesGroupByFofoId(new ArrayList<>(fofoIds),
|
| - |
|
1854 |
Arrays.asList(OrderStatus.BILLED, OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.DELIVERY_SUCCESS, OrderStatus.ACCEPTED, OrderStatus.SUBMITTED_FOR_PROCESSING),
|
| - |
|
1855 |
YearMonth.now().atDay(1).atStartOfDay(), LocalDateTime.now()).stream().collect(Collectors.toMap(x -> x.getId(), x -> x.getAmount()));
|
| - |
|
1856 |
|
| 1842 |
//Only L3 and above can change the activationType
|
1857 |
//Only L3 and above can change the activationType
|
| 1843 |
|
1858 |
|
| 1844 |
model.addAttribute("customRetailers", customRetailers);
|
1859 |
model.addAttribute("customRetailers", customRetailers);
|
| - |
|
1860 |
model.addAttribute("fofoMTDSaleMap", fofoMTDSaleMap);
|
| - |
|
1861 |
model.addAttribute("fofoIdMonthlyTargetMap", fofoIdMonthlyTargetMap);
|
| - |
|
1862 |
model.addAttribute("currentMonthTillDateRetailerPOValueMap", currentMonthTillDateRetailerPOValueMap);
|
| 1845 |
|
1863 |
|
| 1846 |
LOGGER.info("fofoIdBrandAmountMap" + fofoIdBrandAmountMap);
|
1864 |
LOGGER.info("fofoIdBrandAmountMap" + fofoIdBrandAmountMap);
|
| 1847 |
|
1865 |
|
| 1848 |
model.addAttribute("partnerDailyInvestmentMap", partnerDailyInvestmentMap);
|
1866 |
model.addAttribute("partnerDailyInvestmentMap", partnerDailyInvestmentMap);
|
| 1849 |
|
1867 |
|