| Line 62... |
Line 62... |
| 62 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
62 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
| 63 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
63 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 64 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
64 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
| 65 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
65 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
| 66 |
import com.spice.profitmandi.service.pricing.PricingService;
|
66 |
import com.spice.profitmandi.service.pricing.PricingService;
|
| - |
|
67 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 67 |
import com.spice.profitmandi.service.user.RetailerService;
|
68 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 68 |
import com.spice.profitmandi.web.processor.OtpProcessor;
|
69 |
import com.spice.profitmandi.web.processor.OtpProcessor;
|
| 69 |
import com.spice.profitmandi.web.res.DealBrands;
|
70 |
import com.spice.profitmandi.web.res.DealBrands;
|
| 70 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
71 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
| 71 |
import com.spice.profitmandi.web.res.DealsResponse;
|
72 |
import com.spice.profitmandi.web.res.DealsResponse;
|
| Line 126... |
Line 127... |
| 126 |
@Autowired
|
127 |
@Autowired
|
| 127 |
private TagListingRepository tagListingRepository;
|
128 |
private TagListingRepository tagListingRepository;
|
| 128 |
|
129 |
|
| 129 |
@Autowired
|
130 |
@Autowired
|
| 130 |
private ItemRepository itemRepository;
|
131 |
private ItemRepository itemRepository;
|
| - |
|
132 |
|
| - |
|
133 |
@Autowired
|
| - |
|
134 |
private SchemeService schemeService;
|
| 131 |
|
135 |
|
| 132 |
@Autowired
|
136 |
@Autowired
|
| 133 |
private ItemAvailabilityCacheRepository itemAvailabilityCacheRepository;
|
137 |
private ItemAvailabilityCacheRepository itemAvailabilityCacheRepository;
|
| 134 |
|
138 |
|
| 135 |
@Autowired
|
139 |
@Autowired
|
| Line 435... |
Line 439... |
| 435 |
return false;
|
439 |
return false;
|
| 436 |
}
|
440 |
}
|
| 437 |
|
441 |
|
| 438 |
private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal)
|
442 |
private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal)
|
| 439 |
throws ProfitMandiBusinessException {
|
443 |
throws ProfitMandiBusinessException {
|
| - |
|
444 |
Map<Integer, Float> itemCashbackMap = schemeService.getItemSchemeCashBack();
|
| 440 |
Map<Integer, TagListing> itemTagListingMap = null;
|
445 |
Map<Integer, TagListing> itemTagListingMap = null;
|
| 441 |
List<FofoCatalogResponse> dealResponse = new ArrayList<>();
|
446 |
List<FofoCatalogResponse> dealResponse = new ArrayList<>();
|
| 442 |
List<Integer> tagIds = Arrays.asList(4);
|
447 |
List<Integer> tagIds = Arrays.asList(4);
|
| 443 |
if (docs.length() > 0) {
|
448 |
if (docs.length() > 0) {
|
| 444 |
HashSet<Integer> itemsSet = new HashSet<>();
|
449 |
HashSet<Integer> itemsSet = new HashSet<>();
|
| Line 493... |
Line 498... |
| 493 |
fofoAvailabilityInfoMap.get(itemId).setSellingPrice(sellingPrice);
|
498 |
fofoAvailabilityInfoMap.get(itemId).setSellingPrice(sellingPrice);
|
| 494 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|
499 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|
| 495 |
}
|
500 |
}
|
| 496 |
} else {
|
501 |
} else {
|
| 497 |
FofoAvailabilityInfo fdi = new FofoAvailabilityInfo();
|
502 |
FofoAvailabilityInfo fdi = new FofoAvailabilityInfo();
|
| - |
|
503 |
fdi.setCashback(itemCashbackMap.get(itemId)==null ? 0 : itemCashbackMap.get(itemId));
|
| 498 |
fdi.setSellingPrice((float) childItem.getDouble("sellingPrice_f"));
|
504 |
fdi.setSellingPrice((float) childItem.getDouble("sellingPrice_f"));
|
| 499 |
fdi.setMop((float) childItem.getDouble("mop_f"));
|
505 |
fdi.setMop((float) childItem.getDouble("mop_f"));
|
| 500 |
fdi.setColor(childItem.has("color_s") ? childItem.getString("color_s") : "");
|
506 |
fdi.setColor(childItem.has("color_s") ? childItem.getString("color_s") : "");
|
| 501 |
fdi.setTagId(childItem.getInt("tagId_i"));
|
507 |
fdi.setTagId(childItem.getInt("tagId_i"));
|
| 502 |
fdi.setItem_id(itemId);
|
508 |
fdi.setItem_id(itemId);
|