Subversion Repositories SmartDukaan

Rev

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

Rev 28442 Rev 28443
Line 25... Line 25...
25
import java.util.Map;
25
import java.util.Map;
26
import java.util.Map.Entry;
26
import java.util.Map.Entry;
27
import java.util.Optional;
27
import java.util.Optional;
28
import java.util.Set;
28
import java.util.Set;
29
import java.util.TreeMap;
29
import java.util.TreeMap;
-
 
30
import java.util.stream.Collector;
30
import java.util.stream.Collectors;
31
import java.util.stream.Collectors;
31
 
32
 
32
import javax.servlet.http.HttpServletRequest;
33
import javax.servlet.http.HttpServletRequest;
33
import javax.transaction.Transactional;
34
import javax.transaction.Transactional;
34
 
35
 
Line 111... Line 112...
111
import com.spice.profitmandi.dao.model.InStockBrandModel;
112
import com.spice.profitmandi.dao.model.InStockBrandModel;
112
import com.spice.profitmandi.dao.model.ItemWiseTertiaryModel;
113
import com.spice.profitmandi.dao.model.ItemWiseTertiaryModel;
113
import com.spice.profitmandi.dao.model.MonthSaleModel;
114
import com.spice.profitmandi.dao.model.MonthSaleModel;
114
import com.spice.profitmandi.dao.model.PartnerDetailModel;
115
import com.spice.profitmandi.dao.model.PartnerDetailModel;
115
import com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel;
116
import com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel;
-
 
117
import com.spice.profitmandi.dao.model.PriceDropYearMonthModel;
116
import com.spice.profitmandi.dao.model.SecondaryOrderBilledLmsModel;
118
import com.spice.profitmandi.dao.model.SecondaryOrderBilledLmsModel;
117
import com.spice.profitmandi.dao.model.SimpleCampaign;
119
import com.spice.profitmandi.dao.model.SimpleCampaign;
118
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
120
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
119
import com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel;
121
import com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel;
120
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
122
import com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel;
Line 157... Line 159...
157
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
159
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
158
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
160
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
159
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
161
import com.spice.profitmandi.dao.repository.inventory.SaholicInventoryCISRepository;
160
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
162
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
161
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
163
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
-
 
164
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
162
import com.spice.profitmandi.service.PartnerInvestmentService;
165
import com.spice.profitmandi.service.PartnerInvestmentService;
163
import com.spice.profitmandi.service.PartnerStatsService;
166
import com.spice.profitmandi.service.PartnerStatsService;
164
import com.spice.profitmandi.service.authentication.RoleManager;
167
import com.spice.profitmandi.service.authentication.RoleManager;
165
import com.spice.profitmandi.service.inventory.InventoryService;
168
import com.spice.profitmandi.service.inventory.InventoryService;
166
import com.spice.profitmandi.service.offers.OfferService;
169
import com.spice.profitmandi.service.offers.OfferService;
Line 193... Line 196...
193
 
196
 
194
	@Value("${web.api.port}")
197
	@Value("${web.api.port}")
195
	private int webApiPort;
198
	private int webApiPort;
196
 
199
 
197
	@Autowired
200
	@Autowired
-
 
201
	private PriceDropRepository priceDropRepository;
-
 
202
 
-
 
203
	@Autowired
198
	private CookiesProcessor cookiesProcessor;
204
	private CookiesProcessor cookiesProcessor;
199
 
205
 
200
	@Autowired
206
	@Autowired
201
	private PendingOrderRepository pendingOrderRepository;
207
	private PendingOrderRepository pendingOrderRepository;
202
 
208
 
Line 787... Line 793...
787
		model.addAttribute("chartMap", gson.toJson(cm));
793
		model.addAttribute("chartMap", gson.toJson(cm));
788
 
794
 
789
		return "bar_chart";
795
		return "bar_chart";
790
	}
796
	}
791
 
797
 
-
 
798
	@RequestMapping(value = "/getMonthlyPriceDrop", method = RequestMethod.GET)
-
 
799
	public String getMonthlyPriceDrop(HttpServletRequest request, Model model) throws Exception {
-
 
800
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
-
 
801
		int fofoId = loginDetails.getFofoId();
-
 
802
		ChartModel cm = this.getMonthlyPriceDrop(fofoId);
-
 
803
 
-
 
804
		LOGGER.info("chartMap" + gson.toJson(cm));
-
 
805
		model.addAttribute("chartMap", gson.toJson(cm));
-
 
806
 
-
 
807
		return "price_drop_chart";
-
 
808
	}
-
 
809
 
-
 
810
	private ChartModel getMonthlyPriceDrop(int fofoId) throws ProfitMandiBusinessException {
-
 
811
 
-
 
812
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
-
 
813
 
-
 
814
		LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(20);
-
 
815
 
-
 
816
		List<PriceDropYearMonthModel> priceDropYearMonthModels = priceDropRepository
-
 
817
				.selectBrandPendingPriceDropByYearMonth(fofoId, startOfMonth);
-
 
818
			DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("MM-yyyy");
-
 
819
 
-
 
820
		Map<YearMonth, Map<String, Double>> monthBrandValue = new HashMap<>();
-
 
821
 
-
 
822
		for (PriceDropYearMonthModel priceDropYearMonthModel : priceDropYearMonthModels) {
-
 
823
 
-
 
824
			Map<String, Double> brandValue = new HashMap<>();
-
 
825
			brandValue.put(priceDropYearMonthModel.getBrand(), (double) priceDropYearMonthModel.getAmount());
-
 
826
			monthBrandValue.put(YearMonth.parse(priceDropYearMonthModel.getYearMonth(), dateTimeFormatter), brandValue);
-
 
827
		}
-
 
828
		Map<YearMonth, Map<String, Double>> sortedMonthBrandValue = new TreeMap<>(monthBrandValue);
-
 
829
		List<String> brands = new ArrayList<>();
-
 
830
 
-
 
831
		brands.add("Accessories");
-
 
832
		brands.add("Oppo");
-
 
833
		brands.add("Vivo");
-
 
834
		brands.add("Samsung");
-
 
835
		brands.add("Realme");
-
 
836
		brands.add("Mi");
-
 
837
		brands.add("Tecno");
-
 
838
		brands.add("Itel");
-
 
839
		brands.add("Lava");
-
 
840
		brands.add("Nokia");
-
 
841
		for (int i = 6; i >= 1; i--) {
-
 
842
 
-
 
843
			LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
-
 
844
			Map<String, Double> valbrand = sortedMonthBrandValue.get(YearMonth.from(startMonth));
-
 
845
			for (String brand : brands) {
-
 
846
				if (valbrand != null) {
-
 
847
					if (!valbrand.containsKey(brand)) {
-
 
848
						valbrand.put(brand, 0.0);
-
 
849
					} else {
-
 
850
						valbrand.put(brand, valbrand.get(brand));
-
 
851
					}
-
 
852
 
-
 
853
				} else {
-
 
854
					valbrand = new HashMap<String, Double>();
-
 
855
					valbrand.put(brand, 0.0);
-
 
856
				}
-
 
857
			}
-
 
858
 
-
 
859
			sortedMonthBrandValue.put(YearMonth.from(curDate.withDayOfMonth(1).minusMonths(i)), valbrand);
-
 
860
 
-
 
861
		}
-
 
862
		Multimap<String, Map<YearMonth, Double>> brandMonthValueMap = ArrayListMultimap.create();
-
 
863
 
-
 
864
		for (Entry<YearMonth, Map<String, Double>> month : sortedMonthBrandValue.entrySet()) {
-
 
865
			for (Entry<String, Double> val : month.getValue().entrySet()) {
-
 
866
				Map<YearMonth, Double> yearValue = new HashMap<>();
-
 
867
 
-
 
868
				yearValue.put(month.getKey(), val.getValue() == null ? 0 : val.getValue());
-
 
869
 
-
 
870
				brandMonthValueMap.put(val.getKey(), yearValue);
-
 
871
 
-
 
872
			}
-
 
873
		}
-
 
874
 
-
 
875
		Map<String, List<Double>> sortedBrandValue = new LinkedHashMap<>();
-
 
876
 
-
 
877
		for (String brand : brands) {
-
 
878
			Collection<Map<YearMonth, Double>> coll = brandMonthValueMap.get(brand);
-
 
879
 
-
 
880
			List<Double> valueList = new ArrayList<>();
-
 
881
			for (Map<YearMonth, Double> col : coll) {
-
 
882
 
-
 
883
				valueList.addAll(col.values());
-
 
884
			}
-
 
885
			sortedBrandValue.put(brand, valueList);
-
 
886
		}
-
 
887
		LinkedHashSet<String> labels = new LinkedHashSet<String>();
-
 
888
 
-
 
889
		for (int i = 6; i >= 1; i--) {
-
 
890
 
-
 
891
			LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
-
 
892
			labels.add(startMonth.format(DateTimeFormatter.ofPattern("MMM''uu")).toString());
-
 
893
		}
-
 
894
 
-
 
895
		List<DatasetModel> datasets = new ArrayList<>();
-
 
896
		List<String> colorList = new ArrayList<>();
-
 
897
		colorList.add("papayawhip");
-
 
898
		colorList.add("darkgreen");
-
 
899
		colorList.add("dodgerblue");
-
 
900
		colorList.add("darkblue");
-
 
901
		colorList.add("gold");
-
 
902
 
-
 
903
		colorList.add("coral");
-
 
904
 
-
 
905
		colorList.add("steelblue");
-
 
906
		colorList.add("red");
-
 
907
		colorList.add("crimson");
-
 
908
		colorList.add("midnightblue");
-
 
909
		colorList.add("cornsilk");
-
 
910
 
-
 
911
		List<String> borderList = new ArrayList<>();
-
 
912
		borderList.add("pink");
-
 
913
		borderList.add("mediumseagreen");
-
 
914
		borderList.add("lightblue");
-
 
915
		borderList.add("#0000cd");
-
 
916
		borderList.add("#f7e98e");
-
 
917
 
-
 
918
		borderList.add("#ff8c69");
-
 
919
 
-
 
920
		borderList.add("#0000cd");
-
 
921
		borderList.add("lightsalmon");
-
 
922
		borderList.add("lightsalmon");
-
 
923
		borderList.add("#0000cd");
-
 
924
		borderList.add("cornsilk");
-
 
925
 
-
 
926
		int i = 0;
-
 
927
 
-
 
928
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
-
 
929
 
-
 
930
			DatasetModel purchaseModel = new DatasetModel();
-
 
931
			purchaseModel.setLabel(brandValue.getKey());
-
 
932
			purchaseModel.setBackgroundColor(colorList.get(i));
-
 
933
			if (brandValue.getValue().isEmpty()) {
-
 
934
 
-
 
935
				purchaseModel.setData(Arrays.asList(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
-
 
936
			} else {
-
 
937
				purchaseModel.setData(brandValue.getValue());
-
 
938
			}
-
 
939
			purchaseModel.setType("line");
-
 
940
			purchaseModel.setOrder(1);
-
 
941
			purchaseModel.setFill("false");
-
 
942
			purchaseModel.setBorderColor(borderList.get(i));
-
 
943
			datasets.add(purchaseModel);
-
 
944
 
-
 
945
			i++;
-
 
946
		}
-
 
947
 
-
 
948
		DataModel dm = new DataModel();
-
 
949
		dm.setDatasets(datasets);
-
 
950
		dm.setLabels(labels);
-
 
951
 
-
 
952
		LegendModel lm = new LegendModel();
-
 
953
		lm.setPosition("top");
-
 
954
 
-
 
955
		Tooltips tooltips = new Tooltips();
-
 
956
		tooltips.setBodyFontSize(15);
-
 
957
		tooltips.setTitleFontSize(15);
-
 
958
		tooltips.setMode("index");
-
 
959
		tooltips.setIntersect(false);
-
 
960
 
-
 
961
		HoverModel hover = new HoverModel();
-
 
962
		hover.setIntersect(false);
-
 
963
		hover.setMode("index");
-
 
964
 
-
 
965
		TitleModel tm = new TitleModel();
-
 
966
		tm.setText("Brand Wise Monthly Price-Drop");
-
 
967
		tm.setDisplay(true);
-
 
968
		tm.setFontSize(20);
-
 
969
		tm.setFontColor("#111");
-
 
970
 
-
 
971
		OptionsModel om = new OptionsModel();
-
 
972
		om.setResponsive(true);
-
 
973
		om.setLegend(lm);
-
 
974
		om.setTitle(tm);
-
 
975
		om.setTooltips(tooltips);
-
 
976
		om.setHover(hover);
-
 
977
 
-
 
978
		ChartModel cm = new ChartModel();
-
 
979
 
-
 
980
		cm.setType("line");
-
 
981
		cm.setData(dm);
-
 
982
		cm.setOptions(om);
-
 
983
 
-
 
984
		LOGGER.info("cm" + cm);
-
 
985
 
-
 
986
		return cm;
-
 
987
	}
-
 
988
 
792
	private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
989
	private ChartInvestmentModel getInvestmentChart(int fofoId) throws ProfitMandiBusinessException {
793
		PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
990
		PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
794
 
991
 
795
		Map<String, Float> investmentWalletAmount = new HashMap<>();
992
		Map<String, Float> investmentWalletAmount = new HashMap<>();
796
		investmentWalletAmount.put("Wallet", investment.getWalletAmount());
993
		investmentWalletAmount.put("Wallet", investment.getWalletAmount());
Line 877... Line 1074...
877
		LOGGER.info("soblms" + soblms);
1074
		LOGGER.info("soblms" + soblms);
878
		Map<String, Map<YearMonth, Double>> brandMonthValueMap = new HashMap<>();
1075
		Map<String, Map<YearMonth, Double>> brandMonthValueMap = new HashMap<>();
879
		for (SecondaryOrderBilledLmsModel orderBilledLmsMode : soblms) {
1076
		for (SecondaryOrderBilledLmsModel orderBilledLmsMode : soblms) {
880
			Map<YearMonth, Double> yearMonthMap = new HashMap<>();
1077
			Map<YearMonth, Double> yearMonthMap = new HashMap<>();
881
			yearMonthMap.put(YearMonth.from(startOfMonth), (double) orderBilledLmsMode.getFirstMonthValue());
1078
			yearMonthMap.put(YearMonth.from(startOfMonth), (double) orderBilledLmsMode.getFirstMonthValue());
882
			yearMonthMap.put(YearMonth.from(startOfMonth.minusNanos(1)),
1079
			yearMonthMap.put(YearMonth.from(startOfMonth.minusMonths(1)),
883
					(double) orderBilledLmsMode.getSecondMonthValue());
1080
					(double) orderBilledLmsMode.getSecondMonthValue());
884
 
1081
 
885
			yearMonthMap.put(YearMonth.from(startOfMonth.minusMonths(2)),
1082
			yearMonthMap.put(YearMonth.from(startOfMonth.minusMonths(2)),
886
					(double) orderBilledLmsMode.getThirdMonthValue());
1083
					(double) orderBilledLmsMode.getThirdMonthValue());
887
			yearMonthMap.put(YearMonth.from(startOfMonth.minusMonths(3)),
1084
			yearMonthMap.put(YearMonth.from(startOfMonth.minusMonths(3)),
Line 920... Line 1117...
920
			}
1117
			}
921
			sortedBrandValue.put(brand, valueList);
1118
			sortedBrandValue.put(brand, valueList);
922
 
1119
 
923
		}
1120
		}
924
		LinkedHashSet<String> labels = new LinkedHashSet<String>();
1121
		LinkedHashSet<String> labels = new LinkedHashSet<String>();
925
		
1122
 
926
		for (int i = 6; i >= 1; i--) {
1123
		for (int i = 6; i >= 1; i--) {
927
 
1124
 
928
			LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
1125
			LocalDateTime startMonth = curDate.withDayOfMonth(1).minusMonths(i);
929
			labels.add(startMonth.format(DateTimeFormatter.ofPattern("MMM''uu")).toString());
1126
			labels.add(startMonth.format(DateTimeFormatter.ofPattern("MMM''uu")).toString());
930
 
1127
 
931
			LOGGER.info("labels" + labels);
1128
			LOGGER.info("labels" + labels);
932
		}
1129
		}
933
 
1130
 
934
		LOGGER.info("labels" + labels);
1131
		LOGGER.info("labels" + labels);
935
	
1132
 
936
		LOGGER.info("sortedBrandValue" + sortedBrandValue);
1133
		LOGGER.info("sortedBrandValue" + sortedBrandValue);
937
		List<DatasetModel> datasets = new ArrayList<>();
1134
		List<DatasetModel> datasets = new ArrayList<>();
938
		List<String> colorList = new ArrayList<>();
1135
		List<String> colorList = new ArrayList<>();
939
		colorList.add("slateblue");
1136
		colorList.add("papayawhip");
940
		colorList.add("darkgreen");
1137
		colorList.add("darkgreen");
941
		colorList.add("darkorange");
1138
		colorList.add("dodgerblue");
942
		colorList.add("#654321");
1139
		colorList.add("darkblue");
943
		colorList.add("deeppink");
1140
		colorList.add("gold");
944
 
1141
 
945
		colorList.add("darkred");
1142
		colorList.add("coral");
946
 
1143
 
947
		colorList.add("burlywood");
1144
		colorList.add("steelblue");
948
		colorList.add("goldenrod");
1145
		colorList.add("red");
949
		colorList.add("slategray");
1146
		colorList.add("crimson");
950
		colorList.add("darkviolet");
1147
		colorList.add("midnightblue");
951
		colorList.add("cornsilk");
1148
		colorList.add("cornsilk");
952
 
1149
 
953
		List<String> borderList = new ArrayList<>();
1150
		List<String> borderList = new ArrayList<>();
954
		borderList.add("lightskyblue");
-
 
955
		borderList.add("green");
-
 
956
		borderList.add("orange");
-
 
957
		borderList.add("#DB8C44");
-
 
958
		borderList.add("pink");
1151
		borderList.add("pink");
-
 
1152
		borderList.add("mediumseagreen");
-
 
1153
		borderList.add("lightblue");
-
 
1154
		borderList.add("#0000cd");
959
		borderList.add("red");
1155
		borderList.add("#f7e98e");
960
 
1156
 
961
		borderList.add("slategray");
1157
		borderList.add("#ff8c69");
-
 
1158
 
962
		borderList.add("burlywood");
1159
		borderList.add("#0000cd");
963
		borderList.add("goldenrod");
1160
		borderList.add("lightsalmon");
964
		borderList.add("darkviolet");
1161
		borderList.add("lightsalmon");
-
 
1162
		borderList.add("#0000cd");
965
		borderList.add("cornsilk");
1163
		borderList.add("cornsilk");
966
 
1164
 
967
		int i = 0;
1165
		int i = 0;
968
 
1166
 
969
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
1167
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
970
 
1168
 
971
			DatasetModel purchaseModel = new DatasetModel();
1169
			DatasetModel purchaseModel = new DatasetModel();
972
			purchaseModel.setLabel(brandValue.getKey());
1170
			purchaseModel.setLabel(brandValue.getKey());
973
			purchaseModel.setBackgroundColor(borderList.get(i));
1171
			purchaseModel.setBackgroundColor(colorList.get(i));
974
			if (brandValue.getValue().isEmpty()) {
1172
			if (brandValue.getValue().isEmpty()) {
975
 
1173
 
976
				purchaseModel.setData(Arrays.asList(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
1174
				purchaseModel.setData(Arrays.asList(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
977
			} else {
1175
			} else {
978
				purchaseModel.setData(brandValue.getValue());
1176
				purchaseModel.setData(brandValue.getValue());
979
			}
1177
			}
980
			purchaseModel.setType("line");
1178
			purchaseModel.setType("line");
981
			purchaseModel.setOrder(1);
1179
			purchaseModel.setOrder(1);
982
			purchaseModel.setFill("false");
1180
			purchaseModel.setFill("false");
983
			purchaseModel.setBorderColor(colorList.get(i));
1181
			purchaseModel.setBorderColor(borderList.get(i));
984
			datasets.add(purchaseModel);
1182
			datasets.add(purchaseModel);
985
 
1183
 
986
			i++;
1184
			i++;
987
		}
1185
		}
988
 
1186
 
Line 1106... Line 1304...
1106
		List<String> labelList = new ArrayList<>(labels);
1304
		List<String> labelList = new ArrayList<>(labels);
1107
		List<Double> lmsValues = new ArrayList<>();
1305
		List<Double> lmsValues = new ArrayList<>();
1108
 
1306
 
1109
		List<DatasetModel> datasets = new ArrayList<>();
1307
		List<DatasetModel> datasets = new ArrayList<>();
1110
		List<String> colorList = new ArrayList<>();
1308
		List<String> colorList = new ArrayList<>();
1111
		colorList.add("slateblue");
1309
		colorList.add("papayawhip");
1112
		colorList.add("darkgreen");
1310
		colorList.add("mediumseagreen");
1113
		colorList.add("darkorange");
1311
		colorList.add("dodgerblue");
1114
		colorList.add("#654321");
1312
		colorList.add("darkblue");
1115
		colorList.add("deeppink");
1313
		colorList.add("gold");
1116
 
1314
 
1117
		colorList.add("darkred");
1315
		colorList.add("coral");
1118
 
1316
 
1119
		colorList.add("burlywood");
1317
		colorList.add("steelblue");
1120
		colorList.add("goldenrod");
1318
		colorList.add("red");
1121
		colorList.add("slategray");
1319
		colorList.add("crimson");
1122
		colorList.add("darkviolet");
1320
		colorList.add("midnightblue");
1123
		colorList.add("cornsilk");
1321
		colorList.add("cornsilk");
1124
 
1322
 
1125
		List<String> borderList = new ArrayList<>();
1323
		List<String> borderList = new ArrayList<>();
1126
		borderList.add("lightskyblue");
-
 
1127
		borderList.add("green");
-
 
1128
		borderList.add("orange");
-
 
1129
		borderList.add("#DB8C44");
-
 
1130
		borderList.add("pink");
1324
		borderList.add("pink");
-
 
1325
		borderList.add("lawngreen");
-
 
1326
		borderList.add("lightblue");
-
 
1327
		borderList.add("#0000cd");
1131
		borderList.add("red");
1328
		borderList.add("#f7e98e");
1132
 
1329
 
1133
		borderList.add("slategray");
1330
		borderList.add("lightcoral");
-
 
1331
 
1134
		borderList.add("burlywood");
1332
		borderList.add("#0000cd");
1135
		borderList.add("goldenrod");
1333
		borderList.add("lightsalmon");
1136
		borderList.add("darkviolet");
1334
		borderList.add("lightsalmon");
-
 
1335
		borderList.add("#0000cd");
1137
		borderList.add("cornsilk");
1336
		borderList.add("cornsilk");
1138
 
1337
 
1139
		int i = 0;
1338
		int i = 0;
1140
 
1339
 
1141
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
1340
		for (Entry<String, List<Double>> brandValue : sortedBrandValue.entrySet()) {
1142
 
1341
 
1143
			DatasetModel lineLmsChart = new DatasetModel();
1342
			DatasetModel lineLmsChart = new DatasetModel();
1144
			lineLmsChart.setLabel(brandValue.getKey());
1343
			lineLmsChart.setLabel(brandValue.getKey());
1145
			lineLmsChart.setBackgroundColor(borderList.get(i));
1344
			lineLmsChart.setBackgroundColor(colorList.get(i));
1146
			if (brandValue.getValue().isEmpty()) {
1345
			if (brandValue.getValue().isEmpty()) {
1147
 
1346
 
1148
				lineLmsChart.setData(Arrays.asList(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
1347
				lineLmsChart.setData(Arrays.asList(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
1149
			} else {
1348
			} else {
1150
				lineLmsChart.setData(brandValue.getValue());
1349
				lineLmsChart.setData(brandValue.getValue());
1151
			}
1350
			}
1152
			lineLmsChart.setType("line");
1351
			lineLmsChart.setType("line");
1153
			lineLmsChart.setOrder(1);
1352
			lineLmsChart.setOrder(1);
1154
			lineLmsChart.setFill("false");
1353
			lineLmsChart.setFill("false");
1155
			lineLmsChart.setBorderColor(colorList.get(i));
1354
			lineLmsChart.setBorderColor(borderList.get(i));
1156
			datasets.add(lineLmsChart);
1355
			datasets.add(lineLmsChart);
1157
 
1356
 
1158
			i++;
1357
			i++;
1159
		}
1358
		}
1160
 
1359