| Line 13... |
Line 13... |
| 13 |
import org.springframework.stereotype.Controller;
|
13 |
import org.springframework.stereotype.Controller;
|
| 14 |
import org.springframework.transaction.annotation.Transactional;
|
14 |
import org.springframework.transaction.annotation.Transactional;
|
| 15 |
import org.springframework.ui.Model;
|
15 |
import org.springframework.ui.Model;
|
| 16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
16 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
17 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| - |
|
18 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 18 |
|
19 |
|
| 19 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
20 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| - |
|
21 |
import com.spice.profitmandi.dao.entity.dtr.NotificationData;
|
| 20 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
22 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 21 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
23 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 22 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
24 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
25 |
import com.spice.profitmandi.dao.repository.dtr.NotificationPanelRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseReturnItemRepository;
|
26 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseReturnItemRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
27 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 25 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
28 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 26 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
29 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 27 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
30 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| Line 64... |
Line 67... |
| 64 |
@Autowired
|
67 |
@Autowired
|
| 65 |
private OrderRepository orderRepository;
|
68 |
private OrderRepository orderRepository;
|
| 66 |
|
69 |
|
| 67 |
@Autowired
|
70 |
@Autowired
|
| 68 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
71 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
| 69 |
|
72 |
|
| 70 |
/*
|
73 |
/*
|
| 71 |
* @Autowired private ScanRepository scanRepository;
|
74 |
* @Autowired private ScanRepository scanRepository;
|
| 72 |
*/
|
75 |
*/
|
| 73 |
|
76 |
|
| 74 |
@Autowired
|
77 |
@Autowired
|
| 75 |
private TransactionService transactionService;
|
78 |
private TransactionService transactionService;
|
| - |
|
79 |
|
| - |
|
80 |
@Autowired
|
| - |
|
81 |
private NotificationPanelRepository notificationPanelRepository;
|
| 76 |
|
82 |
|
| 77 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
83 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
| 78 |
|
84 |
|
| 79 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
85 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
| 80 |
public String dashboard(HttpServletRequest request, Model model)
|
86 |
public String dashboard(HttpServletRequest request,@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| - |
|
87 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
| 81 |
throws ProfitMandiBusinessException, URISyntaxException, IOException {
|
88 |
throws ProfitMandiBusinessException, URISyntaxException, IOException {
|
| 82 |
// LOGGER.info("scanRepository.selectScansByInventoryItemId(1)",
|
89 |
// LOGGER.info("scanRepository.selectScansByInventoryItemId(1)",
|
| 83 |
// scanRepository.selectScansByInventoryItemId(1));
|
90 |
// scanRepository.selectScansByInventoryItemId(1));
|
| 84 |
LOGGER.info("In Dashboard");
|
91 |
LOGGER.info("In Dashboard");
|
| 85 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
92 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| Line 137... |
Line 144... |
| 137 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|
144 |
model.addAttribute("isAdmin", roleManager.isAdmin(loginDetails.getRoleIds()));
|
| 138 |
model.addAttribute("webApiHost", webApiHost);
|
145 |
model.addAttribute("webApiHost", webApiHost);
|
| 139 |
model.addAttribute("webApiPort", webApiPort);
|
146 |
model.addAttribute("webApiPort", webApiPort);
|
| 140 |
model.addAttribute("webApiScheme", webApiScheme);
|
147 |
model.addAttribute("webApiScheme", webApiScheme);
|
| 141 |
model.addAttribute("webApiRoot", webApiRoot);
|
148 |
model.addAttribute("webApiRoot", webApiRoot);
|
| - |
|
149 |
|
| - |
|
150 |
List<NotificationData> notificationData = null;
|
| - |
|
151 |
long size = 0;
|
| - |
|
152 |
|
| - |
|
153 |
notificationData = notificationPanelRepository.selectAllNotificationData(offset, limit);
|
| - |
|
154 |
size = notificationPanelRepository.selectAllCount();
|
| - |
|
155 |
LOGGER.info("notification_data {}", notificationData);
|
| - |
|
156 |
|
| - |
|
157 |
LOGGER.info("notification_data {}",size);
|
| - |
|
158 |
|
| - |
|
159 |
|
| - |
|
160 |
if (!notificationData.isEmpty()) {
|
| - |
|
161 |
|
| - |
|
162 |
model.addAttribute("notificationData",notificationData);
|
| - |
|
163 |
LOGGER.info("notificationdata", notificationData);
|
| - |
|
164 |
model.addAttribute("start", offset + 1);
|
| - |
|
165 |
model.addAttribute("size", size);
|
| - |
|
166 |
model.addAttribute("url", "/getPaginatedNotificationData");
|
| - |
|
167 |
|
| - |
|
168 |
LOGGER.info("start {}",offset+1);
|
| - |
|
169 |
LOGGER.info("SIZE {}",size);
|
| - |
|
170 |
|
| - |
|
171 |
|
| - |
|
172 |
|
| - |
|
173 |
if (notificationData.size() < limit) {
|
| - |
|
174 |
model.addAttribute("end", offset + notificationData.size());
|
| - |
|
175 |
LOGGER.info("SIZE2 {}", offset + notificationData.size());
|
| - |
|
176 |
} else {
|
| - |
|
177 |
model.addAttribute("end", offset + limit);
|
| - |
|
178 |
|
| - |
|
179 |
LOGGER.info("end {}",size);
|
| - |
|
180 |
|
| - |
|
181 |
|
| - |
|
182 |
}
|
| - |
|
183 |
|
| - |
|
184 |
|
| - |
|
185 |
} else {
|
| - |
|
186 |
|
| - |
|
187 |
model.addAttribute("notificationData", notificationData);
|
| - |
|
188 |
model.addAttribute("size", size);
|
| - |
|
189 |
LOGGER.info("sizeOriginal {}",size);
|
| - |
|
190 |
|
| - |
|
191 |
}
|
| 142 |
// LOGGER.info("loginDetails.getFofoId()"+loginDetails.getFofoId());
|
192 |
// LOGGER.info("loginDetails.getFofoId()"+loginDetails.getFofoId());
|
| 143 |
// inventoryService.prebookingAvailabilitySendMessage(loginDetails.getFofoId());
|
193 |
// inventoryService.prebookingAvailabilitySendMessage(loginDetails.getFofoId());
|
| 144 |
return "dashboard";
|
194 |
return "dashboard";
|
| 145 |
}
|
195 |
}
|
| 146 |
|
196 |
|
| - |
|
197 |
|
| - |
|
198 |
@RequestMapping(value = "/getPaginatedNotificationData", method = RequestMethod.GET)
|
| - |
|
199 |
public String getPaginatedNotificationData(HttpServletRequest request,
|
| - |
|
200 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| - |
|
201 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model) throws Exception {
|
| - |
|
202 |
List<NotificationData> notificationData = null;
|
| - |
|
203 |
|
| - |
|
204 |
notificationData = notificationPanelRepository.selectAllNotificationData(offset, limit);
|
| - |
|
205 |
|
| - |
|
206 |
LOGGER.info("notification_data {}", notificationData);
|
| - |
|
207 |
|
| - |
|
208 |
|
| - |
|
209 |
if (!notificationData.isEmpty()) {
|
| - |
|
210 |
|
| - |
|
211 |
model.addAttribute("notificationData",notificationData);
|
| - |
|
212 |
model.addAttribute("url", "/getPaginatedNotificationData");
|
| - |
|
213 |
|
| - |
|
214 |
} else {
|
| - |
|
215 |
model.addAttribute("notificationData", notificationData);
|
| - |
|
216 |
|
| - |
|
217 |
}
|
| - |
|
218 |
|
| - |
|
219 |
return "dashboard-paginated";
|
| - |
|
220 |
}
|
| 147 |
@RequestMapping(value = "/contactUs", method = RequestMethod.GET)
|
221 |
@RequestMapping(value = "/contactUs", method = RequestMethod.GET)
|
| 148 |
public String contactUs(HttpServletRequest request, Model model) throws Throwable {
|
222 |
public String contactUs(HttpServletRequest request, Model model) throws Throwable {
|
| 149 |
model.addAttribute("appContextPath", request.getContextPath());
|
223 |
model.addAttribute("appContextPath", request.getContextPath());
|
| 150 |
return "contact-us";
|
224 |
return "contact-us";
|
| 151 |
}
|
225 |
}
|