Subversion Repositories SmartDukaan

Rev

Rev 27917 | Rev 27931 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27917 Rev 27930
Line 825... Line 825...
825
		lmtdUnActivated.setLabel("LMTD Unactivation");
825
		lmtdUnActivated.setLabel("LMTD Unactivation");
826
		lmtdUnActivated.setBackgroundColor("red");
826
		lmtdUnActivated.setBackgroundColor("red");
827
		lmtdUnActivated.setData(lmtdUnActivatedImeisValues);
827
		lmtdUnActivated.setData(lmtdUnActivatedImeisValues);
828
		lmtdUnActivated.setStack("stack1");
828
		lmtdUnActivated.setStack("stack1");
829
		lmtdUnActivated.setOrder(1);
829
		lmtdUnActivated.setOrder(1);
830
		
-
 
831
 
830
 
832
		DatasetModel LmtdActivatedImeis = new DatasetModel();
831
		DatasetModel LmtdActivatedImeis = new DatasetModel();
833
		LmtdActivatedImeis.setLabel("LMTD Activation");
832
		LmtdActivatedImeis.setLabel("LMTD Activation");
834
		LmtdActivatedImeis.setBackgroundColor("#87ceeb");
833
		LmtdActivatedImeis.setBackgroundColor("#87ceeb");
835
		LmtdActivatedImeis.setData(lmtdActivatedImeisValues);
834
		LmtdActivatedImeis.setData(lmtdActivatedImeisValues);
836
		LmtdActivatedImeis.setStack("stack1");
835
		LmtdActivatedImeis.setStack("stack1");
837
		LmtdActivatedImeis.setOrder(1);
836
		LmtdActivatedImeis.setOrder(1);
838
		
-
 
839
		
837
 
840
		DatasetModel linemtdChart = new DatasetModel();
838
		DatasetModel linemtdChart = new DatasetModel();
841
		linemtdChart.setLabel("MTD");
839
		linemtdChart.setLabel("MTD");
842
		linemtdChart.setBackgroundColor("#006400");
840
		linemtdChart.setBackgroundColor("#006400");
843
		
841
 
844
		linemtdChart.setData(mtdValues);
842
		linemtdChart.setData(mtdValues);
845
		linemtdChart.setType("line");
843
		linemtdChart.setType("line");
846
		linemtdChart.setOrder(2);
844
		linemtdChart.setOrder(2);
847
		linemtdChart.setFill("false");
845
		linemtdChart.setFill("false");
848
	
846
 
849
		DatasetModel lineLmtdChart = new DatasetModel();
847
		DatasetModel lineLmtdChart = new DatasetModel();
850
		lineLmtdChart.setLabel("LMTD");
848
		lineLmtdChart.setLabel("LMTD");
851
		lineLmtdChart.setBackgroundColor("#006400");
849
		lineLmtdChart.setBackgroundColor("#006400");
852
		lineLmtdChart.setData(lmtdValues);
850
		lineLmtdChart.setData(lmtdValues);
853
		lineLmtdChart.setType("line");
851
		lineLmtdChart.setType("line");
854
		lineLmtdChart.setOrder(3);
852
		lineLmtdChart.setOrder(3);
855
		lineLmtdChart.setFill("false");
853
		lineLmtdChart.setFill("false");
856
	
-
 
857
 
854
 
858
		List<DatasetModel> datasets = new ArrayList<>();
855
		List<DatasetModel> datasets = new ArrayList<>();
859
		datasets.add(lmtdUnActivated);
856
		datasets.add(lmtdUnActivated);
860
		datasets.add(LmtdActivatedImeis);
857
		datasets.add(LmtdActivatedImeis);
861
		datasets.add(dsmUnactivated);
858
		datasets.add(dsmUnactivated);
Line 885... Line 882...
885
		yAxis.setStacked(false);
882
		yAxis.setStacked(false);
886
		yAxes.add(yAxis);
883
		yAxes.add(yAxis);
887
 
884
 
888
		ScalesModel sm = new ScalesModel();
885
		ScalesModel sm = new ScalesModel();
889
		sm.setxAxes(xAxes);
886
		sm.setxAxes(xAxes);
890
		
-
 
891
 
887
 
892
		OptionsModel om = new OptionsModel();
888
		OptionsModel om = new OptionsModel();
893
		om.setLegend(lm);
889
		om.setLegend(lm);
894
		om.setTitle(tm);
890
		om.setTitle(tm);
895
		om.setScales(sm);
891
		om.setScales(sm);
Line 937... Line 933...
937
			Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
933
			Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
938
 
934
 
939
			Set<Integer> fofoIds = storeGuyMap.get(authUser.getEmailId());
935
			Set<Integer> fofoIds = storeGuyMap.get(authUser.getEmailId());
940
			if (emails.contains(authUser.getEmailId())) {
936
			if (emails.contains(authUser.getEmailId())) {
941
				fofoIds = storeGuyMap.get("tarun.verma@smartdukaan.com");
937
				fofoIds = storeGuyMap.get("tarun.verma@smartdukaan.com");
-
 
938
				LOGGER.info("fofoIds" + fofoIds);
942
			}
939
			}
943
 
940
 
944
			LOGGER.info("fofoIds" + fofoIds);
-
 
945
 
941
 
946
			if (fofoIds != null) {
942
			if (fofoIds != null) {
947
 
943
 
948
				Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
944
				Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
949
						.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
945
						.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
Line 1034... Line 1030...
1034
							.map(x -> x.getMenuId()).collect(Collectors.toList());
1030
							.map(x -> x.getMenuId()).collect(Collectors.toList());
1035
					if (menuIds.size() > 0) {
1031
					if (menuIds.size() > 0) {
1036
						menus = menuRepository.selectAllByIds(menuIds);
1032
						menus = menuRepository.selectAllByIds(menuIds);
1037
					}
1033
					}
1038
				}
1034
				}
-
 
1035
			}
1039
				List<Position> salesPositions = positions.stream()
1036
				/*List<Position> salesPositions = positions.stream()
1040
						.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES)
1037
						.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES)
1041
						.collect(Collectors.toList());
1038
						.collect(Collectors.toList());
1042
				if (salesPositions.size() > 0) {
1039
				if (salesPositions.size() > 0) {
1043
					Set<CustomRetailer> positionRetailers = new HashSet<>();
1040
					Set<CustomRetailer> positionRetailers = new HashSet<>();
1044
					csService.getPositionCustomRetailerMap(salesPositions).values().forEach(customRetailers -> {
1041
					csService.getPositionCustomRetailerMap(salesPositions).values().forEach(customRetailers -> {
1045
						positionRetailers.addAll(customRetailers);
1042
						positionRetailers.addAll(customRetailers);
1046
					});
1043
					});
-
 
1044
				}*/
-
 
1045
				if(fofoIds.size() > 0) {
-
 
1046
					Set<CustomRetailer> positionRetailers = fofoIds.stream().map(x->retailerService.getAllFofoRetailers().get(fofoId)).collect(Collectors.toSet());
1047
					model.addAttribute("retailers", gson.toJson(positionRetailers));
1047
					model.addAttribute("retailers", gson.toJson(positionRetailers));
1048
					model.addAttribute("reporticoProjectMap", ReporticoProject.salesReporticoProjectMap);
1048
					model.addAttribute("reporticoProjectMap", ReporticoProject.salesReporticoProjectMap);
1049
					model.addAttribute("warehouses", getWarehouses(positionRetailers));
1049
					model.addAttribute("warehouses", getWarehouses(positionRetailers));
1050
				}
1050
				} else {
1051
				List<Position> warehousePositions = positions.stream()
1051
					List<Position> warehousePositions = positions.stream()
1052
						.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_WAREHOUSE)
1052
							.filter(x -> x.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_WAREHOUSE)
1053
						.collect(Collectors.toList());
1053
							.collect(Collectors.toList());
1054
				if (warehousePositions.size() > 0) {
1054
					if (warehousePositions.size() > 0) {
1055
					Set<CustomRetailer> positionRetailers = new HashSet<>();
1055
						Set<CustomRetailer> positionRetailers = new HashSet<>();
1056
					csService.getPositionCustomRetailerMap(warehousePositions).values().forEach(customRetailers -> {
1056
						csService.getPositionCustomRetailerMap(warehousePositions).values().forEach(customRetailers -> {
1057
						positionRetailers.addAll(customRetailers);
1057
							positionRetailers.addAll(customRetailers);
1058
					});
1058
						});
1059
					model.addAttribute("reporticoProjectMap", ReporticoProject.warehouseReporticoMap);
1059
						model.addAttribute("reporticoProjectMap", ReporticoProject.warehouseReporticoMap);
1060
					model.addAttribute("retailers", gson.toJson(positionRetailers));
1060
						model.addAttribute("retailers", gson.toJson(positionRetailers));
1061
					model.addAttribute("warehouses", getWarehouses(positionRetailers));
1061
						model.addAttribute("warehouses", getWarehouses(positionRetailers));
-
 
1062
					}
1062
				}
1063
				}
1063
				model.addAttribute("authId", authUser.getId());
1064
				model.addAttribute("authId", authUser.getId());
1064
 
1065
 
1065
			}
-
 
1066
			model.addAttribute("rctPartneStat", rctPartneStat);
1066
			model.addAttribute("rctPartneStat", rctPartneStat);
1067
 
1067
 
1068
			model.addAttribute("reporticoDate", rctSaholic);
1068
			model.addAttribute("reporticoDate", rctSaholic);
1069
			model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
1069
			model.addAttribute("warehousePartnerDetailMap", warehousePartnerDetailMap);
1070
			model.addAttribute("warehouseMap", wm);
1070
			model.addAttribute("warehouseMap", wm);