| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.common.web.client.RestClient;
|
22 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 23 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
23 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
| 24 |
import com.spice.profitmandi.dao.cart.CartService;
|
24 |
import com.spice.profitmandi.dao.cart.CartService;
|
| 25 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
25 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 26 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
26 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
| - |
|
27 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
| 27 |
import com.spice.profitmandi.dao.entity.catalog.*;
|
28 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| - |
|
29 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| - |
|
30 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 28 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
31 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
32 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
33 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
34 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
| 32 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
35 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| Line 34... |
Line 37... |
| 34 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
37 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 35 |
import com.spice.profitmandi.dao.entity.user.*;
|
38 |
import com.spice.profitmandi.dao.entity.user.*;
|
| 36 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
39 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
| 37 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
40 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
| 38 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
41 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
| 39 |
import com.spice.profitmandi.dao.enumuration.catalog.OfferSchemeType;
|
- |
|
| 40 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
42 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 41 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
43 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 42 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
44 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 43 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
45 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 44 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
46 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
| Line 67... |
Line 69... |
| 67 |
import com.spice.profitmandi.service.*;
|
69 |
import com.spice.profitmandi.service.*;
|
| 68 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
70 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
| 69 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
71 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 70 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
72 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
| 71 |
import com.spice.profitmandi.service.integrations.psismart.PsiSmartService;
|
73 |
import com.spice.profitmandi.service.integrations.psismart.PsiSmartService;
|
| - |
|
74 |
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
|
| 72 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
75 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| 73 |
import com.spice.profitmandi.service.inventory.*;
|
76 |
import com.spice.profitmandi.service.inventory.*;
|
| 74 |
import com.spice.profitmandi.service.offers.OfferService;
|
77 |
import com.spice.profitmandi.service.offers.OfferService;
|
| 75 |
import com.spice.profitmandi.service.order.OrderService;
|
78 |
import com.spice.profitmandi.service.order.OrderService;
|
| 76 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
79 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| 77 |
import com.spice.profitmandi.service.recharge.provider.OxigenRechargeProviderService;
|
80 |
import com.spice.profitmandi.service.recharge.provider.OxigenRechargeProviderService;
|
| 78 |
import com.spice.profitmandi.service.recharge.provider.ThinkWalnutDigitalRechargeProviderService;
|
81 |
import com.spice.profitmandi.service.recharge.provider.ThinkWalnutDigitalRechargeProviderService;
|
| 79 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
82 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 80 |
import com.spice.profitmandi.service.serviceConfig.ServiceConfigService;
|
83 |
import com.spice.profitmandi.service.serviceConfig.ServiceConfigService;
|
| 81 |
import com.spice.profitmandi.service.smartping.SmartPingService;
|
- |
|
| 82 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
84 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
| 83 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
85 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 84 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
86 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 85 |
import com.spice.profitmandi.service.user.RetailerService;
|
87 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 86 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
88 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
| 87 |
import com.spice.profitmandi.service.wallet.WalletService;
|
89 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 88 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
90 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
| 89 |
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
|
91 |
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
|
| 90 |
import in.shop2020.model.v1.order.OrderStatus;
|
92 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 91 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
93 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 92 |
import okhttp3.OkHttpClient;
|
- |
|
| 93 |
import okhttp3.Request;
|
- |
|
| 94 |
import okhttp3.Response;
|
- |
|
| 95 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
94 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| 96 |
import org.apache.commons.lang.StringUtils;
|
95 |
import org.apache.commons.lang.StringUtils;
|
| 97 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
96 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
| 98 |
import org.apache.http.client.methods.HttpPost;
|
97 |
import org.apache.http.client.methods.HttpPost;
|
| 99 |
import org.apache.http.conn.HttpHostConnectException;
|
98 |
import org.apache.http.conn.HttpHostConnectException;
|
| Line 103... |
Line 102... |
| 103 |
import org.apache.logging.log4j.LogManager;
|
102 |
import org.apache.logging.log4j.LogManager;
|
| 104 |
import org.apache.logging.log4j.Logger;
|
103 |
import org.apache.logging.log4j.Logger;
|
| 105 |
import org.hibernate.Session;
|
104 |
import org.hibernate.Session;
|
| 106 |
import org.hibernate.SessionFactory;
|
105 |
import org.hibernate.SessionFactory;
|
| 107 |
import org.hibernate.query.NativeQuery;
|
106 |
import org.hibernate.query.NativeQuery;
|
| 108 |
import org.json.JSONArray;
|
- |
|
| 109 |
import org.json.JSONObject;
|
107 |
import org.json.JSONObject;
|
| 110 |
import org.json.XML;
|
- |
|
| 111 |
import org.springframework.beans.factory.annotation.Autowired;
|
108 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 112 |
import org.springframework.beans.factory.annotation.Qualifier;
|
109 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| 113 |
import org.springframework.beans.factory.annotation.Value;
|
110 |
import org.springframework.beans.factory.annotation.Value;
|
| 114 |
import org.springframework.core.io.ByteArrayResource;
|
111 |
import org.springframework.core.io.ByteArrayResource;
|
| 115 |
import org.springframework.core.io.InputStreamSource;
|
112 |
import org.springframework.core.io.InputStreamSource;
|
| Line 1022... |
Line 1019... |
| 1022 |
@Autowired
|
1019 |
@Autowired
|
| 1023 |
TransactionRelatedTasks transactionRelatedTasks;
|
1020 |
TransactionRelatedTasks transactionRelatedTasks;
|
| 1024 |
|
1021 |
|
| 1025 |
@Autowired
|
1022 |
@Autowired
|
| 1026 |
PsiSmartService psiSmartService;
|
1023 |
PsiSmartService psiSmartService;
|
| - |
|
1024 |
|
| 1027 |
public void test() throws Exception {
|
1025 |
public void test() throws Exception {
|
| 1028 |
System.out.println(psiSmartService.getRegistrationEndPoint("9990381569"));
|
1026 |
System.out.println(psiSmartService.getRegistrationEndPoint("9990381569"));
|
| 1029 |
//Map<Integer, List<Offer>> offerMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
|
1027 |
//Map<Integer, List<Offer>> offerMap = offerRepository.selectAllPublishedMapByPartner(YearMonth.now());
|
| 1030 |
//LOGGER.info("Offers - {}", offerMap.entrySet().stream().filter(x->x.getKey()==168118414).flatMap(x->x.getValue().stream().map(y->y.getId())).collect(Collectors.toList()));
|
1028 |
//LOGGER.info("Offers - {}", offerMap.entrySet().stream().filter(x->x.getKey()==168118414).flatMap(x->x.getValue().stream().map(y->y.getId())).collect(Collectors.toList()));
|
| 1031 |
//bluedartAuthService.getAuthToken();
|
1029 |
//bluedartAuthService.getAuthToken();
|
| Line 3593... |
Line 3591... |
| 3593 |
}
|
3591 |
}
|
| 3594 |
|
3592 |
|
| 3595 |
double userWalletAmount = userWallet.getAmount() - Math.abs(interestAmount);
|
3593 |
double userWalletAmount = userWallet.getAmount() - Math.abs(interestAmount);
|
| 3596 |
|
3594 |
|
| 3597 |
if (userWalletAmount > Math.abs(principalAmount) && principalAmount < 0) {
|
3595 |
if (userWalletAmount > Math.abs(principalAmount) && principalAmount < 0) {
|
| 3598 |
|
- |
|
| 3599 |
settledLoanStatement(LoanReferenceType.PRINCIPAL, BigDecimal.valueOf(principalAmount), loan.getFofoId(), loan.getId(), "Amount adjusted against loan", LocalDateTime.now());
|
3596 |
settledLoanStatement(LoanReferenceType.PRINCIPAL, BigDecimal.valueOf(principalAmount), loan.getFofoId(), loan.getId(), "Amount adjusted against loan", LocalDateTime.now());
|
| 3600 |
double amount = userWalletAmount - Math.abs(principalAmount);
|
- |
|
| 3601 |
|
- |
|
| 3602 |
paidAmount += Math.abs(principalAmount);
|
3597 |
paidAmount += Math.abs(principalAmount);
|
| 3603 |
|
- |
|
| 3604 |
// userWallet.setAmount((int) amount);
|
- |
|
| 3605 |
|
- |
|
| 3606 |
BigDecimal utilizationAmount = sdCreditRequirement.getUtilizedAmount().subtract(BigDecimal.valueOf(principalAmount).abs());
|
3598 |
BigDecimal utilizationAmount = sdCreditRequirement.getUtilizedAmount().subtract(BigDecimal.valueOf(principalAmount).abs());
|
| 3607 |
|
- |
|
| 3608 |
sdCreditRequirement.setUtilizedAmount(utilizationAmount);
|
3599 |
sdCreditRequirement.setUtilizedAmount(utilizationAmount);
|
| 3609 |
|
- |
|
| 3610 |
CreditAccount creditAccount = creditAccountRepository.selectByFofoIdAndGateway(loan.getFofoId(), Gateway.SDDIRECT);
|
3600 |
CreditAccount creditAccount = creditAccountRepository.selectByFofoIdAndGateway(loan.getFofoId(), Gateway.SDDIRECT);
|
| 3611 |
|
3601 |
|
| 3612 |
creditAccount.setAvailableAmount(sdCreditRequirement.getAvailableLimit().floatValue());
|
3602 |
creditAccount.setAvailableAmount(sdCreditRequirement.getAvailableLimit().floatValue());
|
| 3613 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
3603 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
| 3614 |
|
3604 |
|
| Line 3664... |
Line 3654... |
| 3664 |
|
3654 |
|
| 3665 |
double settledAmount = paidAmount;
|
3655 |
double settledAmount = paidAmount;
|
| 3666 |
for (SanctionRequest sanctionRequest : sanctionRequests) {
|
3656 |
for (SanctionRequest sanctionRequest : sanctionRequests) {
|
| 3667 |
|
3657 |
|
| 3668 |
List<Order> orders = orderRepository.selectAllByTransactionId(sanctionRequest.getTransactionId());
|
3658 |
List<Order> orders = orderRepository.selectAllByTransactionId(sanctionRequest.getTransactionId());
|
| 3669 |
if(orders.size()==0) {
|
3659 |
if (orders.size() == 0) {
|
| 3670 |
LOGGER.info("Could not find orders - for Sanction Request {}", sanctionRequest);
|
3660 |
LOGGER.info("Could not find orders - for Sanction Request {}", sanctionRequest);
|
| 3671 |
continue;
|
3661 |
continue;
|
| 3672 |
}
|
3662 |
}
|
| 3673 |
|
3663 |
|
| 3674 |
if (settledAmount >= sanctionRequest.getPendingAmount().doubleValue()) {
|
3664 |
if (settledAmount >= sanctionRequest.getPendingAmount().doubleValue()) {
|
| Line 4624... |
Line 4614... |
| 4624 |
|
4614 |
|
| 4625 |
//String url = "http://app.smartdukaan.com/pages/home/credit";
|
4615 |
//String url = "http://app.smartdukaan.com/pages/home/credit";
|
| 4626 |
|
4616 |
|
| 4627 |
String message = getMessageForDueDateExtend(defaultLoan, amount);
|
4617 |
String message = getMessageForDueDateExtend(defaultLoan, amount);
|
| 4628 |
String whatsAppMessage = getWhatsAppMessageForDueDateExtend(defaultLoan, amount);
|
4618 |
String whatsAppMessage = getWhatsAppMessageForDueDateExtend(defaultLoan, amount);
|
| 4629 |
if(whatsAppMessage != null) {
|
4619 |
if (whatsAppMessage != null) {
|
| 4630 |
notificationService.sendWhatsappMessage(whatsAppMessage, title, address.getPhoneNumber());
|
4620 |
notificationService.sendWhatsappMessage(whatsAppMessage, title, address.getPhoneNumber());
|
| 4631 |
if(notYetSent) {
|
4621 |
if (notYetSent) {
|
| 4632 |
notificationService.sendWhatsappMessage(whatsAppMessage, title, "9911565032");
|
4622 |
notificationService.sendWhatsappMessage(whatsAppMessage, title, "9911565032");
|
| 4633 |
notYetSent = false;
|
4623 |
notYetSent = false;
|
| 4634 |
}
|
4624 |
}
|
| 4635 |
}
|
4625 |
}
|
| 4636 |
|
4626 |
|