Subversion Repositories SmartDukaan

Rev

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

Rev 31650 Rev 31852
Line 142... Line 142...
142
	private NotificationService notificationService;
142
	private NotificationService notificationService;
143
 
143
 
144
	@Autowired
144
	@Autowired
145
	private FofoStoreRepository fofoStoreRepository;
145
	private FofoStoreRepository fofoStoreRepository;
146
 
146
 
147
	private static final List<String> SELLINS = Arrays.asList("Base Payout", "Cash Discount", "Upfront Margin");
147
	private static final List<String> SELLINS = Arrays.asList("Base Payout", "Cash Discount", "Upfront Margin", "Modelwise");
148
	private static final List<String> SELLOUTS = Arrays.asList("Tertiary Payout", "Hygiene Payout", "Investment Payout", "Category Payout", "Activation Margin", "Special Support");
148
	private static final List<String> SELLOUTS = Arrays.asList("Tertiary Payout", "Hygiene Payout", "Investment Payout", "Category Payout", "Activation Margin", "Special Support");
149
	private static final List<String> ALL_MARGINS = Arrays.asList(SELLINS, SELLOUTS).stream().flatMap(x -> x.stream()).collect(Collectors.toList());
149
	private static final List<String> ALL_MARGINS = Arrays.asList(SELLINS, SELLOUTS).stream().flatMap(x -> x.stream()).collect(Collectors.toList());
150
 
150
 
151
	@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
151
	@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
152
	public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
152
	public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
Line 495... Line 495...
495
 
495
 
496
		List<PriceDropIMEI> priceDropIMEIsToProcess = priceDropIMEIs.stream()
496
		List<PriceDropIMEI> priceDropIMEIsToProcess = priceDropIMEIs.stream()
497
				.filter(x -> priceDropImeisModel.getUpdatedImeis().contains(x.getImei()))
497
				.filter(x -> priceDropImeisModel.getUpdatedImeis().contains(x.getImei()))
498
				.filter(x -> !x.getStatus().equals(finalStatus)).collect(Collectors.toList());
498
				.filter(x -> !x.getStatus().equals(finalStatus)).collect(Collectors.toList());
499
 
499
 
500
		/*for (PriceDropIMEI priceDropIMEI : priceDropIMEIsToProcess) {
500
        /*for (PriceDropIMEI priceDropIMEI : priceDropIMEIsToProcess) {
501
			priceDropIMEI.setUpdateTimestamp(LocalDateTime.now());
501
			priceDropIMEI.setUpdateTimestamp(LocalDateTime.now());
502
		}*/
502
		}*/
503
 
503
 
504
		if (status.equals(PriceDropImeiStatus.APPROVED)) {
504
		if (status.equals(PriceDropImeiStatus.APPROVED)) {
505
			priceDropService.processPriceDrop(priceDropImeisModel.getPriceDropId(),
505
			priceDropService.processPriceDrop(priceDropImeisModel.getPriceDropId(),
Line 670... Line 670...
670
				summaryModel.setHygienePayout(1);
670
				summaryModel.setHygienePayout(1);
671
			}
671
			}
672
			if (summaryModel.getInvestmentPayout() == 0 && x.getInvestmentPayout() > 0) {
672
			if (summaryModel.getInvestmentPayout() == 0 && x.getInvestmentPayout() > 0) {
673
				summaryModel.setInvestmentPayout(1);
673
				summaryModel.setInvestmentPayout(1);
674
			}
674
			}
-
 
675
			if (summaryModel.getModelWise() == 0 && x.getModelWise() > 0) {
-
 
676
				summaryModel.setModelWise(1);
-
 
677
			}
675
		});
678
		});
676
 
679
 
677
		LOGGER.info("Summary Model {}", summaryModel);
680
		LOGGER.info("Summary Model {}", summaryModel);
678
 
681
 
679
		return summaryModel;
682
		return summaryModel;