| Line 4... |
Line 4... |
| 4 |
import com.spice.profitmandi.common.model.BulkOrderModel;
|
4 |
import com.spice.profitmandi.common.model.BulkOrderModel;
|
| 5 |
import com.spice.profitmandi.common.model.LineItemModel;
|
5 |
import com.spice.profitmandi.common.model.LineItemModel;
|
| 6 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
6 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 7 |
import com.spice.profitmandi.common.model.TransactionApprovalModel;
|
7 |
import com.spice.profitmandi.common.model.TransactionApprovalModel;
|
| 8 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
8 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 9 |
import com.spice.profitmandi.common.util.Utils;
|
- |
|
| 10 |
import com.spice.profitmandi.dao.cart.CartService;
|
9 |
import com.spice.profitmandi.dao.cart.CartService;
|
| 11 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 12 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
11 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
| 13 |
import com.spice.profitmandi.dao.entity.catalog.Liquidation;
|
- |
|
| 14 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
12 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 15 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
13 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
| 16 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
14 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 17 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
- |
|
| 18 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
15 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
| 19 |
import com.spice.profitmandi.dao.model.CartItem;
|
16 |
import com.spice.profitmandi.dao.model.CartItem;
|
| 20 |
import com.spice.profitmandi.dao.model.UserCart;
|
17 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 21 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
18 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
19 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
|
20 |
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
21 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
22 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 26 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
23 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| - |
|
24 |
import com.spice.profitmandi.dao.repository.fofo.LoanTransactionRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
25 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 28 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
26 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
27 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
28 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
| 31 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
29 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 32 |
import com.spice.profitmandi.dao.service.BidService;
|
30 |
import com.spice.profitmandi.dao.service.BidService;
|
| 33 |
import com.spice.profitmandi.service.AuthService;
|
- |
|
| 34 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
31 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 35 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
32 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 36 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
33 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
| 37 |
import com.spice.profitmandi.service.wallet.WalletService;
|
34 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 38 |
import org.apache.logging.log4j.LogManager;
|
35 |
import org.apache.logging.log4j.LogManager;
|
| Line 41... |
Line 38... |
| 41 |
import org.apache.poi.ss.usermodel.Row;
|
38 |
import org.apache.poi.ss.usermodel.Row;
|
| 42 |
import org.apache.poi.xssf.usermodel.XSSFRow;
|
39 |
import org.apache.poi.xssf.usermodel.XSSFRow;
|
| 43 |
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
40 |
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
| 44 |
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
41 |
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
| 45 |
import org.springframework.beans.factory.annotation.Autowired;
|
42 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 46 |
import org.springframework.mail.javamail.JavaMailSender;
|
- |
|
| 47 |
import org.springframework.stereotype.Service;
|
43 |
import org.springframework.stereotype.Service;
|
| 48 |
import org.springframework.transaction.annotation.Transactional;
|
44 |
import org.springframework.transaction.annotation.Transactional;
|
| 49 |
import org.springframework.web.multipart.MultipartFile;
|
45 |
import org.springframework.web.multipart.MultipartFile;
|
| 50 |
|
46 |
|
| 51 |
import java.math.BigDecimal;
|
47 |
import java.math.BigDecimal;
|
| 52 |
import java.nio.charset.StandardCharsets;
|
- |
|
| 53 |
import java.util.ArrayList;
|
48 |
import java.util.ArrayList;
|
| 54 |
import java.util.List;
|
49 |
import java.util.List;
|
| 55 |
import java.util.Map;
|
50 |
import java.util.Map;
|
| 56 |
import java.util.stream.Collectors;
|
51 |
import java.util.stream.Collectors;
|
| 57 |
|
52 |
|
| Line 90... |
Line 85... |
| 90 |
private AuthRepository authRepository;
|
85 |
private AuthRepository authRepository;
|
| 91 |
@Autowired
|
86 |
@Autowired
|
| 92 |
private BidRepository bidRepository;
|
87 |
private BidRepository bidRepository;
|
| 93 |
@Autowired
|
88 |
@Autowired
|
| 94 |
private BidService bidService;
|
89 |
private BidService bidService;
|
| - |
|
90 |
|
| - |
|
91 |
@Autowired
|
| - |
|
92 |
private LoanTransactionRepository loanTransactionRepository;
|
| - |
|
93 |
|
| 95 |
@Autowired
|
94 |
@Autowired
|
| 96 |
private LiquidationRepository liquidationRepository;
|
95 |
private LiquidationRepository liquidationRepository;
|
| 97 |
|
96 |
|
| 98 |
|
97 |
|
| 99 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
98 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
| Line 218... |
Line 217... |
| 218 |
if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
|
217 |
if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
|
| 219 |
bid.setStatus(ProfitMandiConstants.BID_ENUM.CLOSED);
|
218 |
bid.setStatus(ProfitMandiConstants.BID_ENUM.CLOSED);
|
| 220 |
}
|
219 |
}
|
| 221 |
if (approvalRequired) {
|
220 |
if (approvalRequired) {
|
| 222 |
this.createApproval(transactionId);
|
221 |
this.createApproval(transactionId);
|
| - |
|
222 |
if (loanId > 0) {
|
| - |
|
223 |
LoanTransaction loanTransaction = new LoanTransaction();
|
| - |
|
224 |
loanTransaction.setLoanId(loanId);
|
| - |
|
225 |
loanTransaction.setTransactionId(transactionId);
|
| - |
|
226 |
loanTransactionRepository.persist(loanTransaction);
|
| - |
|
227 |
}
|
| 223 |
} else {
|
228 |
} else {
|
| 224 |
transactionService.processTransaction(transactionId,loanId);
|
229 |
transactionService.processTransaction(transactionId,loanId);
|
| 225 |
}
|
230 |
}
|
| 226 |
|
231 |
|
| 227 |
}
|
232 |
}
|