| Line 37... |
Line 37... |
| 37 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
37 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
| 38 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
38 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 39 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
39 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 40 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
40 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| 41 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
41 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
| - |
|
42 |
import com.spice.profitmandi.dao.model.TargetSlab;
|
| 42 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
43 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
44 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 44 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
45 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 45 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
46 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 46 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
47 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| Line 58... |
Line 59... |
| 58 |
import com.spice.profitmandi.service.integrations.gstpro.GstProAuthService;
|
59 |
import com.spice.profitmandi.service.integrations.gstpro.GstProAuthService;
|
| 59 |
import com.spice.profitmandi.service.integrations.gstpro.GstProService;
|
60 |
import com.spice.profitmandi.service.integrations.gstpro.GstProService;
|
| 60 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
61 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 61 |
import com.spice.profitmandi.service.inventory.PurchaseService;
|
62 |
import com.spice.profitmandi.service.inventory.PurchaseService;
|
| 62 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
63 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
| - |
|
64 |
import com.spice.profitmandi.service.offers.ItemCriteria;
|
| 63 |
import com.spice.profitmandi.service.offers.OfferService;
|
65 |
import com.spice.profitmandi.service.offers.OfferService;
|
| 64 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
66 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
| 65 |
import com.spice.profitmandi.service.order.OrderService;
|
67 |
import com.spice.profitmandi.service.order.OrderService;
|
| 66 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
68 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| 67 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
69 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| Line 923... |
Line 925... |
| 923 |
}
|
925 |
}
|
| 924 |
|
926 |
|
| 925 |
@Autowired
|
927 |
@Autowired
|
| 926 |
AmazonPurchaseService amazonPurchaseService;
|
928 |
AmazonPurchaseService amazonPurchaseService;
|
| 927 |
|
929 |
|
| - |
|
930 |
@Autowired
|
| - |
|
931 |
OfferTargetSlabRepository offerTargetSlabRepository;
|
| - |
|
932 |
|
| 928 |
public void amazonPurchase() throws Exception {
|
933 |
public void amazonPurchase() throws Exception {
|
| 929 |
amazonPurchaseService.purchaseAmazon("B085M5R82K", 10, 3999);
|
934 |
amazonPurchaseService.purchaseAmazon("B085M5R82K", 10, 3999);
|
| 930 |
}
|
935 |
}
|
| 931 |
|
936 |
|
| - |
|
937 |
@Autowired
|
| - |
|
938 |
ItemCriteriaRepository itemCriteriaRepository;
|
| - |
|
939 |
|
| - |
|
940 |
public void createOfferCriteria() throws Exception {
|
| - |
|
941 |
Map<Integer, List<Integer>> map = new HashMap<>();
|
| - |
|
942 |
map.put(31960, Arrays.asList(57, 69));
|
| - |
|
943 |
map.put(32844, Arrays.asList(57, 69));
|
| - |
|
944 |
map.put(31964, Arrays.asList(65, 78));
|
| - |
|
945 |
map.put(33493, Arrays.asList(70, 84));
|
| - |
|
946 |
map.put(32847, Arrays.asList(65, 78));
|
| - |
|
947 |
map.put(32623, Arrays.asList(72, 86));
|
| - |
|
948 |
map.put(31972, Arrays.asList(74, 88));
|
| - |
|
949 |
map.put(33495, Arrays.asList(78, 93));
|
| - |
|
950 |
map.put(32699, Arrays.asList(78, 93));
|
| - |
|
951 |
map.put(31967, Arrays.asList(78, 93));
|
| - |
|
952 |
map.put(33424, Arrays.asList(86, 103));
|
| - |
|
953 |
map.put(33441, Arrays.asList(94, 113));
|
| - |
|
954 |
map.put(33491, Arrays.asList(102, 123));
|
| - |
|
955 |
map.put(32664, Arrays.asList(94, 112));
|
| - |
|
956 |
map.put(33430, Arrays.asList(159, 181));
|
| - |
|
957 |
map.put(33381, Arrays.asList(172, 195));
|
| - |
|
958 |
map.put(33484, Arrays.asList(184, 209));
|
| - |
|
959 |
map.put(32698, Arrays.asList(171, 194));
|
| - |
|
960 |
map.put(32665, Arrays.asList(171, 194));
|
| - |
|
961 |
map.put(33428, Arrays.asList(146, 166));
|
| - |
|
962 |
map.put(33499, Arrays.asList(196, 223));
|
| - |
|
963 |
map.put(33427, Arrays.asList(184, 208));
|
| - |
|
964 |
map.put(33385, Arrays.asList(203, 230));
|
| - |
|
965 |
map.put(33373, Arrays.asList(196, 222));
|
| - |
|
966 |
map.put(33429, Arrays.asList(171, 193));
|
| - |
|
967 |
map.put(33387, Arrays.asList(215, 244));
|
| - |
|
968 |
map.put(33432, Arrays.asList(208, 236));
|
| - |
|
969 |
map.put(32546, Arrays.asList(196, 222));
|
| - |
|
970 |
map.put(33389, Arrays.asList(227, 257));
|
| - |
|
971 |
map.put(33498, Arrays.asList(233, 264));
|
| - |
|
972 |
map.put(33496, Arrays.asList(202, 229));
|
| - |
|
973 |
map.put(32088, Arrays.asList(233, 264));
|
| - |
|
974 |
map.put(33377, Arrays.asList(233, 264));
|
| - |
|
975 |
map.put(33395, Arrays.asList(327, 392));
|
| - |
|
976 |
map.put(33393, Arrays.asList(344, 413));
|
| - |
|
977 |
map.put(32277, Arrays.asList(360, 432));
|
| - |
|
978 |
map.put(33397, Arrays.asList(377, 452));
|
| - |
|
979 |
map.put(32305, Arrays.asList(393, 472));
|
| - |
|
980 |
map.put(33492, Arrays.asList(409, 491));
|
| - |
|
981 |
map.put(33399, Arrays.asList(409, 491));
|
| - |
|
982 |
map.put(33405, Arrays.asList(442, 531));
|
| - |
|
983 |
map.put(33403, Arrays.asList(442, 531));
|
| - |
|
984 |
map.put(32854, Arrays.asList(442, 531));
|
| - |
|
985 |
map.put(32155, Arrays.asList(458, 550));
|
| - |
|
986 |
map.put(32151, Arrays.asList(458, 550));
|
| - |
|
987 |
map.put(33407, Arrays.asList(475, 570));
|
| - |
|
988 |
map.put(32855, Arrays.asList(475, 570));
|
| - |
|
989 |
map.put(33409, Arrays.asList(655, 786));
|
| - |
|
990 |
map.put(33411, Arrays.asList(688, 825));
|
| - |
|
991 |
map.put(32687, Arrays.asList(688, 825));
|
| - |
|
992 |
map.put(33413, Arrays.asList(720, 865));
|
| - |
|
993 |
map.put(33415, Arrays.asList(1032, 1238));
|
| - |
|
994 |
map.put(33417, Arrays.asList(1097, 1316));
|
| - |
|
995 |
|
| - |
|
996 |
Offer offer = offerRepository.selectById(1099);
|
| - |
|
997 |
List<TargetSlab> targetSlabs = offerTargetSlabRepository.getByOfferId(offer.getId());
|
| - |
|
998 |
ItemCriteria itemCriteria = targetSlabs.get(0).getItemCriteriaPayouts().get(0).getItemCriteria();
|
| - |
|
999 |
|
| - |
|
1000 |
Map<List<Integer>, List<Integer>> payoutModelsMap = map.entrySet().stream().map(x ->
|
| - |
|
1001 |
{
|
| - |
|
1002 |
try {
|
| - |
|
1003 |
int catalogId = itemRepository.selectById(x.getKey()).getCatalogItemId();
|
| - |
|
1004 |
return new AbstractMap.SimpleEntry<>(catalogId, x.getValue());
|
| - |
|
1005 |
} catch (Exception e) {
|
| - |
|
1006 |
return new AbstractMap.SimpleEntry<>(0, new ArrayList());
|
| - |
|
1007 |
}
|
| - |
|
1008 |
}).collect(Collectors.groupingBy(x -> x.getValue(), Collectors.mapping(x -> x.getKey(), Collectors.toList())));
|
| - |
|
1009 |
|
| - |
|
1010 |
payoutModelsMap.entrySet().stream().forEach(x ->
|
| - |
|
1011 |
{
|
| - |
|
1012 |
itemCriteria.setCatalogIds(x.getValue());
|
| - |
|
1013 |
|
| - |
|
1014 |
com.spice.profitmandi.dao.entity.catalog.ItemCriteria itemCriteria1 = new com.spice.profitmandi.dao.entity.catalog.ItemCriteria();
|
| - |
|
1015 |
itemCriteria1.setCriteria(gson.toJson(itemCriteria));
|
| - |
|
1016 |
itemCriteriaRepository.persist(itemCriteria1);
|
| - |
|
1017 |
com.spice.profitmandi.dao.entity.catalog.TargetSlab ts = new com.spice.profitmandi.dao.entity.catalog.TargetSlab();
|
| - |
|
1018 |
ts.setOfferId(offer.getId());
|
| - |
|
1019 |
ts.setAmountType(targetSlabs.get(0).getItemCriteriaPayouts().get(0).getAmountType());
|
| - |
|
1020 |
ts.setPayoutTarget(25);
|
| - |
|
1021 |
ts.setItemCriteriaId(itemCriteria1.getId());
|
| - |
|
1022 |
ts.setPayoutValue(x.getKey().get(0));
|
| - |
|
1023 |
offerTargetSlabRepository.persist(ts);
|
| - |
|
1024 |
|
| - |
|
1025 |
com.spice.profitmandi.dao.entity.catalog.TargetSlab ts1 = new com.spice.profitmandi.dao.entity.catalog.TargetSlab();
|
| - |
|
1026 |
ts1.setOfferId(offer.getId());
|
| - |
|
1027 |
ts1.setAmountType(targetSlabs.get(0).getItemCriteriaPayouts().get(0).getAmountType());
|
| - |
|
1028 |
ts1.setPayoutTarget(100);
|
| - |
|
1029 |
ts1.setItemCriteriaId(itemCriteria1.getId());
|
| - |
|
1030 |
ts1.setPayoutValue(x.getKey().get(1));
|
| - |
|
1031 |
offerTargetSlabRepository.persist(ts1);
|
| - |
|
1032 |
});
|
| - |
|
1033 |
|
| - |
|
1034 |
}
|
| - |
|
1035 |
|
| 932 |
|
1036 |
|
| 933 |
private class SioTuple {
|
1037 |
private class SioTuple {
|
| 934 |
int inventoryId;
|
1038 |
int inventoryId;
|
| 935 |
SchemeType schemeType;
|
1039 |
SchemeType schemeType;
|
| 936 |
|
1040 |
|
| Line 1412... |
Line 1516... |
| 1412 |
partnerDailyInvestment.setUnbilledAmount(investment.getUnbilledAmount());
|
1516 |
partnerDailyInvestment.setUnbilledAmount(investment.getUnbilledAmount());
|
| 1413 |
partnerDailyInvestment.setReturnInTransitAmount(investment.getReturnInTransitAmount());
|
1517 |
partnerDailyInvestment.setReturnInTransitAmount(investment.getReturnInTransitAmount());
|
| 1414 |
partnerDailyInvestment.setSalesAmount(investment.getSalesAmount());
|
1518 |
partnerDailyInvestment.setSalesAmount(investment.getSalesAmount());
|
| 1415 |
partnerDailyInvestment.setInStockAmount(investment.getInStockAmount());
|
1519 |
partnerDailyInvestment.setInStockAmount(investment.getInStockAmount());
|
| 1416 |
partnerDailyInvestment.setWalletAmount(investment.getWalletAmount());
|
1520 |
partnerDailyInvestment.setWalletAmount(investment.getWalletAmount());
|
| - |
|
1521 |
partnerDailyInvestment.setActivatedGrnPendingAmount(investment.getActivatedGrnPendingAmount());
|
| 1417 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
1522 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
| 1418 |
}
|
1523 |
}
|
| 1419 |
}
|
1524 |
}
|
| 1420 |
}
|
1525 |
}
|
| 1421 |
|
1526 |
|