Subversion Repositories SmartDukaan

Rev

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

Rev 26721 Rev 26748
Line 283... Line 283...
283
		}
283
		}
284
 
284
 
285
	}
285
	}
286
 
286
 
287
	@RequestMapping(value = "/open-indent/confirm", method = RequestMethod.POST)
287
	@RequestMapping(value = "/open-indent/confirm", method = RequestMethod.POST)
288
	public String confirmOpenIndent(HttpServletRequest request, Model model) throws Exception {
288
	public String confirmOpenIndent(HttpServletRequest request,
-
 
289
			@RequestParam(required = false, defaultValue = "0") int fofoId, Model model) throws Exception {
-
 
290
 
-
 
291
		if (fofoId == 0) {
289
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
292
			LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
290
		int fofoId = loginDetails.getFofoId();
293
			fofoId = loginDetails.getFofoId();
-
 
294
		}
291
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
295
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
-
 
296
 
292
		LocalDate currentMonthDate = LocalDate.now();
297
		LocalDate currentMonthDate = LocalDate.now();
293
		MonthlyPlanned monthlyPlanned = null;
298
		MonthlyPlanned monthlyPlanned = null;
294
		if (LocalDate.now().isAfter(LocalDate.now().withDayOfMonth(25))
299
		if (LocalDate.now().isAfter(LocalDate.now().withDayOfMonth(25))
295
				&& LocalDate.now().isBefore(LocalDate.now().plusMonths(1).withDayOfMonth(8))) {
300
				&& LocalDate.now().isBefore(LocalDate.now().plusMonths(1).withDayOfMonth(8))) {
296
			currentMonthDate = LocalDate.now().plusMonths(1).withDayOfMonth(1);
301
			currentMonthDate = LocalDate.now().plusMonths(1).withDayOfMonth(1);
Line 610... Line 615...
610
		LOGGER.info("fofoOrderIds" + fofoOrderIds);
615
		LOGGER.info("fofoOrderIds" + fofoOrderIds);
611
		Map<String, Object> equalsJoinMap = new HashMap<>();
616
		Map<String, Object> equalsJoinMap = new HashMap<>();
612
 
617
 
613
		equalsJoinMap.put("orderId", fofoOrderIds);
618
		equalsJoinMap.put("orderId", fofoOrderIds);
614
		Map<Integer, Integer> last15daysMap = null;
619
		Map<Integer, Integer> last15daysMap = null;
615
		if (!fofoOrderIds.isEmpty()) {
620
		if (fofoOrderIds != null && !fofoOrderIds.isEmpty()) {
616
 
621
 
617
			last15daysMap = itemRepository
622
			last15daysMap = itemRepository
618
					.selectItems(FofoOrderItem.class, "id", "itemId", equalsMap, notEqualsMap, equalsJoinMap,
623
					.selectItems(FofoOrderItem.class, "id", "itemId", equalsMap, notEqualsMap, equalsJoinMap,
619
							notEqualsJoinMap, "quantity")
624
							notEqualsJoinMap, "quantity")
620
					.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));
625
					.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> (int) x.getAggregateValue()));