| Line 8... |
Line 8... |
| 8 |
import com.spice.profitmandi.common.util.FileUtil;
|
8 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 9 |
import com.spice.profitmandi.common.util.PdfUtils;
|
9 |
import com.spice.profitmandi.common.util.PdfUtils;
|
| 10 |
import com.spice.profitmandi.common.util.StringUtils;
|
10 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 11 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
11 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 12 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
12 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| - |
|
13 |
import com.spice.profitmandi.dao.entity.catalog.CustomerOffer;
|
| - |
|
14 |
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
|
| 13 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
15 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 14 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
16 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 15 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
17 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 16 |
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
|
18 |
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
|
| 17 |
import com.spice.profitmandi.dao.entity.dtr.InsuranceProvider;
|
19 |
import com.spice.profitmandi.dao.entity.dtr.InsuranceProvider;
|
| 18 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
20 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
| - |
|
21 |
import com.spice.profitmandi.dao.entity.dtr.WebOffer;
|
| 19 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
22 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 20 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
23 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
| 21 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
24 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 22 |
import com.spice.profitmandi.dao.entity.user.Address;
|
25 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 23 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
26 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 24 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
27 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
| 25 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
28 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 26 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
29 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
| 27 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
30 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 28 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
31 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 29 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
- |
|
| 30 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
32 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| 31 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
33 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 32 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
34 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| 33 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
35 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 34 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
36 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
| Line 179... |
Line 181... |
| 179 |
@Autowired
|
181 |
@Autowired
|
| 180 |
CartRepository cartRepository;
|
182 |
CartRepository cartRepository;
|
| 181 |
@Autowired
|
183 |
@Autowired
|
| 182 |
UserWalletRepository userWalletRepository;
|
184 |
UserWalletRepository userWalletRepository;
|
| 183 |
|
185 |
|
| - |
|
186 |
@Autowired
|
| - |
|
187 |
private CatalogRepository catalogRepository;
|
| - |
|
188 |
|
| - |
|
189 |
@Autowired
|
| - |
|
190 |
private CustomerOfferRepository customerOfferRepository;
|
| - |
|
191 |
|
| - |
|
192 |
@Autowired
|
| - |
|
193 |
private CustomerOfferItemRepository customerOfferItemRepository;
|
| - |
|
194 |
|
| - |
|
195 |
@Autowired
|
| - |
|
196 |
private WebOfferRepository webOfferRepository;
|
| 184 |
|
197 |
|
| 185 |
@Autowired
|
198 |
@Autowired
|
| 186 |
PositionRepository positionRepository;
|
199 |
PositionRepository positionRepository;
|
| 187 |
|
200 |
|
| 188 |
@Autowired
|
201 |
@Autowired
|
| Line 922... |
Line 935... |
| 922 |
}
|
935 |
}
|
| 923 |
|
936 |
|
| 924 |
itemIdAndPoiMap = pendingOrderItems.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> pendingOrderItemRepository.selectById(x.getId())));
|
937 |
itemIdAndPoiMap = pendingOrderItems.stream().collect(Collectors.toMap(x -> x.getItemId(), x -> pendingOrderItemRepository.selectById(x.getId())));
|
| 925 |
}
|
938 |
}
|
| 926 |
|
939 |
|
| - |
|
940 |
|
| - |
|
941 |
// get the list of customer item for every item code start here
|
| - |
|
942 |
// ...............................................................
|
| - |
|
943 |
|
| - |
|
944 |
List<Map<Integer, List<CustomerOfferItem>>> itemOfferItemMapList = new ArrayList<>();
|
| - |
|
945 |
|
| - |
|
946 |
|
| - |
|
947 |
LocalDateTime todayDate = LocalDateTime.now();
|
| - |
|
948 |
LocalDate todayDate2 = LocalDate.now();
|
| - |
|
949 |
|
| - |
|
950 |
Map<Integer, List<CustomerOfferItem>> offerItemMap = new HashMap<>();
|
| - |
|
951 |
Map<Integer, List<WebOffer>> webOfferMap = new HashMap<>();
|
| - |
|
952 |
|
| - |
|
953 |
List<CustomerOffer> customerOffers = customerOfferRepository.selectOffersByDate(todayDate);
|
| - |
|
954 |
List<Integer> customerOfferIds = customerOffers.stream().map(x -> x.getId()).distinct().collect(Collectors.toList());
|
| - |
|
955 |
for (CartFofo cartItem : cartItems) {
|
| - |
|
956 |
Item item = itemRepository.selectById(cartItem.getItemId());
|
| - |
|
957 |
List<CustomerOfferItem> customerOfferItems = customerOfferItemRepository.selectByOfferIds(customerOfferIds, item.getCatalogItemId(), todayDate2);
|
| - |
|
958 |
|
| - |
|
959 |
offerItemMap.put(item.getId(), customerOfferItems);
|
| - |
|
960 |
|
| - |
|
961 |
|
| - |
|
962 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(item.getCatalogItemId());
|
| - |
|
963 |
webOfferMap.put(item.getId(), webOffers);
|
| - |
|
964 |
}
|
| - |
|
965 |
|
| - |
|
966 |
// get the list of customer item for every item code end here
|
| - |
|
967 |
// ...............................................................
|
| - |
|
968 |
|
| 927 |
LOGGER.info("itemIdAndPoiMap {}", itemIdAndPoiMap);
|
969 |
LOGGER.info("itemIdAndPoiMap {}", itemIdAndPoiMap);
|
| 928 |
LOGGER.info("mopPriceMap {}", mopPriceMap);
|
970 |
LOGGER.info("mopPriceMap {}", mopPriceMap);
|
| 929 |
model.addAttribute("stateNames",
|
971 |
model.addAttribute("stateNames",
|
| 930 |
stateRepository.selectAll().stream().map(x -> x.getName()).collect(Collectors.toList()));
|
972 |
stateRepository.selectAll().stream().map(x -> x.getName()).collect(Collectors.toList()));
|
| 931 |
model.addAttribute("retailerStateName", address.getState());
|
973 |
model.addAttribute("retailerStateName", address.getState());
|
| Line 939... |
Line 981... |
| 939 |
model.addAttribute("onlineSellingPrice", onlineSellingPrice);
|
981 |
model.addAttribute("onlineSellingPrice", onlineSellingPrice);
|
| 940 |
|
982 |
|
| 941 |
model.addAttribute("mopPriceMap", mopPriceMap);
|
983 |
model.addAttribute("mopPriceMap", mopPriceMap);
|
| 942 |
model.addAttribute("paymentOptions", paymentOptions);
|
984 |
model.addAttribute("paymentOptions", paymentOptions);
|
| 943 |
model.addAttribute("accessoriesDeals", accessoriesDeals);
|
985 |
model.addAttribute("accessoriesDeals", accessoriesDeals);
|
| - |
|
986 |
model.addAttribute("offerItemMap", offerItemMap);
|
| - |
|
987 |
model.addAttribute("webOfferMap", webOfferMap);
|
| 944 |
return "order-index";
|
988 |
return "order-index";
|
| 945 |
}
|
989 |
}
|
| 946 |
|
990 |
|
| 947 |
private Map<String, List<MobileInsurancePlan>> getPlans(float sellingPrice, int itemId, int poiId)
|
991 |
private Map<String, List<MobileInsurancePlan>> getPlans(float sellingPrice, int itemId, int poiId)
|
| 948 |
throws ProfitMandiBusinessException {
|
992 |
throws ProfitMandiBusinessException {
|
| Line 968... |
Line 1012... |
| 968 |
"Could not fetch insurance Plans");
|
1012 |
"Could not fetch insurance Plans");
|
| 969 |
}
|
1013 |
}
|
| 970 |
|
1014 |
|
| 971 |
}
|
1015 |
}
|
| 972 |
|
1016 |
|
| - |
|
1017 |
|
| - |
|
1018 |
@GetMapping("/getItemWiseUpgradeOffer")
|
| - |
|
1019 |
public String getItemWiseUpgradeOffer(HttpServletRequest request, @RequestParam int itemId, Model model)
|
| - |
|
1020 |
throws ProfitMandiBusinessException {
|
| - |
|
1021 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
1022 |
|
| - |
|
1023 |
Item item = itemRepository.selectById(itemId);
|
| - |
|
1024 |
|
| - |
|
1025 |
LocalDateTime todayDate = LocalDateTime.now();
|
| - |
|
1026 |
LocalDate todayDate2 = LocalDate.now();
|
| - |
|
1027 |
|
| - |
|
1028 |
List<CustomerOffer> customerOffers = customerOfferRepository.selectOffersByDate(todayDate);
|
| - |
|
1029 |
Map<Integer, CustomerOffer> customerOfferMap = customerOffers.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
1030 |
List<Integer> customerOfferIds = customerOffers.stream().map(x -> x.getId()).distinct().collect(Collectors.toList());
|
| - |
|
1031 |
List<CustomerOfferItem> customerOfferItems = customerOfferItemRepository.selectByOfferIds(customerOfferIds, item.getCatalogItemId(), todayDate2);
|
| - |
|
1032 |
|
| - |
|
1033 |
List<WebOffer> webOffers = webOfferRepository.selectAllActiveOffers().get(item.getCatalogItemId());
|
| - |
|
1034 |
|
| - |
|
1035 |
model.addAttribute("webOffers", webOffers);
|
| - |
|
1036 |
model.addAttribute("customerOfferMap", customerOfferMap);
|
| - |
|
1037 |
model.addAttribute("customerOfferItems", customerOfferItems);
|
| - |
|
1038 |
|
| - |
|
1039 |
return "upgrade-customer-offer-model";
|
| - |
|
1040 |
}
|
| - |
|
1041 |
|
| 973 |
@GetMapping("/insuranceDetails")
|
1042 |
@GetMapping("/insuranceDetails")
|
| 974 |
public String getInsuranceDetails(HttpServletRequest request,
|
1043 |
public String getInsuranceDetails(HttpServletRequest request,
|
| 975 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
1044 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 976 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
1045 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
| 977 |
throws ProfitMandiBusinessException {
|
1046 |
throws ProfitMandiBusinessException {
|