Subversion Repositories SmartDukaan

Rev

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

Rev 34637 Rev 34661
Line 26... Line 26...
26
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
26
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
27
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
27
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
28
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
28
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
29
import com.spice.profitmandi.dao.repository.user.AddressRepository;
29
import com.spice.profitmandi.dao.repository.user.AddressRepository;
30
import com.spice.profitmandi.dao.service.BidService;
30
import com.spice.profitmandi.dao.service.BidService;
-
 
31
import com.spice.profitmandi.service.transaction.BlockLoanIdSanctionId;
31
import com.spice.profitmandi.service.transaction.SDCreditService;
32
import com.spice.profitmandi.service.transaction.SDCreditService;
32
import com.spice.profitmandi.service.transaction.TransactionService;
33
import com.spice.profitmandi.service.transaction.TransactionService;
33
import com.spice.profitmandi.service.wallet.CommonPaymentService;
34
import com.spice.profitmandi.service.wallet.CommonPaymentService;
34
import com.spice.profitmandi.service.wallet.WalletService;
35
import com.spice.profitmandi.service.wallet.WalletService;
35
import org.apache.logging.log4j.LogManager;
36
import org.apache.logging.log4j.LogManager;
Line 200... Line 201...
200
            double creditAmountRequired = totalPayableAmount - walletAmount;
201
            double creditAmountRequired = totalPayableAmount - walletAmount;
201
            int loanId = 0;
202
            int loanId = 0;
202
            try {
203
            try {
203
                if (creditAmountRequired > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE) {
204
                if (creditAmountRequired > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE) {
204
                    LOGGER.info("Creating new loan for: {}",userCart.getUserId());
205
                    LOGGER.info("Creating new loan for: {}",userCart.getUserId());
205
                    Loan loan = sdCreditService.createLoan(userCart.getUserId(), creditAmountRequired, 0, "Credit limit assigned via SD Credit");
206
                    BlockLoanIdSanctionId loan = sdCreditService.createSDDirectOrder(userCart.getUserId(), creditAmountRequired, 0);
206
                    loanId = loan.getId();
207
                    loanId = loan.getLoanId();
207
                }
208
                }
208
            } catch (Exception exception){
209
            } catch (Exception exception){
209
                if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
210
                if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
210
                    finalBidStatus = bidService.sendMailToRBM(netAmountInHand, totalPayableAmount, fofoId);
211
                    finalBidStatus = bidService.sendMailToRBM(netAmountInHand, totalPayableAmount, fofoId);
211
                    LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Cancelling the BID");
212
                    LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Cancelling the BID");