| Line 1321... |
Line 1321... |
| 1321 |
int itemId = entry.getKey();
|
1321 |
int itemId = entry.getKey();
|
| 1322 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
1322 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
| 1323 |
LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
|
1323 |
LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
|
| 1324 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
1324 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
| 1325 |
Item item = itemRepository.selectById(itemId);
|
1325 |
Item item = itemRepository.selectById(itemId);
|
| 1326 |
if (!(item.getBrand().equals("Live Demo") || item.getCategoryId()!=ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId()!=ProfitMandiConstants.TABLET_CATEGORY_ID)&& customFofoOrderItem.getSerialNumberDetails().stream()
|
1326 |
if (customFofoOrderItem.getSerialNumberDetails().stream()
|
| 1327 |
.filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber()))
|
1327 |
.filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber()))
|
| 1328 |
.collect(Collectors.toList()).size() > 0) {
|
1328 |
.collect(Collectors.toList()).size() > 0) {
|
| 1329 |
if (Utils.compareFloat(priceModel.getPrice(),
|
1329 |
if (Utils.compareFloat(priceModel.getPrice(),
|
| 1330 |
customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
|
1330 |
customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
|
| 1331 |
throw new ProfitMandiBusinessException("Selling Price for ",
|
1331 |
throw new ProfitMandiBusinessException("Selling Price for ",
|
| Line 1344... |
Line 1344... |
| 1344 |
private void validateMopPrice(Map<Integer, PriceModel> itemIdMopPriceMap,
|
1344 |
private void validateMopPrice(Map<Integer, PriceModel> itemIdMopPriceMap,
|
| 1345 |
Map<Integer, CustomFofoOrderItem> itemIdCustomFofoLineItemMap) throws ProfitMandiBusinessException {
|
1345 |
Map<Integer, CustomFofoOrderItem> itemIdCustomFofoLineItemMap) throws ProfitMandiBusinessException {
|
| 1346 |
Map<Integer, Float> invalidMopItemIdPriceMap = new HashMap<>();
|
1346 |
Map<Integer, Float> invalidMopItemIdPriceMap = new HashMap<>();
|
| 1347 |
for (Map.Entry<Integer, PriceModel> entry : itemIdMopPriceMap.entrySet()) {
|
1347 |
for (Map.Entry<Integer, PriceModel> entry : itemIdMopPriceMap.entrySet()) {
|
| 1348 |
CustomFofoOrderItem customFofoOrderItem = itemIdCustomFofoLineItemMap.get(entry.getKey());
|
1348 |
CustomFofoOrderItem customFofoOrderItem = itemIdCustomFofoLineItemMap.get(entry.getKey());
|
| - |
|
1349 |
Item item = itemRepository.selectById(customFofoOrderItem.getItemId());
|
| - |
|
1350 |
if (!(item.getBrand().equals("Live Demo") || item.getCategoryId()!=ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId()!=ProfitMandiConstants.TABLET_CATEGORY_ID) &&
|
| 1349 |
if (customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount() < entry.getValue()
|
1351 |
customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount() < entry.getValue()
|
| 1350 |
.getPrice()) {
|
1352 |
.getPrice()) {
|
| 1351 |
invalidMopItemIdPriceMap.put(entry.getKey(), customFofoOrderItem.getSellingPrice());
|
1353 |
invalidMopItemIdPriceMap.put(entry.getKey(), customFofoOrderItem.getSellingPrice());
|
| 1352 |
}
|
1354 |
}
|
| 1353 |
}
|
1355 |
}
|
| 1354 |
|
1356 |
|