| Line 172... |
Line 172... |
| 172 |
|
172 |
|
| 173 |
VendorCatalogPricingLog vendorCatalogPricingLog = vendorCatalogPricingLogRepository.selectById(id);
|
173 |
VendorCatalogPricingLog vendorCatalogPricingLog = vendorCatalogPricingLogRepository.selectById(id);
|
| 174 |
|
174 |
|
| 175 |
if (status.equals(VendorCatalogPricingStatus.APPROVED)) {
|
175 |
if (status.equals(VendorCatalogPricingStatus.APPROVED)) {
|
| 176 |
List<VendorCatalogPricingLog> vendorCatalogPricingLogsOnEffectedDate = vendorCatalogPricingLogRepository.selectByEffectedDateAndCatalogId(vendorCatalogPricingLog.getVendorId(), vendorCatalogPricingLog.getCatalogId(), vendorCatalogPricingLog.getEffectedOn());
|
176 |
List<VendorCatalogPricingLog> vendorCatalogPricingLogsOnEffectedDate = vendorCatalogPricingLogRepository.selectByEffectedDateAndCatalogId(vendorCatalogPricingLog.getVendorId(), vendorCatalogPricingLog.getCatalogId(), vendorCatalogPricingLog.getEffectedOn());
|
| 177 |
VendorCatalogPricingLog approvedPricingLog = vendorCatalogPricingLogsOnEffectedDate.stream().filter(x -> x.getStatus().equals(VendorCatalogPricingStatus.APPROVED)).findAny().orElseGet(null);
|
177 |
Optional<VendorCatalogPricingLog> optionalVendorCatalogPricingLog = vendorCatalogPricingLogsOnEffectedDate.stream().filter(x -> x.getStatus().equals(VendorCatalogPricingStatus.APPROVED)).findAny();
|
| 178 |
if (approvedPricingLog != null) {
|
178 |
if (optionalVendorCatalogPricingLog.isPresent()) {
|
| - |
|
179 |
VendorCatalogPricingLog approvedPricingLog = optionalVendorCatalogPricingLog.get();
|
| 179 |
approvedPricingLog.setStatus(VendorCatalogPricingStatus.REJECTED);
|
180 |
approvedPricingLog.setStatus(VendorCatalogPricingStatus.REJECTED);
|
| 180 |
approvedPricingLog.setUpdatedTimestamp(LocalDateTime.now());
|
181 |
approvedPricingLog.setUpdatedTimestamp(LocalDateTime.now());
|
| 181 |
}
|
182 |
}
|
| 182 |
|
183 |
|
| 183 |
}
|
184 |
}
|