Subversion Repositories SmartDukaan

Rev

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

Rev 23379 Rev 23568
Line 1... Line 1...
1
package com.spice.profitmandi.web.controller;
1
package com.spice.profitmandi.web.controller;
2
 
2
 
-
 
3
import java.io.IOException;
-
 
4
import java.net.URISyntaxException;
-
 
5
 
3
import javax.servlet.http.HttpServletRequest;
6
import javax.servlet.http.HttpServletRequest;
4
 
7
 
5
import org.slf4j.Logger;
8
import org.apache.logging.log4j.Logger;
6
import org.slf4j.LoggerFactory;
9
import org.apache.logging.log4j.LogManager;
7
import org.springframework.beans.factory.annotation.Autowired;
10
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.beans.factory.annotation.Value;
11
import org.springframework.beans.factory.annotation.Value;
9
import org.springframework.stereotype.Controller;
12
import org.springframework.stereotype.Controller;
10
import org.springframework.transaction.annotation.Transactional;
13
import org.springframework.transaction.annotation.Transactional;
11
import org.springframework.ui.Model;
14
import org.springframework.ui.Model;
Line 13... Line 16...
13
import org.springframework.web.bind.annotation.RequestMethod;
16
import org.springframework.web.bind.annotation.RequestMethod;
14
 
17
 
15
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
18
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
16
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
19
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
17
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
20
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
-
 
21
import com.spice.profitmandi.service.inventory.InventoryService;
18
import com.spice.profitmandi.web.model.LoginDetails;
22
import com.spice.profitmandi.web.model.LoginDetails;
19
import com.spice.profitmandi.web.util.CookiesProcessor;
23
import com.spice.profitmandi.web.util.CookiesProcessor;
20
 
24
 
21
@Controller
25
@Controller
22
@Transactional(rollbackFor = Throwable.class)
26
@Transactional(rollbackFor = Throwable.class)
Line 30... Line 34...
30
 
34
 
31
	@Autowired
35
	@Autowired
32
	private CookiesProcessor cookiesProcessor;
36
	private CookiesProcessor cookiesProcessor;
33
	
37
	
34
	@Autowired
38
	@Autowired
-
 
39
	private InventoryService inventoryService;
-
 
40
	@Autowired
35
	private FofoStoreRepository fofoStoreRepository;
41
	private FofoStoreRepository fofoStoreRepository;
36
	
42
	
37
	private static final Logger LOGGER = LoggerFactory.getLogger(DashboardController.class);
43
	private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
38
	
44
	
39
	@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
45
	@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
40
	public String dashboard(HttpServletRequest request, Model model) throws ProfitMandiBusinessException{
46
	public String dashboard(HttpServletRequest request, Model model) throws ProfitMandiBusinessException, URISyntaxException, IOException{
41
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
47
		LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
42
		
48
		
43
		FofoStore fofoStore = null;
49
		FofoStore fofoStore = null;
44
		try {
50
		try {
45
			fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
51
			fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
Line 49... Line 55...
49
		model.addAttribute("fofoStoreCode", fofoStore != null ? fofoStore.getCode() : null);
55
		model.addAttribute("fofoStoreCode", fofoStore != null ? fofoStore.getCode() : null);
50
		model.addAttribute("appContextPath", request.getContextPath());
56
		model.addAttribute("appContextPath", request.getContextPath());
51
		model.addAttribute("roleTypes", loginDetails.getRoleTypes());
57
		model.addAttribute("roleTypes", loginDetails.getRoleTypes());
52
		model.addAttribute("webApiHost", webApiHost);
58
		model.addAttribute("webApiHost", webApiHost);
53
		model.addAttribute("webApiPort", webApiPort);
59
		model.addAttribute("webApiPort", webApiPort);
-
 
60
		//LOGGER.info("loginDetails.getFofoId()"+loginDetails.getFofoId());
-
 
61
		//inventoryService.prebookingAvailabilitySendMessage(loginDetails.getFofoId());
54
		return "dashboard";
62
		return "dashboard";
55
	}
63
	}
56
	
64
	
57
	
65
	
58
	@RequestMapping(value = "/contactUs", method = RequestMethod.GET)
66
	@RequestMapping(value = "/contactUs", method = RequestMethod.GET)