Subversion Repositories SmartDukaan

Rev

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

Rev 31416 Rev 31432
Line 247... Line 247...
247
		try {
247
		try {
248
			String response = mvcResponseSender.createResponseString(this.getPlans(price, itemId));
248
			String response = mvcResponseSender.createResponseString(this.getPlans(price, itemId));
249
			model.addAttribute("response1", response);
249
			model.addAttribute("response1", response);
250
		} catch (Exception e) {
250
		} catch (Exception e) {
251
			// TODO Auto-generated catch block
251
			// TODO Auto-generated catch block
252
			e.printStackTrace();
252
			LOGGER.info(e.getMessage(), e);
253
			throw new ProfitMandiBusinessException("Plans", "Plans API", "Error formatting insurance plans");
253
			throw new ProfitMandiBusinessException("Plans", "Plans API", "Error formatting insurance plans");
254
		}
254
		}
255
 
255
 
256
		return "response";
256
		return "response";
257
	}
257
	}
Line 822... Line 822...
822
		try {
822
		try {
823
			Map<String, List<MobileInsurancePlan>> productDurationPlans = insuranceService.getAllPlans(itemId,
823
			Map<String, List<MobileInsurancePlan>> productDurationPlans = insuranceService.getAllPlans(itemId,
824
					sellingPrice);
824
					sellingPrice);
825
			return productDurationPlans;
825
			return productDurationPlans;
826
		} catch (Exception e) {
826
		} catch (Exception e) {
827
			e.printStackTrace();
827
			LOGGER.info(e, e);
828
			throw new ProfitMandiBusinessException("Fetch Insurance Plans", "Insurance",
828
			throw new ProfitMandiBusinessException("Fetch Insurance Plans", "Insurance",
829
					"Could not fetch insurance Plans");
829
					"Could not fetch insurance Plans");
830
		}
830
		}
831
 
831
 
832
	}
832
	}
Line 1461... Line 1461...
1461
	@RequestMapping(value = "/schemePayoutReport", method = RequestMethod.GET)
1461
	@RequestMapping(value = "/schemePayoutReport", method = RequestMethod.GET)
1462
	public String getSchemePayoutReport(HttpServletRequest request, Model model) throws Exception {
1462
	public String getSchemePayoutReport(HttpServletRequest request, Model model) throws Exception {
1463
		LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
1463
		LoginDetails fofoDetails = cookiesProcessor.getCookiesObject(request);
1464
 
1464
 
1465
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();
1465
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();
1466
		LocalDateTime currentStartMonth = currentDate.minusMonths(3).toLocalDate().atStartOfDay();
1466
		LocalDateTime startDate = currentDate.minusMonths(3).toLocalDate().atStartOfDay();
1467
 
1467
 
1468
		List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
1468
		List<SchemePayoutReportModel> schemePayoutReports = fofoOrderRepository
1469
				.selectSchemePayoutReport(fofoDetails.getFofoId(), currentStartMonth, currentDate);
1469
				.selectSchemePayoutReport(fofoDetails.getFofoId(), startDate, currentDate);
1470
		LOGGER.info("schemePayoutReports {}", schemePayoutReports);
1470
		LOGGER.info("schemePayoutReports {}", schemePayoutReports);
1471
 
1471
 
1472
		model.addAttribute("startDate", currentDate.minusMonths(3).toLocalDate());
1472
		model.addAttribute("startDate", currentDate.minusMonths(3).toLocalDate());
1473
		model.addAttribute("endDate", LocalDate.now());
1473
		model.addAttribute("endDate", LocalDate.now());
1474
		model.addAttribute("schemePayoutReports", schemePayoutReports);
1474
		model.addAttribute("schemePayoutReports", schemePayoutReports);