Subversion Repositories SmartDukaan

Rev

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

Rev 27701 Rev 27702
Line 324... Line 324...
324
			model.addAttribute("fofoStore", customRetailer);
324
			model.addAttribute("fofoStore", customRetailer);
325
			model.addAttribute("partnerType", partnerType);
325
			model.addAttribute("partnerType", partnerType);
326
			model.addAttribute("hasGift", hasGift(fofoId));
326
			model.addAttribute("hasGift", hasGift(fofoId));
327
			model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
327
			model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
328
 
328
 
329
			// model.addAttribute("brandStockPrices", this.getBrandStockPrices(fofoId));
329
			model.addAttribute("brandStockPrices", this.getBrandStockPrices(fofoId));
330
			model.addAttribute("salesMap", this.getSales(fofoId));
330
			model.addAttribute("salesMap", this.getSales(fofoId));
331
			model.addAttribute("activatedImeis", inventoryItemRepository.selectCountByActivatedNotSold(fofoId));
331
			model.addAttribute("activatedImeis", inventoryItemRepository.selectCountByActivatedNotSold(fofoId));
332
			// this.setInvestments
332
			// this.setInvestments
333
			//
333
			//
334
			model.addAttribute("investments", this.getInvestments(fofoId));
334
			model.addAttribute("investments", this.getInvestments(fofoId));
Line 497... Line 497...
497
		}
497
		}
498
		return String.valueOf(finalval);
498
		return String.valueOf(finalval);
499
 
499
 
500
	}
500
	}
501
 
501
 
502
	/*
-
 
503
	 * private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws
502
	private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws Exception {
504
	 * Exception { Map<String, BrandStockPrice> brandStockPricesMap =
-
 
505
	 * inventoryService.getBrandWiseStockValue(fofoId);
503
		Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
506
	 * 
504
 
507
	 * List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
505
		List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(3);
508
	 * List<BrandStockPrice> brandStockPrices = new ArrayList<>();
506
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
509
	 * 
507
 
-
 
508
		mobileBrands.stream().forEach(x -> {
510
	 * mobileBrands.stream().forEach(x -> { String brand = (String) x.get("name");
509
			String brand = (String) x.get("name");
511
	 * if (brandStockPricesMap.containsKey(brand)) { BrandStockPrice brandStockPrice
510
			if (brandStockPricesMap.containsKey(brand)) {
512
	 * = brandStockPricesMap.get(brand); brandStockPrice.setBrandUrl((String)
511
				BrandStockPrice brandStockPrice = brandStockPricesMap.get(brand);
-
 
512
				brandStockPrice.setBrandUrl((String) x.get("url"));
513
	 * x.get("url")); brandStockPrice.setRank(((Double) x.get("rank")).intValue());
513
				brandStockPrice.setRank(((Double) x.get("rank")).intValue());
514
	 * brandStockPrices.add(brandStockPrice); } });
514
				brandStockPrices.add(brandStockPrice);
515
	 * 
515
			}
-
 
516
		});
-
 
517
 
516
	 * return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted((x,
518
		return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted((x, y) -> x.getRank() - y.getRank())
517
	 * y) -> x.getRank() - y.getRank()) .collect(Collectors.toList()); }
519
				.collect(Collectors.toList());
518
	 */
520
	}
519
 
521
 
520
	@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
522
	@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
521
	public String dashboard(HttpServletRequest request, Model model) throws Exception {
523
	public String dashboard(HttpServletRequest request, Model model) throws Exception {
522
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
524
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
523
		String email = loginDetails.getEmailId();
525
		String email = loginDetails.getEmailId();
Line 558... Line 560...
558
						.selectSumStockGroupByFofoIdsForMobileOrAccessories(loginDetails.getFofoId(),
560
						.selectSumStockGroupByFofoIdsForMobileOrAccessories(loginDetails.getFofoId(),
559
								Optional.of(false))
561
								Optional.of(false))
560
						.get(loginDetails.getFofoId());
562
						.get(loginDetails.getFofoId());
561
 
563
 
562
				model.addAttribute("accesoriesStock", String.format("%.0f", accesoriesStock));
564
				model.addAttribute("accesoriesStock", String.format("%.0f", accesoriesStock));
563
				// model.addAttribute("brandStockPrices",
-
 
564
				// this.getBrandStockPrices(loginDetails.getFofoId()));
565
				model.addAttribute("brandStockPrices", this.getBrandStockPrices(loginDetails.getFofoId()));
565
				model.addAttribute("salesMap", this.getSales(loginDetails.getFofoId()));
566
				model.addAttribute("salesMap", this.getSales(loginDetails.getFofoId()));
566
				ChartModel cm = this.getBrandChart(loginDetails.getFofoId());
567
				ChartModel cm = this.getBrandChart(loginDetails.getFofoId());
567
 
568
 
568
				LOGGER.info("chartMap" + gson.toJson(cm));
569
				LOGGER.info("chartMap" + gson.toJson(cm));
569
				model.addAttribute("chartMap", gson.toJson(cm));
570
				model.addAttribute("chartMap", gson.toJson(cm));