| Line 1128... |
Line 1128... |
| 1128 |
|
1128 |
|
| 1129 |
if (doc.has("_childDocuments_")) {
|
1129 |
if (doc.has("_childDocuments_")) {
|
| 1130 |
for (int j = 0; j < doc.getJSONArray("_childDocuments_").length(); j++) {
|
1130 |
for (int j = 0; j < doc.getJSONArray("_childDocuments_").length(); j++) {
|
| 1131 |
JSONObject childItem = doc.getJSONArray("_childDocuments_").getJSONObject(j);
|
1131 |
JSONObject childItem = doc.getJSONArray("_childDocuments_").getJSONObject(j);
|
| 1132 |
int itemId = childItem.getInt("itemId_i");
|
1132 |
int itemId = childItem.getInt("itemId_i");
|
| - |
|
1133 |
// Solr sometimes outlives the DB row (stale index, soft-deleted Item,
|
| - |
|
1134 |
// cache lag). One bad row shouldn't 400 the whole catalogue — treat
|
| - |
|
1135 |
// a missing row as "not a smartphone" and keep going.
|
| - |
|
1136 |
try {
|
| 1133 |
ffdr.setIsSmartPhone(itemRepository.selectById(itemId).isSmartPhone());
|
1137 |
ffdr.setIsSmartPhone(itemRepository.selectById(itemId).isSmartPhone());
|
| - |
|
1138 |
} catch (ProfitMandiBusinessException e) {
|
| - |
|
1139 |
logger.warn("partnerStock: itemId {} present in Solr but missing from DB — skipping isSmartPhone", itemId);
|
| - |
|
1140 |
ffdr.setIsSmartPhone(false);
|
| - |
|
1141 |
}
|
| 1134 |
float sellingPrice = (float) childItem.getDouble("sellingPrice_f");
|
1142 |
float sellingPrice = (float) childItem.getDouble("sellingPrice_f");
|
| 1135 |
if (fofoAvailabilityInfoMap.containsKey(itemId)) {
|
1143 |
if (fofoAvailabilityInfoMap.containsKey(itemId)) {
|
| 1136 |
if (fofoAvailabilityInfoMap.get(itemId).getSellingPrice() > sellingPrice) {
|
1144 |
if (fofoAvailabilityInfoMap.get(itemId).getSellingPrice() > sellingPrice) {
|
| 1137 |
fofoAvailabilityInfoMap.get(itemId).setSellingPrice(sellingPrice);
|
1145 |
fofoAvailabilityInfoMap.get(itemId).setSellingPrice(sellingPrice);
|
| 1138 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|
1146 |
fofoAvailabilityInfoMap.get(itemId).setMop((float) childItem.getDouble("mop_f"));
|