| 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;
|
3 |
import java.io.IOException;
|
| 4 |
import java.net.URISyntaxException;
|
4 |
import java.net.URISyntaxException;
|
| 5 |
import java.util.List;
|
- |
|
| 6 |
import java.util.Set;
|
- |
|
| 7 |
|
5 |
|
| 8 |
import javax.servlet.http.HttpServletRequest;
|
6 |
import javax.servlet.http.HttpServletRequest;
|
| 9 |
|
7 |
|
| 10 |
import org.apache.logging.log4j.LogManager;
|
8 |
import org.apache.logging.log4j.LogManager;
|
| 11 |
import org.apache.logging.log4j.Logger;
|
9 |
import org.apache.logging.log4j.Logger;
|
| 12 |
import org.springframework.beans.factory.annotation.Autowired;
|
10 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 13 |
import org.springframework.beans.factory.annotation.Qualifier;
|
- |
|
| 14 |
import org.springframework.beans.factory.annotation.Value;
|
11 |
import org.springframework.beans.factory.annotation.Value;
|
| 15 |
import org.springframework.stereotype.Controller;
|
12 |
import org.springframework.stereotype.Controller;
|
| 16 |
import org.springframework.transaction.annotation.Transactional;
|
13 |
import org.springframework.transaction.annotation.Transactional;
|
| 17 |
import org.springframework.ui.Model;
|
14 |
import org.springframework.ui.Model;
|
| 18 |
import org.springframework.web.bind.annotation.RequestMapping;
|
15 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 19 |
import org.springframework.web.bind.annotation.RequestMethod;
|
16 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 20 |
|
17 |
|
| 21 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
18 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 22 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
- |
|
| 23 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
19 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 24 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
- |
|
| 25 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
20 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 26 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
21 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 27 |
import com.spice.profitmandi.web.model.LoginDetails;
|
22 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| 28 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
23 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
| 29 |
import com.spice.profitmandi.web.util.RoleManager;
|
- |
|
| 30 |
|
24 |
|
| 31 |
@Controller
|
25 |
@Controller
|
| 32 |
@Transactional(rollbackFor = Throwable.class)
|
26 |
@Transactional(rollbackFor = Throwable.class)
|
| 33 |
public class DashboardController {
|
27 |
public class DashboardController {
|
| 34 |
|
28 |
|
| Line 57... |
Line 51... |
| 57 |
try {
|
51 |
try {
|
| 58 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
52 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
| 59 |
} catch (ProfitMandiBusinessException e) {
|
53 |
} catch (ProfitMandiBusinessException e) {
|
| 60 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
54 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
| 61 |
}
|
55 |
}
|
| 62 |
model.addAttribute("fofoStore", fofoStore);
|
56 |
model.addAttribute("fofoStoreCode", fofoStore != null ? fofoStore.getCode() : null);
|
| 63 |
model.addAttribute("appContextPath", request.getContextPath());
|
57 |
model.addAttribute("appContextPath", request.getContextPath());
|
| 64 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|
58 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|
| 65 |
model.addAttribute("webApiHost", webApiHost);
|
59 |
model.addAttribute("webApiHost", webApiHost);
|
| 66 |
model.addAttribute("webApiPort", webApiPort);
|
60 |
model.addAttribute("webApiPort", webApiPort);
|
| 67 |
//LOGGER.info("loginDetails.getFofoId()"+loginDetails.getFofoId());
|
61 |
//LOGGER.info("loginDetails.getFofoId()"+loginDetails.getFofoId());
|