| Line 50... |
Line 50... |
| 50 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
50 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 51 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
51 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 52 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
52 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 53 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
53 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 54 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
54 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
| - |
|
55 |
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferItemRepository;
|
| - |
|
56 |
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferRepository;
|
| - |
|
57 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
| - |
|
58 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 55 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
59 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| - |
|
60 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| - |
|
61 |
import com.spice.profitmandi.dao.repository.catalog.StateGstRateRepository;
|
| - |
|
62 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 56 |
import com.spice.profitmandi.dao.repository.cs.*;
|
63 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
64 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| - |
|
65 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| - |
|
66 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| - |
|
67 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
| - |
|
68 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
| - |
|
69 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
| - |
|
70 |
import com.spice.profitmandi.dao.repository.dtr.EmployeeAttendanceRepository;
|
| - |
|
71 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
72 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
|
| - |
|
73 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
|
| - |
|
74 |
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
|
| - |
|
75 |
import com.spice.profitmandi.dao.repository.dtr.LeadRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
76 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| - |
|
77 |
import com.spice.profitmandi.dao.repository.dtr.NotificationCampaignRepository;
|
| - |
|
78 |
import com.spice.profitmandi.dao.repository.dtr.PartnerProblemRepository;
|
| - |
|
79 |
import com.spice.profitmandi.dao.repository.dtr.PushNotificationRepository;
|
| - |
|
80 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderCreditWalletHistoryRepository;
|
| - |
|
81 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
| - |
|
82 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| - |
|
83 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
| - |
|
84 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
| - |
|
85 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| - |
|
86 |
import com.spice.profitmandi.dao.repository.dtr.UserCampaignRepository;
|
| - |
|
87 |
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
|
| - |
|
88 |
import com.spice.profitmandi.dao.repository.dtr.WebProductListingRepository;
|
| - |
|
89 |
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
|
| - |
|
90 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| - |
|
91 |
import com.spice.profitmandi.dao.repository.fofo.CurrentPartnerDailyInvestmentRepository;
|
| - |
|
92 |
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
|
| - |
|
93 |
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
|
| - |
|
94 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
|
| - |
|
95 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| - |
|
96 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
| - |
|
97 |
import com.spice.profitmandi.dao.repository.fofo.FofoPaymentRepository;
|
| - |
|
98 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
| - |
|
99 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| - |
|
100 |
import com.spice.profitmandi.dao.repository.fofo.MonthlyTargetRepository;
|
| - |
|
101 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| - |
|
102 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| - |
|
103 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
| - |
|
104 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| - |
|
105 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
|
| - |
|
106 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
|
| - |
|
107 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
|
| - |
|
108 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
109 |
import com.spice.profitmandi.dao.repository.fofo.RazorPayRepository;
|
| - |
|
110 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| - |
|
111 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| - |
|
112 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| - |
|
113 |
import com.spice.profitmandi.dao.repository.fofo.ServiceConfigRepository;
|
| 59 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
114 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
115 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
116 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
| - |
|
117 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
| - |
|
118 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
119 |
import com.spice.profitmandi.dao.repository.transaction.LoanRepository;
|
| - |
|
120 |
import com.spice.profitmandi.dao.repository.transaction.LoanStatementRepository;
|
| - |
|
121 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| - |
|
122 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
| - |
|
123 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
| - |
|
124 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
| - |
|
125 |
import com.spice.profitmandi.dao.repository.transaction.SanctionRequestRepository;
|
| - |
|
126 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
| - |
|
127 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
| - |
|
128 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| 63 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
129 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 64 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
130 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 65 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
131 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
| 66 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
132 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
| 67 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
133 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
| Line 83... |
Line 149... |
| 83 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
149 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
| 84 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
150 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 85 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
151 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 86 |
import com.spice.profitmandi.service.user.RetailerService;
|
152 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 87 |
import com.spice.profitmandi.service.wallet.WalletService;
|
153 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| - |
|
154 |
|
| 88 |
import in.shop2020.model.v1.order.OrderStatus;
|
155 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 89 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
156 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 90 |
import okhttp3.OkHttpClient;
|
157 |
import okhttp3.OkHttpClient;
|
| 91 |
import okhttp3.Request;
|
158 |
import okhttp3.Request;
|
| 92 |
import okhttp3.Response;
|
159 |
import okhttp3.Response;
|
| 93 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
- |
|
| 94 |
import org.apache.commons.lang.StringUtils;
|
- |
|
| 95 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
- |
|
| 96 |
import org.apache.http.client.methods.HttpPost;
|
- |
|
| 97 |
import org.apache.http.conn.HttpHostConnectException;
|
- |
|
| 98 |
import org.apache.http.entity.StringEntity;
|
- |
|
| 99 |
import org.apache.http.impl.client.CloseableHttpClient;
|
- |
|
| 100 |
import org.apache.http.impl.client.HttpClients;
|
- |
|
| 101 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 102 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 103 |
import org.json.JSONArray;
|
- |
|
| 104 |
import org.json.JSONObject;
|
- |
|
| 105 |
import org.json.XML;
|
- |
|
| 106 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 107 |
import org.springframework.beans.factory.annotation.Qualifier;
|
- |
|
| 108 |
import org.springframework.beans.factory.annotation.Value;
|
- |
|
| 109 |
import org.springframework.core.io.ByteArrayResource;
|
- |
|
| 110 |
import org.springframework.core.io.InputStreamSource;
|
- |
|
| 111 |
import org.springframework.mail.javamail.JavaMailSender;
|
- |
|
| 112 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
- |
|
| 113 |
import org.springframework.stereotype.Component;
|
- |
|
| 114 |
import org.springframework.transaction.annotation.Transactional;
|
- |
|
| 115 |
|
- |
|
| 116 |
import javax.mail.MessagingException;
|
- |
|
| 117 |
import javax.mail.internet.InternetAddress;
|
- |
|
| 118 |
import javax.mail.internet.MimeMessage;
|
- |
|
| 119 |
import java.io.*;
|
- |
|
| 120 |
import java.math.BigDecimal;
|
- |
|
| 121 |
import java.math.RoundingMode;
|
- |
|
| 122 |
import java.nio.file.Files;
|
- |
|
| 123 |
import java.nio.file.Paths;
|
- |
|
| 124 |
import java.sql.Timestamp;
|
- |
|
| 125 |
import java.text.DecimalFormat;
|
- |
|
| 126 |
import java.time.*;
|
- |
|
| 127 |
import java.time.format.DateTimeFormatter;
|
- |
|
| 128 |
import java.time.temporal.ChronoField;
|
- |
|
| 129 |
import java.time.temporal.ChronoUnit;
|
- |
|
| 130 |
import java.util.*;
|
- |
|
| 131 |
import java.util.Map.Entry;
|
- |
|
| 132 |
import java.util.stream.Collector;
|
- |
|
| 133 |
import java.util.stream.Collectors;
|
- |
|
| 134 |
import java.util.stream.Stream;
|
- |
|
| 135 |
|
160 |
|
| 136 |
@Component
|
161 |
@Component
|
| 137 |
@Transactional(rollbackFor = Throwable.class)
|
162 |
@Transactional(rollbackFor = Throwable.class)
|
| 138 |
public class ScheduledTasks {
|
163 |
public class ScheduledTasks {
|
| 139 |
|
164 |
|
| Line 4765... |
Line 4790... |
| 4765 |
|
4790 |
|
| 4766 |
Set<Integer> itemIds = tagListingRepository
|
4791 |
Set<Integer> itemIds = tagListingRepository
|
| 4767 |
.selectAllByDatesBetweenSortByDate(LocalDateTime.now().minusDays(30), LocalDateTime.now()).stream()
|
4792 |
.selectAllByDatesBetweenSortByDate(LocalDateTime.now().minusDays(30), LocalDateTime.now()).stream()
|
| 4768 |
.map(x -> x.getItemId()).collect(Collectors.toSet());
|
4793 |
.map(x -> x.getItemId()).collect(Collectors.toSet());
|
| 4769 |
|
4794 |
|
| - |
|
4795 |
LOGGER.info("itemIds {}", itemIds);
|
| - |
|
4796 |
|
| 4770 |
Set<Integer> catalogItemIds = itemRepository.selectByIds(itemIds).stream().map(x -> x.getCatalogItemId())
|
4797 |
List<Integer> catalogItemIds = itemRepository.selectByIds(itemIds).stream().map(x -> x.getCatalogItemId())
|
| 4771 |
.collect(Collectors.toSet());
|
4798 |
.distinct().collect(Collectors.toList());
|
| 4772 |
|
4799 |
|
| 4773 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
4800 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
| 4774 |
if (!catalogItemIds.isEmpty()) {
|
4801 |
if (!catalogItemIds.isEmpty()) {
|
| 4775 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
4802 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
| 4776 |
int count = 0;
|
4803 |
int count = 0;
|