| Line 12... |
Line 12... |
| 12 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
12 |
import com.spice.profitmandi.dao.entity.catalog.Bid;
|
| 13 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
13 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 14 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
14 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 15 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
15 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 16 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
16 |
import com.spice.profitmandi.dao.entity.fofo.LoanTransaction;
|
| - |
|
17 |
import com.spice.profitmandi.dao.entity.onBoarding.LoiForm;
|
| 17 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
18 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 18 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
19 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 19 |
import com.spice.profitmandi.dao.entity.transaction.Transaction;
|
20 |
import com.spice.profitmandi.dao.entity.transaction.Transaction;
|
| 20 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
21 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
| 21 |
import com.spice.profitmandi.dao.entity.user.StoreTimelinetb;
|
22 |
import com.spice.profitmandi.dao.entity.user.StoreTimelinetb;
|
| Line 36... |
Line 37... |
| 36 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
37 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
38 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
39 |
import com.spice.profitmandi.dao.repository.transaction.TransactionApprovalRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
40 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
41 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| - |
|
42 |
import com.spice.profitmandi.dao.repository.user.LoiFormRepository;
|
| 41 |
import com.spice.profitmandi.dao.service.BidService;
|
43 |
import com.spice.profitmandi.dao.service.BidService;
|
| 42 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
44 |
import com.spice.profitmandi.service.catalog.BrandsService;
|
| 43 |
import com.spice.profitmandi.service.transaction.BlockLoanIdSanctionId;
|
45 |
import com.spice.profitmandi.service.transaction.BlockLoanIdSanctionId;
|
| 44 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
46 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 45 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
47 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| Line 130... |
Line 132... |
| 130 |
com.spice.profitmandi.service.catalog.ComboService comboService;
|
132 |
com.spice.profitmandi.service.catalog.ComboService comboService;
|
| 131 |
|
133 |
|
| 132 |
@Autowired
|
134 |
@Autowired
|
| 133 |
com.spice.profitmandi.dao.repository.cs.PositionRepository positionRepository;
|
135 |
com.spice.profitmandi.dao.repository.cs.PositionRepository positionRepository;
|
| 134 |
|
136 |
|
| - |
|
137 |
@Autowired
|
| - |
|
138 |
LoiFormRepository loiFormRepository;
|
| - |
|
139 |
|
| 135 |
|
140 |
|
| 136 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
141 |
public void parseBulkOrders(MultipartFile file, int creatorId) throws Exception {
|
| 137 |
XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
|
142 |
XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
|
| 138 |
|
143 |
|
| 139 |
myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
|
144 |
myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
|
| Line 323... |
Line 328... |
| 323 |
"Full Stock Payment must be completed before first PO can be created");
|
328 |
"Full Stock Payment must be completed before first PO can be created");
|
| 324 |
}
|
329 |
}
|
| 325 |
|
330 |
|
| 326 |
// Block first PO until the business agreement e-sign has been verified
|
331 |
// Block first PO until the business agreement e-sign has been verified
|
| 327 |
// (by Legal / Gaurav Sharma) — sits between FULL_STOCK_PAYMENT and PO creation.
|
332 |
// (by Legal / Gaurav Sharma) — sits between FULL_STOCK_PAYMENT and PO creation.
|
| - |
|
333 |
// (by Legal / Gaurav Sharma) — sits between FULL_STOCK_PAYMENT and PO creation.
|
| - |
|
334 |
LoiForm loiForm = loiFormRepository.selectByOnboardingId(pob.getId());
|
| - |
|
335 |
|
| - |
|
336 |
if (loiForm != null) {
|
| 328 |
StoreTimelinetb esignEntry = storeTimelinetbRepository.selectByOnboardingIdAndEvent(
|
337 |
StoreTimelinetb esignEntry = storeTimelinetbRepository.selectByOnboardingIdAndEvent(
|
| - |
|
338 |
pob.getId(),
|
| 329 |
pob.getId(), StoreTimeline.AGREEMENT_ESIGN);
|
339 |
StoreTimeline.AGREEMENT_ESIGN
|
| - |
|
340 |
);
|
| - |
|
341 |
|
| 330 |
if (esignEntry == null) {
|
342 |
if (esignEntry == null) {
|
| - |
|
343 |
LOGGER.warn(
|
| 331 |
LOGGER.warn("PO creation blocked for fofoId={}, onboardingId={}: AGREEMENT_ESIGN not done", fofoId, pob.getId());
|
344 |
"PO creation blocked for fofoId={}, onboardingId={}: AGREEMENT_ESIGN not done",
|
| - |
|
345 |
fofoId,
|
| - |
|
346 |
pob.getId()
|
| - |
|
347 |
);
|
| - |
|
348 |
|
| 332 |
throw new ProfitMandiBusinessException(
|
349 |
throw new ProfitMandiBusinessException(
|
| 333 |
"Business agreement e-sign is required before creating PO",
|
350 |
"Business agreement e-sign is required before creating PO",
|
| 334 |
fofoStore.getCode(),
|
351 |
fofoStore.getCode(),
|
| 335 |
"Business agreement e-sign must be verified before first PO can be created");
|
352 |
"Business agreement e-sign must be verified before first PO can be created"
|
| - |
|
353 |
);
|
| - |
|
354 |
}
|
| 336 |
}
|
355 |
}
|
| - |
|
356 |
|
| 337 |
}
|
357 |
}
|
| 338 |
}
|
358 |
}
|
| 339 |
}
|
359 |
}
|
| 340 |
|
360 |
|
| 341 |
LOGGER.info("totalPayableAmount - {}", totalPayableAmount);
|
361 |
LOGGER.info("totalPayableAmount - {}", totalPayableAmount);
|