| Line 702... |
Line 702... |
| 702 |
LOGGER.info("sdssd" + fofoOrder);
|
702 |
LOGGER.info("sdssd" + fofoOrder);
|
| 703 |
fofoOrder.setTotalAmount(totalAmount);
|
703 |
fofoOrder.setTotalAmount(totalAmount);
|
| 704 |
List<FofoItemIdAmountModel> fofoItemIdAmountModel = partnerOptionsAndItemAmountModel.getItemAmountModel();
|
704 |
List<FofoItemIdAmountModel> fofoItemIdAmountModel = partnerOptionsAndItemAmountModel.getItemAmountModel();
|
| 705 |
for (FofoItemIdAmountModel fim : fofoItemIdAmountModel) {
|
705 |
for (FofoItemIdAmountModel fim : fofoItemIdAmountModel) {
|
| 706 |
LOGGER.info("fim" + fim.getFofoItemId());
|
706 |
LOGGER.info("fim" + fim.getFofoItemId());
|
| 707 |
|
707 |
|
| 708 |
LOGGER.info("fimAmount" + fim.getAmount());
|
708 |
LOGGER.info("fimAmount" + fim.getAmount());
|
| 709 |
Item item = itemRepository.selectById(fim.getItemId());
|
709 |
Item item = itemRepository.selectById(fim.getItemId());
|
| 710 |
TagListing tagListing = tagListingRepository.selectByItemId(item.getId());
|
710 |
TagListing tagListing = tagListingRepository.selectByItemId(item.getId());
|
| 711 |
FofoOrderItem fofoOrderItem = fofoOrderItemRepository.selectById(fim.getFofoItemId());
|
711 |
FofoOrderItem fofoOrderItem = fofoOrderItemRepository.selectById(fim.getFofoItemId());
|
| 712 |
LOGGER.info("category" + item.getCategoryId());
|
712 |
LOGGER.info("category" + item.getCategoryId());
|
| 713 |
if (item.getCategoryId() == ProfitMandiConstants.MOBILE_CATEGORY_ID) {
|
713 |
if (item.getCategoryId() == ProfitMandiConstants.MOBILE_CATEGORY_ID) {
|
| 714 |
if (fofoOrderItem.getMop() >= fim.getAmount()) {
|
714 |
if (fofoOrderItem.getMop() <= fim.getAmount()) {
|
| 715 |
|
715 |
|
| 716 |
if (fim.getAmount() <= tagListing.getMrp()) {
|
716 |
if (fim.getAmount() <= tagListing.getMrp()) {
|
| 717 |
fofoOrderItem.setSellingPrice(fim.getAmount());
|
717 |
fofoOrderItem.setSellingPrice(fim.getAmount());
|
| 718 |
} else {
|
718 |
} else {
|
| 719 |
throw new ProfitMandiBusinessException("Amount", fim.getAmount(),
|
719 |
throw new ProfitMandiBusinessException("Amount", fim.getAmount(),
|
| 720 |
"Sum of amount is not less than to MRP");
|
720 |
"Sum of amount is not less than to MRP");
|
| 721 |
}
|
721 |
}
|
| 722 |
|
722 |
|
| 723 |
LOGGER.info("fofoOrderItem2" + fofoOrderItem);
|
723 |
LOGGER.info("fofoOrderItem2" + fofoOrderItem);
|
| 724 |
|
724 |
|
| - |
|
725 |
} else {
|
| - |
|
726 |
// TODO below mop condition need to added added
|
| - |
|
727 |
fofoOrderItem.setSellingPrice(fim.getAmount());
|
| 725 |
}
|
728 |
}
|
| 726 |
|
729 |
|
| 727 |
} else {
|
730 |
} else {
|
| 728 |
fofoOrderItem.setSellingPrice(fim.getAmount());
|
731 |
fofoOrderItem.setSellingPrice(fim.getAmount());
|
| 729 |
LOGGER.info("fofoOrderItem1" + fofoOrderItem);
|
732 |
LOGGER.info("fofoOrderItem1" + fofoOrderItem);
|