| Line 82... |
Line 82... |
| 82 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
82 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 83 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
83 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
| 84 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
84 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 85 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
85 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
| 86 |
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
|
86 |
import com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel;
|
| - |
|
87 |
import com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel;
|
| 87 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
88 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| 88 |
import com.spice.profitmandi.dao.model.InStockBrandItemModel;
|
89 |
import com.spice.profitmandi.dao.model.InStockBrandItemModel;
|
| 89 |
import com.spice.profitmandi.dao.model.InStockBrandModel;
|
90 |
import com.spice.profitmandi.dao.model.InStockBrandModel;
|
| 90 |
import com.spice.profitmandi.dao.model.ItemTypeParams;
|
91 |
import com.spice.profitmandi.dao.model.ItemTypeParams;
|
| 91 |
import com.spice.profitmandi.dao.model.ItemWiseTertiaryModel;
|
92 |
import com.spice.profitmandi.dao.model.ItemWiseTertiaryModel;
|
| 92 |
import com.spice.profitmandi.dao.model.MonthSaleModel;
|
93 |
import com.spice.profitmandi.dao.model.MonthSaleModel;
|
| 93 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
94 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 94 |
import com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel;
|
95 |
import com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel;
|
| 95 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
96 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 96 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
97 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| - |
|
98 |
import com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel;
|
| 97 |
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
|
99 |
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
|
| 98 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel;
|
100 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel;
|
| 99 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandStockModel;
|
101 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandStockModel;
|
| - |
|
102 |
import com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel;
|
| 100 |
import com.spice.profitmandi.dao.model.WarehouseWiseStockModel;
|
103 |
import com.spice.profitmandi.dao.model.WarehouseWiseStockModel;
|
| 101 |
import com.spice.profitmandi.dao.model.WarehouseWiseitemStockModel;
|
104 |
import com.spice.profitmandi.dao.model.WarehouseWiseitemStockModel;
|
| 102 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
105 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 103 |
import com.spice.profitmandi.dao.repository.auth.MenuCategoryRepository;
|
106 |
import com.spice.profitmandi.dao.repository.auth.MenuCategoryRepository;
|
| 104 |
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
|
107 |
import com.spice.profitmandi.dao.repository.auth.MenuRepository;
|
| Line 808... |
Line 811... |
| 808 |
ReporticoCacheTable rctPartneStat = null;
|
811 |
ReporticoCacheTable rctPartneStat = null;
|
| 809 |
|
812 |
|
| 810 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
813 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
| 811 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
814 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 812 |
LinkedHashMap<Integer, String> wm = new LinkedHashMap<Integer, String>();
|
815 |
LinkedHashMap<Integer, String> wm = new LinkedHashMap<Integer, String>();
|
| 813 |
|
- |
|
| 814 |
List<BrandWisePartnerSaleModel> partnersBrandSale = null;
|
816 |
Map<String, BrandWisePartnerSaleModel> partnersBrandSaleMap = null;
|
| 815 |
|
- |
|
| 816 |
List<BrandWisePartnerSaleModel> accessoriesBrandSales = null;
|
817 |
List<BrandWisePartnerSaleModel> accessoriesBrandSales = null;
|
| 817 |
for (Map.Entry<Integer, String> entry : warehouseMap.entrySet()) {
|
818 |
for (Map.Entry<Integer, String> entry : warehouseMap.entrySet()) {
|
| 818 |
wm.put(entry.getKey(), entry.getValue());
|
819 |
wm.put(entry.getKey(), entry.getValue());
|
| 819 |
}
|
820 |
}
|
| 820 |
|
821 |
|
| Line 854... |
Line 855... |
| 854 |
}
|
855 |
}
|
| 855 |
|
856 |
|
| 856 |
warehousePartnerDetailMap = this.getWarehousePartnerDetail();
|
857 |
warehousePartnerDetailMap = this.getWarehousePartnerDetail();
|
| 857 |
rctSaholic = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
858 |
rctSaholic = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
| 858 |
rctPartneStat = reporticoCacheTableRepository.selectByTableName("partnerStat");
|
859 |
rctPartneStat = reporticoCacheTableRepository.selectByTableName("partnerStat");
|
| - |
|
860 |
|
| 859 |
partnersBrandSale = fofoStoreRepository.selectGroupByBrandWarehousePartnerSale();
|
861 |
partnersBrandSaleMap = fofoStoreRepository.selectGroupByBrandWarehousePartnerSale().stream()
|
| - |
|
862 |
.collect(Collectors.toMap(x -> x.getBrand(), x -> x));
|
| - |
|
863 |
|
| - |
|
864 |
List<BrandWiseUnbilledActivateStockModel> unbilledActivatedStock = fofoStoreRepository
|
| - |
|
865 |
.selectUnbilledActivateStockGroupByBrand();
|
| - |
|
866 |
for (BrandWiseUnbilledActivateStockModel un : unbilledActivatedStock) {
|
| - |
|
867 |
BrandWisePartnerSaleModel bpt = partnersBrandSaleMap.get(un.getBrand());
|
| - |
|
868 |
if (bpt != null) {
|
| - |
|
869 |
bpt.setAmtd(un.getUnbilledMtd());
|
| - |
|
870 |
} else {
|
| - |
|
871 |
bpt = new BrandWisePartnerSaleModel();
|
| - |
|
872 |
bpt.setBrand(un.getBrand());
|
| - |
|
873 |
bpt.setAmtd(un.getUnbilledMtd());
|
| - |
|
874 |
bpt.setLms(0);
|
| - |
|
875 |
bpt.setLmtd(0);
|
| - |
|
876 |
bpt.setMtd(0);
|
| - |
|
877 |
bpt.setMtdQty(0);
|
| - |
|
878 |
bpt.setLmtd(0);
|
| - |
|
879 |
bpt.setLmtdQty(0);
|
| - |
|
880 |
partnersBrandSaleMap.put(un.getBrand(), bpt);
|
| - |
|
881 |
}
|
| - |
|
882 |
}
|
| 860 |
accessoriesBrandSales = fofoStoreRepository.selectGroupByBrandAccesoriesWarehousePartnerSale();
|
883 |
accessoriesBrandSales = fofoStoreRepository.selectGroupByBrandAccesoriesWarehousePartnerSale();
|
| 861 |
}
|
884 |
}
|
| 862 |
}
|
885 |
}
|
| 863 |
|
886 |
|
| 864 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in", "manish.tiwari@smartdukaan.com")
|
887 |
if (Arrays.asList("amit.gupta@shop2020.in", "tejbeer.kaur@shop2020.in", "manish.tiwari@smartdukaan.com")
|
| Line 905... |
Line 928... |
| 905 |
|
928 |
|
| 906 |
model.addAttribute("reporticoDate", rctSaholic);
|
929 |
model.addAttribute("reporticoDate", rctSaholic);
|
| 907 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|
930 |
model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
|
| 908 |
model.addAttribute("warehouseMap", wm);
|
931 |
model.addAttribute("warehouseMap", wm);
|
| 909 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
932 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
| 910 |
model.addAttribute("brandSales", partnersBrandSale);
|
933 |
model.addAttribute("brandSalesMap", partnersBrandSaleMap);
|
| 911 |
|
934 |
|
| 912 |
model.addAttribute("accessoriesBrandSales", accessoriesBrandSales);
|
935 |
model.addAttribute("accessoriesBrandSales", accessoriesBrandSales);
|
| 913 |
|
936 |
|
| 914 |
} catch (ProfitMandiBusinessException e) {
|
937 |
} catch (ProfitMandiBusinessException e) {
|
| 915 |
}
|
938 |
}
|
| Line 1196... |
Line 1219... |
| 1196 |
}
|
1219 |
}
|
| 1197 |
|
1220 |
|
| 1198 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
1221 |
@RequestMapping(value = "/getWarehouseWiseBrandPartnerSale", method = RequestMethod.GET)
|
| 1199 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model, @RequestParam String brand)
|
1222 |
public String getWarehouseWiseBrandPartnerSale(HttpServletRequest request, Model model, @RequestParam String brand)
|
| 1200 |
throws Exception {
|
1223 |
throws Exception {
|
| 1201 |
List<WarehouseWiseBrandSaleModel> warehouseWiseBrandPartnerSales = fofoStoreRepository
|
1224 |
Map<Integer, WarehouseWiseBrandSaleModel> warehouseWiseBrandPartnerSales = fofoStoreRepository
|
| 1202 |
.selectGroupByWarehouseBrandWisePartnerSale(brand);
|
1225 |
.selectGroupByWarehouseBrandWisePartnerSale(brand).stream()
|
| - |
|
1226 |
.collect(Collectors.toMap(x -> x.getWarehouseId(), x -> x));
|
| - |
|
1227 |
|
| - |
|
1228 |
List<WarehouseWiseBrandUnbilledActivatedModel> unbilledStock = fofoStoreRepository
|
| - |
|
1229 |
.selectUnbilledActivateStockGroupByWarehouse(brand);
|
| - |
|
1230 |
|
| - |
|
1231 |
for (WarehouseWiseBrandUnbilledActivatedModel un : unbilledStock) {
|
| - |
|
1232 |
WarehouseWiseBrandSaleModel bpt = warehouseWiseBrandPartnerSales.get(un.getWarehouseId());
|
| - |
|
1233 |
if (bpt != null) {
|
| - |
|
1234 |
bpt.setAmtd(un.getUnbilledMtd());
|
| - |
|
1235 |
} else {
|
| - |
|
1236 |
bpt = new WarehouseWiseBrandSaleModel();
|
| - |
|
1237 |
bpt.setWarehouseId(un.getWarehouseId());
|
| - |
|
1238 |
bpt.setAmtd(un.getUnbilledMtd());
|
| - |
|
1239 |
bpt.setLms(0);
|
| - |
|
1240 |
bpt.setLmtd(0);
|
| - |
|
1241 |
bpt.setMtd(0);
|
| - |
|
1242 |
bpt.setMtdQty(0);
|
| - |
|
1243 |
bpt.setLmtd(0);
|
| - |
|
1244 |
bpt.setLmtdQty(0);
|
| - |
|
1245 |
warehouseWiseBrandPartnerSales.put(un.getWarehouseId(), bpt);
|
| - |
|
1246 |
}
|
| - |
|
1247 |
}
|
| 1203 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1248 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1204 |
|
1249 |
|
| 1205 |
Set<String> brands = inventoryService.getAllTagListingBrands();
|
1250 |
Set<String> brands = inventoryService.getAllTagListingBrands();
|
| 1206 |
model.addAttribute("warehouseWiseBrandPartnerSales", warehouseWiseBrandPartnerSales);
|
1251 |
model.addAttribute("warehouseWiseBrandPartnerSales", warehouseWiseBrandPartnerSales);
|
| 1207 |
model.addAttribute("warehouseMap", warehouseMap);
|
1252 |
model.addAttribute("warehouseMap", warehouseMap);
|
| Line 1227... |
Line 1272... |
| 1227 |
|
1272 |
|
| 1228 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
1273 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
| 1229 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
1274 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
| 1230 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
1275 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
| 1231 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1276 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1232 |
List<WarehouseBrandWiseItemSaleModel> branditemSales = fofoStoreRepository
|
1277 |
Map<Integer, WarehouseBrandWiseItemSaleModel> branditemSalesMap = fofoStoreRepository
|
| 1233 |
.selectWarehouseBrandItemSale(warehouseId, brand);
|
1278 |
.selectWarehouseBrandItemSale(warehouseId, brand).stream()
|
| - |
|
1279 |
.collect(Collectors.toMap(x -> x.getItemId(), x -> x));
|
| - |
|
1280 |
;
|
| - |
|
1281 |
|
| - |
|
1282 |
List<WarehouseBrandItemUnbilledActivatedModel> unbilledItems = fofoStoreRepository
|
| - |
|
1283 |
.selectWarehouseBrandItemUnbilledActivateStock(warehouseId, brand);
|
| - |
|
1284 |
|
| - |
|
1285 |
for (WarehouseBrandItemUnbilledActivatedModel un : unbilledItems) {
|
| - |
|
1286 |
WarehouseBrandWiseItemSaleModel bpt = branditemSalesMap.get(un.getItemId());
|
| - |
|
1287 |
if (bpt != null) {
|
| - |
|
1288 |
bpt.setAmtd(un.getAmtd());
|
| - |
|
1289 |
} else {
|
| - |
|
1290 |
bpt = new WarehouseBrandWiseItemSaleModel();
|
| - |
|
1291 |
bpt.setWarehouseId(un.getWarehouseId());
|
| - |
|
1292 |
bpt.setItemId(un.getItemId());
|
| - |
|
1293 |
bpt.setAmtd(un.getAmtd());
|
| - |
|
1294 |
bpt.setBrand(un.getBrand());
|
| - |
|
1295 |
bpt.setModelName(un.getModelName());
|
| - |
|
1296 |
bpt.setModelNumber(un.getModelNumber());
|
| - |
|
1297 |
bpt.setColor(un.getColor());
|
| - |
|
1298 |
bpt.setLms(0);
|
| - |
|
1299 |
bpt.setLmtd(0);
|
| - |
|
1300 |
bpt.setMtd(0);
|
| - |
|
1301 |
bpt.setMtdQty(0);
|
| - |
|
1302 |
bpt.setLmtd(0);
|
| - |
|
1303 |
bpt.setLmtdQty(0);
|
| - |
|
1304 |
branditemSalesMap.put(un.getItemId(), bpt);
|
| - |
|
1305 |
}
|
| - |
|
1306 |
}
|
| 1234 |
model.addAttribute("branditemSales", branditemSales);
|
1307 |
model.addAttribute("branditemSales", branditemSalesMap);
|
| 1235 |
model.addAttribute("warehouseMap", warehouseMap);
|
1308 |
model.addAttribute("warehouseMap", warehouseMap);
|
| 1236 |
return "warehouse_partner_itemwise_sale";
|
1309 |
return "warehouse_partner_itemwise_sale";
|
| 1237 |
}
|
1310 |
}
|
| 1238 |
|
1311 |
|
| 1239 |
@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
|
1312 |
@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
|