| Line 676... |
Line 676... |
| 676 |
}
|
676 |
}
|
| 677 |
|
677 |
|
| 678 |
@RequestMapping(value = "/getInProcessOrder", method = RequestMethod.GET)
|
678 |
@RequestMapping(value = "/getInProcessOrder", method = RequestMethod.GET)
|
| 679 |
public String getInProcessOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
679 |
public String getInProcessOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
| 680 |
|
680 |
|
| 681 |
List<com.spice.profitmandi.dao.entity.transaction.Order> inProcessorder = orderRepository.selectAllOrder(OrderStatus.SUBMITTED_FOR_PROCESSING);
|
681 |
List<com.spice.profitmandi.dao.entity.transaction.Order> inProcessOrders = orderRepository.selectAllOrder(Arrays.asList(OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.LOW_INV_PO_RAISED));
|
| 682 |
List<Integer> retailerIds = new ArrayList<>();
|
682 |
List<Integer> retailerIds = new ArrayList<>();
|
| 683 |
List<Integer> orderIds = new ArrayList<>();
|
683 |
List<Integer> orderIds = new ArrayList<>();
|
| 684 |
if (!inProcessorder.isEmpty()) {
|
684 |
if (!inProcessOrders.isEmpty()) {
|
| 685 |
for (com.spice.profitmandi.dao.entity.transaction.Order order : inProcessorder) {
|
685 |
for (com.spice.profitmandi.dao.entity.transaction.Order order : inProcessOrders) {
|
| 686 |
retailerIds.add(order.getRetailerId());
|
686 |
retailerIds.add(order.getRetailerId());
|
| 687 |
orderIds.add(order.getId());
|
687 |
orderIds.add(order.getId());
|
| 688 |
|
688 |
|
| 689 |
}
|
689 |
}
|
| 690 |
|
690 |
|
| Line 700... |
Line 700... |
| 700 |
Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds).stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId, Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
|
700 |
Map<Integer, Optional<NotifyOrder>> notifyOrders = notifyOrderRespository.selectByorderIds(orderIds).stream().collect(Collectors.groupingBy(NotifyOrder::getOrderId, Collectors.maxBy((x1, x2) -> x1.getId() - x2.getId())));
|
| 701 |
|
701 |
|
| 702 |
Map<Integer, NotifyCancel> notifyCancelOrders = notifyCancelOrderRepository.selectByOrderIds(orderIds).stream().collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
|
702 |
Map<Integer, NotifyCancel> notifyCancelOrders = notifyCancelOrderRepository.selectByOrderIds(orderIds).stream().collect(Collectors.toMap(x -> x.getOrderId(), x -> x));
|
| 703 |
Map<Integer, String> storeIdAndFofoIdMap = fofoStoreRepository.selectByRetailerIds(retailerIds).stream().collect(Collectors.toMap(FofoStore::getId, FofoStore::getCode));
|
703 |
Map<Integer, String> storeIdAndFofoIdMap = fofoStoreRepository.selectByRetailerIds(retailerIds).stream().collect(Collectors.toMap(FofoStore::getId, FofoStore::getCode));
|
| 704 |
|
704 |
|
| 705 |
model.addAttribute("inProcessorder", inProcessorder);
|
705 |
model.addAttribute("inProcessorder", inProcessOrders);
|
| 706 |
model.addAttribute("storeIdAndFofoIdMap", storeIdAndFofoIdMap);
|
706 |
model.addAttribute("storeIdAndFofoIdMap", storeIdAndFofoIdMap);
|
| 707 |
model.addAttribute("latestNotifyOrders", notifyOrders);
|
707 |
model.addAttribute("latestNotifyOrders", notifyOrders);
|
| 708 |
model.addAttribute("notifyCancelOrders", notifyCancelOrders);
|
708 |
model.addAttribute("notifyCancelOrders", notifyCancelOrders);
|
| 709 |
} else {
|
709 |
} else {
|
| 710 |
model.addAttribute("inProcessorder", inProcessorder);
|
710 |
model.addAttribute("inProcessorder", inProcessOrders);
|
| 711 |
}
|
711 |
}
|
| 712 |
return "review_order";
|
712 |
return "review_order";
|
| 713 |
}
|
713 |
}
|
| 714 |
|
714 |
|
| 715 |
@RequestMapping(value = "/getPaymentPendingOrder", method = RequestMethod.GET)
|
715 |
@RequestMapping(value = "/getPaymentPendingOrder", method = RequestMethod.GET)
|
| Line 724... |
Line 724... |
| 724 |
}
|
724 |
}
|
| 725 |
|
725 |
|
| 726 |
@RequestMapping(value = "/getKeepInTabOrder", method = RequestMethod.GET)
|
726 |
@RequestMapping(value = "/getKeepInTabOrder", method = RequestMethod.GET)
|
| 727 |
public String getKeepInTabOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
727 |
public String getKeepInTabOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
| 728 |
|
728 |
|
| 729 |
List<com.spice.profitmandi.dao.entity.transaction.Order> keepatab = orderRepository.selectAllOrder(OrderStatus.KEEP_A_TAB);
|
729 |
List<com.spice.profitmandi.dao.entity.transaction.Order> keepatab = orderRepository.selectAllOrder(Arrays.asList(OrderStatus.KEEP_A_TAB));
|
| 730 |
|
730 |
|
| 731 |
model.addAttribute("keepatab", keepatab);
|
731 |
model.addAttribute("keepatab", keepatab);
|
| 732 |
|
732 |
|
| 733 |
return "keep-a-tab";
|
733 |
return "keep-a-tab";
|
| 734 |
}
|
734 |
}
|
| Line 946... |
Line 946... |
| 946 |
}
|
946 |
}
|
| 947 |
|
947 |
|
| 948 |
@RequestMapping(value = "/getAllNotifyOrder", method = RequestMethod.GET)
|
948 |
@RequestMapping(value = "/getAllNotifyOrder", method = RequestMethod.GET)
|
| 949 |
public String getAllNotifyOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
949 |
public String getAllNotifyOrder(HttpServletRequest request, Model model) throws ProfitMandiBusinessException {
|
| 950 |
List<NotifyOrder> notifyOrders = null;
|
950 |
List<NotifyOrder> notifyOrders = null;
|
| 951 |
List<com.spice.profitmandi.dao.entity.transaction.Order> inProcessorder = orderRepository.selectAllOrder(OrderStatus.SUBMITTED_FOR_PROCESSING);
|
951 |
List<com.spice.profitmandi.dao.entity.transaction.Order> inProcessorder = orderRepository.selectAllOrder(Arrays.asList(OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW));
|
| 952 |
|
952 |
|
| 953 |
List<Integer> orderIds = new ArrayList<>();
|
953 |
List<Integer> orderIds = new ArrayList<>();
|
| 954 |
if (!inProcessorder.isEmpty()) {
|
954 |
if (!inProcessorder.isEmpty()) {
|
| 955 |
for (com.spice.profitmandi.dao.entity.transaction.Order order : inProcessorder) {
|
955 |
for (com.spice.profitmandi.dao.entity.transaction.Order order : inProcessorder) {
|
| 956 |
|
956 |
|