Subversion Repositories SmartDukaan

Rev

Rev 34545 | Rev 34654 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34545 Rev 34562
Line 1351... Line 1351...
1351
        bid.setFofoId(userInfo.getRetailerId());
1351
        bid.setFofoId(userInfo.getRetailerId());
1352
        bid.setItemName(biddingModel.getItemName());
1352
        bid.setItemName(biddingModel.getItemName());
1353
        bid.setQuantity(biddingModel.getBidQty());
1353
        bid.setQuantity(biddingModel.getBidQty());
1354
        bid.setStatus(ProfitMandiConstants.BID_ENUM.PENDING);
1354
        bid.setStatus(ProfitMandiConstants.BID_ENUM.PENDING);
1355
        bid.setCreatedAt(LocalDateTime.now());
1355
        bid.setCreatedAt(LocalDateTime.now());
-
 
1356
        if (biddingModel.getId() == null) {
-
 
1357
            bidRepository.persist(bid);
-
 
1358
        }
1356
        if (biddings.size() > 1) {
1359
        if (biddings.size() > 1) {
1357
            for (Bid bidding : biddings) {
1360
            for (Bid bidding : biddings) {
1358
                if (!(bid.getFofoId().equals(bidding.getFofoId()))) bidService.notifyPartner(bid.getFofoId(), bidding, ProfitMandiConstants.BID_ENUM.UPDATE);
1361
                if (!(bid.getFofoId().equals(bidding.getFofoId()))) bidService.notifyPartner(bidding.getFofoId(), bid, ProfitMandiConstants.BID_ENUM.UPDATE);
1359
            }
1362
            }
1360
        }
1363
        }
1361
        if (biddingModel.getId() == null) {
-
 
1362
            bidRepository.persist(bid);
-
 
1363
        }
-
 
1364
        bidService.notifyPartner(bid.getFofoId(), bid, bid.getStatus());
1364
        bidService.notifyPartner(bid.getFofoId(), bid, bid.getStatus());
1365
        return responseSender.ok("Bid placed successfully!");
1365
        return responseSender.ok("Bid placed successfully!");
1366
    }
1366
    }
1367
 
1367
 
1368
 
1368