| Line 51... |
Line 51... |
| 51 |
import com.spice.profitmandi.common.model.DatasetModel;
|
51 |
import com.spice.profitmandi.common.model.DatasetModel;
|
| 52 |
import com.spice.profitmandi.common.model.LegendModel;
|
52 |
import com.spice.profitmandi.common.model.LegendModel;
|
| 53 |
import com.spice.profitmandi.common.model.Notification;
|
53 |
import com.spice.profitmandi.common.model.Notification;
|
| 54 |
import com.spice.profitmandi.common.model.OptionsModel;
|
54 |
import com.spice.profitmandi.common.model.OptionsModel;
|
| 55 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
55 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 56 |
import com.spice.profitmandi.common.model.SaholicInventoryCIsModel;
|
- |
|
| 57 |
import com.spice.profitmandi.common.model.TitleModel;
|
56 |
import com.spice.profitmandi.common.model.TitleModel;
|
| 58 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
57 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 59 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
58 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
| 60 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
59 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 61 |
import com.spice.profitmandi.dao.entity.auth.Menu;
|
60 |
import com.spice.profitmandi.dao.entity.auth.Menu;
|
| Line 68... |
Line 67... |
| 68 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
67 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| 69 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
68 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 70 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
69 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 71 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
70 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 72 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
71 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 73 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTypeChange;
|
- |
|
| 74 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
72 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
| 75 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventoryCIS;
|
- |
|
| 76 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
73 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 77 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
74 |
import com.spice.profitmandi.dao.enumuration.catalog.ItemCriteriaType;
|
| 78 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
75 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 79 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
76 |
import com.spice.profitmandi.dao.enumuration.dtr.LeadStatus;
|
| 80 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
77 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| Line 777... |
Line 774... |
| 777 |
List<Position> positions = positionRepository.selectAll(authUser.getId());
|
774 |
List<Position> positions = positionRepository.selectAll(authUser.getId());
|
| 778 |
Map<Integer, AuthUser> authIdAndAuthUserMap = null;
|
775 |
Map<Integer, AuthUser> authIdAndAuthUserMap = null;
|
| 779 |
ReporticoCacheTable rct = null;
|
776 |
ReporticoCacheTable rct = null;
|
| 780 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
777 |
Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
|
| 781 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
778 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| - |
|
779 |
LinkedHashMap<Integer, String> wm = new LinkedHashMap<Integer, String>();
|
| - |
|
780 |
LinkedHashMap<Integer, String> sortedwm = new LinkedHashMap<Integer, String>();
|
| - |
|
781 |
|
| - |
|
782 |
for (Map.Entry<Integer, String> entry : warehouseMap.entrySet()) {
|
| - |
|
783 |
wm.put(entry.getKey(), entry.getValue());
|
| - |
|
784 |
}
|
| - |
|
785 |
|
| - |
|
786 |
wm.put(0, "Total Values");
|
| - |
|
787 |
long stockValue = 0;
|
| - |
|
788 |
long stockQty = 0;
|
| - |
|
789 |
long pendingIndent = 0;
|
| - |
|
790 |
|
| 782 |
Map<Integer, PartnerDetailModel> authIdAndallValues = null;
|
791 |
Map<Integer, PartnerDetailModel> authIdAndallValues = null;
|
| 783 |
if (positions.size() > 0) {
|
792 |
if (positions.size() > 0) {
|
| 784 |
if (positions.stream()
|
793 |
if (positions.stream()
|
| 785 |
.filter(x -> x.getEscalationType().equals(EscalationType.L3)
|
794 |
.filter(x -> x.getEscalationType().equals(EscalationType.L3)
|
| 786 |
|| x.getEscalationType().equals(EscalationType.L4)
|
795 |
|| x.getEscalationType().equals(EscalationType.L4)
|
| Line 797... |
Line 806... |
| 797 |
|
806 |
|
| 798 |
AuthUser dummyAuthUser = new AuthUser();
|
807 |
AuthUser dummyAuthUser = new AuthUser();
|
| 799 |
dummyAuthUser.setFirstName("Total");
|
808 |
dummyAuthUser.setFirstName("Total");
|
| 800 |
dummyAuthUser.setLastName("Values");
|
809 |
dummyAuthUser.setLastName("Values");
|
| 801 |
authIdAndAuthUserMap.put(0, dummyAuthUser);
|
810 |
authIdAndAuthUserMap.put(0, dummyAuthUser);
|
| 802 |
|
- |
|
| 803 |
warehouseStockMap = saholicInventoryCISRepository.selectGroupByWarehouse().stream()
|
811 |
warehouseStockMap = saholicInventoryCISRepository.selectGroupByWarehouse().stream()
|
| 804 |
.collect(Collectors.toMap(x -> x.getWarehouseId(), x -> x));
|
812 |
.collect(Collectors.toMap(x -> x.getWarehouseId(), x -> x));
|
| 805 |
|
813 |
|
| - |
|
814 |
List<WarehouseWiseStockModel> warehouseStocks = saholicInventoryCISRepository
|
| - |
|
815 |
.selectGroupByWarehouse();
|
| - |
|
816 |
if (!warehouseStocks.isEmpty()) {
|
| - |
|
817 |
for (WarehouseWiseStockModel warehouseStock : warehouseStocks) {
|
| - |
|
818 |
stockValue += warehouseStock.getStockValue();
|
| - |
|
819 |
stockQty += warehouseStock.getStockQty();
|
| - |
|
820 |
pendingIndent += warehouseStock.getPendingIndent();
|
| - |
|
821 |
}
|
| - |
|
822 |
WarehouseWiseStockModel ws = new WarehouseWiseStockModel();
|
| - |
|
823 |
ws.setStockQty(stockQty);
|
| - |
|
824 |
ws.setStockValue(stockValue);
|
| - |
|
825 |
ws.setPendingIndent(pendingIndent);
|
| - |
|
826 |
ws.setWarehouseId(0);
|
| - |
|
827 |
warehouseStockMap.put(0, ws);
|
| - |
|
828 |
|
| - |
|
829 |
}
|
| - |
|
830 |
|
| 806 |
rct = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
831 |
rct = reporticoCacheTableRepository.selectByTableName("SaholicInventoryCIS");
|
| 807 |
LOGGER.info("warehouseStockMap" + warehouseStockMap);
|
832 |
LOGGER.info("warehouseStockMap" + warehouseStockMap);
|
| 808 |
|
833 |
|
| 809 |
authIdAndallValues = this.getL2AuthUserPartnerDetail();
|
834 |
authIdAndallValues = this.getL2AuthUserPartnerDetail();
|
| 810 |
}
|
835 |
}
|
| Line 849... |
Line 874... |
| 849 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
874 |
model.addAttribute("warehouses", getWarehouses(positionRetailers));
|
| 850 |
}
|
875 |
}
|
| 851 |
model.addAttribute("authId", authUser.getId());
|
876 |
model.addAttribute("authId", authUser.getId());
|
| 852 |
|
877 |
|
| 853 |
}
|
878 |
}
|
| - |
|
879 |
LOGGER.info("warehouseMap" + wm);
|
| 854 |
model.addAttribute("reporticoDate", rct);
|
880 |
model.addAttribute("reporticoDate", rct);
|
| 855 |
model.addAttribute("authIdAndallValues", authIdAndallValues);
|
881 |
model.addAttribute("authIdAndallValues", authIdAndallValues);
|
| 856 |
model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
|
882 |
model.addAttribute("authIdAndAuthUserMap", authIdAndAuthUserMap);
|
| 857 |
model.addAttribute("warehouseMap", warehouseMap);
|
883 |
model.addAttribute("warehouseMap", wm);
|
| 858 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
884 |
model.addAttribute("warehouseStockMap", warehouseStockMap);
|
| 859 |
} catch (ProfitMandiBusinessException e) {
|
885 |
} catch (ProfitMandiBusinessException e) {
|
| 860 |
}
|
886 |
}
|
| 861 |
List<Menu> menuList = (menus != null) ? this.prepareMenu(menus) : new ArrayList<>();
|
887 |
List<Menu> menuList = (menus != null) ? this.prepareMenu(menus) : new ArrayList<>();
|
| 862 |
LOGGER.info("menu" + menuList);
|
888 |
LOGGER.info("menu" + menuList);
|
| Line 978... |
Line 1004... |
| 978 |
|
1004 |
|
| 979 |
List<WarehouseWiseBrandStockModel> warehouseWiseBrandStock = saholicInventoryCISRepository
|
1005 |
List<WarehouseWiseBrandStockModel> warehouseWiseBrandStock = saholicInventoryCISRepository
|
| 980 |
.selectGroupByWarehouseAndBrand(warehouseId);
|
1006 |
.selectGroupByWarehouseAndBrand(warehouseId);
|
| 981 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1007 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 982 |
model.addAttribute("warehouseWiseBrandStock", warehouseWiseBrandStock);
|
1008 |
model.addAttribute("warehouseWiseBrandStock", warehouseWiseBrandStock);
|
| - |
|
1009 |
model.addAttribute("warehouseId", warehouseId);
|
| 983 |
model.addAttribute("warehouseMap", warehouseMap);
|
1010 |
model.addAttribute("warehouseMap", warehouseMap);
|
| 984 |
LOGGER.info("warehouseWiseBrandStock" + warehouseWiseBrandStock);
|
1011 |
LOGGER.info("warehouseWiseBrandStock" + warehouseWiseBrandStock);
|
| 985 |
return "warehouse_brand_stock";
|
1012 |
return "warehouse_brand_stock";
|
| 986 |
}
|
1013 |
}
|
| 987 |
|
1014 |
|
| Line 990... |
Line 1017... |
| 990 |
inventoryService.getItemAvailabilityAndIndent();
|
1017 |
inventoryService.getItemAvailabilityAndIndent();
|
| 991 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
1018 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 992 |
return "response";
|
1019 |
return "response";
|
| 993 |
}
|
1020 |
}
|
| 994 |
|
1021 |
|
| 995 |
@RequestMapping(value = "/getWarehouseWiseBrandItemStock", method = RequestMethod.GET)
|
1022 |
@RequestMapping(value = "/getWarehouseWiseBrandAndCategory", method = RequestMethod.GET)
|
| 996 |
public String getWarehouseWiseBrandItemStock(HttpServletRequest request, Model model,
|
1023 |
public String getWarehouseWiseBrandAndCategory(HttpServletRequest request, Model model,
|
| 997 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
1024 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
| 998 |
throws Exception {
|
1025 |
throws Exception {
|
| 999 |
|
1026 |
|
| 1000 |
List<WarehouseWiseitemStockModel> warehouseWiseItemStock = saholicInventoryCISRepository
|
- |
|
| 1001 |
.selectWarehouseItemStock(warehouseId, brands, category);
|
- |
|
| 1002 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1027 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1003 |
List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
|
1028 |
List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
|
| 1004 |
List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
|
1029 |
List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
|
| 1005 |
model.addAttribute("warehouseWiseItemStock", warehouseWiseItemStock);
|
- |
|
| - |
|
1030 |
|
| 1006 |
model.addAttribute("warehouseMap", warehouseMap);
|
1031 |
model.addAttribute("warehouseMap", warehouseMap);
|
| 1007 |
model.addAttribute("brands", listbrands);
|
1032 |
model.addAttribute("brands", listbrands);
|
| 1008 |
model.addAttribute("listCategory", listCategory);
|
1033 |
model.addAttribute("listCategory", listCategory);
|
| 1009 |
|
1034 |
|
| 1010 |
model.addAttribute("selectedBrand", brands);
|
1035 |
model.addAttribute("selectedBrand", brands);
|
| 1011 |
model.addAttribute("selectedWarehouse", warehouseId);
|
1036 |
model.addAttribute("selectedWarehouse", warehouseId);
|
| 1012 |
LOGGER.info("warehouseWiseItemStock" + warehouseWiseItemStock);
|
1037 |
model.addAttribute("selectedCategory", category);
|
| - |
|
1038 |
|
| 1013 |
return "warehouse_brand_item_stock";
|
1039 |
return "warehouse_brand_item_stock";
|
| 1014 |
}
|
1040 |
}
|
| 1015 |
|
1041 |
|
| 1016 |
@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
|
1042 |
@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
|
| 1017 |
public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
|
1043 |
public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
|
| 1018 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
1044 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
| 1019 |
throws Exception {
|
1045 |
throws Exception {
|
| - |
|
1046 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| - |
|
1047 |
if (warehouseId.contains(0)) {
|
| - |
|
1048 |
warehouseId.addAll(warehouseMap.keySet());
|
| 1020 |
|
1049 |
}
|
| 1021 |
List<WarehouseWiseitemStockModel> warehouseWiseItemStock = saholicInventoryCISRepository
|
1050 |
List<WarehouseWiseitemStockModel> warehouseWiseItemStock = saholicInventoryCISRepository
|
| 1022 |
.selectWarehouseItemStock(warehouseId, brands, category);
|
1051 |
.selectWarehouseItemStock(warehouseId, brands, category);
|
| 1023 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
- |
|
| - |
|
1052 |
|
| 1024 |
model.addAttribute("warehouseWiseItemStock", warehouseWiseItemStock);
|
1053 |
model.addAttribute("warehouseWiseItemStock", warehouseWiseItemStock);
|
| 1025 |
model.addAttribute("warehouseMap", warehouseMap);
|
1054 |
model.addAttribute("warehouseMap", warehouseMap);
|
| 1026 |
|
1055 |
|
| 1027 |
LOGGER.info("warehouseWiseItemStock" + warehouseWiseItemStock);
|
1056 |
LOGGER.info("warehouseWiseItemStock" + warehouseWiseItemStock);
|
| 1028 |
return "warehouse_item_details";
|
1057 |
return "warehouse_item_details";
|