| Line 1182... |
Line 1182... |
| 1182 |
LocalDate.of(2020, Month.SEPTEMBER, 1).atStartOfDay(), LocalDateTime.now());
|
1182 |
LocalDate.of(2020, Month.SEPTEMBER, 1).atStartOfDay(), LocalDateTime.now());
|
| 1183 |
LOGGER.info("Lava Inventory Size is {}", lavaInventoryItems.size());
|
1183 |
LOGGER.info("Lava Inventory Size is {}", lavaInventoryItems.size());
|
| 1184 |
}
|
1184 |
}
|
| 1185 |
|
1185 |
|
| 1186 |
public void createOffers(int offerId) throws Exception {
|
1186 |
public void createOffers(int offerId) throws Exception {
|
| 1187 |
Map<Integer, List<Integer>> targetMap = new HashMap<>();
|
1187 |
Map<List<Integer>, List<Integer>> targetMap = new HashMap<>();
|
| 1188 |
targetMap.put(175138855,Arrays.asList(400000,440000,500000));
|
- |
|
| 1189 |
targetMap.put(175138825,Arrays.asList(400000,440000,500000));
|
- |
|
| 1190 |
targetMap.put(175138896,Arrays.asList(400000,440000,500000));
|
- |
|
| 1191 |
targetMap.put(175138913,Arrays.asList(400000,500000,600000));
|
- |
|
| 1192 |
targetMap.put(175138816,Arrays.asList(500000,550000,625000));
|
- |
|
| 1193 |
targetMap.put(175138851,Arrays.asList(500000,600000,700000));
|
- |
|
| 1194 |
targetMap.put(175138914,Arrays.asList(600000,660000,750000));
|
- |
|
| 1195 |
targetMap.put(175135923,Arrays.asList(900000,990000,1125000));
|
- |
|
| 1196 |
targetMap.put(175138408,Arrays.asList(900000,990000,1125000));
|
1188 |
targetMap.put(Arrays.asList(22000,26000,29000),Arrays.asList(175138842,175138838,175138893,175127215,175138883,175135923,172157716,175138910,175138909,175138867,175138717,175138823,175138847,175138887,175138843,175138816,175135227,175138878,175138840,175138901,175138839,175138897,175138801,175138873,175138799,175138855,175138825,175138913,175138851,175138914,175138733,175138821,175138882,175138876,175138834,175138934,175138866,175138174,175138845,175136389,175138833,175138522,175138920,175138903,175138716,175138859,175138906,175138520,175136207,175138844,175138804,175138902,175138800,156232687,175138908,175135707,175138541,175138892,175138854,175138853,175138877,175138857,175138895,175138916,175138674,175138868,175138888,175138856,175138863,175138936,175138922,175138918,175138939,4149607,175138813,175138832,175138835,175138900,175138911,175138917,175138923,175138926,175138940,175138941,175138942,175138949));
|
| 1197 |
targetMap.put(175138805,Arrays.asList(300000,330000,375000));
|
1189 |
targetMap.put(Arrays.asList(24300,28700,32000),Arrays.asList(175138820,175138889,175138824));
|
| 1198 |
targetMap.put(175138733,Arrays.asList(300000,330000,375000));
|
1190 |
targetMap.put(Arrays.asList(24800,29300,32700),Arrays.asList(175138875));
|
| 1199 |
targetMap.put(175138821,Arrays.asList(300000,330000,375000));
|
1191 |
targetMap.put(Arrays.asList(25900,30600,34100),Arrays.asList(175138907));
|
| 1200 |
targetMap.put(175138878,Arrays.asList(380000,418000,475000));
|
- |
|
| 1201 |
targetMap.put(175138882,Arrays.asList(400000,440000,500000));
|
- |
|
| 1202 |
targetMap.put(175138876,Arrays.asList(400000,440000,500000));
|
- |
|
| 1203 |
targetMap.put(175138834,Arrays.asList(400000,440000,500000));
|
- |
|
| 1204 |
targetMap.put(175138934,Arrays.asList(400000,440000,500000));
|
- |
|
| 1205 |
targetMap.put(175138866,Arrays.asList(400000,440000,500000));
|
- |
|
| 1206 |
targetMap.put(175138174,Arrays.asList(400000,440000,500000));
|
- |
|
| 1207 |
targetMap.put(175138887,Arrays.asList(400000,440000,500000));
|
- |
|
| 1208 |
targetMap.put(175138845,Arrays.asList(400000,440000,500000));
|
- |
|
| 1209 |
targetMap.put(175136389,Arrays.asList(400000,440000,500000));
|
- |
|
| 1210 |
targetMap.put(175138833,Arrays.asList(400000,500000,600000));
|
- |
|
| 1211 |
targetMap.put(175138522,Arrays.asList(400000,500000,600000));
|
- |
|
| 1212 |
targetMap.put(175138871,Arrays.asList(400000,500000,600000));
|
- |
|
| 1213 |
targetMap.put(175138920,Arrays.asList(400000,500000,600000));
|
- |
|
| 1214 |
targetMap.put(175138903,Arrays.asList(400000,500000,600000));
|
- |
|
| 1215 |
targetMap.put(175138839,Arrays.asList(412000,453200,515000));
|
- |
|
| 1216 |
targetMap.put(175138716,Arrays.asList(450000,495000,562500));
|
- |
|
| 1217 |
targetMap.put(175138859,Arrays.asList(500000,550000,625000));
|
- |
|
| 1218 |
targetMap.put(175138906,Arrays.asList(500000,550000,625000));
|
- |
|
| 1219 |
targetMap.put(175138874,Arrays.asList(500000,550000,625000));
|
- |
|
| 1220 |
targetMap.put(175138520,Arrays.asList(500000,550000,625000));
|
- |
|
| 1221 |
targetMap.put(175136207,Arrays.asList(500000,550000,625000));
|
- |
|
| 1222 |
targetMap.put(175138844,Arrays.asList(500000,550000,625000));
|
- |
|
| 1223 |
targetMap.put(175138804,Arrays.asList(550000,605000,687500));
|
- |
|
| 1224 |
targetMap.put(175127215,Arrays.asList(555000,610500,693750));
|
- |
|
| 1225 |
targetMap.put(175138902,Arrays.asList(600000,660000,750000));
|
1192 |
targetMap.put(Arrays.asList(26000,30700,34200),Arrays.asList(175138871));
|
| 1226 |
targetMap.put(175138800,Arrays.asList(600000,660000,750000));
|
1193 |
targetMap.put(Arrays.asList(26800,31600,35300),Arrays.asList(175138805));
|
| 1227 |
targetMap.put(175138897,Arrays.asList(600000,660000,750000));
|
1194 |
targetMap.put(Arrays.asList(28600,33800,37700),Arrays.asList(175138829));
|
| 1228 |
targetMap.put(172157716,Arrays.asList(616000,677600,770000));
|
- |
|
| 1229 |
targetMap.put(175138801,Arrays.asList(680000,748000,850000));
|
- |
|
| 1230 |
targetMap.put(157112773,Arrays.asList(800000,880000,1000000));
|
- |
|
| 1231 |
targetMap.put(175138864,Arrays.asList(888000,976800,1110000));
|
- |
|
| 1232 |
targetMap.put(175138820,Arrays.asList(900000,990000,1125000));
|
- |
|
| 1233 |
targetMap.put(156232687,Arrays.asList(900000,990000,1125000));
|
- |
|
| 1234 |
targetMap.put(175135227,Arrays.asList(970000,1067000,1212500));
|
1195 |
targetMap.put(Arrays.asList(29300,34600,38600),Arrays.asList(175138870));
|
| 1235 |
targetMap.put(175138883,Arrays.asList(1200000,1320000,1500000));
|
- |
|
| 1236 |
targetMap.put(175138843,Arrays.asList(1200000,1320000,1500000));
|
- |
|
| 1237 |
targetMap.put(175138908,Arrays.asList(1300000,1430000,1500000));
|
- |
|
| 1238 |
targetMap.put(175138814,Arrays.asList(1300000,1430000,1625000));
|
- |
|
| 1239 |
targetMap.put(175135707,Arrays.asList(1350000,1485000,1687500));
|
- |
|
| 1240 |
targetMap.put(175138541,Arrays.asList(1752000,1927200,2190000));
|
1196 |
targetMap.put(Arrays.asList(31900,37700,42100),Arrays.asList(175138896,175135376));
|
| 1241 |
targetMap.put(175138842,Arrays.asList(1904000,2094400,2380000));
|
- |
|
| 1242 |
targetMap.put(175138893,Arrays.asList(400000,440000,500000));
|
- |
|
| 1243 |
targetMap.put(175138892,Arrays.asList(400000,440000,500000));
|
- |
|
| 1244 |
targetMap.put(175138886,Arrays.asList(300000,330000,375000));
|
- |
|
| 1245 |
targetMap.put(175138854,Arrays.asList(300000,330000,375000));
|
- |
|
| 1246 |
targetMap.put(175138853,Arrays.asList(300000,330000,375000));
|
- |
|
| 1247 |
targetMap.put(175138862,Arrays.asList(300000,330000,375000));
|
1197 |
targetMap.put(Arrays.asList(34200,40500,45100),Arrays.asList(175138874));
|
| 1248 |
targetMap.put(175138799,Arrays.asList(300000,330000,375000));
|
1198 |
targetMap.put(Arrays.asList(35400,41800,46600),Arrays.asList(175138812));
|
| 1249 |
targetMap.put(175138877,Arrays.asList(350000,385000,437500));
|
1199 |
targetMap.put(Arrays.asList(35900,42400,47300),Arrays.asList(175138827));
|
| 1250 |
targetMap.put(175138858,Arrays.asList(400000,440000,500000));
|
1200 |
targetMap.put(Arrays.asList(36400,43000,48000),Arrays.asList(175138864));
|
| 1251 |
targetMap.put(175138889,Arrays.asList(400000,440000,500000));
|
1201 |
targetMap.put(Arrays.asList(36900,43600,48600),Arrays.asList(157112773));
|
| 1252 |
targetMap.put(175138847,Arrays.asList(400000,440000,500000));
|
- |
|
| 1253 |
targetMap.put(175138857,Arrays.asList(400000,440000,500000));
|
- |
|
| 1254 |
targetMap.put(175135376,Arrays.asList(400000,440000,500000));
|
- |
|
| 1255 |
targetMap.put(175138870,Arrays.asList(400000,440000,500000));
|
- |
|
| 1256 |
targetMap.put(175138873,Arrays.asList(400000,440000,500000));
|
- |
|
| 1257 |
targetMap.put(175138901,Arrays.asList(400000,500000,600000));
|
- |
|
| 1258 |
targetMap.put(175138812,Arrays.asList(465000,511500,581250));
|
- |
|
| 1259 |
targetMap.put(175138895,Arrays.asList(500000,550000,625000));
|
- |
|
| 1260 |
targetMap.put(175138910,Arrays.asList(500000,550000,625000));
|
1202 |
targetMap.put(Arrays.asList(42900,50700,56600),Arrays.asList(175138862));
|
| 1261 |
targetMap.put(175138916,Arrays.asList(500000,600000,700000));
|
- |
|
| 1262 |
targetMap.put(175138909,Arrays.asList(500000,600000,700000));
|
- |
|
| 1263 |
targetMap.put(175138824,Arrays.asList(550000,605000,687500));
|
1203 |
targetMap.put(Arrays.asList(50700,59900,66800),Arrays.asList(175138879));
|
| 1264 |
targetMap.put(175138879,Arrays.asList(555000,610500,693750));
|
- |
|
| 1265 |
targetMap.put(175138907,Arrays.asList(566000,622600,707500));
|
- |
|
| 1266 |
targetMap.put(175138674,Arrays.asList(650000,715000,812500));
|
1204 |
targetMap.put(Arrays.asList(62300,73600,82000),Arrays.asList(175138886));
|
| 1267 |
targetMap.put(175138840,Arrays.asList(650000,715000,812500));
|
1205 |
targetMap.put(Arrays.asList(67500,79700,88900),Arrays.asList(175138836));
|
| 1268 |
targetMap.put(175138836,Arrays.asList(700000,770000,875000));
|
- |
|
| 1269 |
targetMap.put(175138868,Arrays.asList(775000,852500,968750));
|
- |
|
| 1270 |
targetMap.put(175138823,Arrays.asList(900000,990000,1125000));
|
1206 |
targetMap.put(Arrays.asList(69400,82000,91400),Arrays.asList(175138885));
|
| 1271 |
targetMap.put(175138888,Arrays.asList(900000,990000,1125000));
|
1207 |
targetMap.put(Arrays.asList(70500,83400,93000),Arrays.asList(175138408));
|
| 1272 |
targetMap.put(175138867,Arrays.asList(904000,994400,1130000));
|
- |
|
| 1273 |
targetMap.put(175138856,Arrays.asList(926000,1018600,1157500));
|
- |
|
| 1274 |
targetMap.put(175138863,Arrays.asList(968000,1064800,1210000));
|
- |
|
| 1275 |
targetMap.put(175138827,Arrays.asList(1150000,1265000,1437500));
|
- |
|
| 1276 |
targetMap.put(175138829,Arrays.asList(1300000,1430000,1625000));
|
1208 |
targetMap.put(Arrays.asList(130400,154100,171900),Arrays.asList(175138858));
|
| 1277 |
targetMap.put(175138875,Arrays.asList(1490000,1639000,1862500));
|
- |
|
| 1278 |
targetMap.put(175138372,Arrays.asList(1630000,1750000,1880000));
|
- |
|
| 1279 |
targetMap.put(175138885,Arrays.asList(2800000,3200000,3500000));
|
1209 |
targetMap.put(Arrays.asList(237800,281000,313400),Arrays.asList(175138372));
|
| 1280 |
targetMap.put(175138936,Arrays.asList(500000,580000,650000));
|
- |
|
| 1281 |
targetMap.put(175138922,Arrays.asList(700000,800000,900000));
|
- |
|
| 1282 |
targetMap.put(175138918,Arrays.asList(700000,800000,900000));
|
- |
|
| 1283 |
targetMap.put(175138939,Arrays.asList(700000,800000,900000));
|
- |
|
| - |
|
1210 |
|
| 1284 |
|
1211 |
|
| 1285 |
CreateOfferRequest createOfferRequest = offerService.getOffer(offerId);
|
1212 |
CreateOfferRequest createOfferRequest = offerService.getOffer(offerId);
|
| 1286 |
for(Map.Entry<Integer, List<Integer>> targetEntry : targetMap.entrySet()) {
|
1213 |
for(Map.Entry<List<Integer>, List<Integer>> targetEntry : targetMap.entrySet()) {
|
| 1287 |
int fofoId = targetEntry.getKey();
|
- |
|
| 1288 |
if(createOfferRequest.getPartnerCriteria().getFofoIds().contains(fofoId)) {
|
- |
|
| 1289 |
continue;
|
- |
|
| 1290 |
}
|
- |
|
| 1291 |
List<Integer> targets = targetEntry.getValue();
|
1214 |
List<Integer> targets = targetEntry.getValue();
|
| 1292 |
if(targets.size() != createOfferRequest.getTargetSlabs().size()) {
|
- |
|
| 1293 |
throw new ProfitMandiBusinessException("Invalid targets", fofoId, "invalid targets");
|
- |
|
| 1294 |
}
|
1215 |
|
| 1295 |
createOfferRequest.getPartnerCriteria().setFofoIds(Arrays.asList(fofoId));
|
1216 |
createOfferRequest.getPartnerCriteria().setFofoIds(targetEntry.getKey());
|
| 1296 |
int counter = 0;
|
1217 |
int counter = 0;
|
| 1297 |
for(com.spice.profitmandi.dao.model.TargetSlab targetSlab : createOfferRequest.getTargetSlabs()) {
|
1218 |
for(com.spice.profitmandi.dao.model.TargetSlab targetSlab : createOfferRequest.getTargetSlabs()) {
|
| 1298 |
targetSlab.setOnwardsAmount(targets.get(counter));
|
1219 |
targetSlab.setOnwardsAmount(targets.get(counter));
|
| 1299 |
counter++;
|
1220 |
counter++;
|
| 1300 |
}
|
1221 |
}
|