| Line 84... |
Line 84... |
| 84 |
import com.spice.profitmandi.dao.model.MonthSaleModel;
|
84 |
import com.spice.profitmandi.dao.model.MonthSaleModel;
|
| 85 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
85 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 86 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
86 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 87 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
87 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 88 |
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
|
88 |
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
|
| 89 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel;
|
89 |
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
|
| 90 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandStockModel;
|
90 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandStockModel;
|
| 91 |
import com.spice.profitmandi.dao.model.WarehouseWisePartnerSaleModel;
|
91 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel;
|
| 92 |
import com.spice.profitmandi.dao.model.WarehouseWiseStockModel;
|
92 |
import com.spice.profitmandi.dao.model.WarehouseWiseStockModel;
|
| 93 |
import com.spice.profitmandi.dao.model.WarehouseWiseitemStockModel;
|
93 |
import com.spice.profitmandi.dao.model.WarehouseWiseitemStockModel;
|
| 94 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
94 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 95 |
import com.spice.profitmandi.dao.repository.auth.MenuCategoryRepository;
|
95 |
import com.spice.profitmandi.dao.repository.auth.MenuCategoryRepository;
|
| 96 |
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
|
96 |
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
|
| Line 790... |
Line 790... |
| 790 |
Map<Integer, PartnerDetailModel> warehousePartnerDetailMap = null;
|
790 |
Map<Integer, PartnerDetailModel> warehousePartnerDetailMap = null;
|
| 791 |
ReporticoCacheTable rct = null;
|
791 |
ReporticoCacheTable rct = null;
|
| 792 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
792 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
| 793 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
793 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 794 |
LinkedHashMap<Integer, String> wm = new LinkedHashMap<Integer, String>();
|
794 |
LinkedHashMap<Integer, String> wm = new LinkedHashMap<Integer, String>();
|
| 795 |
LinkedHashMap<Integer, String> sortedwm = new LinkedHashMap<Integer, String>();
|
- |
|
| 796 |
|
- |
|
| 797 |
Map<Integer, WarehouseWisePartnerSaleModel> warehousePartnersSales = null;
|
- |
|
| 798 |
|
795 |
|
| - |
|
796 |
List<BrandWisePartnerSaleModel> partnersBrandSale = null;
|
| 799 |
for (Map.Entry<Integer, String> entry : warehouseMap.entrySet()) {
|
797 |
for (Map.Entry<Integer, String> entry : warehouseMap.entrySet()) {
|
| 800 |
wm.put(entry.getKey(), entry.getValue());
|
798 |
wm.put(entry.getKey(), entry.getValue());
|
| 801 |
}
|
799 |
}
|
| 802 |
|
800 |
|
| 803 |
wm.put(0, "Total Values");
|
801 |
wm.put(0, "Total Values");
|
| Line 832... |
Line 830... |
| 832 |
ws.setTertiary(tertiary);
|
830 |
ws.setTertiary(tertiary);
|
| 833 |
ws.setWarehouseId(0);
|
831 |
ws.setWarehouseId(0);
|
| 834 |
warehouseStockMap.put(0, ws);
|
832 |
warehouseStockMap.put(0, ws);
|
| 835 |
|
833 |
|
| 836 |
}
|
834 |
}
|
| 837 |
warehousePartnersSales = this.getWarehousePartnerSale();
|
- |
|
| 838 |
rct = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
- |
|
| 839 |
LOGGER.info("warehouseStockMap" + warehouseStockMap);
|
- |
|
| 840 |
warehousePartnerDetailMap = this.getWarehousePartnerDetail();
|
- |
|
| 841 |
LOGGER.info("warehousePartnerDetailMap" + warehousePartnerDetailMap);
|
- |
|
| 842 |
|
835 |
|
| - |
|
836 |
warehousePartnerDetailMap = this.getWarehousePartnerDetail();
|
| - |
|
837 |
rct = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
| - |
|
838 |
partnersBrandSale = fofoStoreRepository.selectGroupByBrandWarehousePartnerSale();
|
| 843 |
}
|
839 |
}
|
| 844 |
}
|
840 |
}
|
| 845 |
|
841 |
|
| 846 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in", "manish.tiwari@smartdukaan.com")
|
842 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in", "manish.tiwari@smartdukaan.com")
|
| 847 |
.contains(email)) {
|
843 |
.contains(email)) {
|
| Line 882... |
Line 878... |
| 882 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
878 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
| 883 |
}
|
879 |
}
|
| 884 |
model.addAttribute("authId", authUser.getId());
|
880 |
model.addAttribute("authId", authUser.getId());
|
| 885 |
|
881 |
|
| 886 |
}
|
882 |
}
|
| 887 |
LOGGER.info("warehouseMap" + wm);
|
- |
|
| 888 |
model.addAttribute("reporticoDate", rct);
|
883 |
model.addAttribute("reporticoDate", rct);
|
| 889 |
LOGGER.info("warehousePartnersSales" + warehousePartnersSales);
|
- |
|
| 890 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|
884 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|
| 891 |
model.addAttribute("warehouseMap", wm);
|
885 |
model.addAttribute("warehouseMap", wm);
|
| 892 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
886 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
| 893 |
model.addAttribute("brandSales", warehousePartnersSales);
|
887 |
model.addAttribute("brandSales", partnersBrandSale);
|
| 894 |
|
888 |
|
| 895 |
} catch (ProfitMandiBusinessException e) {
|
889 |
} catch (ProfitMandiBusinessException e) {
|
| 896 |
}
|
890 |
}
|
| 897 |
List<Menu> menuList = (menus != null) ? this.prepareMenu(menus) : new ArrayList<>();
|
891 |
List<Menu> menuList = (menus != null) ? this.prepareMenu(menus) : new ArrayList<>();
|
| 898 |
LOGGER.info("menu" + menuList);
|
892 |
LOGGER.info("menu" + menuList);
|
| Line 1098... |
Line 1092... |
| 1098 |
return gson.toJson(warehouses);
|
1092 |
return gson.toJson(warehouses);
|
| 1099 |
|
1093 |
|
| 1100 |
}
|
1094 |
}
|
| 1101 |
|
1095 |
|
| 1102 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
1096 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
| 1103 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model,
|
1097 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model, @RequestParam String brand)
|
| 1104 |
@RequestParam int warehouseId) throws Exception {
|
1098 |
throws Exception {
|
| 1105 |
List<WarehouseWiseBrandSaleModel> warehouseBrandPartnerSales = fofoStoreRepository
|
1099 |
List<WarehouseWiseBrandSaleModel> warehouseWiseBrandPartnerSales = fofoStoreRepository
|
| 1106 |
.selectGroupByBrandWarehousePartnerSale(warehouseId);
|
1100 |
.selectGroupByWarehouseBrandWisePartnerSale(brand);
|
| 1107 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1101 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| - |
|
1102 |
|
| 1108 |
model.addAttribute("warehouseBrandPartnerSales", warehouseBrandPartnerSales);
|
1103 |
Set<String> brands = inventoryService.getAllTagListingBrands();
|
| 1109 |
model.addAttribute("warehouseId", warehouseId);
|
1104 |
model.addAttribute("warehouseWiseBrandPartnerSales", warehouseWiseBrandPartnerSales);
|
| 1110 |
model.addAttribute("warehouseMap", warehouseMap);
|
1105 |
model.addAttribute("warehouseMap", warehouseMap);
|
| - |
|
1106 |
model.addAttribute("brands", brands);
|
| - |
|
1107 |
model.addAttribute("selectedbrand", brand);
|
| - |
|
1108 |
|
| 1111 |
LOGGER.info("warehouseBrandPartnerSales" + warehouseBrandPartnerSales);
|
1109 |
LOGGER.info("warehouseWiseBrandPartnerSales" + warehouseWiseBrandPartnerSales);
|
| 1112 |
return "warehouse_partner_brandwise_sale";
|
1110 |
return "warehousewise_brand_partners_sale";
|
| 1113 |
}
|
1111 |
}
|
| 1114 |
|
1112 |
|
| 1115 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
1113 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
| 1116 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
1114 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
| 1117 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
1115 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
| Line 1385... |
Line 1383... |
| 1385 |
warehouseIdAndallValues.put(0, partnerDetailModel);
|
1383 |
warehouseIdAndallValues.put(0, partnerDetailModel);
|
| 1386 |
|
1384 |
|
| 1387 |
return warehouseIdAndallValues;
|
1385 |
return warehouseIdAndallValues;
|
| 1388 |
}
|
1386 |
}
|
| 1389 |
|
1387 |
|
| 1390 |
private Map<Integer, WarehouseWisePartnerSaleModel> getWarehousePartnerSale() {
|
- |
|
| 1391 |
|
- |
|
| 1392 |
Map<Integer, WarehouseWisePartnerSaleModel> warehousePartnersSalesMap = new HashMap<>();
|
- |
|
| 1393 |
List<WarehouseWisePartnerSaleModel> warehousePartnersSales = fofoStoreRepository
|
- |
|
| 1394 |
.selectGroupByWarehousePartnerSale();
|
- |
|
| 1395 |
|
- |
|
| 1396 |
warehousePartnersSalesMap = warehousePartnersSales.stream()
|
- |
|
| 1397 |
.collect(Collectors.toMap(x -> x.getWarehouseId(), x -> x));
|
- |
|
| 1398 |
|
- |
|
| 1399 |
long lmtd = 0;
|
- |
|
| 1400 |
long lmtdQty = 0;
|
- |
|
| 1401 |
long mtd = 0;
|
- |
|
| 1402 |
long mtdQty = 0;
|
- |
|
| 1403 |
long lms = 0;
|
- |
|
| 1404 |
long lmsQty = 0;
|
- |
|
| 1405 |
;
|
- |
|
| 1406 |
if (!warehousePartnersSales.isEmpty()) {
|
- |
|
| 1407 |
|
- |
|
| 1408 |
for (WarehouseWisePartnerSaleModel sale : warehousePartnersSales) {
|
- |
|
| 1409 |
lmtd += sale.getLmtd();
|
- |
|
| 1410 |
lmtdQty += sale.getLmtdQty();
|
- |
|
| 1411 |
mtd += sale.getMtd();
|
- |
|
| 1412 |
mtdQty += sale.getMtdQty();
|
- |
|
| 1413 |
lms += sale.getLms();
|
- |
|
| 1414 |
lmsQty += sale.getLmsQty();
|
- |
|
| 1415 |
}
|
- |
|
| 1416 |
|
- |
|
| 1417 |
WarehouseWisePartnerSaleModel wp = new WarehouseWisePartnerSaleModel();
|
- |
|
| 1418 |
wp.setLmtd(lmtd);
|
- |
|
| 1419 |
wp.setLmtdQty(lmtdQty);
|
- |
|
| 1420 |
wp.setMtd(mtd);
|
- |
|
| 1421 |
wp.setMtdQty(mtdQty);
|
- |
|
| 1422 |
wp.setLms(lms);
|
- |
|
| 1423 |
wp.setLmsQty(lmsQty);
|
- |
|
| 1424 |
|
- |
|
| 1425 |
wp.setWarehouseId(0);
|
- |
|
| 1426 |
warehousePartnersSales.add(wp);
|
- |
|
| 1427 |
warehousePartnersSalesMap.put(0, wp);
|
- |
|
| 1428 |
}
|
- |
|
| 1429 |
return warehousePartnersSalesMap;
|
- |
|
| 1430 |
}
|
- |
|
| 1431 |
|
- |
|
| 1432 |
@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
|
1388 |
@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
|
| 1433 |
public String getItemWiseTertiary(HttpServletRequest request,
|
1389 |
public String getItemWiseTertiary(HttpServletRequest request,
|
| 1434 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
1390 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
| 1435 |
throws ProfitMandiBusinessException {
|
1391 |
throws ProfitMandiBusinessException {
|
| 1436 |
List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
|
1392 |
List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
|