| 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 approvedLog = vendorCatalogPricingLogsOnEffectedDate.stream().filter(x -> x.getStatus().equals(VendorCatalogPricingStatus.APPROVED)).findAny().orElseGet(null);
|
177 |
VendorCatalogPricingLog approvedPricingLog = vendorCatalogPricingLogsOnEffectedDate.stream().filter(x -> x.getStatus().equals(VendorCatalogPricingStatus.APPROVED)).findAny().orElseGet(null);
|
| 178 |
if (approvedLog != null) {
|
178 |
if (approvedPricingLog != null) {
|
| 179 |
approvedLog.setStatus(VendorCatalogPricingStatus.REJECTED);
|
179 |
approvedPricingLog.setStatus(VendorCatalogPricingStatus.REJECTED);
|
| 180 |
approvedLog.setUpdatedTimestamp(LocalDateTime.now());
|
180 |
approvedPricingLog.setUpdatedTimestamp(LocalDateTime.now());
|
| 181 |
}
|
181 |
}
|
| 182 |
|
182 |
|
| 183 |
}
|
183 |
}
|
| 184 |
vendorCatalogPricingLog.setStatus(status);
|
184 |
vendorCatalogPricingLog.setStatus(status);
|
| 185 |
vendorCatalogPricingLog.setUpdatedTimestamp(LocalDateTime.now());
|
185 |
vendorCatalogPricingLog.setUpdatedTimestamp(LocalDateTime.now());
|