| Line 20... |
Line 20... |
| 20 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
20 |
import com.spice.profitmandi.dao.entity.fofo.LiveDemoSerialNumber;
|
| 21 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
21 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 22 |
import com.spice.profitmandi.dao.entity.user.Address;
|
22 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 23 |
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
|
23 |
import com.spice.profitmandi.dao.enumuration.catalog.ByPassRequestStatus;
|
| 24 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
24 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| - |
|
25 |
import com.spice.profitmandi.dao.enumuration.inventory.CatalogMovingEnum;
|
| 25 |
import com.spice.profitmandi.dao.model.*;
|
26 |
import com.spice.profitmandi.dao.model.*;
|
| 26 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
27 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
28 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 28 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
29 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 29 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
30 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| Line 37... |
Line 38... |
| 37 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
38 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
39 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.warehouse.WarehousePurchaseOrderRepository;
|
40 |
import com.spice.profitmandi.dao.repository.warehouse.WarehousePurchaseOrderRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
|
41 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
|
| 41 |
import com.spice.profitmandi.service.NotificationService;
|
42 |
import com.spice.profitmandi.service.NotificationService;
|
| - |
|
43 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
| 42 |
import com.spice.profitmandi.service.inventory.Combo;
|
44 |
import com.spice.profitmandi.service.inventory.Combo;
|
| 43 |
import com.spice.profitmandi.service.inventory.ComboOptionModel;
|
45 |
import com.spice.profitmandi.service.inventory.ComboOptionModel;
|
| 44 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
46 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 45 |
import com.spice.profitmandi.service.inventory.MappedComboModel;
|
47 |
import com.spice.profitmandi.service.inventory.MappedComboModel;
|
| 46 |
import com.spice.profitmandi.service.order.OrderService;
|
48 |
import com.spice.profitmandi.service.order.OrderService;
|
| Line 129... |
Line 131... |
| 129 |
|
131 |
|
| 130 |
@Autowired
|
132 |
@Autowired
|
| 131 |
private ItemRepository itemRepository;
|
133 |
private ItemRepository itemRepository;
|
| 132 |
|
134 |
|
| 133 |
@Autowired
|
135 |
@Autowired
|
| - |
|
136 |
BrandsService brandsService;
|
| - |
|
137 |
|
| - |
|
138 |
@Autowired
|
| 134 |
private Gson gson;
|
139 |
private Gson gson;
|
| 135 |
|
140 |
|
| 136 |
@Autowired
|
141 |
@Autowired
|
| 137 |
private RetailerService retailerService;
|
142 |
private RetailerService retailerService;
|
| 138 |
|
143 |
|
| Line 198... |
Line 203... |
| 198 |
@Autowired
|
203 |
@Autowired
|
| 199 |
private CsService csService;
|
204 |
private CsService csService;
|
| 200 |
|
205 |
|
| 201 |
@Autowired
|
206 |
@Autowired
|
| 202 |
AuthRepository authRepository;
|
207 |
AuthRepository authRepository;
|
| - |
|
208 |
@Autowired
|
| - |
|
209 |
private CategorisedCatalogRepository categorisedCatalogRepository;
|
| 203 |
|
210 |
|
| 204 |
@Autowired
|
211 |
@Autowired
|
| 205 |
PositionRepository positionRepository;
|
212 |
PositionRepository positionRepository;
|
| 206 |
|
213 |
|
| 207 |
@Autowired
|
214 |
@Autowired
|
| Line 228... |
Line 235... |
| 228 |
@Autowired
|
235 |
@Autowired
|
| 229 |
private AddressRepository addressRepository;
|
236 |
private AddressRepository addressRepository;
|
| 230 |
|
237 |
|
| 231 |
@Autowired
|
238 |
@Autowired
|
| 232 |
private CustomerOfferRepository customerOfferRepository;
|
239 |
private CustomerOfferRepository customerOfferRepository;
|
| - |
|
240 |
@Autowired
|
| - |
|
241 |
private CatalogRepository catalogRepository;
|
| 233 |
|
242 |
|
| 234 |
@Autowired
|
243 |
@Autowired
|
| 235 |
private CustomerOfferItemRepository customerOfferItemRepository;
|
244 |
private CustomerOfferItemRepository customerOfferItemRepository;
|
| 236 |
|
245 |
|
| 237 |
@RequestMapping(value = "/getCurrentInventorySnapshot")
|
246 |
@RequestMapping(value = "/getCurrentInventorySnapshot")
|
| Line 280... |
Line 289... |
| 280 |
model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
|
289 |
model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
|
| 281 |
|
290 |
|
| 282 |
return "catalog";
|
291 |
return "catalog";
|
| 283 |
}
|
292 |
}
|
| 284 |
|
293 |
|
| - |
|
294 |
@RequestMapping(value = "/getCategorisedCatalog", method = RequestMethod.GET)
|
| - |
|
295 |
public String getCategorisedCatalog(HttpServletRequest request, Model model) throws Exception {
|
| - |
|
296 |
List<String> brands = brandsService.getBrandsToDisplay(3).stream().map(x -> x.getName()).collect(Collectors.toList());
|
| - |
|
297 |
model.addAttribute("brands", brands);
|
| - |
|
298 |
|
| - |
|
299 |
return "catagorised-catalog";
|
| - |
|
300 |
|
| - |
|
301 |
}
|
| - |
|
302 |
|
| - |
|
303 |
@RequestMapping(value = "/getCatalogMovementByBrand", method = RequestMethod.GET)
|
| - |
|
304 |
public String getCatalogMovementByBrand(HttpServletRequest request, Model model, @RequestParam String brand) throws Exception {
|
| - |
|
305 |
|
| - |
|
306 |
List<CategorisedCatalogListModel> categorisedCatalogListModels = categorisedCatalogRepository.getBrandWiseCatalogMovement(brand);
|
| - |
|
307 |
|
| - |
|
308 |
List<Catalog> catalogs = catalogRepository.selectAllByBrand(brand, ProfitMandiConstants.MOBILE_CATEGORY_ID);
|
| - |
|
309 |
|
| - |
|
310 |
List<CatalogMovingEnum> catalogMovingEnumList = Arrays.asList(CatalogMovingEnum.values());
|
| - |
|
311 |
|
| - |
|
312 |
model.addAttribute("categorisedCatalogListModels", categorisedCatalogListModels);
|
| - |
|
313 |
model.addAttribute("catalogs", catalogs);
|
| - |
|
314 |
model.addAttribute("catalogMovingEnumList", catalogMovingEnumList);
|
| - |
|
315 |
model.addAttribute("brand", brand);
|
| - |
|
316 |
|
| - |
|
317 |
return "catagorised-catalog-list";
|
| - |
|
318 |
|
| - |
|
319 |
}
|
| - |
|
320 |
|
| - |
|
321 |
@RequestMapping(value = "/createUpdateCatalogMovement", method = RequestMethod.GET)
|
| - |
|
322 |
public String createUpdateCatalogMovement(HttpServletRequest request, Model model, @RequestParam int catalogId, @RequestParam CatalogMovingEnum status, @RequestParam LocalDate startDate, @RequestParam String brand) throws Exception {
|
| - |
|
323 |
|
| - |
|
324 |
CategorisedCatalog currentCategorisedCatalog = categorisedCatalogRepository.getCurrentCatalogMovement(catalogId);
|
| - |
|
325 |
|
| - |
|
326 |
LOGGER.info("currentCategorisedCatalog {}", currentCategorisedCatalog);
|
| - |
|
327 |
|
| - |
|
328 |
if (currentCategorisedCatalog != null) {
|
| - |
|
329 |
if (currentCategorisedCatalog.getStatus().equals(status)) {
|
| - |
|
330 |
currentCategorisedCatalog.setStartDate(startDate);
|
| - |
|
331 |
} else {
|
| - |
|
332 |
currentCategorisedCatalog.setEndDate(LocalDate.now().minusDays(1));
|
| - |
|
333 |
|
| - |
|
334 |
CategorisedCatalog categorisedCatalog = new CategorisedCatalog();
|
| - |
|
335 |
categorisedCatalog.setCatalogId(catalogId);
|
| - |
|
336 |
categorisedCatalog.setStatus(status);
|
| - |
|
337 |
categorisedCatalog.setStartDate(startDate);
|
| - |
|
338 |
categorisedCatalogRepository.persist(categorisedCatalog);
|
| - |
|
339 |
}
|
| - |
|
340 |
|
| - |
|
341 |
} else {
|
| - |
|
342 |
CategorisedCatalog categorisedCatalog = new CategorisedCatalog();
|
| - |
|
343 |
categorisedCatalog.setCatalogId(catalogId);
|
| - |
|
344 |
categorisedCatalog.setStatus(status);
|
| - |
|
345 |
categorisedCatalog.setStartDate(startDate);
|
| - |
|
346 |
categorisedCatalogRepository.persist(categorisedCatalog);
|
| - |
|
347 |
|
| - |
|
348 |
}
|
| - |
|
349 |
|
| - |
|
350 |
model.addAttribute("response1", true);
|
| - |
|
351 |
return "response";
|
| - |
|
352 |
|
| - |
|
353 |
}
|
| - |
|
354 |
|
| - |
|
355 |
@RequestMapping(value = "/getCatalogMovementHistory", method = RequestMethod.GET)
|
| - |
|
356 |
public String getCatalogMovementHistory(HttpServletRequest request, Model model, @RequestParam int catalogId) throws Exception {
|
| - |
|
357 |
List<CategorisedCatalogListModel> categorisedCatalogListModelList = categorisedCatalogRepository.getCatalogMovement(catalogId);
|
| - |
|
358 |
|
| - |
|
359 |
model.addAttribute("categorisedCatalogListModelList", categorisedCatalogListModelList);
|
| - |
|
360 |
return "catalog-movement-history";
|
| - |
|
361 |
|
| - |
|
362 |
}
|
| - |
|
363 |
|
| - |
|
364 |
|
| - |
|
365 |
|
| 285 |
@RequestMapping(value = "/getWebOfferByCatalogId")
|
366 |
@RequestMapping(value = "/getWebOfferByCatalogId")
|
| 286 |
public String getCatalog(HttpServletRequest request, @RequestParam int catalogItemId, Model model)
|
367 |
public String getCatalog(HttpServletRequest request, @RequestParam int catalogItemId, Model model)
|
| 287 |
throws ProfitMandiBusinessException {
|
368 |
throws ProfitMandiBusinessException {
|
| 288 |
|
369 |
|
| 289 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(catalogItemId);
|
370 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(catalogItemId);
|