Subversion Repositories SmartDukaan

Rev

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

Rev 28434 Rev 28435
Line 30... Line 30...
30
import java.util.stream.Collectors;
30
import java.util.stream.Collectors;
31
 
31
 
32
import javax.servlet.http.HttpServletRequest;
32
import javax.servlet.http.HttpServletRequest;
33
import javax.transaction.Transactional;
33
import javax.transaction.Transactional;
34
 
34
 
-
 
35
import org.apache.commons.collections4.OrderedMap;
35
import org.apache.logging.log4j.LogManager;
36
import org.apache.logging.log4j.LogManager;
36
import org.apache.logging.log4j.Logger;
37
import org.apache.logging.log4j.Logger;
37
import org.bouncycastle.crypto.tls.HashAlgorithm;
38
import org.bouncycastle.crypto.tls.HashAlgorithm;
38
import org.json.JSONObject;
39
import org.json.JSONObject;
39
import org.springframework.beans.factory.annotation.Autowired;
40
import org.springframework.beans.factory.annotation.Autowired;
Line 883... Line 884...
883
 
884
 
884
			}
885
			}
885
		}
886
		}
886
 
887
 
887
		LOGGER.info("map" + brandMonthValueMap);
888
		LOGGER.info("map" + brandMonthValueMap);
888
		Map<String, List<Double>> brandlistValue = new HashMap<>();
-
 
889
		List<String> brands = new ArrayList<>();
-
 
890
		for (String bwr : brandMonthValueMap.keys()) {
-
 
891
			if (!brands.contains(bwr)) {
-
 
892
				brands.add(bwr);
-
 
893
 
889
 
-
 
890
		List<String> brands = new ArrayList<>();
-
 
891
		brands.add("Accessories");
-
 
892
		brands.add("Oppo");
-
 
893
		brands.add("Vivo");
-
 
894
		brands.add("Samsung");
-
 
895
		brands.add("Realme");
894
			}
896
		brands.add("Mi");
-
 
897
		brands.add("Tecno");
895
		}
898
		brands.add("Itel");
896
		LOGGER.info("brands" + brands);
899
		brands.add("Lava");
-
 
900
		brands.add("Nokia");
-
 
901
		Map<String, List<Double>> sortedBrandValue = new LinkedHashMap<>();
897
 
902
 
898
		for (String brand : brands) {
903
		for (String brand : brands) {
899
			Collection<Map<YearMonth, Double>> coll = brandMonthValueMap.get(brand);
904
			Collection<Map<YearMonth, Double>> coll = brandMonthValueMap.get(brand);
900
			LOGGER.info("coll" + coll);
905
			LOGGER.info("coll" + coll);
901
 
906
 
Line 903... Line 908...
903
			for (Map<YearMonth, Double> col : coll) {
908
			for (Map<YearMonth, Double> col : coll) {
904
 
909
 
905
				valueList.addAll(col.values());
910
				valueList.addAll(col.values());
906
			}
911
			}
907
 
912
 
908
			brandlistValue.put(brand, valueList);
913
			sortedBrandValue.put(brand, valueList);
909
 
914
 
910
		}
915
		}
911
 
916
 
912
		LOGGER.info("brandlistValue" + brandlistValue);
917
		LOGGER.info("sortedBrandValue" + sortedBrandValue);
913
		LinkedHashSet<String> labels = new LinkedHashSet<String>();
918
		LinkedHashSet<String> labels = new LinkedHashSet<String>();
914
		for (Entry<YearMonth, Map<String, Double>> val : sortedMonthValueMap.entrySet()) {
919
		for (Entry<YearMonth, Map<String, Double>> val : sortedMonthValueMap.entrySet()) {
915
			labels.add(val.getKey().format(DateTimeFormatter.ofPattern("MMM''uu")).toString());
920
			labels.add(val.getKey().format(DateTimeFormatter.ofPattern("MMM''uu")).toString());
916
			
-
 
917
			
-
 
918
			
-
 
919
		
921
 
920
		}
922
		}
921
 
923
 
922
		List<String> labelList = new ArrayList<>(labels);
924
		List<String> labelList = new ArrayList<>(labels);
923
		List<Double> lmsValues = new ArrayList<>();
925
		List<Double> lmsValues = new ArrayList<>();
924
		List<DatasetModel> datasets = new ArrayList<>();
926
		List<DatasetModel> datasets = new ArrayList<>();
925
 
-
 
926
		List<String> colorList = new ArrayList<>();
927
		List<String> colorList = new ArrayList<>();
927
 
-
 
-
 
928
		colorList.add("slateblue");
-
 
929
		colorList.add("darkgreen");
928
		colorList.add("darkorange");
930
		colorList.add("darkorange");
929
		colorList.add("#654321");
931
		colorList.add("#654321");
930
		colorList.add("deeppink");
932
		colorList.add("deeppink");
931
		colorList.add("darkgreen");
933
		
932
		colorList.add("darkred");
934
		colorList.add("darkred");
933
		colorList.add("slateblue");
935
		
934
		colorList.add("burlywood");
936
		colorList.add("burlywood");
935
		colorList.add("goldenrod");
937
		colorList.add("goldenrod");
936
		colorList.add("slategray");
938
		colorList.add("slategray");
937
		colorList.add("darkviolet");
939
		colorList.add("darkviolet");
938
		colorList.add("cornsilk");
940
		colorList.add("cornsilk");
939
		
-
 
940
		List<String> borderList = new ArrayList<>();
-
 
941
 
941
 
-
 
942
		List<String> borderList = new ArrayList<>();
-
 
943
		borderList.add("lightskyblue");
-
 
944
		borderList.add("green");
942
		borderList.add("orange");
945
		borderList.add("orange");
943
		borderList.add("#DB8C44");
946
		borderList.add("#DB8C44");
944
		borderList.add("pink");
947
		borderList.add("pink");
945
		borderList.add("green");
948
		
946
		borderList.add("red");
949
		borderList.add("red");
947
		borderList.add("lightskyblue");
950
		
948
		borderList.add("slategray");
951
		borderList.add("slategray");
949
		borderList.add("burlywood");
952
		borderList.add("burlywood");
950
		borderList.add("goldenrod");
953
		borderList.add("goldenrod");
951
		borderList.add("darkviolet");
954
		borderList.add("darkviolet");
952
		borderList.add("cornsilk");
955
		borderList.add("cornsilk");
953
 
956
 
954
		int i= 0;
957
		int i = 0;
955
	
958
 
956
		for (Entry<String, List<Double>> brandValue : brandlistValue.entrySet()) {
959
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
957
 
960
 
958
			DatasetModel lineLmsChart = new DatasetModel();
961
			DatasetModel lineLmsChart = new DatasetModel();
959
			lineLmsChart.setLabel(brandValue.getKey());
962
			lineLmsChart.setLabel(brandValue.getKey());
960
			lineLmsChart.setBackgroundColor(borderList.get(i));
963
			lineLmsChart.setBackgroundColor(borderList.get(i));
-
 
964
			if (brandValue.getValue().isEmpty()) {
-
 
965
 
-
 
966
                  lineLmsChart.setData(Arrays.asList(0.0,0.0,0.0,0.0,0.0,0.0));
-
 
967
			} else {
961
			lineLmsChart.setData(brandValue.getValue());
968
				lineLmsChart.setData(brandValue.getValue());
-
 
969
			}
962
			lineLmsChart.setType("line");
970
			lineLmsChart.setType("line");
963
			lineLmsChart.setOrder(1);
971
			lineLmsChart.setOrder(1);
964
			lineLmsChart.setFill("false");
972
			lineLmsChart.setFill("false");
965
			lineLmsChart.setBorderColor(colorList.get(i));
973
			lineLmsChart.setBorderColor(colorList.get(i));
966
			datasets.add(lineLmsChart);
974
			datasets.add(lineLmsChart);
967
		
975
 
968
			i++;
976
			i++;
969
		}
977
		}
970
 
978
 
971
		DataModel dm = new DataModel();
979
		DataModel dm = new DataModel();
972
		dm.setDatasets(datasets);
980
		dm.setDatasets(datasets);
973
		dm.setLabels(labels);
981
		dm.setLabels(labels);
974
 
982
 
975
		LegendModel lm = new LegendModel();
983
		LegendModel lm = new LegendModel();
976
		lm.setPosition("top");
984
		lm.setPosition("top");
977
		
985
 
978
		Tooltips tooltips = new Tooltips();
986
		Tooltips tooltips = new Tooltips();
979
		tooltips.setBodyFontSize(15);
987
		tooltips.setBodyFontSize(15);
980
		tooltips.setTitleFontSize(15);
988
		tooltips.setTitleFontSize(15);
981
		tooltips.setMode("index");
989
		tooltips.setMode("index");
982
		tooltips.setIntersect(false);
990
		tooltips.setIntersect(false);
983
		
991
 
984
		HoverModel hover = new HoverModel();
992
		HoverModel hover = new HoverModel();
985
		hover.setIntersect(false);
993
		hover.setIntersect(false);
986
		hover.setMode("index");
994
		hover.setMode("index");
987
		
-
 
988
		
995
 
989
		TitleModel tm = new TitleModel();
996
		TitleModel tm = new TitleModel();
990
		tm.setText("Brand Wise LMS");
997
		tm.setText("Brand Wise LMS");
991
		tm.setDisplay(true);
998
		tm.setDisplay(true);
992
		tm.setFontSize(20);
999
		tm.setFontSize(20);
993
        tm.setFontColor("#111");
1000
		tm.setFontColor("#111");
994
		
1001
 
995
        OptionsModel om = new OptionsModel();
1002
		OptionsModel om = new OptionsModel();
996
		om.setResponsive(true);
1003
		om.setResponsive(true);
997
		om.setLegend(lm);
1004
		om.setLegend(lm);
998
		om.setTitle(tm);
1005
		om.setTitle(tm);
999
		om.setTooltips(tooltips);
1006
		om.setTooltips(tooltips);
1000
		om.setHover(hover);
1007
		om.setHover(hover);
Line 1017... Line 1024...
1017
		LOGGER.info("cur Date" + curDate.withDayOfMonth(1));
1024
		LOGGER.info("cur Date" + curDate.withDayOfMonth(1));
1018
 
1025
 
1019
		LOGGER.info("curDateYear" + curDate.with(LocalTime.MAX));
1026
		LOGGER.info("curDateYear" + curDate.with(LocalTime.MAX));
1020
 
1027
 
1021
		Map<String, Double> brandwisesale = fofoOrderItemRepository
1028
		Map<String, Double> brandwisesale = fofoOrderItemRepository
1022
		.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
1029
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
1023
 
1030
 
1024
		LOGGER.info("brandwisesale" + brandwisesale);
1031
		LOGGER.info("brandwisesale" + brandwisesale);
1025
 
1032
 
1026
		Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
1033
		Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
1027
		fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
1034
				fofoId, curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
1028
		brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
1035
		brandwisesale.put("Accessories", accesoriesmtdsale.get(fofoId));
1029
 
1036
 
1030
		Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
1037
		Map<String, Double> activatedImeisWithSellingPriceMTD = fofoOrderRepository
1031
		.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
1038
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId).stream()
1032
		.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
1039
				.collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
1033
 
1040
 
1034
		activatedImeisWithSellingPriceMTD.put("Lava", brandwisesale.get("Lava"));
1041
		activatedImeisWithSellingPriceMTD.put("Lava", brandwisesale.get("Lava"));
1035
 
1042
 
1036
		Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
1043
		Map<String, Double> activatedImeisWithSellingPriceLMTD = fofoOrderRepository
1037
		.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
1044
				.selectValueOfActivatedImeis(curDate.withDayOfMonth(1).minusMonths(1),
1038
		curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
1045
						curDate.with(LocalTime.MAX).minusMonths(1), fofoId)
1039
		.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
1046
				.stream().collect(Collectors.toMap(x -> x.getBrand(), x -> (double) x.getSellingPrice()));
1040
		Map<String, Double> lmtdBrandWiseSale = fofoOrderItemRepository.selectSumAmountGroupByBrand(
1047
		Map<String, Double> lmtdBrandWiseSale = fofoOrderItemRepository.selectSumAmountGroupByBrand(
1041
		curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
1048
				curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
1042
		activatedImeisWithSellingPriceLMTD.put("Lava", lmtdBrandWiseSale.get("Lava"));
1049
		activatedImeisWithSellingPriceLMTD.put("Lava", lmtdBrandWiseSale.get("Lava"));
1043
 
1050
 
1044
		Map<Integer, Double> accesorieslmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
1051
		Map<Integer, Double> accesorieslmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(
1045
		fofoId, curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1),
1052
				fofoId, curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1),
1046
		Optional.of(false));
1053
				Optional.of(false));
1047
 
1054
 
1048
		lmtdBrandWiseSale.put("Accessories", accesorieslmtdsale.get(fofoId));
1055
		lmtdBrandWiseSale.put("Accessories", accesorieslmtdsale.get(fofoId));
1049
 
1056
 
1050
		ChartModel cm = new ChartModel();
1057
		ChartModel cm = new ChartModel();
1051
 
1058
 
1052
		 HashSet<String> labels = new HashSet<String>();
1059
		HashSet<String> labels = new HashSet<String>();
1053
		 labels.addAll(brandwisesale.keySet());
1060
		labels.addAll(brandwisesale.keySet());
1054
		 labels.addAll(lmtdBrandWiseSale.keySet());
1061
		labels.addAll(lmtdBrandWiseSale.keySet());
1055
 
1062
 
1056
		 List<String> labelList = new ArrayList<>(labels);
1063
		List<String> labelList = new ArrayList<>(labels);
1057
 
1064
 
1058
		 List<Double> mtdActivatedImeisValues = new ArrayList<>();
1065
		List<Double> mtdActivatedImeisValues = new ArrayList<>();
1059
 
1066
 
1060
		 List<Double> mtdValues = new ArrayList<>();
1067
		List<Double> mtdValues = new ArrayList<>();
1061
		 List<Double> lmtdUnActivatedImeisValues = new ArrayList<>();
1068
		List<Double> lmtdUnActivatedImeisValues = new ArrayList<>();
1062
		 List<Double> lmtdActivatedImeisValues = new ArrayList<>();
1069
		List<Double> lmtdActivatedImeisValues = new ArrayList<>();
1063
		 List<Double> mtdUnActivatedImeisValues = new ArrayList<>();
1070
		List<Double> mtdUnActivatedImeisValues = new ArrayList<>();
1064
		 List<Double> lmtdValues = new ArrayList<>();
1071
		List<Double> lmtdValues = new ArrayList<>();
1065
		 for (String label : labelList) {
1072
		for (String label : labelList) {
1066
		 mtdActivatedImeisValues.add(activatedImeisWithSellingPriceMTD.get(label) == null ? 0
1073
			mtdActivatedImeisValues.add(activatedImeisWithSellingPriceMTD.get(label) == null ? 0
1067
		 : activatedImeisWithSellingPriceMTD.get(label));
1074
					: activatedImeisWithSellingPriceMTD.get(label));
1068
		 lmtdActivatedImeisValues.add(activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
1075
			lmtdActivatedImeisValues.add(activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
1069
		 : activatedImeisWithSellingPriceLMTD.get(label));
1076
					: activatedImeisWithSellingPriceLMTD.get(label));
1070
 
1077
 
1071
		 mtdValues.add(brandwisesale.get(label) == null ? 0 : brandwisesale.get(label));
1078
			mtdValues.add(brandwisesale.get(label) == null ? 0 : brandwisesale.get(label));
1072
		 if (brandwisesale.get(label) != null) {
1079
			if (brandwisesale.get(label) != null) {
1073
		 mtdUnActivatedImeisValues
1080
				mtdUnActivatedImeisValues
1074
		 .add(brandwisesale.get(label) - (activatedImeisWithSellingPriceMTD.get(label) == null ? 0
1081
						.add(brandwisesale.get(label) - (activatedImeisWithSellingPriceMTD.get(label) == null ? 0
1075
		 : activatedImeisWithSellingPriceMTD.get(label)));
1082
								: activatedImeisWithSellingPriceMTD.get(label)));
1076
		 } else {
1083
			} else {
1077
		 mtdUnActivatedImeisValues.add(0.0);
1084
				mtdUnActivatedImeisValues.add(0.0);
1078
		 }
1085
			}
1079
		 if (lmtdBrandWiseSale.get(label) != null) {
1086
			if (lmtdBrandWiseSale.get(label) != null) {
1080
		 lmtdUnActivatedImeisValues
1087
				lmtdUnActivatedImeisValues
1081
		 .add(lmtdBrandWiseSale.get(label) - (activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
1088
						.add(lmtdBrandWiseSale.get(label) - (activatedImeisWithSellingPriceLMTD.get(label) == null ? 0
1082
		 : activatedImeisWithSellingPriceLMTD.get(label)));
1089
								: activatedImeisWithSellingPriceLMTD.get(label)));
1083
		 } else {
1090
			} else {
1084
		 lmtdUnActivatedImeisValues.add(0.0);
1091
				lmtdUnActivatedImeisValues.add(0.0);
1085
		 }
1092
			}
1086
 
1093
 
1087
		 lmtdValues.add(lmtdBrandWiseSale.get(label) == null ? 0 : lmtdBrandWiseSale.get(label));
1094
			lmtdValues.add(lmtdBrandWiseSale.get(label) == null ? 0 : lmtdBrandWiseSale.get(label));
1088
		 }
1095
		}
1089
		 DatasetModel dsmtotal = new DatasetModel();
1096
		DatasetModel dsmtotal = new DatasetModel();
1090
		 dsmtotal.setLabel("MTD");
1097
		dsmtotal.setLabel("MTD");
1091
		 dsmtotal.setBackgroundColor("blue");
1098
		dsmtotal.setBackgroundColor("blue");
1092
		 dsmtotal.setBorderColor("blue");
1099
		dsmtotal.setBorderColor("blue");
1093
		 dsmtotal.setData(mtdValues);
1100
		dsmtotal.setData(mtdValues);
1094
		 dsmtotal.setStack("stack0");
1101
		dsmtotal.setStack("stack0");
1095
		 dsmtotal.setOrder(1);
1102
		dsmtotal.setOrder(1);
1096
 
1103
 
1097
		 DatasetModel dsmUnactivated = new DatasetModel();
1104
		DatasetModel dsmUnactivated = new DatasetModel();
1098
		 dsmUnactivated.setLabel("MTD Unactivated");
1105
		dsmUnactivated.setLabel("MTD Unactivated");
1099
		 dsmUnactivated.setBackgroundColor("red");
1106
		dsmUnactivated.setBackgroundColor("red");
1100
		 dsmUnactivated.setBorderColor("red");
1107
		dsmUnactivated.setBorderColor("red");
1101
		 dsmUnactivated.setData(mtdUnActivatedImeisValues);
1108
		dsmUnactivated.setData(mtdUnActivatedImeisValues);
1102
		 dsmUnactivated.setStack("stack0");
1109
		dsmUnactivated.setStack("stack0");
1103
		 dsmUnactivated.setOrder(1);
1110
		dsmUnactivated.setOrder(1);
1104
 
1111
 
1105
		 LOGGER.info("mtdValuesMoney" + mtdValues);
1112
		LOGGER.info("mtdValuesMoney" + mtdValues);
1106
 
1113
 
1107
		 DatasetModel mtdActivatedImeis = new DatasetModel();
1114
		DatasetModel mtdActivatedImeis = new DatasetModel();
1108
		 mtdActivatedImeis.setLabel("MTD Activation");
1115
		mtdActivatedImeis.setLabel("MTD Activation");
1109
		 mtdActivatedImeis.setBorderColor("#00008b");
1116
		mtdActivatedImeis.setBorderColor("#00008b");
1110
		 mtdActivatedImeis.setData(mtdActivatedImeisValues);
1117
		mtdActivatedImeis.setData(mtdActivatedImeisValues);
1111
		 mtdActivatedImeis.setBackgroundColor("#00008b");
1118
		mtdActivatedImeis.setBackgroundColor("#00008b");
1112
		 mtdActivatedImeis.setStack("stack0");
1119
		mtdActivatedImeis.setStack("stack0");
1113
		 mtdActivatedImeis.setOrder(1);
1120
		mtdActivatedImeis.setOrder(1);
1114
 
1121
 
1115
		 DatasetModel lmtddsmtotal = new DatasetModel();
1122
		DatasetModel lmtddsmtotal = new DatasetModel();
1116
		 lmtddsmtotal.setLabel("LMTD");
1123
		lmtddsmtotal.setLabel("LMTD");
1117
		 lmtddsmtotal.setBackgroundColor("blue");
1124
		lmtddsmtotal.setBackgroundColor("blue");
1118
		 lmtddsmtotal.setData(lmtdValues);
1125
		lmtddsmtotal.setData(lmtdValues);
1119
		 lmtddsmtotal.setBorderColor("blue");
1126
		lmtddsmtotal.setBorderColor("blue");
1120
		 lmtddsmtotal.setStack("stack1");
1127
		lmtddsmtotal.setStack("stack1");
1121
		 lmtddsmtotal.setOrder(1);
1128
		lmtddsmtotal.setOrder(1);
1122
 
1129
 
1123
		 DatasetModel lmtdUnActivated = new DatasetModel();
1130
		DatasetModel lmtdUnActivated = new DatasetModel();
1124
		 lmtdUnActivated.setLabel("LMTD Unactivation");
1131
		lmtdUnActivated.setLabel("LMTD Unactivation");
1125
		 lmtdUnActivated.setBackgroundColor("red");
1132
		lmtdUnActivated.setBackgroundColor("red");
1126
		 lmtdUnActivated.setBorderColor("red");
1133
		lmtdUnActivated.setBorderColor("red");
1127
		 lmtdUnActivated.setData(lmtdUnActivatedImeisValues);
1134
		lmtdUnActivated.setData(lmtdUnActivatedImeisValues);
1128
		 lmtdUnActivated.setStack("stack1");
1135
		lmtdUnActivated.setStack("stack1");
1129
		 lmtdUnActivated.setOrder(1);
1136
		lmtdUnActivated.setOrder(1);
1130
 
1137
 
1131
		 DatasetModel LmtdActivatedImeis = new DatasetModel();
1138
		DatasetModel LmtdActivatedImeis = new DatasetModel();
1132
		 LmtdActivatedImeis.setLabel("LMTD Activation");
1139
		LmtdActivatedImeis.setLabel("LMTD Activation");
1133
		 LmtdActivatedImeis.setBackgroundColor("#87ceeb");
1140
		LmtdActivatedImeis.setBackgroundColor("#87ceeb");
1134
		 LmtdActivatedImeis.setBorderColor("#87ceeb");
1141
		LmtdActivatedImeis.setBorderColor("#87ceeb");
1135
		 LmtdActivatedImeis.setData(lmtdActivatedImeisValues);
1142
		LmtdActivatedImeis.setData(lmtdActivatedImeisValues);
1136
		 LmtdActivatedImeis.setStack("stack1");
1143
		LmtdActivatedImeis.setStack("stack1");
1137
		 LmtdActivatedImeis.setOrder(1);
1144
		LmtdActivatedImeis.setOrder(1);
1138
 
1145
 
1139
		 DatasetModel linemtdChart = new DatasetModel();
1146
		DatasetModel linemtdChart = new DatasetModel();
1140
		 linemtdChart.setLabel("MTD");
1147
		linemtdChart.setLabel("MTD");
1141
		 linemtdChart.setBackgroundColor("#006400");
1148
		linemtdChart.setBackgroundColor("#006400");
1142
		 linemtdChart.setBorderColor("#006400");
1149
		linemtdChart.setBorderColor("#006400");
1143
		 linemtdChart.setData(mtdValues);
1150
		linemtdChart.setData(mtdValues);
1144
		 linemtdChart.setType("line");
1151
		linemtdChart.setType("line");
1145
		 linemtdChart.setOrder(2);
1152
		linemtdChart.setOrder(2);
1146
		 linemtdChart.setFill("false");
1153
		linemtdChart.setFill("false");
1147
 
1154
 
1148
		 DatasetModel lineLmtdChart = new DatasetModel();
1155
		DatasetModel lineLmtdChart = new DatasetModel();
1149
		 lineLmtdChart.setLabel("LMTD");
1156
		lineLmtdChart.setLabel("LMTD");
1150
		 lineLmtdChart.setBackgroundColor("hotpink");
1157
		lineLmtdChart.setBackgroundColor("hotpink");
1151
		 lineLmtdChart.setBorderColor("hotpink");
1158
		lineLmtdChart.setBorderColor("hotpink");
1152
		 lineLmtdChart.setData(lmtdValues);
1159
		lineLmtdChart.setData(lmtdValues);
1153
		 lineLmtdChart.setType("line");
1160
		lineLmtdChart.setType("line");
1154
		 lineLmtdChart.setOrder(3);
1161
		lineLmtdChart.setOrder(3);
1155
		 lineLmtdChart.setFill("false");
1162
		lineLmtdChart.setFill("false");
1156
 
1163
 
1157
		 List<DatasetModel> datasets = new ArrayList<>();
1164
		List<DatasetModel> datasets = new ArrayList<>();
1158
		 datasets.add(mtdActivatedImeis);
1165
		datasets.add(mtdActivatedImeis);
1159
		 datasets.add(dsmUnactivated);
1166
		datasets.add(dsmUnactivated);
1160
		 datasets.add(LmtdActivatedImeis);
1167
		datasets.add(LmtdActivatedImeis);
1161
		 datasets.add(lmtdUnActivated);
1168
		datasets.add(lmtdUnActivated);
1162
		 datasets.add(linemtdChart);
1169
		datasets.add(linemtdChart);
1163
		 datasets.add(lineLmtdChart);
1170
		datasets.add(lineLmtdChart);
1164
 
1171
 
1165
		 DataModel dm = new DataModel();
1172
		DataModel dm = new DataModel();
1166
		 dm.setDatasets(datasets);
1173
		dm.setDatasets(datasets);
1167
		 dm.setLabels(labels);
1174
		dm.setLabels(labels);
1168
		 
1175
 
1169
		 Tooltips tooltips = new Tooltips();
1176
		Tooltips tooltips = new Tooltips();
1170
			tooltips.setBodyFontSize(10);
1177
		tooltips.setBodyFontSize(10);
1171
			tooltips.setTitleFontSize(10);
1178
		tooltips.setTitleFontSize(10);
1172
			tooltips.setMode("index");
1179
		tooltips.setMode("index");
1173
			tooltips.setIntersect(false);
1180
		tooltips.setIntersect(false);
1174
			
1181
 
1175
			HoverModel hover = new HoverModel();
1182
		HoverModel hover = new HoverModel();
1176
			hover.setIntersect(false);
1183
		hover.setIntersect(false);
1177
			hover.setMode("index");
1184
		hover.setMode("index");
1178
 
1185
 
1179
		 LegendModel lm = new LegendModel();
1186
		LegendModel lm = new LegendModel();
1180
		 lm.setPosition("top");
1187
		lm.setPosition("top");
1181
 
1188
 
1182
		 TitleModel tm = new TitleModel();
1189
		TitleModel tm = new TitleModel();
1183
		 tm.setText("Brand Wise Sales");
1190
		tm.setText("Brand Wise Sales");
1184
		 tm.setDisplay(true);
1191
		tm.setDisplay(true);
1185
		 tm.setFontSize(20);
1192
		tm.setFontSize(20);
1186
	        tm.setFontColor("#111");
1193
		tm.setFontColor("#111");
1187
 
1194
 
1188
		 List<Axis> xAxes = new ArrayList<>();
1195
		List<Axis> xAxes = new ArrayList<>();
1189
		 Axis xAxis = new Axis();
1196
		Axis xAxis = new Axis();
1190
		 xAxis.setStacked(true);
1197
		xAxis.setStacked(true);
1191
		 xAxes.add(xAxis);
1198
		xAxes.add(xAxis);
1192
 
1199
 
1193
		 List<Axis> yAxes = new ArrayList<>();
1200
		List<Axis> yAxes = new ArrayList<>();
1194
		 Axis yAxis = new Axis();
1201
		Axis yAxis = new Axis();
1195
		 yAxis.setStacked(false);
1202
		yAxis.setStacked(false);
1196
		 yAxes.add(yAxis);
1203
		yAxes.add(yAxis);
1197
 
1204
 
1198
		 ScalesModel sm = new ScalesModel();
1205
		ScalesModel sm = new ScalesModel();
1199
		 sm.setxAxes(xAxes);
1206
		sm.setxAxes(xAxes);
1200
 
-
 
1201
		 OptionsModel om = new OptionsModel();
-
 
1202
		 om.setLegend(lm);
-
 
1203
		 om.setTitle(tm);
-
 
1204
		 om.setScales(sm);
-
 
1205
		 om.setHover(hover);
-
 
1206
		 om.setTooltips(tooltips);
-
 
1207
 
-
 
1208
		 cm.setType("bar");
-
 
1209
		 cm.setData(dm);
-
 
1210
		 cm.setOptions(om);
-
 
1211
 
1207
 
-
 
1208
		OptionsModel om = new OptionsModel();
-
 
1209
		om.setLegend(lm);
-
 
1210
		om.setTitle(tm);
1212
		 LOGGER.info("cm" + cm);
1211
		om.setScales(sm);
-
 
1212
		om.setHover(hover);
-
 
1213
		om.setTooltips(tooltips);
-
 
1214
 
-
 
1215
		cm.setType("bar");
-
 
1216
		cm.setData(dm);
-
 
1217
		cm.setOptions(om);
1213
 
1218
 
1214
		 return cm;
1219
		LOGGER.info("cm" + cm);
1215
 
1220
 
1216
		 }
1221
		return cm;
1217
 
1222
 
-
 
1223
	}
1218
 
1224
 
1219
	private String adminPanel(int fofoId, String email, Model model) throws Exception {
1225
	private String adminPanel(int fofoId, String email, Model model) throws Exception {
1220
		List<Menu> menus = null;
1226
		List<Menu> menus = null;
1221
		try {
1227
		try {
1222
			AuthUser authUser = authRepository.selectByEmailOrMobile(email);
1228
			AuthUser authUser = authRepository.selectByEmailOrMobile(email);