| Line 7... |
Line 7... |
| 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.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.Item;
|
| 12 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
13 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 13 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
14 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
| 14 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
15 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 15 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
16 |
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.Transaction;
|
| Line 18... |
Line 19... |
| 18 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
19 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
| 19 |
import com.spice.profitmandi.dao.model.CartItem;
|
20 |
import com.spice.profitmandi.dao.model.CartItem;
|
| 20 |
import com.spice.profitmandi.dao.model.UserCart;
|
21 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 21 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
22 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
23 |
import com.spice.profitmandi.dao.repository.catalog.BidRepository;
|
| - |
|
24 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
|
25 |
import com.spice.profitmandi.dao.repository.catalog.LiquidationRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
26 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
27 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 26 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
28 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.fofo.LoanTransactionRepository;
|
29 |
import com.spice.profitmandi.dao.repository.fofo.LoanTransactionRepository;
|
| Line 29... |
Line 31... |
| 29 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
31 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
32 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
| 31 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
33 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
| 32 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
34 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 33 |
import com.spice.profitmandi.dao.service.BidService;
|
35 |
import com.spice.profitmandi.dao.service.BidService;
|
| - |
|
36 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
| 34 |
import com.spice.profitmandi.service.transaction.BlockLoanIdSanctionId;
|
37 |
import com.spice.profitmandi.service.transaction.BlockLoanIdSanctionId;
|
| 35 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
38 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 36 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
39 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 37 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
40 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
| 38 |
import com.spice.profitmandi.service.wallet.WalletService;
|
41 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| Line 89... |
Line 92... |
| 89 |
private AuthRepository authRepository;
|
92 |
private AuthRepository authRepository;
|
| 90 |
@Autowired
|
93 |
@Autowired
|
| 91 |
private BidRepository bidRepository;
|
94 |
private BidRepository bidRepository;
|
| 92 |
@Autowired
|
95 |
@Autowired
|
| 93 |
private BidService bidService;
|
96 |
private BidService bidService;
|
| - |
|
97 |
@Autowired
|
| - |
|
98 |
ItemRepository itemRepository;
|
| 94 |
|
99 |
@Autowired
|
| - |
|
100 |
private BrandsService brandsService;
|
| 95 |
@Autowired
|
101 |
@Autowired
|
| 96 |
private LoanTransactionRepository loanTransactionRepository;
|
102 |
private LoanTransactionRepository loanTransactionRepository;
|
| 97 |
|
103 |
|
| 98 |
@Autowired
|
104 |
@Autowired
|
| 99 |
private LiquidationRepository liquidationRepository;
|
105 |
private LiquidationRepository liquidationRepository;
|
| Line 151... |
Line 157... |
| 151 |
TagListing tagListing = tagListingRepository.selectByItemId(fofoBulkOrderModel.getItemId());
|
157 |
TagListing tagListing = tagListingRepository.selectByItemId(fofoBulkOrderModel.getItemId());
|
| 152 |
if (tagListing == null) {
|
158 |
if (tagListing == null) {
|
| 153 |
String message = "Pricing Does not exist for " + fofoBulkOrderModel.getItemId() + "(" + fofoBulkOrderModel.getDescription() + ")";
|
159 |
String message = "Pricing Does not exist for " + fofoBulkOrderModel.getItemId() + "(" + fofoBulkOrderModel.getDescription() + ")";
|
| 154 |
throw new ProfitMandiBusinessException(message, message, message);
|
160 |
throw new ProfitMandiBusinessException(message, message, message);
|
| 155 |
}
|
161 |
}
|
| - |
|
162 |
List<String> partnerIneligibleBrands = brandsService.partnerIneligibleBrands(fofoId);
|
| - |
|
163 |
Item item = itemRepository.selectById(fofoBulkOrderModel.getItemId());
|
| - |
|
164 |
if (partnerIneligibleBrands.contains(item.getBrand())) {
|
| - |
|
165 |
throw new ProfitMandiBusinessException("Brand is not allowed", "Brand ( " + item.getBrand() + ") is not allowed for this partner", "");
|
| - |
|
166 |
}
|
| - |
|
167 |
|
| 156 |
double itemSellingPrice = tagListing.getSellingPrice();
|
168 |
double itemSellingPrice = tagListing.getSellingPrice();
|
| 157 |
boolean isActualPrice = fofoBulkOrderModel.getItemPrice() == itemSellingPrice;
|
169 |
boolean isActualPrice = fofoBulkOrderModel.getItemPrice() == itemSellingPrice;
|
| 158 |
boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0d;
|
170 |
boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0d;
|
| 159 |
double customSellingPrice = fofoBulkOrderModel.getItemPrice();
|
171 |
double customSellingPrice = fofoBulkOrderModel.getItemPrice();
|
| 160 |
int itemId = cartItem.getItemId();
|
172 |
int itemId = cartItem.getItemId();
|