Subversion Repositories SmartDukaan

Rev

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

Rev 30963 Rev 30964
Line 444... Line 444...
444
	@PostMapping(value = "/deactivateStore")
444
	@PostMapping(value = "/deactivateStore")
445
	public String deActivateStore(HttpServletRequest request,
445
	public String deActivateStore(HttpServletRequest request,
446
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
446
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
447
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
447
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
448
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
448
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
-
 
449
		if (!Arrays
449
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
450
				.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
-
 
451
						"rahul.katyal@smartdukaan.com", "tejbeer.kaur@smartdukaan.com")
450
				"tejbeer.kaur@smartdukaan.com").contains(loginDetails.getEmailId())) {
452
				.contains(loginDetails.getEmailId())) {
451
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
453
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
452
					"You are not authorise to deactivate retailer");
454
					"You are not authorise to deactivate retailer");
453
		}
455
		}
454
		fofoStore.setActive(false);
456
		fofoStore.setActive(false);
455
		fofoStoreRepository.persist(fofoStore);
457
		fofoStoreRepository.persist(fofoStore);
Line 461... Line 463...
461
	@PostMapping(value = "/activateStoreForever")
463
	@PostMapping(value = "/activateStoreForever")
462
	public String activateStoreForever(HttpServletRequest request,
464
	public String activateStoreForever(HttpServletRequest request,
463
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
465
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
464
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
466
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
465
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
467
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
466
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com")
468
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
467
				.contains(loginDetails.getEmailId())) {
469
				"rahul.katyal@smartdukaan.com").contains(loginDetails.getEmailId())) {
468
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
470
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
469
					"You are not authorise to activate retailer");
471
					"You are not authorise to activate retailer");
470
		}
472
		}
471
		fofoStore.setActive(true);
473
		fofoStore.setActive(true);
472
		fofoStoreRepository.persist(fofoStore);
474
		fofoStoreRepository.persist(fofoStore);
Line 480... Line 482...
480
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId,
482
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId,
481
			@RequestParam(name = "days", required = true) int days, Model model) throws Exception {
483
			@RequestParam(name = "days", required = true) int days, Model model) throws Exception {
482
 
484
 
483
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
485
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
484
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
486
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
485
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com")
487
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
486
				.contains(loginDetails.getEmailId())) {
488
				"rahul.katyal@smartdukaan.com").contains(loginDetails.getEmailId())) {
487
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
489
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
488
					"You are not authorise to deactivate retailer");
490
					"You are not authorise to deactivate retailer");
489
		}
491
		}
490
 
492
 
491
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();
493
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();