| Line 40... |
Line 40... |
| 40 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
40 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 41 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
41 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 42 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
42 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 43 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
43 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 44 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
44 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| - |
|
45 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
| 45 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
46 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
| 46 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
47 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| 47 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
48 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 48 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
49 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 49 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
50 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| Line 2273... |
Line 2274... |
| 2273 |
FofoOrder fofoOrder = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
2274 |
FofoOrder fofoOrder = fofoOrderRepository.selectByInvoiceNumber(invoiceNumber);
|
| 2274 |
FofoOrderItem fofoOrderItem = fofoOrderItemRepository.selectByOrderId(fofoOrder.getId()).get(0);
|
2275 |
FofoOrderItem fofoOrderItem = fofoOrderItemRepository.selectByOrderId(fofoOrder.getId()).get(0);
|
| 2275 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
2276 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
| 2276 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
2277 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
| 2277 |
BAGInsuranceModel bagInsuranceModel = new BAGInsuranceModel();
|
2278 |
BAGInsuranceModel bagInsuranceModel = new BAGInsuranceModel();
|
| 2278 |
//bagInsuranceModel.setModelId();
|
2279 |
// bagInsuranceModel.setModelId();
|
| 2279 |
bagInsuranceModel.setAddressLine1(customerAddress.getLine1());
|
2280 |
bagInsuranceModel.setAddressLine1(customerAddress.getLine1());
|
| 2280 |
bagInsuranceModel.setAddressLine2(customerAddress.getLine2());
|
2281 |
bagInsuranceModel.setAddressLine2(customerAddress.getLine2());
|
| 2281 |
bagInsuranceModel.setCity(customerAddress.getCity());
|
2282 |
bagInsuranceModel.setCity(customerAddress.getCity());
|
| 2282 |
bagInsuranceModel.setBrandWarranty("1 Year");
|
2283 |
bagInsuranceModel.setBrandWarranty("1 Year");
|
| 2283 |
Item item = itemRepository.selectById(fofoOrderItem.getId());
|
2284 |
Item item = itemRepository.selectById(fofoOrderItem.getId());
|
| Line 3557... |
Line 3558... |
| 3557 |
|
3558 |
|
| 3558 |
}
|
3559 |
}
|
| 3559 |
|
3560 |
|
| 3560 |
}
|
3561 |
}
|
| 3561 |
|
3562 |
|
| 3562 |
|
- |
|
| 3563 |
public void processActivatedImeisForSchemes() throws ProfitMandiBusinessException {
|
3563 |
public void processActivatedImeisForSchemes() throws ProfitMandiBusinessException {
|
| 3564 |
schemeService.processActivatedImeisForSchemes();
|
3564 |
schemeService.processActivatedImeisForSchemes();
|
| 3565 |
}
|
3565 |
}
|
| 3566 |
|
3566 |
|
| - |
|
3567 |
@Autowired
|
| - |
|
3568 |
private CurrentPartnerDailyInvestmentRepository currentPartnerDailyInvestmentRepository;
|
| - |
|
3569 |
|
| - |
|
3570 |
public void updatePartnerLimit() throws ProfitMandiBusinessException {
|
| - |
|
3571 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getFofoRetailers(true);
|
| - |
|
3572 |
|
| - |
|
3573 |
Map<Integer, SDCreditRequirement> sdCreditRequirementMap = sdCreditRequirementRepository.selectAll().stream()
|
| - |
|
3574 |
.collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| - |
|
3575 |
Map<Integer, CurrentPartnerDailyInvestment> currentPartnerDailyInvestmentMap = currentPartnerDailyInvestmentRepository
|
| - |
|
3576 |
.selectAll().stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
| - |
|
3577 |
|
| - |
|
3578 |
for (Entry<Integer, CustomRetailer> customRetailerEntry : customRetailerMap.entrySet()) {
|
| - |
|
3579 |
int fofoId = customRetailerEntry.getKey();
|
| - |
|
3580 |
|
| - |
|
3581 |
SDCreditRequirement sdCreditRequirement = sdCreditRequirementMap.get(customRetailerEntry.getKey());
|
| - |
|
3582 |
|
| - |
|
3583 |
CurrentPartnerDailyInvestment currentPartnerDailyInvestment = currentPartnerDailyInvestmentMap.get(fofoId);
|
| - |
|
3584 |
BigDecimal suggestedAmount = BigDecimal.ZERO;
|
| - |
|
3585 |
if (currentPartnerDailyInvestment != null) {
|
| - |
|
3586 |
suggestedAmount = BigDecimal.valueOf(currentPartnerDailyInvestment.getTotalInvestment() * 0.1);
|
| - |
|
3587 |
}
|
| - |
|
3588 |
|
| - |
|
3589 |
LOGGER.info("suggestedAmount {} ", suggestedAmount);
|
| - |
|
3590 |
|
| - |
|
3591 |
if (sdCreditRequirement == null) {
|
| - |
|
3592 |
sdCreditRequirement = new SDCreditRequirement();
|
| - |
|
3593 |
sdCreditRequirement.setFofoId(fofoId);
|
| - |
|
3594 |
sdCreditRequirement.setRisk(CreditRisk.NO_RISK);
|
| - |
|
3595 |
sdCreditRequirement.setCreditDays(15);
|
| - |
|
3596 |
sdCreditRequirement.setInterestRate(BigDecimal.valueOf(0.05));
|
| - |
|
3597 |
sdCreditRequirement.setSuggestedLimit(suggestedAmount);
|
| - |
|
3598 |
sdCreditRequirement.setLimit(suggestedAmount);
|
| - |
|
3599 |
sdCreditRequirement.setUtilizedAmount(BigDecimal.ZERO);
|
| - |
|
3600 |
sdCreditRequirement.setAvailableLimit(suggestedAmount);
|
| - |
|
3601 |
sdCreditRequirement.setCreateTimestamp(LocalDateTime.now());
|
| - |
|
3602 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
| - |
|
3603 |
sdCreditRequirementRepository.persist(sdCreditRequirement);
|
| - |
|
3604 |
}
|
| - |
|
3605 |
sdCreditRequirement.setSuggestedLimit(suggestedAmount);
|
| - |
|
3606 |
sdCreditRequirement.setLimit(suggestedAmount);
|
| - |
|
3607 |
BigDecimal utilizedLimit = new BigDecimal(sdCreditService.getUtilizationAmount(fofoId));
|
| - |
|
3608 |
|
| - |
|
3609 |
BigDecimal availableLimit = sdCreditRequirement.getLimit().subtract(utilizedLimit);
|
| - |
|
3610 |
|
| - |
|
3611 |
LOGGER.info("utilizedLimit {} ", utilizedLimit);
|
| - |
|
3612 |
|
| - |
|
3613 |
LOGGER.info("availableLimit {} ", availableLimit);
|
| - |
|
3614 |
|
| - |
|
3615 |
sdCreditRequirement.setUtilizedAmount(utilizedLimit);
|
| - |
|
3616 |
|
| - |
|
3617 |
sdCreditRequirement.setAvailableLimit(availableLimit);
|
| - |
|
3618 |
|
| - |
|
3619 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
| - |
|
3620 |
|
| - |
|
3621 |
}
|
| - |
|
3622 |
|
| - |
|
3623 |
}
|
| - |
|
3624 |
|
| 3567 |
}
|
3625 |
}
|
| 3568 |
|
3626 |
|
| 3569 |
//2284
|
3627 |
//2284
|
| 3570 |
|
3628 |
|