Subversion Repositories SmartDukaan

Rev

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

Rev 34823 Rev 34878
Line 796... Line 796...
796
        // ResponseEntity<byte[]>(byteArrayOutputStream.toByteArray(),
796
        // ResponseEntity<byte[]>(byteArrayOutputStream.toByteArray(),
797
        // headers,HttpStatus.OK));
797
        // headers,HttpStatus.OK));
798
        /*
798
        /*
799
         * ResponseEntity<byte[]> response = new
799
         * ResponseEntity<byte[]> response = new
800
         * ResponseEntity<byte[]>(byteArrayOutputStream.toByteArray(), headers,
800
         * ResponseEntity<byte[]>(byteArrayOutputStream.toByteArray(), headers,
801
         * HttpStatus.OK); return response;
801
         * HttpStatus.OK); return response;{
802
         */
802
         */
803
 
803
 
804
    }
804
    }
805
 
805
 
806
    @RequestMapping(value = "/store/listing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
806
    @RequestMapping(value = "/store/listing", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
Line 1367... Line 1367...
1367
        bid.setStatus(ProfitMandiConstants.BID_ENUM.PENDING);
1367
        bid.setStatus(ProfitMandiConstants.BID_ENUM.PENDING);
1368
        bid.setCreatedAt(LocalDateTime.now());
1368
        bid.setCreatedAt(LocalDateTime.now());
1369
        if (biddingModel.getId() == null) {
1369
        if (biddingModel.getId() == null) {
1370
            bidRepository.persist(bid);
1370
            bidRepository.persist(bid);
1371
            //debit 500 from wallet
1371
            //debit 500 from wallet
-
 
1372
            try {
1372
            String reason = "Advance security for "+bid.getItemName()+" bid";
1373
                String reason = "Advance security for "+bid.getItemName()+" bid";
1373
            String message = "Dear Partner - We have Debited Rs "+ProfitMandiConstants.BID_CHARGES+" as Booking amount against your Bidding of Model No. "+bid.getItemName()+". We will refund this amount if the Bid gets approved.";
1374
                String message = "Dear Partner - We have Debited Rs "+ProfitMandiConstants.BID_CHARGES+" as Booking amount against your Bidding of Model No. "+bid.getItemName()+". We will refund this amount if the Bid gets approved.";
1374
            walletService.consumeAmountFromWallet(bid.getFofoId(),
1375
                walletService.consumeAmountFromWallet(bid.getFofoId(),
1375
                    bid.getId(),
1376
                        bid.getId(),
1376
                    WalletReferenceType.ADVANCE_SECURITY,
1377
                        WalletReferenceType.ADVANCE_SECURITY,
1377
                    reason, ProfitMandiConstants.BID_CHARGES,
1378
                        reason, ProfitMandiConstants.BID_CHARGES,
1378
                    bid.getCreatedAt(),true);
1379
                        bid.getCreatedAt(),false);
1379
            bidService.sendPushNotification(message,"Bidding Update!",Arrays.asList(bid.getFofoId()));
1380
                bidService.sendPushNotification(message,"Bidding Update!",Arrays.asList(bid.getFofoId()));
-
 
1381
            } catch (Exception e) {
-
 
1382
                logger.info("WalletDebit: {}",e.getMessage());
-
 
1383
            }
1380
        }
1384
        }
1381
        if (biddings.size() > 1) {
1385
        if (biddings.size() > 1) {
1382
            for (Bid bidding : biddings) {
1386
            for (Bid bidding : biddings) {
1383
                if (!(bid.getFofoId().equals(bidding.getFofoId()))) bidService.notifyPartner(bidding.getFofoId(), bid, ProfitMandiConstants.BID_ENUM.UPDATE);
1387
                if (!(bid.getFofoId().equals(bidding.getFofoId()))) bidService.notifyPartner(bidding.getFofoId(), bid, ProfitMandiConstants.BID_ENUM.UPDATE);
1384
            }
1388
            }