Subversion Repositories SmartDukaan

Rev

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

Rev 25797 Rev 25798
Line 39... Line 39...
39
import org.springframework.web.bind.annotation.RequestParam;
39
import org.springframework.web.bind.annotation.RequestParam;
40
 
40
 
41
import com.mongodb.DBObject;
41
import com.mongodb.DBObject;
42
import com.spice.profitmandi.common.enumuration.CounterSize;
42
import com.spice.profitmandi.common.enumuration.CounterSize;
43
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
43
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
44
import com.spice.profitmandi.common.model.BrandStockPrice;
44
import com.spice.profitmandi.common.model.CatalogIdAggregateValue;
45
import com.spice.profitmandi.common.model.CatalogIdAggregateValue;
45
import com.spice.profitmandi.common.model.CatalogListingModel;
46
import com.spice.profitmandi.common.model.CatalogListingModel;
46
import com.spice.profitmandi.common.model.CustomRetailer;
47
import com.spice.profitmandi.common.model.CustomRetailer;
47
import com.spice.profitmandi.common.model.PlannedModel;
48
import com.spice.profitmandi.common.model.PlannedModel;
48
import com.spice.profitmandi.common.model.StockAllocationModel;
49
import com.spice.profitmandi.common.model.StockAllocationModel;
Line 637... Line 638...
637
				Comparator.reverseOrder());
638
				Comparator.reverseOrder());
638
		LOGGER.info("monthlyPlanned" + monthlyPlanned);
639
		LOGGER.info("monthlyPlanned" + monthlyPlanned);
639
		model.addAttribute("catalogTagListings",
640
		model.addAttribute("catalogTagListings",
640
				catalogModelList.stream().sorted(firstCmp).collect(Collectors.toList()));
641
				catalogModelList.stream().sorted(firstCmp).collect(Collectors.toList()));
641
		model.addAttribute("isAdmin", roleManager.isAdmin(roleIds));
642
		model.addAttribute("isAdmin", roleManager.isAdmin(roleIds));
642
		// model.addAttribute("brandStockPrices",this.getBrandStockPrices(loginDetails.getFofoId()));
643
	    model.addAttribute("brandStockPrices",this.getBrandStockPrices(loginDetails.getFofoId()));
643
		model.addAttribute("customRetailers", customRetailers);
644
		model.addAttribute("customRetailers", customRetailers);
644
		model.addAttribute("totalAmount", totalAmount);
645
		model.addAttribute("totalAmount", totalAmount);
645
		model.addAttribute("monthlyPlanned", monthlyPlanned);
646
		model.addAttribute("monthlyPlanned", monthlyPlanned);
646
		model.addAttribute("totalPcs", totalPcs);
647
		model.addAttribute("totalPcs", totalPcs);
647
		return "open-indent";
648
		return "open-indent";
Line 903... Line 904...
903
		focusedModelRepository.deleteById(catalogId);
904
		focusedModelRepository.deleteById(catalogId);
904
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
905
		model.addAttribute("response", mvcResponseSender.createResponseString(true));
905
		return "response";
906
		return "response";
906
	}
907
	}
907
 
908
 
908
	/*
-
 
909
	 * private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws
909
	private List<BrandStockPrice> getBrandStockPrices(int fofoId) throws Exception {
910
	 * Exception { Map<String, BrandStockPrice> brandStockPricesMap =
-
 
911
	 * inventoryService.getBrandWiseStockValue(fofoId);
910
		Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
912
	 * 
911
 
913
	 * List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
912
		List<DBObject> mobileBrands = mongoClient.getMongoBrands(fofoId, "", 3);
914
	 * List<BrandStockPrice> brandStockPrices = new ArrayList<>();
913
		List<BrandStockPrice> brandStockPrices = new ArrayList<>();
915
	 * 
914
 
-
 
915
		mobileBrands.stream().forEach(x -> {
916
	 * mobileBrands.stream().forEach(x -> { String brand = (String) x.get("name");
916
			String brand = (String) x.get("name");
917
	 * if (brandStockPricesMap.containsKey(brand)) { BrandStockPrice brandStockPrice
917
			if (brandStockPricesMap.containsKey(brand)) {
918
	 * = brandStockPricesMap.get(brand); brandStockPrice.setBrandUrl((String)
918
				BrandStockPrice brandStockPrice = brandStockPricesMap.get(brand);
-
 
919
				brandStockPrice.setBrandUrl((String) x.get("url"));
919
	 * x.get("url")); brandStockPrice.setRank(((Double) x.get("rank")).intValue());
920
				brandStockPrice.setRank(((Double) x.get("rank")).intValue());
920
	 * brandStockPrices.add(brandStockPrice); } });
921
				brandStockPrices.add(brandStockPrice);
921
	 * 
922
			}
-
 
923
		});
-
 
924
 
922
	 * return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted((x,
925
		return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted((x, y) -> x.getRank() - y.getRank())
923
	 * y) -> x.getRank() - y.getRank()) .collect(Collectors.toList()); }
926
				.collect(Collectors.toList());
924
	 */
927
	}
925
 
928
 
926
}
929
}
927
930