| Line 9... |
Line 9... |
| 9 |
import com.spice.profitmandi.dao.cart.CartService;
|
9 |
import com.spice.profitmandi.dao.cart.CartService;
|
| 10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 11 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
11 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
| 12 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
12 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 13 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
13 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
| - |
|
14 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 14 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
15 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| - |
|
16 |
import com.spice.profitmandi.dao.entity.transaction.Transaction;
|
| - |
|
17 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
| - |
|
18 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 15 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
19 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
| 16 |
import com.spice.profitmandi.dao.model.CartItem;
|
20 |
import com.spice.profitmandi.dao.model.CartItem;
|
| 17 |
import com.spice.profitmandi.dao.model.UserCart;
|
21 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 18 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
22 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
23 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
| Line 93... |
Line 97... |
| 93 |
private LoanTransactionRepository loanTransactionRepository;
|
97 |
private LoanTransactionRepository loanTransactionRepository;
|
| 94 |
|
98 |
|
| 95 |
@Autowired
|
99 |
@Autowired
|
| 96 |
private LiquidationRepository liquidationRepository;
|
100 |
private LiquidationRepository liquidationRepository;
|
| 97 |
|
101 |
|
| - |
|
102 |
@Autowired
|
| - |
|
103 |
com.spice.profitmandi.dao.repository.user.UserRepository user_userRepository;
|
| - |
|
104 |
|
| 98 |
|
105 |
|
| 99 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
106 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
| 100 |
XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
|
107 |
XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
|
| 101 |
|
108 |
|
| 102 |
myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
|
109 |
myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
|
| Line 180... |
Line 187... |
| 180 |
|
187 |
|
| 181 |
double netAmountInHand = creditAvailability.doubleValue() + walletAmount;
|
188 |
double netAmountInHand = creditAvailability.doubleValue() + walletAmount;
|
| 182 |
LOGGER.info("netAmountInHand - " + netAmountInHand);
|
189 |
LOGGER.info("netAmountInHand - " + netAmountInHand);
|
| 183 |
if (totalPayableAmount > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE && netAmountInHand < totalPayableAmount) {
|
190 |
if (totalPayableAmount > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE && netAmountInHand < totalPayableAmount) {
|
| 184 |
if (type.equals(ProfitMandiConstants.PO_TYPE.MANUAL)) {
|
191 |
if (type.equals(ProfitMandiConstants.PO_TYPE.MANUAL)) {
|
| - |
|
192 |
User user = user_userRepository.selectById(fofoId);
|
| 185 |
throw new ProfitMandiBusinessException("Skipping order due to insufficient balance for id - ", fofoId, " ,Check wallet Balance once");
|
193 |
throw new ProfitMandiBusinessException("Skipping order due to insufficient balance for id - ", fofoId, user.getName());
|
| 186 |
} else {
|
194 |
} else {
|
| 187 |
if (scheduleType.equals(ProfitMandiConstants.BID_CRON_ENUM.TODAY)) {
|
195 |
if (scheduleType.equals(ProfitMandiConstants.BID_CRON_ENUM.TODAY)) {
|
| 188 |
finalBidStatus = bidService.sendMailToRBM(netAmountInHand, totalPayableAmount, fofoId);
|
196 |
finalBidStatus = bidService.sendMailToRBM(netAmountInHand, totalPayableAmount, fofoId);
|
| 189 |
LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Sending mail to RBM");
|
197 |
LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Sending mail to RBM");
|
| 190 |
//throw new ProfitMandiBusinessException("Skipping order due to insufficient balance for id - ", fofoId, " ,Sending mail to RBM");
|
198 |
//throw new ProfitMandiBusinessException("Skipping order due to insufficient balance for id - ", fofoId, " ,Sending mail to RBM");
|