| Line 1... |
Line 1... |
| 1 |
package com.smartdukaan.cron.scheduled;
|
1 |
package com.smartdukaan.cron.scheduled;
|
| 2 |
|
2 |
|
| 3 |
import static java.util.stream.Collectors.groupingBy;
|
- |
|
| 4 |
import static java.util.stream.Collectors.mapping;
|
- |
|
| 5 |
|
- |
|
| 6 |
import java.io.FileOutputStream;
|
- |
|
| 7 |
import java.io.IOException;
|
- |
|
| 8 |
import java.io.ObjectOutputStream;
|
- |
|
| 9 |
import java.io.Serializable;
|
- |
|
| 10 |
import java.io.UnsupportedEncodingException;
|
- |
|
| 11 |
import java.math.BigDecimal;
|
- |
|
| 12 |
import java.math.RoundingMode;
|
- |
|
| 13 |
import java.nio.file.Files;
|
- |
|
| 14 |
import java.nio.file.Paths;
|
- |
|
| 15 |
import java.sql.Timestamp;
|
- |
|
| 16 |
import java.text.DecimalFormat;
|
- |
|
| 17 |
import java.time.Duration;
|
- |
|
| 18 |
import java.time.LocalDate;
|
- |
|
| 19 |
import java.time.LocalDateTime;
|
- |
|
| 20 |
import java.time.LocalTime;
|
- |
|
| 21 |
import java.time.Month;
|
- |
|
| 22 |
import java.time.YearMonth;
|
- |
|
| 23 |
import java.time.format.DateTimeFormatter;
|
- |
|
| 24 |
import java.time.temporal.ChronoField;
|
- |
|
| 25 |
import java.time.temporal.ChronoUnit;
|
- |
|
| 26 |
import java.util.ArrayList;
|
- |
|
| 27 |
import java.util.Arrays;
|
- |
|
| 28 |
import java.util.Base64;
|
- |
|
| 29 |
import java.util.Collections;
|
- |
|
| 30 |
import java.util.Comparator;
|
- |
|
| 31 |
import java.util.HashMap;
|
- |
|
| 32 |
import java.util.HashSet;
|
- |
|
| 33 |
import java.util.LinkedHashMap;
|
- |
|
| 34 |
import java.util.List;
|
- |
|
| 35 |
import java.util.Map;
|
- |
|
| 36 |
import java.util.Map.Entry;
|
- |
|
| 37 |
import java.util.Objects;
|
- |
|
| 38 |
import java.util.Optional;
|
- |
|
| 39 |
import java.util.Set;
|
- |
|
| 40 |
import java.util.stream.Collectors;
|
- |
|
| 41 |
import java.util.stream.Stream;
|
- |
|
| 42 |
|
- |
|
| 43 |
import javax.mail.MessagingException;
|
- |
|
| 44 |
import javax.mail.internet.InternetAddress;
|
- |
|
| 45 |
import javax.mail.internet.MimeMessage;
|
- |
|
| 46 |
|
- |
|
| 47 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
- |
|
| 48 |
import org.apache.commons.lang.StringUtils;
|
- |
|
| 49 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
- |
|
| 50 |
import org.apache.http.client.methods.HttpPost;
|
- |
|
| 51 |
import org.apache.http.conn.HttpHostConnectException;
|
- |
|
| 52 |
import org.apache.http.entity.StringEntity;
|
- |
|
| 53 |
import org.apache.http.impl.client.CloseableHttpClient;
|
- |
|
| 54 |
import org.apache.http.impl.client.HttpClients;
|
- |
|
| 55 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 56 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 57 |
import org.json.JSONArray;
|
- |
|
| 58 |
import org.json.JSONObject;
|
- |
|
| 59 |
import org.json.XML;
|
- |
|
| 60 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 61 |
import org.springframework.beans.factory.annotation.Qualifier;
|
- |
|
| 62 |
import org.springframework.beans.factory.annotation.Value;
|
- |
|
| 63 |
import org.springframework.core.io.ByteArrayResource;
|
- |
|
| 64 |
import org.springframework.core.io.InputStreamSource;
|
- |
|
| 65 |
import org.springframework.mail.javamail.JavaMailSender;
|
- |
|
| 66 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
- |
|
| 67 |
import org.springframework.stereotype.Component;
|
- |
|
| 68 |
import org.springframework.transaction.annotation.Transactional;
|
- |
|
| 69 |
|
- |
|
| 70 |
import com.google.common.collect.Lists;
|
3 |
import com.google.common.collect.Lists;
|
| 71 |
import com.google.gson.Gson;
|
4 |
import com.google.gson.Gson;
|
| 72 |
import com.razorpay.Payment;
|
5 |
import com.razorpay.Payment;
|
| 73 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationService;
|
6 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationService;
|
| 74 |
import com.smartdukaan.cron.itelImeiActivation.TecnoImeiActivation;
|
7 |
import com.smartdukaan.cron.itelImeiActivation.TecnoImeiActivation;
|
| 75 |
import com.spice.profitmandi.common.enumuration.ActivationType;
|
- |
|
| 76 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
8 |
import com.spice.profitmandi.common.enumuration.*;
|
| 77 |
import com.spice.profitmandi.common.enumuration.RechargeStatus;
|
- |
|
| 78 |
import com.spice.profitmandi.common.enumuration.ReporticoProject;
|
- |
|
| 79 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
9 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 80 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
- |
|
| 81 |
import com.spice.profitmandi.common.model.FocusedModelShortageModel;
|
- |
|
| 82 |
import com.spice.profitmandi.common.model.GstRate;
|
10 |
import com.spice.profitmandi.common.model.*;
|
| 83 |
import com.spice.profitmandi.common.model.InvoicePdfModel;
|
- |
|
| 84 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
- |
|
| 85 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
- |
|
| 86 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
- |
|
| 87 |
import com.spice.profitmandi.common.services.ReporticoService;
|
11 |
import com.spice.profitmandi.common.services.ReporticoService;
|
| 88 |
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
|
12 |
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
|
| 89 |
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
|
13 |
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
|
| 90 |
import com.spice.profitmandi.common.services.mandii.MandiiService;
|
14 |
import com.spice.profitmandi.common.services.mandii.MandiiService;
|
| 91 |
import com.spice.profitmandi.common.util.FileUtil;
|
15 |
import com.spice.profitmandi.common.util.FileUtil;
|
| Line 101... |
Line 25... |
| 101 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
25 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 102 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
26 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 103 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
27 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 104 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
28 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 105 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| 106 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
- |
|
| 107 |
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
|
- |
|
| 108 |
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
|
- |
|
| 109 |
import com.spice.profitmandi.dao.entity.dtr.EmployeeAttendance;
|
- |
|
| 110 |
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
|
- |
|
| 111 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
- |
|
| 112 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
- |
|
| 113 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
- |
|
| 114 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
|
- |
|
| 115 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
- |
|
| 116 |
import com.spice.profitmandi.dao.entity.dtr.RetailerBlockBrands;
|
- |
|
| 117 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 118 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
- |
|
| 119 |
import com.spice.profitmandi.dao.entity.fofo.CurrentPartnerDailyInvestment;
|
- |
|
| 120 |
import com.spice.profitmandi.dao.entity.fofo.Customer;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
| 121 |
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
|
- |
|
| 122 |
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
|
- |
|
| 123 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
- |
|
| 124 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
- |
|
| 125 |
import com.spice.profitmandi.dao.entity.fofo.FofoPayment;
|
- |
|
| 126 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
- |
|
| 127 |
import com.spice.profitmandi.dao.entity.fofo.HygieneData;
|
- |
|
| 128 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
- |
|
| 129 |
import com.spice.profitmandi.dao.entity.fofo.MonthlyTarget;
|
- |
|
| 130 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
- |
|
| 131 |
import com.spice.profitmandi.dao.entity.fofo.PartnerProblem;
|
- |
|
| 132 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
- |
|
| 133 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
|
- |
|
| 134 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
|
- |
|
| 135 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
32 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 136 |
import com.spice.profitmandi.dao.entity.fofo.RazorPay;
|
- |
|
| 137 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
- |
|
| 138 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
- |
|
| 139 |
import com.spice.profitmandi.dao.entity.inventory.PartnerAgeingModel;
|
33 |
import com.spice.profitmandi.dao.entity.inventory.PartnerAgeingModel;
|
| 140 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
34 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
| 141 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
35 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
| 142 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
36 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
| 143 |
import com.spice.profitmandi.dao.entity.transaction.Loan;
|
37 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 144 |
import com.spice.profitmandi.dao.entity.transaction.LoanStatement;
|
- |
|
| 145 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
- |
|
| 146 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
- |
|
| 147 |
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
|
- |
|
| 148 |
import com.spice.profitmandi.dao.entity.transaction.SDCreditRequirement;
|
- |
|
| 149 |
import com.spice.profitmandi.dao.entity.transaction.SanctionRequest;
|
- |
|
| 150 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
- |
|
| 151 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
- |
|
| 152 |
import com.spice.profitmandi.dao.entity.user.Address;
|
- |
|
| 153 |
import com.spice.profitmandi.dao.entity.user.Device;
|
- |
|
| 154 |
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
|
- |
|
| 155 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
38 |
import com.spice.profitmandi.dao.entity.user.*;
|
| 156 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
39 |
import com.spice.profitmandi.dao.entity.warehouse.BrandRegionMapping;
|
| 157 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
40 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
| 158 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
41 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 159 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
42 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 160 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
43 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 161 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
44 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| Line 163... |
Line 46... |
| 163 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
46 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 164 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
47 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
| 165 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
48 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
| 166 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
49 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| 167 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
50 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 168 |
import com.spice.profitmandi.dao.model.RetailerFilterModel;
|
- |
|
| 169 |
import com.spice.profitmandi.dao.model.RetailerPeformanceFilterModel;
|
- |
|
| 170 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
51 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 171 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
52 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 172 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
53 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 173 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
54 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
| 174 |
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferItemRepository;
|
- |
|
| 175 |
import com.spice.profitmandi.dao.repository.catalog.CustomerOfferRepository;
|
- |
|
| 176 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
- |
|
| 177 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
- |
|
| 178 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
55 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 179 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
- |
|
| 180 |
import com.spice.profitmandi.dao.repository.catalog.StateGstRateRepository;
|
- |
|
| 181 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
- |
|
| 182 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
56 |
import com.spice.profitmandi.dao.repository.cs.*;
|
| 183 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
- |
|
| 184 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
- |
|
| 185 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
- |
|
| 186 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
- |
|
| 187 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
- |
|
| 188 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
- |
|
| 189 |
import com.spice.profitmandi.dao.repository.dtr.EmployeeAttendanceRepository;
|
- |
|
| 190 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
- |
|
| 191 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
|
- |
|
| 192 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
|
- |
|
| 193 |
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
|
- |
|
| 194 |
import com.spice.profitmandi.dao.repository.dtr.LeadRepository;
|
- |
|
| 195 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
57 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 196 |
import com.spice.profitmandi.dao.repository.dtr.NotificationCampaignRepository;
|
- |
|
| 197 |
import com.spice.profitmandi.dao.repository.dtr.PartnerProblemRepository;
|
- |
|
| 198 |
import com.spice.profitmandi.dao.repository.dtr.PushNotificationRepository;
|
- |
|
| 199 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderCreditWalletHistoryRepository;
|
- |
|
| 200 |
import com.spice.profitmandi.dao.repository.dtr.RechargeProviderRepository;
|
- |
|
| 201 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
- |
|
| 202 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
- |
|
| 203 |
import com.spice.profitmandi.dao.repository.dtr.RetailerBlockBrandsRepository;
|
- |
|
| 204 |
import com.spice.profitmandi.dao.repository.dtr.RetailerFilterRepository;
|
- |
|
| 205 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
- |
|
| 206 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
- |
|
| 207 |
import com.spice.profitmandi.dao.repository.dtr.UserCampaignRepository;
|
- |
|
| 208 |
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
|
- |
|
| 209 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
- |
|
| 210 |
import com.spice.profitmandi.dao.repository.fofo.CurrentPartnerDailyInvestmentRepository;
|
- |
|
| 211 |
import com.spice.profitmandi.dao.repository.fofo.CustomerAddressRepository;
|
- |
|
| 212 |
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
|
- |
|
| 213 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
|
- |
|
| 214 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
- |
|
| 215 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
- |
|
| 216 |
import com.spice.profitmandi.dao.repository.fofo.FofoPaymentRepository;
|
- |
|
| 217 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
- |
|
| 218 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
- |
|
| 219 |
import com.spice.profitmandi.dao.repository.fofo.MonthlyTargetRepository;
|
- |
|
| 220 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
- |
|
| 221 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
- |
|
| 222 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
- |
|
| 223 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
- |
|
| 224 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
|
- |
|
| 225 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
|
- |
|
| 226 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
|
- |
|
| 227 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
- |
|
| 228 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseReturnItemRepository;
|
- |
|
| 229 |
import com.spice.profitmandi.dao.repository.fofo.RazorPayRepository;
|
58 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| 230 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
- |
|
| 231 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
- |
|
| 232 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
- |
|
| 233 |
import com.spice.profitmandi.dao.repository.fofo.ServiceConfigRepository;
|
- |
|
| 234 |
import com.spice.profitmandi.dao.repository.inventory.BrandAgeingLimitRepository;
|
59 |
import com.spice.profitmandi.dao.repository.inventory.BrandAgeingLimitRepository;
|
| 235 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
60 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
| 236 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
61 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 237 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
62 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
| 238 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
- |
|
| 239 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
- |
|
| 240 |
import com.spice.profitmandi.dao.repository.transaction.LoanRepository;
|
63 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
| 241 |
import com.spice.profitmandi.dao.repository.transaction.LoanStatementRepository;
|
- |
|
| 242 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
- |
|
| 243 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
- |
|
| 244 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
- |
|
| 245 |
import com.spice.profitmandi.dao.repository.transaction.SDCreditRequirementRepository;
|
- |
|
| 246 |
import com.spice.profitmandi.dao.repository.transaction.SanctionRequestRepository;
|
- |
|
| 247 |
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
|
- |
|
| 248 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
- |
|
| 249 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
- |
|
| 250 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
64 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 251 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
65 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 252 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
66 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
| 253 |
import com.spice.profitmandi.dao.repository.warehouse.BrandRegionMappingRepository;
|
67 |
import com.spice.profitmandi.dao.repository.warehouse.BrandRegionMappingRepository;
|
| 254 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
68 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
| 255 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
69 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
| 256 |
import com.spice.profitmandi.service.NotificationService;
|
70 |
import com.spice.profitmandi.service.NotificationService;
|
| 257 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
71 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| 258 |
import com.spice.profitmandi.service.PartnerStatsService;
|
72 |
import com.spice.profitmandi.service.PartnerStatsService;
|
| 259 |
import com.spice.profitmandi.service.PerformanceService;
|
- |
|
| 260 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
73 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
| 261 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
74 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 262 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
75 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
| 263 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
76 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| 264 |
import com.spice.profitmandi.service.inventory.AgeingModel;
|
77 |
import com.spice.profitmandi.service.inventory.AgeingModel;
|
| Line 275... |
Line 88... |
| 275 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
88 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
| 276 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
89 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 277 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
90 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 278 |
import com.spice.profitmandi.service.user.RetailerService;
|
91 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 279 |
import com.spice.profitmandi.service.wallet.WalletService;
|
92 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 280 |
|
- |
|
| 281 |
import in.shop2020.model.v1.order.OrderStatus;
|
93 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 282 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
94 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 283 |
import okhttp3.OkHttpClient;
|
95 |
import okhttp3.OkHttpClient;
|
| 284 |
import okhttp3.Request;
|
96 |
import okhttp3.Request;
|
| 285 |
import okhttp3.Response;
|
97 |
import okhttp3.Response;
|
| - |
|
98 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| - |
|
99 |
import org.apache.commons.lang.StringUtils;
|
| - |
|
100 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
| - |
|
101 |
import org.apache.http.client.methods.HttpPost;
|
| - |
|
102 |
import org.apache.http.conn.HttpHostConnectException;
|
| - |
|
103 |
import org.apache.http.entity.StringEntity;
|
| - |
|
104 |
import org.apache.http.impl.client.CloseableHttpClient;
|
| - |
|
105 |
import org.apache.http.impl.client.HttpClients;
|
| - |
|
106 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
107 |
import org.apache.logging.log4j.Logger;
|
| - |
|
108 |
import org.json.JSONArray;
|
| - |
|
109 |
import org.json.JSONObject;
|
| - |
|
110 |
import org.json.XML;
|
| - |
|
111 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
112 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| - |
|
113 |
import org.springframework.beans.factory.annotation.Value;
|
| - |
|
114 |
import org.springframework.core.io.ByteArrayResource;
|
| - |
|
115 |
import org.springframework.core.io.InputStreamSource;
|
| - |
|
116 |
import org.springframework.mail.javamail.JavaMailSender;
|
| - |
|
117 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| - |
|
118 |
import org.springframework.stereotype.Component;
|
| - |
|
119 |
import org.springframework.transaction.annotation.Transactional;
|
| - |
|
120 |
|
| - |
|
121 |
import javax.mail.MessagingException;
|
| - |
|
122 |
import javax.mail.internet.InternetAddress;
|
| - |
|
123 |
import javax.mail.internet.MimeMessage;
|
| - |
|
124 |
import java.io.*;
|
| - |
|
125 |
import java.math.BigDecimal;
|
| - |
|
126 |
import java.math.RoundingMode;
|
| - |
|
127 |
import java.nio.file.Files;
|
| - |
|
128 |
import java.nio.file.Paths;
|
| - |
|
129 |
import java.sql.Timestamp;
|
| - |
|
130 |
import java.text.DecimalFormat;
|
| - |
|
131 |
import java.time.*;
|
| - |
|
132 |
import java.time.format.DateTimeFormatter;
|
| - |
|
133 |
import java.time.temporal.ChronoField;
|
| - |
|
134 |
import java.time.temporal.ChronoUnit;
|
| - |
|
135 |
import java.util.*;
|
| - |
|
136 |
import java.util.Map.Entry;
|
| - |
|
137 |
import java.util.stream.Collector;
|
| - |
|
138 |
import java.util.stream.Collectors;
|
| - |
|
139 |
import java.util.stream.Stream;
|
| - |
|
140 |
|
| - |
|
141 |
import static java.util.stream.Collectors.groupingBy;
|
| - |
|
142 |
import static java.util.stream.Collectors.mapping;
|
| 286 |
|
143 |
|
| 287 |
@Component
|
144 |
@Component
|
| 288 |
@Transactional(rollbackFor = Throwable.class)
|
145 |
@Transactional(rollbackFor = Throwable.class)
|
| 289 |
public class ScheduledTasks {
|
146 |
public class ScheduledTasks {
|
| 290 |
|
147 |
|
| Line 346... |
Line 203... |
| 346 |
|
203 |
|
| 347 |
@Autowired
|
204 |
@Autowired
|
| 348 |
private CsService csService;
|
205 |
private CsService csService;
|
| 349 |
|
206 |
|
| 350 |
@Autowired
|
207 |
@Autowired
|
| - |
|
208 |
RetailerBlockBrandsRepository retailerBlockBrandsRepository;
|
| - |
|
209 |
|
| - |
|
210 |
@Autowired
|
| 351 |
private SaholicInventoryService saholicInventoryService;
|
211 |
private SaholicInventoryService saholicInventoryService;
|
| 352 |
|
212 |
|
| 353 |
@Autowired
|
213 |
@Autowired
|
| 354 |
private InsurancePolicyRepository insurancePolicyRepository;
|
214 |
private InsurancePolicyRepository insurancePolicyRepository;
|
| 355 |
|
215 |
|
| Line 402... |
Line 262... |
| 402 |
private SchemeService schemeService;
|
262 |
private SchemeService schemeService;
|
| 403 |
|
263 |
|
| 404 |
@Autowired
|
264 |
@Autowired
|
| 405 |
private ServiceConfigRepository serviceConfigRepository;
|
265 |
private ServiceConfigRepository serviceConfigRepository;
|
| 406 |
|
266 |
|
| 407 |
@Autowired
|
- |
|
| 408 |
private RetailerBlockBrandsRepository retailerBlockBrandsRepository;
|
- |
|
| 409 |
|
- |
|
| 410 |
@Value("${delhivery.tracking.token}")
|
267 |
@Value("${delhivery.tracking.token}")
|
| 411 |
private String token;
|
268 |
private String token;
|
| 412 |
|
269 |
|
| 413 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[]{"uday.singh@smartudkaan.com", "mohinder.mutreja@smartdukaan.com", "ankit.bhatia@smartdukaan.com", "tarun.verma@smartdukaan.com", "kuldeep.kumar@smartdukaan.com", "manish.gupta@smartdukaan.com"};
|
270 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[]{"uday.singh@smartudkaan.com", "mohinder.mutreja@smartdukaan.com", "ankit.bhatia@smartdukaan.com", "tarun.verma@smartdukaan.com", "kuldeep.kumar@smartdukaan.com", "manish.gupta@smartdukaan.com"};
|
| 414 |
|
271 |
|
| Line 1003... |
Line 860... |
| 1003 |
|
860 |
|
| 1004 |
System.out.println(ageingModelMap.size());
|
861 |
System.out.println(ageingModelMap.size());
|
| 1005 |
List<PartnerAgeingModel> partnerAgeingModels = ageingService.getAllAgeingForTertiary();
|
862 |
List<PartnerAgeingModel> partnerAgeingModels = ageingService.getAllAgeingForTertiary();
|
| 1006 |
|
863 |
|
| 1007 |
|
864 |
|
| 1008 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber", "Color", "Exceed Days", "Last ScanType", "Supplier Name", "Current Warehouse", "First Warehouse", "Invoice Number", "Invoice Date"), ageingModelMap.values().stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(), x.getExceedDays(), x.getLastScanType(), x.getSupplierName(), x.getCurrentWarehouse(), x.getFirstWarehouse(), x.getInvoiceNumber(), FormattingUtils.formatDate(x.getInvoiceDate()))).collect(Collectors.toList()));
|
865 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber",
|
| - |
|
866 |
"Color", "Exceed Days", "Last ScanType", "Supplier Name", "Current Warehouse", "First Warehouse", "Invoice Number", "Invoice Date"),
|
| - |
|
867 |
ageingModelMap.values().stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(),
|
| - |
|
868 |
x.getExceedDays(), x.getLastScanType(), x.getSupplierName(), x.getCurrentWarehouse(), x.getFirstWarehouse(), x.getInvoiceNumber(), FormattingUtils.formatDate(x.getInvoiceDate())))
|
| - |
|
869 |
.collect(Collectors.toList()));
|
| 1009 |
|
870 |
|
| 1010 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream2 = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber", "Color", "Partner Id", "Partner Code", "Partner Name", "Activation Type", "City", "State", "Billing Date", "Exceed Days", "Max Ageing", "Activation Date"), partnerAgeingModels.stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(), x.getFofoId(), x.getFofoCode(), x.getFofoName(), x.getActivationType(), x.getFofoCity(), x.getFofoState(), FormattingUtils.formatDate(x.getBillingDate()), x.getExceedDays(), x.getMaxAgeingDays(), x.getActivationDate())).collect(Collectors.toList()));
|
871 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream2 = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber",
|
| - |
|
872 |
"Color", "Partner Id", "Partner Code", "Partner Name", "Activation Type", "City", "State", "Billing Date", "Exceed Days", "Max Ageing", "Activation Date"),
|
| - |
|
873 |
partnerAgeingModels.stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(),
|
| - |
|
874 |
x.getFofoId(), x.getFofoCode(), x.getFofoName(), x.getActivationType(), x.getFofoCity(), x.getFofoState(), FormattingUtils.formatDate(x.getBillingDate()), x.getExceedDays(), x.getMaxAgeingDays(), x.getActivationDate()))
|
| - |
|
875 |
.collect(Collectors.toList()));
|
| 1011 |
Utils.Attachment attachment1 = new Utils.Attachment("secondary-alert.csv", new ByteArrayResource(byteArrayOutputStream.toByteArray()));
|
876 |
Utils.Attachment attachment1 = new Utils.Attachment("secondary-alert.csv", new ByteArrayResource(byteArrayOutputStream.toByteArray()));
|
| 1012 |
Utils.Attachment attachment2 = new Utils.Attachment("tertiary-alert.csv", new ByteArrayResource(byteArrayOutputStream2.toByteArray()));
|
877 |
Utils.Attachment attachment2 = new Utils.Attachment("tertiary-alert.csv", new ByteArrayResource(byteArrayOutputStream2.toByteArray()));
|
| 1013 |
|
878 |
|
| 1014 |
String mailSubject = "Stock ageing Alert";
|
879 |
String mailSubject = "Stock ageing Alert";
|
| 1015 |
Utils.sendMailWithAttachments(mailSender, new String[]{"deena.nath@smartdukaan.com"}, null, mailSubject, "PFA", attachment1, attachment2);
|
880 |
Utils.sendMailWithAttachments(mailSender, new String[]{"deena.nath@smartdukaan.com"}, null, mailSubject, "PFA", attachment1, attachment2);
|
| Line 1128... |
Line 993... |
| 1128 |
BrandRegionMappingRepository brandRegionMappingRepository;
|
993 |
BrandRegionMappingRepository brandRegionMappingRepository;
|
| 1129 |
|
994 |
|
| 1130 |
public void test() throws Exception {
|
995 |
public void test() throws Exception {
|
| 1131 |
System.out.println("Starting test");
|
996 |
System.out.println("Starting test");
|
| 1132 |
//processScheme(LocalDate.of(2023,05, 02).atStartOfDay(), LocalDate.of(2023, 05, 6).atStartOfDay(), false);
|
997 |
//processScheme(LocalDate.of(2023,05, 02).atStartOfDay(), LocalDate.of(2023, 05, 6).atStartOfDay(), false);
|
| 1133 |
partnerTypeChangeService.getTypeOnDate(175139287, LocalDate.of(2023, 01, 01));
|
998 |
//
|
| 1134 |
partnerTypeChangeService.getTypeOnDate(175139287, LocalDate.of(2023, 02, 01));
|
999 |
for (String inv : Arrays.asList("DLWE066/2966","UPBLY175/1014","UPSRP547/16","UPSBL299/2620","UPSML508/76","UPBLY175/1015","UPBLY175/1013","UPMTR498/377","UPBUD432/122","UPAZM132/1443","UPETH173/2124","HRGN516/139","UPSRP547/36","UPCDL116/1172","UPSRP547/42","RJAMR522/36","RJBHW525/16","HRRHK424/78","HRRHK424/81","HRRHK424/84","HRRHK424/85","HRRHK424/83","HRRHK424/77","HRRHK424/76","HRRHK424/75","HRRHK424/73","HRRHK424/74","HRRHK424/45","HRKA135/3528","HRKN025/4479","UPAZM132/1460","UPBSR530/51","HRKN093/1434","HRRHK424/80","HRKA153/3823","HRFB402/534","UPETH173/2232","HRGN516/140","UPGBN590/10","RJJHU440/113","HRKN148/828","HRPHK245/617","HRKA256/170","UPBSR608/4","RJBHW445/3","UPSJP484/169","UPSJP484/169","UPSRP455/600","UPSRP455/599","RJJU518/546","HRKN184/669","UPMTR498/447","UPAMH419/232","UPMZR448/392","HRPW604/24","UPSML508/126","HRMWT562/38","HRKA395/221","UKAL569/69","UPMZR448/324","UPMTR532/153","UPMTR532/193", "HRKN025/4630")) {
|
| 1135 |
partnerTypeChangeService.getTypeOnDate(175139287, LocalDate.of(2023, 03, 01));
|
1000 |
System.out.println("Invoice - " + inv);
|
| 1136 |
FofoStore fs = fofoStoreRepository.selectByRetailerId(175139287);
|
1001 |
orderService.reverseScheme(fofoOrderRepository.selectByInvoiceNumber(inv));
|
| 1137 |
this.rolloutMarginForStoreOnMonth(fs, LocalDate.of(2023, 2, 1));
|
1002 |
}
|
| 1138 |
|
1003 |
|
| 1139 |
//this.sendMailForSamsungRebilling();
|
1004 |
//this.sendMailForSamsungRebilling();
|
| 1140 |
/*List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
1005 |
/*List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
| 1141 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
1006 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
| 1142 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
1007 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
| Line 2446... |
Line 2311... |
| 2446 |
continue;
|
2311 |
continue;
|
| 2447 |
}
|
2312 |
}
|
| 2448 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = focusedModelRepository.selectAllByRegionIds(regionIds).stream().collect(groupingBy(FocusedModel::getCatalogId, mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
2313 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = focusedModelRepository.selectAllByRegionIds(regionIds).stream().collect(groupingBy(FocusedModel::getCatalogId, mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
| 2449 |
|
2314 |
|
| 2450 |
LOGGER.info("focusedCatalogIdAndQtyMap" + focusedCatalogIdAndQtyMap);
|
2315 |
LOGGER.info("focusedCatalogIdAndQtyMap" + focusedCatalogIdAndQtyMap);
|
| - |
|
2316 |
|
| 2451 |
Map<String, RetailerBlockBrands> retailerBlockBrands = retailerBlockBrandsRepository.selectAllByRetailer(fofoId).stream().collect(Collectors.toMap(x -> x.getBlockBrands(), x -> x));
|
2317 |
Map<String, RetailerBlockBrands> retailerBlockBrands = retailerBlockBrandsRepository.selectAllByRetailer(fofoId).stream().collect(Collectors.toMap(x -> x.getBlockBrands(), x -> x));
|
| 2452 |
|
2318 |
|
| 2453 |
|
2319 |
|
| 2454 |
for (Map.Entry<Integer, Optional<Integer>> entry : focusedCatalogIdAndQtyMap.entrySet()) {
|
2320 |
for (Map.Entry<Integer, Optional<Integer>> entry : focusedCatalogIdAndQtyMap.entrySet()) {
|
| 2455 |
int minQty = entry.getValue().get();
|
2321 |
int minQty = entry.getValue().get();
|
| Line 4163... |
Line 4029... |
| 4163 |
}
|
4029 |
}
|
| 4164 |
|
4030 |
|
| 4165 |
}
|
4031 |
}
|
| 4166 |
|
4032 |
|
| 4167 |
private String getMessageHygieneAlertForPartner(
|
4033 |
private String getMessageHygieneAlertForPartner(
|
| 4168 |
Map<Integer, Map<YearMonth, List<HygieneData>>> partnerYearMonthData, Map<Integer, Map<LocalDate, List<HygieneData>>> partnerDateWiseData) {
|
4034 |
Map<Integer, Map<YearMonth, List<HygieneData>>> partnerYearMonthData, Map<Integer, Map<LocalDate, List<HygieneData>>> partnerDateWiseData) {
|
| 4169 |
|
4035 |
|
| 4170 |
Map<Integer, CustomRetailer> customeRetailerMap = retailerService.getAllFofoRetailers();
|
4036 |
Map<Integer, CustomRetailer> customeRetailerMap = retailerService.getAllFofoRetailers();
|
| 4171 |
|
4037 |
|
| 4172 |
LocalDateTime startDate = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
4038 |
LocalDateTime startDate = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
| 4173 |
LocalDateTime endDate = LocalDateTime.now();
|
4039 |
LocalDateTime endDate = LocalDateTime.now();
|
| Line 4401... |
Line 4267... |
| 4401 |
|
4267 |
|
| 4402 |
}
|
4268 |
}
|
| 4403 |
|
4269 |
|
| 4404 |
}
|
4270 |
}
|
| 4405 |
|
4271 |
|
| 4406 |
@Autowired
|
- |
|
| 4407 |
private RetailerFilterRepository retailerFilterRepository;
|
- |
|
| 4408 |
|
- |
|
| 4409 |
@Autowired
|
- |
|
| 4410 |
private PerformanceService performanceService;
|
- |
|
| 4411 |
|
- |
|
| 4412 |
|
- |
|
| 4413 |
public void sendFilteredRetailerPerformance() throws Exception {
|
- |
|
| 4414 |
RetailerFilterModel retailerFilterModel = performanceService.getRetailerFilterModel();
|
- |
|
| 4415 |
|
- |
|
| 4416 |
Map<Integer, CustomRetailer> customRetailers = retailerService.getFofoRetailers(true);
|
- |
|
| 4417 |
|
- |
|
| 4418 |
|
- |
|
| 4419 |
List<RetailerPeformanceFilterModel> partnersPerformance = performanceService.getPerformance(retailerFilterModel, customRetailers);
|
- |
|
| 4420 |
|
- |
|
| 4421 |
Map<Integer, RetailerPeformanceFilterModel> partnersPerformanceMap = new HashMap<>();
|
- |
|
| 4422 |
|
- |
|
| 4423 |
if (!partnersPerformance.isEmpty()) {
|
- |
|
| 4424 |
partnersPerformanceMap = partnersPerformance.stream().collect(Collectors.toMap(x -> x.getFofoId(), x -> x));
|
- |
|
| 4425 |
performanceService.sendPartnerPerformanceEmail(partnersPerformanceMap, retailerFilterModel, customRetailers);
|
- |
|
| 4426 |
|
- |
|
| 4427 |
}
|
- |
|
| 4428 |
|
- |
|
| 4429 |
|
- |
|
| 4430 |
}
|
- |
|
| 4431 |
|
- |
|
| 4432 |
|
- |
|
| 4433 |
}
|
4272 |
}
|
| 4434 |
// 2284'
|
4273 |
// 2284'
|
| 4435 |
|
4274 |
|