| Line 3... |
Line 3... |
| 3 |
import java.io.IOException;
|
3 |
import java.io.IOException;
|
| 4 |
import java.util.ArrayList;
|
4 |
import java.util.ArrayList;
|
| 5 |
import java.util.HashMap;
|
5 |
import java.util.HashMap;
|
| 6 |
import java.util.List;
|
6 |
import java.util.List;
|
| 7 |
import java.util.Map;
|
7 |
import java.util.Map;
|
| - |
|
8 |
import java.util.Scanner;
|
| - |
|
9 |
import java.util.stream.Collectors;
|
| 8 |
|
10 |
|
| 9 |
import javax.servlet.http.HttpServletRequest;
|
11 |
import javax.servlet.http.HttpServletRequest;
|
| 10 |
|
12 |
|
| 11 |
import org.apache.http.HttpResponse;
|
13 |
import org.apache.http.HttpResponse;
|
| 12 |
import org.apache.logging.log4j.LogManager;
|
14 |
import org.apache.logging.log4j.LogManager;
|
| Line 24... |
Line 26... |
| 24 |
import org.springframework.web.bind.annotation.RequestMapping;
|
26 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 25 |
import org.springframework.web.bind.annotation.RequestMethod;
|
27 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 26 |
|
28 |
|
| 27 |
import com.spice.profitmandi.common.enumuration.ReporticoProject;
|
29 |
import com.spice.profitmandi.common.enumuration.ReporticoProject;
|
| 28 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
30 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| - |
|
31 |
import com.spice.profitmandi.common.model.ReporticoUrlInfo;
|
| 29 |
import com.spice.profitmandi.common.services.ReporticoService;
|
32 |
import com.spice.profitmandi.common.services.ReporticoService;
|
| 30 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
33 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 31 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
34 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 32 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
35 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
36 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 33 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
37 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
| 34 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
38 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 35 |
import com.spice.profitmandi.web.model.LoginDetails;
|
39 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| 36 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
40 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
| 37 |
|
41 |
|
| Line 42... |
Line 46... |
| 42 |
@Autowired
|
46 |
@Autowired
|
| 43 |
private RoleRepository roleRepository;
|
47 |
private RoleRepository roleRepository;
|
| 44 |
|
48 |
|
| 45 |
@Autowired
|
49 |
@Autowired
|
| 46 |
private CookiesProcessor cookiesProcessor;
|
50 |
private CookiesProcessor cookiesProcessor;
|
| - |
|
51 |
|
| - |
|
52 |
@Autowired
|
| - |
|
53 |
private FofoStoreRepository fofoStoreRepository;
|
| 47 |
|
54 |
|
| 48 |
@Autowired
|
55 |
@Autowired
|
| 49 |
private ReporticoService reporticoService;
|
56 |
private ReporticoService reporticoService;
|
| 50 |
|
57 |
|
| 51 |
@Autowired
|
58 |
@Autowired
|
| Line 104... |
Line 111... |
| 104 |
Map<String, String> reportParams) throws ProfitMandiBusinessException, IOException {
|
111 |
Map<String, String> reportParams) throws ProfitMandiBusinessException, IOException {
|
| 105 |
return reporticoService.getReportFile(projectName, fileName, reportParams);
|
112 |
return reporticoService.getReportFile(projectName, fileName, reportParams);
|
| 106 |
}
|
113 |
}
|
| 107 |
|
114 |
|
| 108 |
@RequestMapping(value = "/reports", method = RequestMethod.GET)
|
115 |
@RequestMapping(value = "/reports", method = RequestMethod.GET)
|
| 109 |
public String reports(Model model) throws ProfitMandiBusinessException, UnsupportedOperationException, IOException {
|
116 |
public String reports(HttpServletRequest httpServletRequest, Model model) throws ProfitMandiBusinessException, UnsupportedOperationException, IOException {
|
| - |
|
117 |
|
| - |
|
118 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(httpServletRequest);
|
| - |
|
119 |
Map<ReporticoProject, List<ReporticoUrlInfo>> returnMap = ReporticoProject.reporticoProjectMap;
|
| - |
|
120 |
if(fofoStoreRepository.getWarehousePartnerMap().get(7720).stream().filter(x->x.getId()==loginDetails.getFofoId()).count() > 0) {
|
| - |
|
121 |
Map<ReporticoProject, List<ReporticoUrlInfo>> returnMap1 = new HashMap<ReporticoProject, List<ReporticoUrlInfo>>();
|
| - |
|
122 |
returnMap1.put(ReporticoProject.FOCO, returnMap.get(ReporticoProject.FOCO));
|
| - |
|
123 |
returnMap1.put(ReporticoProject.FOCOR, returnMap.get(ReporticoProject.FOCOR).stream().skip(1).collect(Collectors.toList()));
|
| - |
|
124 |
}
|
| 110 |
model.addAttribute("reporticoProjectMap", ReporticoProject.reporticoProjectMap);
|
125 |
model.addAttribute("reporticoProjectMap", ReporticoProject.reporticoProjectMap);
|
| - |
|
126 |
|
| 111 |
return "reports";
|
127 |
return "reports";
|
| 112 |
}
|
128 |
}
|
| 113 |
}
|
129 |
}
|