Subversion Repositories SmartDukaan

Rev

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

Rev 30723 Rev 30944
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.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com")
449
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
450
				.contains(loginDetails.getEmailId())) {
450
				"tejbeer.kaur@smartdukaan.com").contains(loginDetails.getEmailId())) {
451
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
451
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
452
					"You are not authorise to deactivate retailer");
452
					"You are not authorise to deactivate retailer");
453
		}
453
		}
454
		fofoStore.setActive(false);
454
		fofoStore.setActive(false);
455
		fofoStoreRepository.persist(fofoStore);
455
		fofoStoreRepository.persist(fofoStore);
Line 461... Line 461...
461
	@PostMapping(value = "/activateStoreForever")
461
	@PostMapping(value = "/activateStoreForever")
462
	public String activateStoreForever(HttpServletRequest request,
462
	public String activateStoreForever(HttpServletRequest request,
463
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
463
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
464
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
464
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
465
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
465
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
466
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
466
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com")
467
				"manish.tiwari@smartdukaan.com").contains(loginDetails.getEmailId())) {
467
				.contains(loginDetails.getEmailId())) {
468
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
468
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
469
					"You are not authorise to activate retailer");
469
					"You are not authorise to activate retailer");
470
		}
470
		}
471
		fofoStore.setActive(true);
471
		fofoStore.setActive(true);
472
		fofoStoreRepository.persist(fofoStore);
472
		fofoStoreRepository.persist(fofoStore);
Line 480... Line 480...
480
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId,
480
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId,
481
			@RequestParam(name = "days", required = true) int days, Model model) throws Exception {
481
			@RequestParam(name = "days", required = true) int days, Model model) throws Exception {
482
 
482
 
483
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
483
		FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
484
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
484
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
485
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com",
485
		if (!Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com", "amit.gupta@smartdukaan.com")
486
				"manish.tiwari@smartdukaan.com").contains(loginDetails.getEmailId())) {
486
				.contains(loginDetails.getEmailId())) {
487
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
487
			throw new ProfitMandiBusinessException("Access Denied", "Unauthorised Access",
488
					"You are not authorise to deactivate retailer");
488
					"You are not authorise to deactivate retailer");
489
		}
489
		}
490
 
490
 
491
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();
491
		LocalDateTime currentDate = LocalDate.now().atStartOfDay();
Line 585... Line 585...
585
 
585
 
586
			size = promoterRepository.selectAllCount();
586
			size = promoterRepository.selectAllCount();
587
 
587
 
588
		}
588
		}
589
		if (!promoterInfo.isEmpty()) {
589
		if (!promoterInfo.isEmpty()) {
590
			List<Integer> partnerIds = new ArrayList<>();
590
			Set<Integer> partnerIds = new HashSet<>();
591
 
591
 
592
			for (Promoter promoterdetail : promoterInfo) {
592
			for (Promoter promoterdetail : promoterInfo) {
593
				partnerIds.add(promoterdetail.getRetailerId());
593
				partnerIds.add(promoterdetail.getRetailerId());
594
			}
594
			}
595
			Map<Integer, CustomRetailer> partnersMap = null;
595
			Map<Integer, CustomRetailer> partnersMap = null;