| Line 13... |
Line 13... |
| 13 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
13 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 14 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
14 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
| 15 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
15 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
| 16 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
16 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| 17 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
17 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 18 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
- |
|
| 19 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
18 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 20 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
19 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 21 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
20 |
import com.spice.profitmandi.dao.enumuration.catalog.UpgradeOfferStatus;
|
| 22 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
21 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 23 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
22 |
import com.spice.profitmandi.dao.model.SamsungUpgradeOfferModel;
|
| Line 65... |
Line 64... |
| 65 |
import org.springframework.web.bind.annotation.RequestMethod;
|
64 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 66 |
import org.springframework.web.bind.annotation.RequestParam;
|
65 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 67 |
|
66 |
|
| 68 |
import javax.servlet.http.HttpServletRequest;
|
67 |
import javax.servlet.http.HttpServletRequest;
|
| 69 |
import javax.transaction.Transactional;
|
68 |
import javax.transaction.Transactional;
|
| 70 |
import java.io.*;
|
69 |
import java.io.File;
|
| - |
|
70 |
import java.io.FileInputStream;
|
| - |
|
71 |
import java.io.FileNotFoundException;
|
| 71 |
import java.time.LocalDate;
|
72 |
import java.time.LocalDate;
|
| 72 |
import java.time.LocalDateTime;
|
73 |
import java.time.LocalDateTime;
|
| 73 |
import java.time.LocalTime;
|
74 |
import java.time.LocalTime;
|
| 74 |
import java.time.YearMonth;
|
75 |
import java.time.YearMonth;
|
| 75 |
import java.time.format.DateTimeFormatter;
|
76 |
import java.time.format.DateTimeFormatter;
|
| 76 |
import java.util.*;
|
77 |
import java.util.*;
|
| 77 |
import java.util.stream.Collectors;
|
78 |
import java.util.stream.Collectors;
|
| 78 |
|
79 |
|
| - |
|
80 |
import static in.shop2020.model.v1.order.OrderStatus.*;
|
| - |
|
81 |
|
| 79 |
@Controller
|
82 |
@Controller
|
| 80 |
@Transactional(rollbackOn = Throwable.class)
|
83 |
@Transactional(rollbackOn = Throwable.class)
|
| 81 |
public class DashboardController {
|
84 |
public class DashboardController {
|
| 82 |
|
85 |
|
| 83 |
List<String> emails = Arrays.asList("kamini.sharma@smartdukaan.com", "neeraj.gupta@smartdukaan.com",
|
86 |
List<String> emails = Arrays.asList("kamini.sharma@smartdukaan.com", "neeraj.gupta@smartdukaan.com",
|
| Line 312... |
Line 315... |
| 312 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
315 |
@RequestMapping(value = "/dashboard", method = RequestMethod.GET)
|
| 313 |
public String dashboard(HttpServletRequest request, Model model) throws Exception {
|
316 |
public String dashboard(HttpServletRequest request, Model model) throws Exception {
|
| 314 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
317 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 315 |
String email = loginDetails.getEmailId();
|
318 |
String email = loginDetails.getEmailId();
|
| 316 |
int fofoId = loginDetails.getFofoId();
|
319 |
int fofoId = loginDetails.getFofoId();
|
| 317 |
|
- |
|
| 318 |
LocalDateTime startDate = LocalDate.now().withDayOfYear(1).atStartOfDay();
|
- |
|
| 319 |
LocalDateTime endtDate = LocalDateTime.now();
|
- |
|
| 320 |
OnlineDeliveredOrderSum onlineDeliveredOrderSum = pendingOrderItemRepository
|
- |
|
| 321 |
.selectSumSellingPriceOnlineOrder(fofoId, startDate, endtDate);
|
- |
|
| 322 |
LOGGER.info("onlineDeliveredOrderSum" + onlineDeliveredOrderSum.getSellingPrice());
|
- |
|
| 323 |
|
- |
|
| 324 |
long countOrder = pendingOrderRepository.pendingOrderCount(fofoId, OrderStatus.PROCESSING);
|
- |
|
| 325 |
LOGGER.info("countOrder" + countOrder);
|
- |
|
| 326 |
|
- |
|
| 327 |
ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
|
- |
|
| 328 |
|
- |
|
| 329 |
orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING);
|
- |
|
| 330 |
orderStatus.add(in.shop2020.model.v1.order.OrderStatus.BILLED);
|
- |
|
| 331 |
orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH);
|
- |
|
| 332 |
orderStatus.add(in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS);
|
- |
|
| 333 |
|
- |
|
| 334 |
List<Order> order = orderRepository.selectGrnTimestampNull(fofoId, orderStatus);
|
- |
|
| 335 |
List<LineItem> submittedLineItemIds = order.stream()
|
- |
|
| 336 |
.filter(x -> x.getStatus().equals(in.shop2020.model.v1.order.OrderStatus.SUBMITTED_FOR_PROCESSING))
|
- |
|
| 337 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
- |
|
| 338 |
List<LineItem> billedOrderIds = order.stream()
|
- |
|
| 339 |
.filter(x -> x.getStatus().equals(in.shop2020.model.v1.order.OrderStatus.BILLED))
|
- |
|
| 340 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
- |
|
| 341 |
List<LineItem> shippedOrderIds = order.stream()
|
- |
|
| 342 |
.filter(x -> x.getStatus().equals(in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH))
|
- |
|
| 343 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
- |
|
| 344 |
List<LineItem> grnPendingLineItemIds = order.stream()
|
- |
|
| 345 |
.filter(x -> x.getStatus().equals(in.shop2020.model.v1.order.OrderStatus.DELIVERY_SUCCESS))
|
- |
|
| 346 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
- |
|
| 347 |
|
- |
|
| 348 |
LOGGER.info("billedOrderIds {}", billedOrderIds);
|
- |
|
| 349 |
LOGGER.info("shippedOrderIds {}", shippedOrderIds);
|
- |
|
| 350 |
|
- |
|
| 351 |
long grnPendingCount = grnPendingLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
- |
|
| 352 |
long grnPendingValue = grnPendingLineItemIds.stream()
|
- |
|
| 353 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
- |
|
| 354 |
model.addAttribute("grnPendingCount", grnPendingCount);
|
- |
|
| 355 |
model.addAttribute("grnPendingValue", grnPendingValue);
|
- |
|
| 356 |
|
- |
|
| 357 |
long submittedCount = submittedLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
- |
|
| 358 |
long submittedValue = submittedLineItemIds.stream()
|
- |
|
| 359 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
- |
|
| 360 |
model.addAttribute("submittedCount", submittedCount);
|
- |
|
| 361 |
model.addAttribute("submittedValue", submittedValue);
|
- |
|
| 362 |
|
- |
|
| 363 |
long billedCount = billedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
- |
|
| 364 |
long billedValue = billedOrderIds.stream().collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
- |
|
| 365 |
model.addAttribute("billedValue", billedValue);
|
- |
|
| 366 |
model.addAttribute("billedCount", billedCount);
|
- |
|
| 367 |
LOGGER.info("billedCount {}", billedCount);
|
- |
|
| 368 |
|
- |
|
| 369 |
long shippedCount = shippedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
- |
|
| 370 |
model.addAttribute("shippedCount", shippedCount);
|
- |
|
| 371 |
LOGGER.info("shippedCount {}", shippedCount);
|
- |
|
| 372 |
long shippedValue = shippedOrderIds.stream()
|
- |
|
| 373 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
- |
|
| 374 |
model.addAttribute("shippedValue", shippedValue);
|
- |
|
| 375 |
|
- |
|
| 376 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
- |
|
| 377 |
|
- |
|
| 378 |
LocalDateTime currentMonthStart = curDate.withDayOfMonth(1);
|
- |
|
| 379 |
LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
|
- |
|
| 380 |
LocalDateTime currentMonthEnd = currentMonthStart.withDayOfMonth(1);
|
- |
|
| 381 |
|
- |
|
| 382 |
LOGGER.info("lastMonthStart" + lastMonthStart);
|
- |
|
| 383 |
LOGGER.info("currentMonthEnd" + currentMonthEnd);
|
- |
|
| 384 |
|
- |
|
| 385 |
model.addAttribute("countOrder", countOrder);
|
- |
|
| 386 |
model.addAttribute("onlineDeliveredOrderSum", onlineDeliveredOrderSum.getSellingPrice());
|
- |
|
| 387 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
320 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| 388 |
model.addAttribute("isAdmin", isAdmin);
|
321 |
model.addAttribute("isAdmin", isAdmin);
|
| 389 |
|
322 |
|
| 390 |
model.addAttribute("webApiHost", webApiHost);
|
323 |
model.addAttribute("webApiHost", webApiHost);
|
| 391 |
model.addAttribute("webApiPort", webApiPort);
|
324 |
model.addAttribute("webApiPort", webApiPort);
|
| Line 399... |
Line 332... |
| 399 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
332 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
| 400 |
if (!fofoStore.isActive()) {
|
333 |
if (!fofoStore.isActive()) {
|
| 401 |
return "redirect:/login";
|
334 |
return "redirect:/login";
|
| 402 |
}
|
335 |
}
|
| 403 |
|
336 |
|
| - |
|
337 |
LocalDateTime startDate = LocalDate.now().withDayOfYear(1).atStartOfDay();
|
| - |
|
338 |
LocalDateTime endtDate = LocalDateTime.now();
|
| - |
|
339 |
OnlineDeliveredOrderSum onlineDeliveredOrderSum = pendingOrderItemRepository
|
| - |
|
340 |
.selectSumSellingPriceOnlineOrder(fofoId, startDate, endtDate);
|
| - |
|
341 |
LOGGER.info("onlineDeliveredOrderSum" + onlineDeliveredOrderSum.getSellingPrice());
|
| - |
|
342 |
|
| - |
|
343 |
long countOrder = pendingOrderRepository.pendingOrderCount(fofoId, OrderStatus.PROCESSING);
|
| - |
|
344 |
LOGGER.info("countOrder" + countOrder);
|
| - |
|
345 |
|
| - |
|
346 |
ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
|
| - |
|
347 |
|
| - |
|
348 |
orderStatus.add(SUBMITTED_FOR_PROCESSING);
|
| - |
|
349 |
orderStatus.add(BILLED);
|
| - |
|
350 |
orderStatus.add(SHIPPED_FROM_WH);
|
| - |
|
351 |
orderStatus.add(DELIVERY_SUCCESS);
|
| - |
|
352 |
|
| - |
|
353 |
List<Order> openOrders = orderRepository.selectGrnTimestampNull(fofoId, orderStatus);
|
| - |
|
354 |
List<LineItem> submittedLineItemIds = openOrders.stream()
|
| - |
|
355 |
.filter(x -> x.getStatus().equals(SUBMITTED_FOR_PROCESSING))
|
| - |
|
356 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
| - |
|
357 |
List<LineItem> billedOrderIds = openOrders.stream()
|
| - |
|
358 |
.filter(x -> x.getStatus().equals(BILLED))
|
| - |
|
359 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
| - |
|
360 |
List<LineItem> shippedOrderIds = openOrders.stream()
|
| - |
|
361 |
.filter(x -> x.getStatus().equals(SHIPPED_FROM_WH))
|
| - |
|
362 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
| - |
|
363 |
List<LineItem> grnPendingLineItemIds = openOrders.stream()
|
| - |
|
364 |
.filter(x -> x.getStatus().equals(DELIVERY_SUCCESS))
|
| - |
|
365 |
.map(x -> x.getLineItem()).collect(Collectors.toList());
|
| - |
|
366 |
|
| - |
|
367 |
|
| - |
|
368 |
long imeiActivationPendingCount = 0;
|
| - |
|
369 |
long imeiActivationPendingValue = 0;
|
| - |
|
370 |
List<Integer> grnPendingOrderIds = openOrders.stream().filter(x -> x.getStatus().equals(SHIPPED_FROM_WH) || x.getStatus().equals(DELIVERY_SUCCESS)).map(x -> x.getId()).collect(Collectors.toList());
|
| - |
|
371 |
if (grnPendingOrderIds.size() > 0) {
|
| - |
|
372 |
List<ImeiActivationTimestampModel> imeiActivationTimestampModels = activatedImeiRepository.selectActivatedImeisByOrders(grnPendingOrderIds);
|
| - |
|
373 |
imeiActivationPendingCount = imeiActivationTimestampModels.size();
|
| - |
|
374 |
imeiActivationPendingValue = imeiActivationTimestampModels.stream().collect(Collectors.summingDouble(x -> x.getSellingPrice())).longValue();
|
| - |
|
375 |
}
|
| - |
|
376 |
|
| - |
|
377 |
|
| - |
|
378 |
long grnPendingCount = grnPendingLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
| - |
|
379 |
long grnPendingValue = grnPendingLineItemIds.stream()
|
| - |
|
380 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
| - |
|
381 |
model.addAttribute("grnPendingCount", grnPendingCount);
|
| - |
|
382 |
model.addAttribute("grnPendingValue", grnPendingValue);
|
| - |
|
383 |
|
| - |
|
384 |
long submittedCount = submittedLineItemIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
| - |
|
385 |
long submittedValue = submittedLineItemIds.stream()
|
| - |
|
386 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
| - |
|
387 |
model.addAttribute("submittedCount", submittedCount);
|
| - |
|
388 |
model.addAttribute("submittedValue", submittedValue);
|
| - |
|
389 |
|
| - |
|
390 |
long billedCount = billedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
| - |
|
391 |
long billedValue = billedOrderIds.stream().collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
| - |
|
392 |
model.addAttribute("billedValue", billedValue);
|
| - |
|
393 |
model.addAttribute("billedCount", billedCount);
|
| - |
|
394 |
LOGGER.info("billedCount {}", billedCount);
|
| - |
|
395 |
|
| - |
|
396 |
long shippedCount = shippedOrderIds.stream().collect(Collectors.summingLong(LineItem::getQuantity));
|
| - |
|
397 |
model.addAttribute("shippedCount", shippedCount);
|
| - |
|
398 |
LOGGER.info("shippedCount {}", shippedCount);
|
| - |
|
399 |
long shippedValue = shippedOrderIds.stream()
|
| - |
|
400 |
.collect(Collectors.summingLong(x -> x.getTotalPrice().longValue()));
|
| - |
|
401 |
model.addAttribute("shippedValue", shippedValue);
|
| - |
|
402 |
|
| - |
|
403 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| - |
|
404 |
|
| - |
|
405 |
LocalDateTime currentMonthStart = curDate.withDayOfMonth(1);
|
| - |
|
406 |
LocalDateTime lastMonthStart = currentMonthStart.minusMonths(1);
|
| - |
|
407 |
LocalDateTime currentMonthEnd = currentMonthStart.withDayOfMonth(1);
|
| - |
|
408 |
|
| - |
|
409 |
LOGGER.info("lastMonthStart" + lastMonthStart);
|
| - |
|
410 |
LOGGER.info("currentMonthEnd" + currentMonthEnd);
|
| - |
|
411 |
|
| - |
|
412 |
model.addAttribute("countOrder", countOrder);
|
| - |
|
413 |
model.addAttribute("onlineDeliveredOrderSum", onlineDeliveredOrderSum.getSellingPrice());
|
| - |
|
414 |
|
| 404 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoStore.getId(), LocalDate.now());
|
415 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoStore.getId(), LocalDate.now());
|
| 405 |
model.addAttribute("partnerType", partnerType);
|
416 |
model.addAttribute("partnerType", partnerType);
|
| 406 |
model.addAttribute("partnerTypeImage", PartnerType.imageMap.get(partnerType));
|
417 |
model.addAttribute("partnerTypeImage", PartnerType.imageMap.get(partnerType));
|
| 407 |
model.addAttribute("fofoStore", fofoStore);
|
418 |
model.addAttribute("fofoStore", fofoStore);
|
| 408 |
model.addAttribute("partnerType", partnerType);
|
419 |
model.addAttribute("partnerType", partnerType);
|
| 409 |
model.addAttribute("maa", loginDetails.getFofoId() == 175138885);
|
- |
|
| 410 |
|
- |
|
| 411 |
model.addAttribute("hasGift", fofoUser.hasGift(loginDetails.getFofoId()));
|
420 |
model.addAttribute("hasGift", fofoUser.hasGift(loginDetails.getFofoId()));
|
| 412 |
model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
|
421 |
model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
|
| 413 |
model.addAttribute("retailers", new JSONObject().append("code", fofoStore.getCode())
|
422 |
model.addAttribute("retailers", new JSONObject().append("code", fofoStore.getCode())
|
| 414 |
.append("partnerId", fofoStore.getId()).toString());
|
423 |
.append("partnerId", fofoStore.getId()).toString());
|
| 415 |
model.addAttribute("activatedImeis",
|
424 |
model.addAttribute("activatedImeis",
|
| 416 |
inventoryItemRepository.selectCountByActivatedNotSold(loginDetails.getFofoId()));
|
425 |
inventoryItemRepository.selectCountByActivatedNotSold(loginDetails.getFofoId()));
|
| - |
|
426 |
model.addAttribute("imeiActivationPendingCount",
|
| - |
|
427 |
imeiActivationPendingCount);
|
| - |
|
428 |
model.addAttribute("imeiActivationPendingValue",
|
| - |
|
429 |
imeiActivationPendingValue);
|
| 417 |
|
430 |
|
| 418 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository
|
431 |
Map<Integer, Double> accesoriesmtdsale = fofoOrderRepository
|
| 419 |
.selectSumSaleGroupByFofoIdsForMobileOrAccessories(loginDetails.getFofoId(),
|
432 |
.selectSumSaleGroupByFofoIdsForMobileOrAccessories(loginDetails.getFofoId(),
|
| 420 |
curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
433 |
curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false));
|
| 421 |
|
434 |
|
| Line 437... |
Line 450... |
| 437 |
model.addAttribute("publishedOffers", publishedOffers);
|
450 |
model.addAttribute("publishedOffers", publishedOffers);
|
| 438 |
model.addAttribute("investments", fofoUser.getInvestments(loginDetails.getFofoId()));
|
451 |
model.addAttribute("investments", fofoUser.getInvestments(loginDetails.getFofoId()));
|
| 439 |
model.addAttribute("isInvestmentOk", partnerInvestmentService.isInvestmentOk(loginDetails.getFofoId(),
|
452 |
model.addAttribute("isInvestmentOk", partnerInvestmentService.isInvestmentOk(loginDetails.getFofoId(),
|
| 440 |
10, ProfitMandiConstants.CUTOFF_INVESTMENT));
|
453 |
10, ProfitMandiConstants.CUTOFF_INVESTMENT));
|
| 441 |
|
454 |
|
| - |
|
455 |
double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
|
| - |
|
456 |
currentMonthEnd) / 2;
|
| - |
|
457 |
double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart,
|
| - |
|
458 |
currentMonthStart) / 2;
|
| - |
|
459 |
double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN,
|
| - |
|
460 |
currentMonthEnd) / 2;
|
| - |
|
461 |
model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
|
| - |
|
462 |
model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
|
| - |
|
463 |
model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
|
| - |
|
464 |
|
| - |
|
465 |
long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart,
|
| - |
|
466 |
currentMonthEnd);
|
| - |
|
467 |
|
| - |
|
468 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), false,
|
| - |
|
469 |
currentMonthStart, currentMonthEnd);
|
| - |
|
470 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
| - |
|
471 |
invalidHygieneCount = 1;
|
| - |
|
472 |
}
|
| - |
|
473 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
| - |
|
474 |
for (int i = 0; i <= 5; i++) {
|
| - |
|
475 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
| - |
|
476 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
| - |
|
477 |
}
|
| - |
|
478 |
|
| - |
|
479 |
model.addAttribute("monthValueMap", monthValueMap);
|
| - |
|
480 |
model.addAttribute("month", 0);
|
| - |
|
481 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
| - |
|
482 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| - |
|
483 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| - |
|
484 |
|
| 442 |
} catch (ProfitMandiBusinessException e) {
|
485 |
} catch (ProfitMandiBusinessException e) {
|
| 443 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
486 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
| 444 |
|
487 |
|
| 445 |
}
|
488 |
}
|
| - |
|
489 |
return "dashboard1";
|
| 446 |
}
|
490 |
}
|
| 447 |
|
491 |
|
| 448 |
double currentMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), currentMonthStart,
|
- |
|
| 449 |
currentMonthEnd) / 2;
|
- |
|
| 450 |
double lastMonthRating = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), lastMonthStart,
|
- |
|
| 451 |
currentMonthStart) / 2;
|
- |
|
| 452 |
double ratingTillDate = hygieneDataRepository.selectRatingAvg(loginDetails.getFofoId(), LocalDateTime.MIN,
|
- |
|
| 453 |
currentMonthEnd) / 2;
|
- |
|
| 454 |
model.addAttribute("currentMonthRating", (float) Math.round(currentMonthRating * 10) / 10);
|
- |
|
| 455 |
model.addAttribute("lastMonthRating", (float) Math.round(lastMonthRating * 10) / 10);
|
- |
|
| 456 |
model.addAttribute("ratingTillDate", (float) Math.round(ratingTillDate * 10) / 10);
|
- |
|
| 457 |
|
- |
|
| 458 |
long hygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), true, currentMonthStart,
|
- |
|
| 459 |
currentMonthEnd);
|
- |
|
| 460 |
|
- |
|
| 461 |
long invalidHygieneCount = hygieneDataRepository.selectHygieneCount(loginDetails.getFofoId(), false,
|
- |
|
| 462 |
currentMonthStart, currentMonthEnd);
|
- |
|
| 463 |
if (hygieneCount == 0 && invalidHygieneCount == 0) {
|
- |
|
| 464 |
invalidHygieneCount = 1;
|
- |
|
| 465 |
}
|
- |
|
| 466 |
Map<Integer, String> monthValueMap = new HashMap<>();
|
- |
|
| 467 |
for (int i = 0; i <= 5; i++) {
|
- |
|
| 468 |
LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1).minusMonths(i);
|
- |
|
| 469 |
monthValueMap.put(i, startOfMonth.format(DateTimeFormatter.ofPattern("MMM''uu")));
|
- |
|
| 470 |
}
|
- |
|
| 471 |
|
- |
|
| 472 |
model.addAttribute("monthValueMap", monthValueMap);
|
- |
|
| 473 |
model.addAttribute("month", 0);
|
- |
|
| 474 |
|
- |
|
| 475 |
model.addAttribute("hygienePercentage", (hygieneCount * 100) / (invalidHygieneCount + hygieneCount));
|
- |
|
| 476 |
|
- |
|
| 477 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
- |
|
| 478 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
- |
|
| 479 |
/*
|
- |
|
| 480 |
* if (loginDetails.isReadOnly()) { return "dashboard-readonly"; } else { }
|
- |
|
| 481 |
*/
|
- |
|
| 482 |
|
- |
|
| 483 |
return "dashboard1";
|
- |
|
| 484 |
|
- |
|
| 485 |
}
|
492 |
}
|
| 486 |
|
493 |
|
| 487 |
@RequestMapping(value = "/getGrnPendingOrderStatus", method = RequestMethod.GET)
|
494 |
@RequestMapping(value = "/getGrnPendingOrderStatus", method = RequestMethod.GET)
|
| 488 |
public String getGrnPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
|
495 |
public String getGrnPendingOrderStatus(HttpServletRequest request, Model model) throws Exception {
|
| 489 |
|
496 |
|
| Line 553... |
Line 560... |
| 553 |
|
560 |
|
| 554 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
561 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 555 |
int fofoId = loginDetails.getFofoId();
|
562 |
int fofoId = loginDetails.getFofoId();
|
| 556 |
ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
|
563 |
ArrayList<in.shop2020.model.v1.order.OrderStatus> orderStatus = new ArrayList<>();
|
| 557 |
|
564 |
|
| 558 |
orderStatus.add(in.shop2020.model.v1.order.OrderStatus.SHIPPED_FROM_WH);
|
565 |
orderStatus.add(SHIPPED_FROM_WH);
|
| 559 |
|
566 |
|
| 560 |
List<Order> order = orderRepository.selectOrders(fofoId, orderStatus);
|
567 |
List<Order> order = orderRepository.selectOrders(fofoId, orderStatus);
|
| 561 |
List<Integer> shippedOrderIds = order.stream().filter(x -> x.getPartnerGrnTimestamp() == null)
|
568 |
List<Integer> shippedOrderIds = order.stream().filter(x -> x.getPartnerGrnTimestamp() == null)
|
| 562 |
.map(x -> x.getId()).collect(Collectors.toList());
|
569 |
.map(x -> x.getId()).collect(Collectors.toList());
|
| 563 |
model.addAttribute("shippedOrderIds", shippedOrderIds);
|
570 |
model.addAttribute("shippedOrderIds", shippedOrderIds);
|
| Line 660... |
Line 667... |
| 660 |
return "partner-total-income";
|
667 |
return "partner-total-income";
|
| 661 |
}
|
668 |
}
|
| 662 |
|
669 |
|
| 663 |
@RequestMapping(value = "/getMonthsInvestment", method = RequestMethod.GET)
|
670 |
@RequestMapping(value = "/getMonthsInvestment", method = RequestMethod.GET)
|
| 664 |
public String getMonthsInvestment(HttpServletRequest request,
|
671 |
public String getMonthsInvestment(HttpServletRequest request,
|
| 665 |
@RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model)
|
672 |
@RequestParam(name = "month", required = true, defaultValue = "0") int month, Model model)
|
| 666 |
throws Exception {
|
673 |
throws Exception {
|
| 667 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
674 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 668 |
int fofoId = loginDetails.getFofoId();
|
675 |
int fofoId = loginDetails.getFofoId();
|
| 669 |
Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
|
676 |
Map<String, Object> investment = fofoUser.getInvestmentsMonths(fofoId, month);
|
| 670 |
|
677 |
|
| Line 750... |
Line 757... |
| 750 |
return "bar_chart";
|
757 |
return "bar_chart";
|
| 751 |
}
|
758 |
}
|
| 752 |
|
759 |
|
| 753 |
@RequestMapping(value = "/getPriceDropDetails", method = RequestMethod.GET)
|
760 |
@RequestMapping(value = "/getPriceDropDetails", method = RequestMethod.GET)
|
| 754 |
public String getPriceDropDetails(HttpServletRequest request,
|
761 |
public String getPriceDropDetails(HttpServletRequest request,
|
| 755 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
762 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 756 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
763 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
| 757 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
764 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
| 758 |
throws Exception {
|
765 |
throws Exception {
|
| 759 |
|
766 |
|
| 760 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
767 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
| 761 |
|
768 |
|
| 762 |
List<PriceDropWithDetailsByYearMonthModel> priceDropdetailsList = priceDropRepository
|
769 |
List<PriceDropWithDetailsByYearMonthModel> priceDropdetailsList = priceDropRepository
|
| Line 769... |
Line 776... |
| 769 |
return "price-drop-details";
|
776 |
return "price-drop-details";
|
| 770 |
}
|
777 |
}
|
| 771 |
|
778 |
|
| 772 |
@RequestMapping(value = "/getPriceDropDetailSixMonths", method = RequestMethod.GET)
|
779 |
@RequestMapping(value = "/getPriceDropDetailSixMonths", method = RequestMethod.GET)
|
| 773 |
public String getPriceDropDetailSixMonths(HttpServletRequest request,
|
780 |
public String getPriceDropDetailSixMonths(HttpServletRequest request,
|
| 774 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
781 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 775 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
782 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
| 776 |
throws Exception {
|
783 |
throws Exception {
|
| 777 |
|
784 |
|
| 778 |
LOGGER.info("params" + fofoId + brand);
|
785 |
LOGGER.info("params" + fofoId + brand);
|
| 779 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
786 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 780 |
LocalDateTime startfMonthSixMonth = curDate.withDayOfMonth(1).minusMonths(12);
|
787 |
LocalDateTime startfMonthSixMonth = curDate.withDayOfMonth(1).minusMonths(12);
|
| Line 976... |
Line 983... |
| 976 |
return "activation-tabular";
|
983 |
return "activation-tabular";
|
| 977 |
}
|
984 |
}
|
| 978 |
|
985 |
|
| 979 |
@RequestMapping(value = "/getMonthlyActivationItemDetail", method = RequestMethod.GET)
|
986 |
@RequestMapping(value = "/getMonthlyActivationItemDetail", method = RequestMethod.GET)
|
| 980 |
public String getMonthlyActivationItemDetail(HttpServletRequest request,
|
987 |
public String getMonthlyActivationItemDetail(HttpServletRequest request,
|
| 981 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
988 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 982 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
989 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
| 983 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
990 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
| 984 |
throws Exception {
|
991 |
throws Exception {
|
| 985 |
|
992 |
|
| 986 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
993 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
| 987 |
|
994 |
|
| 988 |
List<ActivationItemDetailModel> activationItemDetails = schemeInOutRepository
|
995 |
List<ActivationItemDetailModel> activationItemDetails = schemeInOutRepository
|
| Line 1013... |
Line 1020... |
| 1013 |
return "activation-pending-item-details";
|
1020 |
return "activation-pending-item-details";
|
| 1014 |
}
|
1021 |
}
|
| 1015 |
|
1022 |
|
| 1016 |
@RequestMapping(value = "/getMonthlyActivationBeforeSixMonthsItemDetail", method = RequestMethod.GET)
|
1023 |
@RequestMapping(value = "/getMonthlyActivationBeforeSixMonthsItemDetail", method = RequestMethod.GET)
|
| 1017 |
public String getMonthlyActivationItemDetail(HttpServletRequest request,
|
1024 |
public String getMonthlyActivationItemDetail(HttpServletRequest request,
|
| 1018 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
1025 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 1019 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
1026 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
| 1020 |
throws Exception {
|
1027 |
throws Exception {
|
| 1021 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1028 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1022 |
|
1029 |
|
| 1023 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
|
1030 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
|
| 1024 |
|
1031 |
|
| Line 1125... |
Line 1132... |
| 1125 |
|
1132 |
|
| 1126 |
}
|
1133 |
}
|
| 1127 |
|
1134 |
|
| 1128 |
@RequestMapping(value = "/getMonthlyUpgradeOfferItemDetail", method = RequestMethod.GET)
|
1135 |
@RequestMapping(value = "/getMonthlyUpgradeOfferItemDetail", method = RequestMethod.GET)
|
| 1129 |
public String getMonthlyUpgradeOfferItemDetail(HttpServletRequest request,
|
1136 |
public String getMonthlyUpgradeOfferItemDetail(HttpServletRequest request,
|
| 1130 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
1137 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 1131 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
1138 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand,
|
| 1132 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
1139 |
@RequestParam(name = "yearMonth", required = false, defaultValue = "0") String yearMonth, Model model)
|
| 1133 |
throws Exception {
|
1140 |
throws Exception {
|
| 1134 |
|
1141 |
|
| 1135 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
1142 |
LOGGER.info("params" + fofoId + brand + yearMonth);
|
| 1136 |
List<UpgradeOfferItemDetailModel> offerItems = samsungUpgradeOfferRepository
|
1143 |
List<UpgradeOfferItemDetailModel> offerItems = samsungUpgradeOfferRepository
|
| 1137 |
.selectUpgradeOfferItemDetails(fofoId, UpgradeOfferStatus.approved, brand, yearMonth);
|
1144 |
.selectUpgradeOfferItemDetails(fofoId, UpgradeOfferStatus.approved, brand, yearMonth);
|
| Line 1141... |
Line 1148... |
| 1141 |
return "upgrade-offer-item-detail";
|
1148 |
return "upgrade-offer-item-detail";
|
| 1142 |
}
|
1149 |
}
|
| 1143 |
|
1150 |
|
| 1144 |
@RequestMapping(value = "/getUpgradeOfferBeforeSixMonthItemDetail", method = RequestMethod.GET)
|
1151 |
@RequestMapping(value = "/getUpgradeOfferBeforeSixMonthItemDetail", method = RequestMethod.GET)
|
| 1145 |
public String getUpgradeOfferBeforeSixMonthItemDetail(HttpServletRequest request,
|
1152 |
public String getUpgradeOfferBeforeSixMonthItemDetail(HttpServletRequest request,
|
| 1146 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
1153 |
@RequestParam(name = "fofoId", required = true, defaultValue = "0") int fofoId,
|
| 1147 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
1154 |
@RequestParam(name = "brand", required = true, defaultValue = "0") String brand, Model model)
|
| 1148 |
throws Exception {
|
1155 |
throws Exception {
|
| 1149 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1156 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1150 |
|
1157 |
|
| 1151 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
|
1158 |
LocalDateTime startOfMonth = curDate.withDayOfMonth(1).minusMonths(6);
|
| 1152 |
|
1159 |
|
| Line 1230... |
Line 1237... |
| 1230 |
return "auth_user_partner_detail";
|
1237 |
return "auth_user_partner_detail";
|
| 1231 |
}
|
1238 |
}
|
| 1232 |
|
1239 |
|
| 1233 |
@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
|
1240 |
@RequestMapping(value = "/getWarehouseWiseBrandStock", method = RequestMethod.GET)
|
| 1234 |
public String getWarehouseWiseBrandStock(HttpServletRequest request, Model model,
|
1241 |
public String getWarehouseWiseBrandStock(HttpServletRequest request, Model model,
|
| 1235 |
@RequestParam List<Integer> warehouseId) throws Exception {
|
1242 |
@RequestParam List<Integer> warehouseId) throws Exception {
|
| 1236 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1243 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1237 |
String email = loginDetails.getEmailId();
|
1244 |
String email = loginDetails.getEmailId();
|
| 1238 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
1245 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| 1239 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
1246 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
| 1240 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
1247 |
AuthUser authUser = authRepository.selectByEmailOrMobile(email);
|
| Line 1273... |
Line 1280... |
| 1273 |
inventoryService.getItemAvailabilityAndIndent();
|
1280 |
inventoryService.getItemAvailabilityAndIndent();
|
| 1274 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
1281 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 1275 |
return "response";
|
1282 |
return "response";
|
| 1276 |
}
|
1283 |
}
|
| 1277 |
|
1284 |
|
| 1278 |
@RequestMapping(value = "/getPartnersStatData", method = RequestMethod.GET)
|
- |
|
| 1279 |
public String getPartnersStatData(HttpServletRequest request, Model model) throws Exception {
|
- |
|
| 1280 |
Map<Integer, PartnerDetailModel> partnerStats = partnerStatsService.getAllPartnerStats();
|
- |
|
| 1281 |
ObjectOutputStream oos = null;
|
- |
|
| 1282 |
FileOutputStream fout = null;
|
- |
|
| 1283 |
try {
|
- |
|
| 1284 |
fout = new FileOutputStream("/tmp/partnerStat.tmp", false);
|
- |
|
| 1285 |
oos = new ObjectOutputStream(fout);
|
- |
|
| 1286 |
oos.writeObject(partnerStats);
|
- |
|
| 1287 |
|
- |
|
| 1288 |
} catch (Exception ex) {
|
- |
|
| 1289 |
ex.printStackTrace();
|
- |
|
| 1290 |
} finally {
|
- |
|
| 1291 |
if (oos != null) {
|
- |
|
| 1292 |
oos.close();
|
- |
|
| 1293 |
}
|
- |
|
| 1294 |
}
|
- |
|
| 1295 |
ReporticoCacheTable rct = reporticoCacheTableRepository.selectByTableName("partnerStat");
|
- |
|
| 1296 |
if (rct == null) {
|
- |
|
| 1297 |
rct = new ReporticoCacheTable();
|
- |
|
| 1298 |
rct.setTableName("partnerStat");
|
- |
|
| 1299 |
|
- |
|
| 1300 |
}
|
- |
|
| 1301 |
rct.setLastCreatedTimestamp(LocalDateTime.now());
|
- |
|
| 1302 |
reporticoCacheTableRepository.persist(rct);
|
- |
|
| 1303 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
- |
|
| 1304 |
return "response";
|
- |
|
| 1305 |
}
|
- |
|
| 1306 |
|
- |
|
| 1307 |
@RequestMapping(value = "/getWarehouseWiseBrandAndCategory", method = RequestMethod.GET)
|
1285 |
@RequestMapping(value = "/getWarehouseWiseBrandAndCategory", method = RequestMethod.GET)
|
| 1308 |
public String getWarehouseWiseBrandAndCategory(HttpServletRequest request, Model model,
|
1286 |
public String getWarehouseWiseBrandAndCategory(HttpServletRequest request, Model model,
|
| 1309 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
1287 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
| 1310 |
throws Exception {
|
1288 |
throws Exception {
|
| 1311 |
|
1289 |
|
| 1312 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1290 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1313 |
List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
|
1291 |
List<String> listbrands = saholicInventoryCISRepository.selectAllBrand();
|
| 1314 |
List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
|
1292 |
List<String> listCategory = saholicInventoryCISRepository.selectAllSubCategory();
|
| Line 1324... |
Line 1302... |
| 1324 |
return "warehouse_brand_item_stock";
|
1302 |
return "warehouse_brand_item_stock";
|
| 1325 |
}
|
1303 |
}
|
| 1326 |
|
1304 |
|
| 1327 |
@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
|
1305 |
@RequestMapping(value = "/getWarehouseWiseItemStock", method = RequestMethod.GET)
|
| 1328 |
public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
|
1306 |
public String getWarehouseWiseItemStock(HttpServletRequest request, Model model,
|
| 1329 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
1307 |
@RequestParam List<Integer> warehouseId, @RequestParam List<String> brands, @RequestParam String category)
|
| 1330 |
throws Exception {
|
1308 |
throws Exception {
|
| 1331 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1309 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1332 |
if (warehouseId.contains(0)) {
|
1310 |
if (warehouseId.contains(0)) {
|
| 1333 |
warehouseId.addAll(warehouseMap.keySet());
|
1311 |
warehouseId.addAll(warehouseMap.keySet());
|
| 1334 |
}
|
1312 |
}
|
| Line 1395... |
Line 1373... |
| 1395 |
return "warehousewise_brand_partners_sale";
|
1373 |
return "warehousewise_brand_partners_sale";
|
| 1396 |
}
|
1374 |
}
|
| 1397 |
|
1375 |
|
| 1398 |
@RequestMapping(value = "/getWarehouseWiseAccesoriesBrandPartnerSale", method = RequestMethod.GET)
|
1376 |
@RequestMapping(value = "/getWarehouseWiseAccesoriesBrandPartnerSale", method = RequestMethod.GET)
|
| 1399 |
public String getWarehouseWiseAccesoriesBrandPartnerSale(HttpServletRequest request, Model model,
|
1377 |
public String getWarehouseWiseAccesoriesBrandPartnerSale(HttpServletRequest request, Model model,
|
| 1400 |
@RequestParam String brand) throws Exception {
|
1378 |
@RequestParam String brand) throws Exception {
|
| 1401 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1379 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1402 |
String email = loginDetails.getEmailId();
|
1380 |
String email = loginDetails.getEmailId();
|
| 1403 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
1381 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| 1404 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
1382 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
| 1405 |
|
1383 |
|
| Line 1424... |
Line 1402... |
| 1424 |
return "warehousewise_accessoriesbrand_sale";
|
1402 |
return "warehousewise_accessoriesbrand_sale";
|
| 1425 |
}
|
1403 |
}
|
| 1426 |
|
1404 |
|
| 1427 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
1405 |
@RequestMapping(value = "/getWarehouseBrandWiseItemSale", method = RequestMethod.GET)
|
| 1428 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
1406 |
public String getWarehouseBrandWiseItemSale(HttpServletRequest request, Model model,
|
| 1429 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
1407 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
| 1430 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1408 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1431 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1409 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1432 |
String email = loginDetails.getEmailId();
|
1410 |
String email = loginDetails.getEmailId();
|
| 1433 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
1411 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| 1434 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
1412 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
| Line 1468... |
Line 1446... |
| 1468 |
return "warehouse_partner_itemwise_sale";
|
1446 |
return "warehouse_partner_itemwise_sale";
|
| 1469 |
}
|
1447 |
}
|
| 1470 |
|
1448 |
|
| 1471 |
@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
|
1449 |
@RequestMapping(value = "/getWarehouseAccesoriesBrandWiseItemSale", method = RequestMethod.GET)
|
| 1472 |
public String getWarehouseAccesoriesBrandWiseItemSale(HttpServletRequest request, Model model,
|
1450 |
public String getWarehouseAccesoriesBrandWiseItemSale(HttpServletRequest request, Model model,
|
| 1473 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
1451 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
| 1474 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1452 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 1475 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1453 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1476 |
String email = loginDetails.getEmailId();
|
1454 |
String email = loginDetails.getEmailId();
|
| 1477 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
1455 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| 1478 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
1456 |
Set<Integer> authfofoIds = storeGuyMap.get(email);
|
| Line 1489... |
Line 1467... |
| 1489 |
return "contact-us";
|
1467 |
return "contact-us";
|
| 1490 |
}
|
1468 |
}
|
| 1491 |
|
1469 |
|
| 1492 |
@RequestMapping(value = "/notifications", method = RequestMethod.GET)
|
1470 |
@RequestMapping(value = "/notifications", method = RequestMethod.GET)
|
| 1493 |
public String getNotificationsWithType(HttpServletRequest request,
|
1471 |
public String getNotificationsWithType(HttpServletRequest request,
|
| 1494 |
@RequestParam(required = false) MessageType messageType,
|
1472 |
@RequestParam(required = false) MessageType messageType,
|
| 1495 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
1473 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 1496 |
@RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
|
1474 |
@RequestParam(name = "limit", defaultValue = "20") int limit, Model model) throws Exception {
|
| 1497 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1475 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1498 |
int userId = 0;
|
1476 |
int userId = 0;
|
| 1499 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
1477 |
boolean isAdmin = roleManager.isAdmin(loginDetails.getRoleIds());
|
| 1500 |
if (isAdmin) {
|
1478 |
if (isAdmin) {
|
| 1501 |
userId = loginDetails.getFofoId();
|
1479 |
userId = loginDetails.getFofoId();
|
| Line 1515... |
Line 1493... |
| 1515 |
return "notification-template";
|
1493 |
return "notification-template";
|
| 1516 |
}
|
1494 |
}
|
| 1517 |
|
1495 |
|
| 1518 |
@RequestMapping(value = "/notifyDocument/documentId", method = RequestMethod.GET)
|
1496 |
@RequestMapping(value = "/notifyDocument/documentId", method = RequestMethod.GET)
|
| 1519 |
public ResponseEntity<?> retailerDocumentById(HttpServletRequest request,
|
1497 |
public ResponseEntity<?> retailerDocumentById(HttpServletRequest request,
|
| 1520 |
@RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, @RequestParam int cid)
|
1498 |
@RequestParam(name = ProfitMandiConstants.DOCUMENT_ID) int documentId, @RequestParam int cid)
|
| 1521 |
throws ProfitMandiBusinessException {
|
1499 |
throws ProfitMandiBusinessException {
|
| 1522 |
Document document = documentRepository.selectById(documentId);
|
1500 |
Document document = documentRepository.selectById(documentId);
|
| 1523 |
NotificationCampaign nc = notificationCampaignRepository.selectById(cid);
|
1501 |
NotificationCampaign nc = notificationCampaignRepository.selectById(cid);
|
| 1524 |
if (nc.getDocumentId() == null) {
|
1502 |
if (nc.getDocumentId() == null) {
|
| 1525 |
throw new ProfitMandiBusinessException("cid", nc.getId(), "not available");
|
1503 |
throw new ProfitMandiBusinessException("cid", nc.getId(), "not available");
|
| Line 1569... |
Line 1547... |
| 1569 |
return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
|
1547 |
return new ResponseEntity<InputStreamResource>(inputStreamResource, headers, HttpStatus.OK);
|
| 1570 |
}
|
1548 |
}
|
| 1571 |
|
1549 |
|
| 1572 |
@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
|
1550 |
@RequestMapping(value = "/getItemWiseTertiary", method = RequestMethod.GET)
|
| 1573 |
public String getItemWiseTertiary(HttpServletRequest request,
|
1551 |
public String getItemWiseTertiary(HttpServletRequest request,
|
| 1574 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
1552 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
| 1575 |
throws ProfitMandiBusinessException {
|
1553 |
throws ProfitMandiBusinessException {
|
| 1576 |
List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
|
1554 |
List<ItemWiseTertiaryModel> itemWiseTertiary = fofoOrderRepository.SelectItemWiseTertiary(fofoId);
|
| 1577 |
|
1555 |
|
| 1578 |
LOGGER.info("itemWiseTertiary" + itemWiseTertiary);
|
1556 |
LOGGER.info("itemWiseTertiary" + itemWiseTertiary);
|
| 1579 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1557 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| Line 1582... |
Line 1560... |
| 1582 |
return "item-wise-tertiary";
|
1560 |
return "item-wise-tertiary";
|
| 1583 |
}
|
1561 |
}
|
| 1584 |
|
1562 |
|
| 1585 |
@RequestMapping(value = "/getItemWiseIndent", method = RequestMethod.GET)
|
1563 |
@RequestMapping(value = "/getItemWiseIndent", method = RequestMethod.GET)
|
| 1586 |
public String getItemWiseIndent(HttpServletRequest request,
|
1564 |
public String getItemWiseIndent(HttpServletRequest request,
|
| 1587 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
1565 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model)
|
| 1588 |
throws ProfitMandiBusinessException {
|
1566 |
throws ProfitMandiBusinessException {
|
| 1589 |
|
1567 |
|
| 1590 |
List<Order> unbilledOrders = transactionService.getInTransitOrders(fofoId);
|
1568 |
List<Order> unbilledOrders = transactionService.getInTransitOrders(fofoId);
|
| 1591 |
model.addAttribute("unbilledOrders", unbilledOrders);
|
1569 |
model.addAttribute("unbilledOrders", unbilledOrders);
|
| 1592 |
|
1570 |
|
| 1593 |
return "item-wise-indent";
|
1571 |
return "item-wise-indent";
|
| 1594 |
}
|
1572 |
}
|
| 1595 |
|
1573 |
|
| 1596 |
@RequestMapping(value = "/getPartnerInvestment", method = RequestMethod.GET)
|
1574 |
@RequestMapping(value = "/getPartnerInvestment", method = RequestMethod.GET)
|
| 1597 |
public String getPartnerInvestment(HttpServletRequest request,
|
1575 |
public String getPartnerInvestment(HttpServletRequest request,
|
| 1598 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1576 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1599 |
Map<Integer, PartnerDetailModel> partnerStats = adminUser.getPartnersStatDataFromFile();
|
1577 |
Map<Integer, PartnerDetailModel> partnerStats = adminUser.getPartnersStatDataFromFile();
|
| 1600 |
PartnerDetailModel partnerDetailModel = partnerStats.get(fofoId);
|
1578 |
PartnerDetailModel partnerDetailModel = partnerStats.get(fofoId);
|
| 1601 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1579 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1602 |
model.addAttribute("partnerDetailModel", partnerDetailModel);
|
1580 |
model.addAttribute("partnerDetailModel", partnerDetailModel);
|
| 1603 |
model.addAttribute("customRetailer", customRetailer);
|
1581 |
model.addAttribute("customRetailer", customRetailer);
|
| 1604 |
return "partner-investment";
|
1582 |
return "partner-investment";
|
| 1605 |
}
|
1583 |
}
|
| 1606 |
|
1584 |
|
| 1607 |
@RequestMapping(value = "/getPartnerPendingIndentItem", method = RequestMethod.GET)
|
1585 |
@RequestMapping(value = "/getPartnerPendingIndentItem", method = RequestMethod.GET)
|
| 1608 |
public String getPartnerPendingIndentItem(HttpServletRequest request, @RequestParam int warehouseId,
|
1586 |
public String getPartnerPendingIndentItem(HttpServletRequest request, @RequestParam int warehouseId,
|
| 1609 |
@RequestParam int itemId, Model model) throws ProfitMandiBusinessException {
|
1587 |
@RequestParam int itemId, Model model) throws ProfitMandiBusinessException {
|
| 1610 |
List<PartnerPendingIndentItemModel> partnerPendingIndent = fofoStoreRepository
|
1588 |
List<PartnerPendingIndentItemModel> partnerPendingIndent = fofoStoreRepository
|
| 1611 |
.selectPartnerPendingIndentItem(itemId, warehouseId);
|
1589 |
.selectPartnerPendingIndentItem(itemId, warehouseId);
|
| 1612 |
|
1590 |
|
| 1613 |
model.addAttribute("partnerPendingIndent", partnerPendingIndent);
|
1591 |
model.addAttribute("partnerPendingIndent", partnerPendingIndent);
|
| 1614 |
return "partner-pending-indent-item";
|
1592 |
return "partner-pending-indent-item";
|
| 1615 |
}
|
1593 |
}
|
| 1616 |
|
1594 |
|
| 1617 |
@RequestMapping(value = "/getPatnerActivateStock", method = RequestMethod.GET)
|
1595 |
@RequestMapping(value = "/getPatnerActivateStock", method = RequestMethod.GET)
|
| 1618 |
public String getPartnerActivateStockItem(HttpServletRequest request,
|
1596 |
public String getPartnerActivateStockItem(HttpServletRequest request,
|
| 1619 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1597 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1620 |
List<ActivateItemModel> activateStocks = new ArrayList<>();
|
1598 |
List<ActivateItemModel> activateStocks = new ArrayList<>();
|
| 1621 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByActivatedNotSold(fofoId);
|
1599 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByActivatedNotSold(fofoId);
|
| 1622 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1600 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1623 |
|
1601 |
|
| 1624 |
for (InventoryItem inventoryItem : inventoryItems) {
|
1602 |
for (InventoryItem inventoryItem : inventoryItems) {
|
| Line 1638... |
Line 1616... |
| 1638 |
return "partner-activate-stock";
|
1616 |
return "partner-activate-stock";
|
| 1639 |
}
|
1617 |
}
|
| 1640 |
|
1618 |
|
| 1641 |
@RequestMapping(value = "/getPatnerBrandWiseMTDSale", method = RequestMethod.GET)
|
1619 |
@RequestMapping(value = "/getPatnerBrandWiseMTDSale", method = RequestMethod.GET)
|
| 1642 |
public String getPatnerBrandWiseMTDSale(HttpServletRequest request,
|
1620 |
public String getPatnerBrandWiseMTDSale(HttpServletRequest request,
|
| 1643 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1621 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1644 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1622 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1645 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1623 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1646 |
Map<String, Double> brandMtdAmount = fofoOrderItemRepository
|
1624 |
Map<String, Double> brandMtdAmount = fofoOrderItemRepository
|
| 1647 |
.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
|
1625 |
.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
|
| 1648 |
Map<String, Long> brandMtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(curDate.withDayOfMonth(1),
|
1626 |
Map<String, Long> brandMtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(curDate.withDayOfMonth(1),
|
| Line 1662... |
Line 1640... |
| 1662 |
return "partner-brand-mtd-sale";
|
1640 |
return "partner-brand-mtd-sale";
|
| 1663 |
}
|
1641 |
}
|
| 1664 |
|
1642 |
|
| 1665 |
@RequestMapping(value = "/getPatnerBrandWiseLMTDSale", method = RequestMethod.GET)
|
1643 |
@RequestMapping(value = "/getPatnerBrandWiseLMTDSale", method = RequestMethod.GET)
|
| 1666 |
public String getPatnerBrandWiseLMTDSale(HttpServletRequest request,
|
1644 |
public String getPatnerBrandWiseLMTDSale(HttpServletRequest request,
|
| 1667 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1645 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1668 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1646 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1669 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1647 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1670 |
Map<String, Double> brandLMtdAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
1648 |
Map<String, Double> brandLMtdAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
| 1671 |
curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
|
1649 |
curDate.withDayOfMonth(1).minusMonths(1), curDate.with(LocalTime.MAX).minusMonths(1), fofoId);
|
| 1672 |
Map<String, Long> brandLmtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(
|
1650 |
Map<String, Long> brandLmtdQty = fofoOrderItemRepository.selectSumQuantityGroupByBrand(
|
| Line 1688... |
Line 1666... |
| 1688 |
return "partner-brand-lmtd-sale";
|
1666 |
return "partner-brand-lmtd-sale";
|
| 1689 |
}
|
1667 |
}
|
| 1690 |
|
1668 |
|
| 1691 |
@RequestMapping(value = "/getPatnerBrandWiseLMSSale", method = RequestMethod.GET)
|
1669 |
@RequestMapping(value = "/getPatnerBrandWiseLMSSale", method = RequestMethod.GET)
|
| 1692 |
public String getPatnerBrandWiseLMSSale(HttpServletRequest request,
|
1670 |
public String getPatnerBrandWiseLMSSale(HttpServletRequest request,
|
| 1693 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1671 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1694 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1672 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1695 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1673 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1696 |
int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
|
1674 |
int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
|
| 1697 |
|
1675 |
|
| 1698 |
Map<String, Double> brandLMSAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
1676 |
Map<String, Double> brandLMSAmount = fofoOrderItemRepository.selectSumAmountGroupByBrand(
|
| Line 1715... |
Line 1693... |
| 1715 |
return "partner-brand-lms-sale";
|
1693 |
return "partner-brand-lms-sale";
|
| 1716 |
}
|
1694 |
}
|
| 1717 |
|
1695 |
|
| 1718 |
@RequestMapping(value = "/getPatnerInStock", method = RequestMethod.GET)
|
1696 |
@RequestMapping(value = "/getPatnerInStock", method = RequestMethod.GET)
|
| 1719 |
public String getPatnerInStock(HttpServletRequest request,
|
1697 |
public String getPatnerInStock(HttpServletRequest request,
|
| 1720 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1698 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1721 |
|
1699 |
|
| 1722 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1700 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1723 |
|
1701 |
|
| 1724 |
List<InStockBrandModel> mobileStocks = currentInventorySnapshotRepository
|
1702 |
List<InStockBrandModel> mobileStocks = currentInventorySnapshotRepository
|
| 1725 |
.selectSumInStockMobileGroupByBrand(fofoId);
|
1703 |
.selectSumInStockMobileGroupByBrand(fofoId);
|
| Line 1739... |
Line 1717... |
| 1739 |
return "partner-instock-item";
|
1717 |
return "partner-instock-item";
|
| 1740 |
}
|
1718 |
}
|
| 1741 |
|
1719 |
|
| 1742 |
@RequestMapping(value = "/getOpenTicketByFofoId", method = RequestMethod.GET)
|
1720 |
@RequestMapping(value = "/getOpenTicketByFofoId", method = RequestMethod.GET)
|
| 1743 |
public String getOpenTicketByFofoId(HttpServletRequest request,
|
1721 |
public String getOpenTicketByFofoId(HttpServletRequest request,
|
| 1744 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
1722 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
|
| 1745 |
Map<Integer, AuthUser> ticketIdAuthUser = new HashMap<>();
|
1723 |
Map<Integer, AuthUser> ticketIdAuthUser = new HashMap<>();
|
| 1746 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1724 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1747 |
List<Integer> ticketIds = ticketRepository.selectAllOpenTicketByRetailer(fofoId).stream().map(x -> x.getId())
|
1725 |
List<Integer> ticketIds = ticketRepository.selectAllOpenTicketByRetailer(fofoId).stream().map(x -> x.getId())
|
| 1748 |
.collect(Collectors.toList());
|
1726 |
.collect(Collectors.toList());
|
| 1749 |
List<TicketAssigned> ticketAssigns = ticketAssignedRepository.selectByTicketIds(ticketIds);
|
1727 |
List<TicketAssigned> ticketAssigns = ticketAssignedRepository.selectByTicketIds(ticketIds);
|
| Line 1758... |
Line 1736... |
| 1758 |
return "open-ticket";
|
1736 |
return "open-ticket";
|
| 1759 |
}
|
1737 |
}
|
| 1760 |
|
1738 |
|
| 1761 |
@RequestMapping(value = "/getPartnerSecondarySale", method = RequestMethod.GET)
|
1739 |
@RequestMapping(value = "/getPartnerSecondarySale", method = RequestMethod.GET)
|
| 1762 |
public String getPartnerSecondarySale(HttpServletRequest request,
|
1740 |
public String getPartnerSecondarySale(HttpServletRequest request,
|
| 1763 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, @RequestParam String timeValue, Model model)
|
1741 |
@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, @RequestParam String timeValue, Model model)
|
| 1764 |
throws Exception {
|
1742 |
throws Exception {
|
| 1765 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
1743 |
LocalDateTime curDate = LocalDate.now().atStartOfDay();
|
| 1766 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
1744 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
|
| 1767 |
int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
|
1745 |
int lengthOfMonth = YearMonth.from(curDate.minusMonths(1)).lengthOfMonth();
|
| 1768 |
LocalDateTime startDate = null;
|
1746 |
LocalDateTime startDate = null;
|
| Line 1891... |
Line 1869... |
| 1891 |
return "accessories-brand-wise-report";
|
1869 |
return "accessories-brand-wise-report";
|
| 1892 |
}
|
1870 |
}
|
| 1893 |
|
1871 |
|
| 1894 |
@RequestMapping(value = "/getMobileLMSGraph", method = RequestMethod.GET)
|
1872 |
@RequestMapping(value = "/getMobileLMSGraph", method = RequestMethod.GET)
|
| 1895 |
public String getMobileLMSGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
|
1873 |
public String getMobileLMSGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
|
| 1896 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
1874 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
| 1897 |
@RequestParam List<Integer> fofoIds, @RequestParam String filterType, Model model) throws Exception {
|
1875 |
@RequestParam List<Integer> fofoIds, @RequestParam String filterType, Model model) throws Exception {
|
| 1898 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
1876 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
| 1899 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
|
1877 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
|
| 1900 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
1878 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
| 1901 |
|
1879 |
|
| 1902 |
ChartModel cm;
|
1880 |
ChartModel cm;
|
| Line 1916... |
Line 1894... |
| 1916 |
return "brand-wise-mobile-lms-chart";
|
1894 |
return "brand-wise-mobile-lms-chart";
|
| 1917 |
}
|
1895 |
}
|
| 1918 |
|
1896 |
|
| 1919 |
@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
|
1897 |
@RequestMapping(value = "/getMobileLMSFilter", method = RequestMethod.GET)
|
| 1920 |
public String getMobileLMSFilter(HttpServletRequest request,
|
1898 |
public String getMobileLMSFilter(HttpServletRequest request,
|
| 1921 |
@RequestParam(required = false, defaultValue = "0") int warehouseId,
|
1899 |
@RequestParam(required = false, defaultValue = "0") int warehouseId,
|
| 1922 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
1900 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
| 1923 |
Model model) throws Exception {
|
1901 |
Model model) throws Exception {
|
| 1924 |
|
1902 |
|
| 1925 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1903 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 1926 |
String email = loginDetails.getEmailId();
|
1904 |
String email = loginDetails.getEmailId();
|
| 1927 |
|
1905 |
|
| 1928 |
if (date == null) {
|
1906 |
if (date == null) {
|
| Line 1946... |
Line 1924... |
| 1946 |
return "chart-filter-lms";
|
1924 |
return "chart-filter-lms";
|
| 1947 |
}
|
1925 |
}
|
| 1948 |
|
1926 |
|
| 1949 |
@RequestMapping(value = "/getMobileLMPGraph", method = RequestMethod.GET)
|
1927 |
@RequestMapping(value = "/getMobileLMPGraph", method = RequestMethod.GET)
|
| 1950 |
public String getMobileLMPGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
|
1928 |
public String getMobileLMPGraph(HttpServletRequest request, @RequestParam(required = false) int warehouseId,
|
| 1951 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
1929 |
@RequestParam(required = false) LocalDateTime date, @RequestParam(required = false) LocalDateTime endDate,
|
| 1952 |
@RequestParam List<Integer> fofoIds, @RequestParam String filterType, Model model) throws Exception {
|
1930 |
@RequestParam List<Integer> fofoIds, @RequestParam String filterType, Model model) throws Exception {
|
| 1953 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
1931 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
| 1954 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
|
1932 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream().collect(Collectors.groupingBy(
|
| 1955 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
1933 |
FofoStore::getWarehouseId, Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
| 1956 |
|
1934 |
|
| 1957 |
ChartModel cm;
|
1935 |
ChartModel cm;
|
| Line 2002... |
Line 1980... |
| 2002 |
return "activation-brandwise-report";
|
1980 |
return "activation-brandwise-report";
|
| 2003 |
}
|
1981 |
}
|
| 2004 |
|
1982 |
|
| 2005 |
@RequestMapping(value = "/getWarehouseBrandWiseItemActivatedModel", method = RequestMethod.GET)
|
1983 |
@RequestMapping(value = "/getWarehouseBrandWiseItemActivatedModel", method = RequestMethod.GET)
|
| 2006 |
public String getWarehouseBrandWiseItemActivatedModel(HttpServletRequest request, Model model,
|
1984 |
public String getWarehouseBrandWiseItemActivatedModel(HttpServletRequest request, Model model,
|
| 2007 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
1985 |
@RequestParam List<Integer> warehouseId, @RequestParam String brand) throws Exception {
|
| 2008 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
1986 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 2009 |
List<Integer> fofoIds = getFofoIds(loginDetails);
|
1987 |
List<Integer> fofoIds = getFofoIds(loginDetails);
|
| 2010 |
|
1988 |
|
| 2011 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
1989 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 2012 |
List<WarehouseBrandWiseItemActivatedModel> activatedItems = activatedImeiRepository
|
1990 |
List<WarehouseBrandWiseItemActivatedModel> activatedItems = activatedImeiRepository
|