| Line 18... |
Line 18... |
| 18 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
18 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 19 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
19 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| 20 |
import com.spice.profitmandi.dao.model.AmountModel;
|
20 |
import com.spice.profitmandi.dao.model.AmountModel;
|
| 21 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
21 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
22 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| - |
|
23 |
import com.spice.profitmandi.dao.event.TagListingEventPublisher;
|
| 23 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
24 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 24 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
25 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
26 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 26 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
27 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
28 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| Line 129... |
Line 130... |
| 129 |
private FofoStoreRepository fofoStoreRepository;
|
130 |
private FofoStoreRepository fofoStoreRepository;
|
| 130 |
|
131 |
|
| 131 |
@Autowired
|
132 |
@Autowired
|
| 132 |
OrderService orderService;
|
133 |
OrderService orderService;
|
| 133 |
|
134 |
|
| - |
|
135 |
@Autowired
|
| - |
|
136 |
private TagListingEventPublisher tagListingEventPublisher;
|
| - |
|
137 |
|
| 134 |
@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
|
138 |
@RequestMapping(value = "/getItemDescription", method = RequestMethod.GET)
|
| 135 |
public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
|
139 |
public String getItemDescription(HttpServletRequest request, Model model) throws Throwable {
|
| 136 |
List<PriceDrop> priceDrops = priceDropRepository.selectAllIncomplete();
|
140 |
List<PriceDrop> priceDrops = priceDropRepository.selectAllIncomplete();
|
| 137 |
Set<Integer> catalogIds = priceDrops.stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
|
141 |
Set<Integer> catalogIds = priceDrops.stream().map(x -> x.getCatalogItemId()).collect(Collectors.toSet());
|
| 138 |
|
142 |
|
| Line 414... |
Line 418... |
| 414 |
priceDropRepository.persist(priceDrop);
|
418 |
priceDropRepository.persist(priceDrop);
|
| 415 |
priceDropService.priceDropStatus(priceDrop.getId());
|
419 |
priceDropService.priceDropStatus(priceDrop.getId());
|
| 416 |
response = true;
|
420 |
response = true;
|
| 417 |
|
421 |
|
| 418 |
this.sendPriceChangeNotification(priceDrop);
|
422 |
this.sendPriceChangeNotification(priceDrop);
|
| - |
|
423 |
|
| - |
|
424 |
// Publish event for real-time Solr update
|
| - |
|
425 |
try {
|
| - |
|
426 |
tagListingEventPublisher.publishPriceChange(0, currentItem.getCatalogItemId());
|
| - |
|
427 |
} catch (Exception e) {
|
| - |
|
428 |
LOGGER.error("Failed to publish price change event for catalogId: {}", currentItem.getCatalogItemId(), e);
|
| - |
|
429 |
}
|
| 419 |
} else {
|
430 |
} else {
|
| 420 |
throw new ProfitMandiBusinessException("Price Drop", priceDropModel.getPd(),
|
431 |
throw new ProfitMandiBusinessException("Price Drop", priceDropModel.getPd(),
|
| 421 |
"Price Drop Should be greater than 0");
|
432 |
"Price Drop Should be greater than 0");
|
| 422 |
}
|
433 |
}
|
| 423 |
}
|
434 |
}
|