| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
22 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
| 23 |
import com.spice.profitmandi.dao.enumuration.fofo.Milestone;
|
23 |
import com.spice.profitmandi.dao.enumuration.fofo.Milestone;
|
| 24 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
24 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 25 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
25 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
| 26 |
import com.spice.profitmandi.dao.model.*;
|
26 |
import com.spice.profitmandi.dao.model.*;
|
| - |
|
27 |
import com.spice.profitmandi.dao.model.warehouse.LMSGraphRequest;
|
| 27 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
28 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 28 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
29 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 29 |
import com.spice.profitmandi.dao.repository.cs.*;
|
30 |
import com.spice.profitmandi.dao.repository.cs.*;
|
| 30 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
31 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 31 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
32 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| Line 1836... |
Line 1837... |
| 1836 |
|
1837 |
|
| 1837 |
model.addAttribute("accessoriesBrandSales", accessoriesBrandSales);
|
1838 |
model.addAttribute("accessoriesBrandSales", accessoriesBrandSales);
|
| 1838 |
return "accessories-brand-wise-report";
|
1839 |
return "accessories-brand-wise-report";
|
| 1839 |
}
|
1840 |
}
|
| 1840 |
|
1841 |
|
| 1841 |
@RequestMapping(value = "/getMobileLMSGraph", method = RequestMethod.POST)
|
1842 |
@PostMapping("/getMobileLMSGraph")
|
| 1842 |
public String getMobileLMSGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
|
1843 |
public String getMobileLMSGraph(@RequestBody LMSGraphRequest lmsGraphRequest, Model model) throws Exception {
|
| 1843 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
1844 |
LocalDate startDate = lmsGraphRequest.getDate().toLocalDate();
|
| 1844 |
@RequestParam List<Integer> fofoIds, @RequestParam String filterType, Model model) throws Exception {
|
1845 |
LocalDate endLocalDate = lmsGraphRequest.getEndDate().toLocalDate();
|
| - |
|
1846 |
|
| 1845 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
|
1847 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository.selectActivePartnersByRetailerIds(lmsGraphRequest.getFofoIds())
|
| - |
|
1848 |
.stream()
|
| - |
|
1849 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
| 1846 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
1850 |
Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
| 1847 |
|
1851 |
|
| 1848 |
ChartModel cm;
|
1852 |
ChartModel cm;
|
| 1849 |
if (warehouseId != 0) {
|
1853 |
if (lmsGraphRequest.getWarehouseId() != 0) {
|
| - |
|
1854 |
cm = adminUser.getBrandWiseLms(
|
| 1850 |
cm = adminUser.getBrandWiseLms(Arrays.asList(warehouseId), fofoIds.stream().map(x -> x).collect(Collectors.toList()), date.toLocalDate(), endDate.toLocalDate(), filterType);
|
1855 |
Arrays.asList(lmsGraphRequest.getWarehouseId()),
|
| - |
|
1856 |
lmsGraphRequest.getFofoIds(),
|
| - |
|
1857 |
startDate,
|
| - |
|
1858 |
endLocalDate,
|
| - |
|
1859 |
lmsGraphRequest.getFilterType()
|
| - |
|
1860 |
);
|
| 1851 |
} else {
|
1861 |
} else {
|
| - |
|
1862 |
cm = adminUser.getBrandWiseLms(
|
| 1852 |
cm = adminUser.getBrandWiseLms(new ArrayList<>(warehouseIdFofoIdMap.keySet()), fofoIds.stream().map(x -> x).collect(Collectors.toList()), date.toLocalDate(), endDate.toLocalDate(), filterType);
|
1863 |
new ArrayList<>(warehouseIdFofoIdMap.keySet()),
|
| - |
|
1864 |
lmsGraphRequest.getFofoIds(),
|
| - |
|
1865 |
startDate,
|
| - |
|
1866 |
endLocalDate,
|
| - |
|
1867 |
lmsGraphRequest.getFilterType()
|
| 1853 |
|
1868 |
);
|
| 1854 |
}
|
1869 |
}
|
| 1855 |
|
1870 |
|
| 1856 |
LOGGER.info("chartMap" + gson.toJson(cm));
|
1871 |
LOGGER.info("chartMap: " + gson.toJson(cm));
|
| 1857 |
model.addAttribute("chartMap", gson.toJson(cm));
|
1872 |
model.addAttribute("chartMap", gson.toJson(cm));
|
| - |
|
1873 |
|
| 1858 |
return "brand-wise-mobile-lms-chart";
|
1874 |
return "brand-wise-mobile-lms-chart";
|
| 1859 |
}
|
1875 |
}
|
| 1860 |
|
1876 |
|
| - |
|
1877 |
|
| 1861 |
@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
|
1878 |
@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
|
| 1862 |
public String getMobileLMSFilter(HttpServletRequest request,
|
1879 |
public String getMobileLMSFilter(HttpServletRequest request,
|
| 1863 |
@RequestParam(required = false, defaultValue = "0") int warehouseId,
|
1880 |
@RequestParam(required = false, defaultValue = "0") int warehouseId,
|
| 1864 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate, Model
|
1881 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate, Model
|
| 1865 |
model) throws Exception {
|
1882 |
model) throws Exception {
|