| 23755 |
amit.gupta |
1 |
package com.smartdukaan.cron;
|
| 23723 |
amit.gupta |
2 |
|
| 32782 |
raveendra. |
3 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
|
|
4 |
import com.smartdukaan.cron.scheduled.*;
|
|
|
5 |
import com.smartdukaan.cron.scheduled.b2b.Listing;
|
| 36745 |
ranu |
6 |
import com.smartdukaan.cron.scheduled.beatmiss.BeatMissDetectorRunner;
|
| 32782 |
raveendra. |
7 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 32831 |
amit.gupta |
8 |
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
|
| 33274 |
amit.gupta |
9 |
import com.smartdukaan.cron.scheduled.purchaseorder.POScheduler;
|
| 34860 |
ranu |
10 |
import com.smartdukaan.cron.scheduled.razorpay.FetchPartnersDisbursementTask;
|
| 36058 |
ranu |
11 |
import com.smartdukaan.cron.scheduled.knowlarity.KnowlarityCallMonitorScheduler;
|
|
|
12 |
import com.spice.profitmandi.common.model.InvoicePdfModel;
|
| 34443 |
vikas.jang |
13 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 32782 |
raveendra. |
14 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
|
|
15 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
|
|
16 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 36035 |
amit |
17 |
import com.spice.profitmandi.dao.service.shopify.ShopifyProductSyncService;
|
| 32782 |
raveendra. |
18 |
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
|
| 37499 |
ranu |
19 |
import com.spice.profitmandi.service.NotificationService;
|
|
|
20 |
import com.spice.profitmandi.service.integrations.icicilombard.IciciLombardService;
|
|
|
21 |
import com.spice.profitmandi.service.integrations.icicilombard.model.LastTransactionsResponseModel;
|
| 32782 |
raveendra. |
22 |
import com.spice.profitmandi.service.integrations.samsung.upgradeoffer.UpgradeOfferService;
|
| 36063 |
ranu |
23 |
import com.spice.profitmandi.service.mail.MailOutboxService;
|
| 23723 |
amit.gupta |
24 |
import org.apache.logging.log4j.LogManager;
|
|
|
25 |
import org.apache.logging.log4j.Logger;
|
| 28389 |
amit.gupta |
26 |
import org.apache.velocity.app.VelocityEngine;
|
|
|
27 |
import org.apache.velocity.exception.VelocityException;
|
| 23898 |
amit.gupta |
28 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
29 |
import org.springframework.boot.ApplicationArguments;
|
|
|
30 |
import org.springframework.boot.ApplicationRunner;
|
| 23723 |
amit.gupta |
31 |
import org.springframework.boot.WebApplicationType;
|
|
|
32 |
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
33 |
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
34 |
import org.springframework.context.annotation.Bean;
|
|
|
35 |
import org.springframework.context.annotation.ComponentScan;
|
| 34554 |
tejus.loha |
36 |
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
| 23935 |
amit.gupta |
37 |
import org.springframework.context.annotation.Primary;
|
| 23723 |
amit.gupta |
38 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
|
39 |
import org.springframework.core.io.ClassPathResource;
|
| 35393 |
amit |
40 |
import org.springframework.core.io.Resource;
|
| 23906 |
amit.gupta |
41 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 37453 |
amit |
42 |
import com.spice.profitmandi.common.services.AuthenticatedIdentityMailSender;
|
| 23906 |
amit.gupta |
43 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 28389 |
amit.gupta |
44 |
import org.springframework.ui.velocity.VelocityEngineFactoryBean;
|
| 23723 |
amit.gupta |
45 |
|
| 32782 |
raveendra. |
46 |
import java.io.FileInputStream;
|
|
|
47 |
import java.io.IOException;
|
|
|
48 |
import java.time.LocalDate;
|
| 37058 |
amit |
49 |
import java.time.LocalDateTime;
|
| 32782 |
raveendra. |
50 |
import java.time.YearMonth;
|
|
|
51 |
import java.util.ArrayList;
|
|
|
52 |
import java.util.Arrays;
|
|
|
53 |
import java.util.List;
|
|
|
54 |
import java.util.Properties;
|
|
|
55 |
import java.util.stream.Collectors;
|
| 23724 |
amit.gupta |
56 |
|
| 23723 |
amit.gupta |
57 |
@SpringBootApplication
|
| 34554 |
tejus.loha |
58 |
@EnableAspectJAutoProxy
|
| 23755 |
amit.gupta |
59 |
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
|
| 24122 |
govind |
60 |
public class Application implements ApplicationRunner {
|
|
|
61 |
|
| 31753 |
tejbeer |
62 |
private static final Logger LOGGER = LogManager.getLogger(Application.class);
|
| 24122 |
govind |
63 |
|
| 31753 |
tejbeer |
64 |
@Autowired
|
|
|
65 |
LeadSyncRunner leadSyncRunner;
|
| 30120 |
amit.gupta |
66 |
|
| 31753 |
tejbeer |
67 |
@Autowired
|
|
|
68 |
StandAlone standAlone;
|
| 30209 |
amit.gupta |
69 |
|
| 31753 |
tejbeer |
70 |
@Autowired
|
|
|
71 |
UpgradeOfferService upgradeOfferService;
|
| 27392 |
amit.gupta |
72 |
|
| 31753 |
tejbeer |
73 |
@Autowired
|
|
|
74 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
| 28368 |
tejbeer |
75 |
|
| 31753 |
tejbeer |
76 |
@Autowired
|
|
|
77 |
private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
|
| 28921 |
tejbeer |
78 |
|
| 31753 |
tejbeer |
79 |
@Autowired
|
|
|
80 |
private InvestmentRelatedTasks investmentRelatedTasks;
|
| 27392 |
amit.gupta |
81 |
|
| 31753 |
tejbeer |
82 |
@Autowired
|
|
|
83 |
private CsService csService;
|
| 29814 |
tejbeer |
84 |
|
| 31753 |
tejbeer |
85 |
@Autowired
|
|
|
86 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
| 24603 |
amit.gupta |
87 |
|
| 31753 |
tejbeer |
88 |
@Autowired
|
|
|
89 |
private ContentPojoPopulator contentPojoPopulator;
|
| 29361 |
tejbeer |
90 |
|
| 31753 |
tejbeer |
91 |
@Autowired
|
|
|
92 |
private Listing listing;
|
| 24122 |
govind |
93 |
|
| 32831 |
amit.gupta |
94 |
@Autowired
|
|
|
95 |
OrderTrackingService orderTrackingService;
|
|
|
96 |
|
| 36306 |
amit |
97 |
@Autowired
|
|
|
98 |
BatchScheduledTasks batchScheduledTasks;
|
|
|
99 |
|
| 36745 |
ranu |
100 |
@Autowired
|
|
|
101 |
private BeatMissDetectorRunner beatMissDetectorRunner;
|
|
|
102 |
|
| 37499 |
ranu |
103 |
@Autowired
|
|
|
104 |
private IciciLombardService iciciLombardService;
|
|
|
105 |
|
| 31753 |
tejbeer |
106 |
public static void main(String[] args) throws Throwable {
|
|
|
107 |
try {
|
| 35803 |
amit |
108 |
WebApplicationType webType = WebApplicationType.SERVLET;
|
|
|
109 |
for (String arg : args) {
|
|
|
110 |
if (arg.contains("spring.main.web-application-type=none")) {
|
|
|
111 |
webType = WebApplicationType.NONE;
|
|
|
112 |
break;
|
|
|
113 |
}
|
|
|
114 |
}
|
|
|
115 |
new SpringApplicationBuilder(Application.class)
|
|
|
116 |
.web(webType)
|
|
|
117 |
.run(args);
|
| 31753 |
tejbeer |
118 |
} catch (Throwable t) {
|
|
|
119 |
t.printStackTrace();
|
|
|
120 |
}
|
|
|
121 |
}
|
| 28389 |
amit.gupta |
122 |
|
| 31753 |
tejbeer |
123 |
@Bean
|
|
|
124 |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
|
|
|
125 |
LOGGER.info("Called Configuration");
|
|
|
126 |
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
|
| 35393 |
amit |
127 |
|
| 35832 |
amit |
128 |
String activeProfile;
|
|
|
129 |
Properties properties = new Properties();
|
|
|
130 |
try {
|
|
|
131 |
properties.load(Application.class.getClassLoader().getResourceAsStream("META-INF/env.property"));
|
|
|
132 |
} catch (IOException e) {
|
|
|
133 |
LOGGER.error("Error reading env.property, defaulting to dev: " + e);
|
|
|
134 |
properties.put("profile", "dev");
|
|
|
135 |
}
|
|
|
136 |
activeProfile = (String) properties.get("profile");
|
| 35393 |
amit |
137 |
|
| 35832 |
amit |
138 |
Resource appResource;
|
|
|
139 |
Resource sharedResource;
|
|
|
140 |
|
|
|
141 |
if ("prod".equals(activeProfile)) {
|
|
|
142 |
appResource = new ClassPathResource("/META-INF/prod.properties");
|
|
|
143 |
sharedResource = new ClassPathResource("/shared-prod.properties");
|
|
|
144 |
} else if ("staging".equals(activeProfile)) {
|
|
|
145 |
appResource = new ClassPathResource("/META-INF/staging.properties");
|
|
|
146 |
sharedResource = new ClassPathResource("/shared-staging.properties");
|
|
|
147 |
} else {
|
|
|
148 |
appResource = new ClassPathResource("/META-INF/dev.properties");
|
|
|
149 |
sharedResource = new ClassPathResource("/shared-dev.properties");
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
LOGGER.info("Cron loading profile: " + activeProfile);
|
|
|
153 |
propertySourcesPlaceholderConfigurer.setLocations(sharedResource, appResource);
|
| 35393 |
amit |
154 |
propertySourcesPlaceholderConfigurer.setIgnoreResourceNotFound(true);
|
|
|
155 |
|
| 31753 |
tejbeer |
156 |
return propertySourcesPlaceholderConfigurer;
|
|
|
157 |
}
|
| 28389 |
amit.gupta |
158 |
|
| 31753 |
tejbeer |
159 |
@Bean(name = "veloctyEngine")
|
|
|
160 |
public VelocityEngine velocityEngine() throws VelocityException, IOException {
|
|
|
161 |
VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
|
| 28389 |
amit.gupta |
162 |
|
| 31753 |
tejbeer |
163 |
Properties velocityProperties = new Properties();
|
|
|
164 |
velocityProperties.put("resource.loader", "class");
|
|
|
165 |
velocityProperties.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
|
|
166 |
velocityProperties.put("file.resource.loader.cache", true);
|
|
|
167 |
velocityProperties.put("file.resource.loader.unicode", true);
|
|
|
168 |
velocityProperties.put("input.encoding", "UTF-8");
|
|
|
169 |
velocityProperties.put("output.encoding", "UTF-8");
|
|
|
170 |
velocityProperties.put("response.encoding", "UTF-8");
|
|
|
171 |
velocityProperties.put("overrideLogging", true);
|
| 28389 |
amit.gupta |
172 |
|
| 31753 |
tejbeer |
173 |
// velocityProperties.put("file.resource.loader.path", ".");
|
| 28389 |
amit.gupta |
174 |
|
| 31753 |
tejbeer |
175 |
factory.setVelocityProperties(velocityProperties);
|
| 28389 |
amit.gupta |
176 |
|
| 31753 |
tejbeer |
177 |
return factory.createVelocityEngine();
|
| 23723 |
amit.gupta |
178 |
|
| 31753 |
tejbeer |
179 |
}
|
| 24122 |
govind |
180 |
|
| 37474 |
amit |
181 |
/**
|
|
|
182 |
* The default sender. Authenticates as sdtech@smartdukaan.com and rewrites
|
|
|
183 |
* every From to that identity — Workspace binds an authenticated session to
|
|
|
184 |
* one address and rejects any other with
|
|
|
185 |
* "535 Authorization failed: Authenticated user is not authorized to send mail".
|
|
|
186 |
*
|
|
|
187 |
* Also answers to "mailSender" so the many unqualified JavaMailSender
|
|
|
188 |
* injections resolve here rather than needing to be touched.
|
|
|
189 |
*/
|
| 37479 |
amit |
190 |
@Bean(name = "googleMailSender")
|
| 31753 |
tejbeer |
191 |
public JavaMailSender googleMailSender() {
|
| 37453 |
amit |
192 |
JavaMailSenderImpl mailSender = new AuthenticatedIdentityMailSender();
|
| 34612 |
ranu |
193 |
mailSender.setHost("smtp.gmail.com");
|
|
|
194 |
mailSender.setPort(465);
|
|
|
195 |
mailSender.setUsername("sdtech@smartdukaan.com");
|
| 37369 |
amit |
196 |
mailSender.setPassword("wbdwyqrcgosrkwdn"); // App Password
|
| 34612 |
ranu |
197 |
|
|
|
198 |
Properties props = mailSender.getJavaMailProperties();
|
|
|
199 |
props.put("mail.smtp.auth", "true");
|
|
|
200 |
props.put("mail.smtp.ssl.enable", "true");
|
|
|
201 |
props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
|
|
|
202 |
props.put("mail.smtp.socketFactory.port", "465");
|
|
|
203 |
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
| 37368 |
amit |
204 |
props.put("mail.smtp.connectiontimeout", "30000");
|
|
|
205 |
props.put("mail.smtp.timeout", "120000");
|
|
|
206 |
props.put("mail.smtp.writetimeout", "120000");
|
| 34612 |
ranu |
207 |
|
|
|
208 |
return mailSender;
|
|
|
209 |
}
|
|
|
210 |
|
| 37479 |
amit |
211 |
/**
|
|
|
212 |
* The default sender.
|
|
|
213 |
*
|
|
|
214 |
* Verified working 2026-08-31: MAIL FROM:<noreply@smartdukaan.com> returns 250
|
|
|
215 |
* over IPv4. It does not authenticate -- Workspace authorises it by allowlisted
|
|
|
216 |
* source IP -- so it may legitimately send as noreply@.
|
|
|
217 |
*
|
| 37480 |
amit |
218 |
* googleMailSender is the alternative and its credentials are valid -- verified
|
|
|
219 |
* 2026-08-31, AUTH OK on both 465 and 587. Use it by qualifier where a message
|
|
|
220 |
* must come from the authenticated identity rather than noreply@.
|
| 37479 |
amit |
221 |
*
|
| 37480 |
amit |
222 |
* SMTP on this host works over IPv4 only, and that is not specific to the relay:
|
|
|
223 |
* over IPv6 the relay answers "550 5.7.1 Invalid credentials for relay" and
|
|
|
224 |
* smtp.gmail.com rejects a valid app password with "535 5.7.8 Username and
|
|
|
225 |
* Password not accepted". The JVM prefers IPv4, which is the only reason mail
|
|
|
226 |
* leaves this box at all. Anything that prefers IPv6 will fail on both paths.
|
| 37479 |
amit |
227 |
*/
|
|
|
228 |
@Bean(name = {"gmailRelaySender", "mailSender"})
|
|
|
229 |
@Primary
|
| 36248 |
amit |
230 |
public JavaMailSender getGmailRelaySender() {
|
|
|
231 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
|
|
232 |
mailSender.setHost("smtp-relay.gmail.com");
|
|
|
233 |
mailSender.setPort(587);
|
|
|
234 |
|
|
|
235 |
Properties props = mailSender.getJavaMailProperties();
|
|
|
236 |
props.put("mail.smtp.starttls.enable", "true");
|
|
|
237 |
props.put("mail.smtp.auth", "false");
|
|
|
238 |
props.put("mail.smtp.localhost", "smartdukaan.com");
|
|
|
239 |
props.put("mail.smtp.ssl.protocols", "TLSv1.2");
|
|
|
240 |
props.put("mail.smtp.ssl.trust", "smtp-relay.gmail.com");
|
|
|
241 |
props.put("mail.transport.protocol", "smtp");
|
| 37368 |
amit |
242 |
props.put("mail.smtp.connectiontimeout", "30000");
|
|
|
243 |
props.put("mail.smtp.timeout", "120000");
|
|
|
244 |
props.put("mail.smtp.writetimeout", "120000");
|
| 36248 |
amit |
245 |
|
|
|
246 |
return mailSender;
|
|
|
247 |
}
|
|
|
248 |
|
| 31753 |
tejbeer |
249 |
@Autowired
|
|
|
250 |
private RunOnceTasks runOnceTasks;
|
| 24122 |
govind |
251 |
|
| 31753 |
tejbeer |
252 |
@Autowired
|
|
|
253 |
private ScheduledTasks scheduledTasks;
|
| 30335 |
amit.gupta |
254 |
|
| 31753 |
tejbeer |
255 |
@Autowired
|
| 34306 |
ranu |
256 |
private ScheduledTasksTest scheduledTasksTest;
|
|
|
257 |
|
|
|
258 |
@Autowired
|
| 34860 |
ranu |
259 |
private FetchPartnersDisbursementTask fetchPartnersDisbursementTask;
|
|
|
260 |
|
|
|
261 |
@Autowired
|
| 31753 |
tejbeer |
262 |
private Reconciliation reconciliation;
|
| 30309 |
amit.gupta |
263 |
|
| 31753 |
tejbeer |
264 |
@Autowired
|
| 36511 |
amit |
265 |
private WarehouseStockReconciliation warehouseStockReconciliation;
|
|
|
266 |
|
|
|
267 |
@Autowired
|
| 37159 |
amit |
268 |
private PartnerIdentityIntegrityMonitor partnerIdentityIntegrityMonitor;
|
|
|
269 |
|
|
|
270 |
@Autowired
|
| 35250 |
amit |
271 |
private Migrations migrations;
|
|
|
272 |
|
|
|
273 |
@Autowired
|
| 31753 |
tejbeer |
274 |
CaptchaService captchaService;
|
| 28921 |
tejbeer |
275 |
|
| 33274 |
amit.gupta |
276 |
@Autowired
|
|
|
277 |
POScheduler poScheduler;
|
| 32878 |
amit.gupta |
278 |
|
| 35929 |
vikas |
279 |
@Autowired
|
|
|
280 |
ShopifyProductSyncService shopifyProductSyncService;
|
| 33274 |
amit.gupta |
281 |
|
| 36058 |
ranu |
282 |
@Autowired
|
|
|
283 |
KnowlarityCallMonitorScheduler knowlarityCallMonitorScheduler;
|
| 35929 |
vikas |
284 |
|
| 36063 |
ranu |
285 |
@Autowired
|
|
|
286 |
MailOutboxService mailOutboxService;
|
|
|
287 |
|
| 37499 |
ranu |
288 |
@Autowired
|
|
|
289 |
NotificationService notificationService;
|
|
|
290 |
|
| 31753 |
tejbeer |
291 |
@Override
|
|
|
292 |
public void run(ApplicationArguments args) throws Exception {
|
| 32008 |
amit.gupta |
293 |
//scheduledTasks.test();
|
|
|
294 |
//System.exit();
|
| 31753 |
tejbeer |
295 |
LOGGER.info("Called run method");
|
| 36058 |
ranu |
296 |
|
|
|
297 |
// Knowlarity Call Monitor - Manual trigger (if 10 AM scheduled start was missed)
|
|
|
298 |
// This just starts the monitor; scheduled healthCheck and stopMonitoring will still work
|
|
|
299 |
if (args.containsOption("startKnowlarityMonitor")) {
|
|
|
300 |
LOGGER.info("Starting Knowlarity Call Monitor manually...");
|
|
|
301 |
knowlarityCallMonitorScheduler.startMonitoring();
|
|
|
302 |
LOGGER.info("Knowlarity Call Monitor started. Scheduled tasks will handle health checks and 10 PM stop.");
|
|
|
303 |
// No sleep needed - Spring scheduler keeps app running and handles 10 PM stop
|
|
|
304 |
}
|
| 36545 |
ranu |
305 |
if (args.containsOption("trackingReport")) {
|
|
|
306 |
runOnceTasks.dailyTrackingReport();
|
|
|
307 |
}
|
| 36058 |
ranu |
308 |
if (args.containsOption("stopKnowlarityMonitor")) {
|
|
|
309 |
LOGGER.info("Stopping Knowlarity Call Monitor...");
|
|
|
310 |
knowlarityCallMonitorScheduler.stopMonitoring();
|
|
|
311 |
}
|
| 36115 |
ranu |
312 |
// Knowlarity - Request fresh snapshot manually (when status not updating)
|
|
|
313 |
if (args.containsOption("refreshKnowlaritySnapshot")) {
|
|
|
314 |
LOGGER.info("Requesting Knowlarity snapshot manually...");
|
|
|
315 |
knowlarityCallMonitorScheduler.healthCheck();
|
|
|
316 |
LOGGER.info("Knowlarity snapshot requested.");
|
|
|
317 |
System.exit(0);
|
|
|
318 |
}
|
| 36058 |
ranu |
319 |
|
| 33260 |
amit.gupta |
320 |
if (args.containsOption("removePartialBillingForTransaction")) {
|
|
|
321 |
if (args.containsOption("trId")) {
|
| 33051 |
amit.gupta |
322 |
int transactionId = Integer.parseInt(args.getOptionValues("trId").get(0));
|
| 33054 |
amit.gupta |
323 |
scheduledTasks.removePartialBillingForTransaction(transactionId);
|
| 33051 |
amit.gupta |
324 |
}
|
|
|
325 |
System.exit(0);
|
|
|
326 |
}
|
| 34523 |
ranu |
327 |
if (args.containsOption("createOpeningStockPartyWise")) {
|
|
|
328 |
scheduledTasks.createOpeningStockPartyWise();
|
|
|
329 |
System.exit(0);
|
|
|
330 |
}
|
| 31753 |
tejbeer |
331 |
if (args.containsOption("tc")) {
|
|
|
332 |
System.out.println("Toffee service called");
|
|
|
333 |
scheduledTasks.toffeeRollback();
|
|
|
334 |
System.exit(0);
|
|
|
335 |
}
|
|
|
336 |
if (args.containsOption("bag")) {
|
|
|
337 |
System.out.println("Bag service called");
|
|
|
338 |
runOnceTasks.testBag();
|
|
|
339 |
System.exit(0);
|
|
|
340 |
}
|
| 29814 |
tejbeer |
341 |
|
| 31753 |
tejbeer |
342 |
if (args.containsOption("rw")) {
|
|
|
343 |
System.out.println("Reverse wallet");
|
|
|
344 |
scheduledTasks.reverseWallet();
|
|
|
345 |
System.exit(0);
|
|
|
346 |
}
|
|
|
347 |
if (args.containsOption("sendIndentTertiary")) {
|
|
|
348 |
System.out.println("sendIndentTertiary");
|
|
|
349 |
scheduledTasks.sendIndentTertiary();
|
|
|
350 |
System.exit(0);
|
|
|
351 |
}
|
|
|
352 |
if (args.containsOption("checkPartnerActiveStore")) {
|
|
|
353 |
System.out.println("checkPartnerActiveStore");
|
|
|
354 |
scheduledTasks.checkPartnerActiveStore();
|
|
|
355 |
System.exit(0);
|
|
|
356 |
}
|
| 37172 |
amit |
357 |
if (args.containsOption("updatePjpAgendaInstances")) {
|
|
|
358 |
System.out.println("updatePjpAgendaInstances");
|
|
|
359 |
scheduledTasks.updatePjpAgendaInstances();
|
|
|
360 |
System.exit(0);
|
|
|
361 |
}
|
| 37040 |
ranu |
362 |
if (args.containsOption("updatePartnerActivationTypeByMonthlySale")) {
|
|
|
363 |
System.out.println("updatePartnerActivationTypeByMonthlySale");
|
|
|
364 |
scheduledTasks.updatePartnerActivationTypeByMonthlySale();
|
|
|
365 |
System.exit(0);
|
|
|
366 |
}
|
| 29800 |
manish |
367 |
|
| 31753 |
tejbeer |
368 |
if (args.containsOption("selectFinServiceFollowUpDateByCurrDate")) {
|
|
|
369 |
System.out.println("selectfinServiceFollowUpDateByCurrDate");
|
| 28368 |
tejbeer |
370 |
|
| 31753 |
tejbeer |
371 |
scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
|
|
|
372 |
System.exit(0);
|
|
|
373 |
}
|
| 25073 |
amit.gupta |
374 |
|
| 31753 |
tejbeer |
375 |
if (args.containsOption("addHdfcPayment")) {
|
|
|
376 |
runOnceTasks.addPayment();
|
|
|
377 |
System.exit(0);
|
|
|
378 |
}
|
| 35250 |
amit |
379 |
if (args.containsOption("migrateOriginalInventoryItemId")) {
|
|
|
380 |
int batchSize = 10_000;
|
|
|
381 |
if (args.containsOption("batchSize")) {
|
|
|
382 |
try {
|
|
|
383 |
batchSize = Integer.parseInt(args.getOptionValues("batchSize").get(0));
|
|
|
384 |
} catch (Exception e) {
|
|
|
385 |
LOGGER.warn("Invalid batchSize provided, defaulting to {}", batchSize);
|
|
|
386 |
}
|
|
|
387 |
}
|
|
|
388 |
LOGGER.info("Starting migration for warehouse.inventoryItem.originalInventoryItemId with batchSize={}", batchSize);
|
| 36003 |
aman |
389 |
//migrations.migrateWarehouseOriginalInventoryItemId(batchSize);
|
| 35250 |
amit |
390 |
LOGGER.info("Migration completed.");
|
|
|
391 |
System.exit(0);
|
|
|
392 |
}
|
| 31753 |
tejbeer |
393 |
if (args.containsOption("processSchemeOut")) {
|
|
|
394 |
System.out.println("Process schemeOut");
|
|
|
395 |
int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
|
|
|
396 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
397 |
runOnceTasks.processSchemeOut(fofoId, orderId);
|
|
|
398 |
System.exit(0);
|
|
|
399 |
}
|
|
|
400 |
if (args.containsOption("at")) {
|
|
|
401 |
System.out.println("Toffee service called");
|
|
|
402 |
ticketRelatedScheduledTask.alertforTicket();
|
|
|
403 |
System.exit(0);
|
|
|
404 |
}
|
|
|
405 |
if (args.containsOption("et")) {
|
|
|
406 |
ticketRelatedScheduledTask.escalateTicket();
|
|
|
407 |
;
|
|
|
408 |
System.exit(0);
|
|
|
409 |
}
|
| 37499 |
ranu |
410 |
if (args.containsOption("iciciBalance")) {
|
|
|
411 |
System.out.println("Fetching ICICI CD balance manually");
|
|
|
412 |
try {
|
|
|
413 |
LastTransactionsResponseModel response = iciciLombardService.getLastTwentyFiveTransactions(null);
|
|
|
414 |
System.out.println("Response: " + response);
|
|
|
415 |
if (response != null
|
|
|
416 |
&& response.getTransactionsDetails() != null
|
|
|
417 |
&& !response.getTransactionsDetails().isEmpty()) {
|
|
|
418 |
LastTransactionsResponseModel.TransactionDetail latest = response.getTransactionsDetails().get(0);
|
|
|
419 |
System.out.println("Current available balance = " + latest.getAvailableBalance()
|
|
|
420 |
+ " (as of " + latest.getEffectiveDate() + " — status: " + latest.getStatus() + ")");
|
|
|
421 |
System.out.println("Last 25 transactions:");
|
|
|
422 |
response.getTransactionsDetails().forEach(t -> System.out.println(" " + t));
|
|
|
423 |
}
|
|
|
424 |
} catch (Exception e) {
|
|
|
425 |
e.printStackTrace();
|
|
|
426 |
}
|
|
|
427 |
System.exit(0);
|
|
|
428 |
}
|
| 31753 |
tejbeer |
429 |
if (args.containsOption("sr")) {
|
|
|
430 |
List<String> schemeIds = args.getOptionValues("schemeId");
|
|
|
431 |
System.out.println(schemeIds);
|
|
|
432 |
scheduledTasks.schemeRollback(schemeIds);
|
|
|
433 |
System.exit(0);
|
|
|
434 |
}
|
|
|
435 |
if (args.containsOption("processActivation")) {
|
|
|
436 |
scheduledTasks.processActivation();
|
|
|
437 |
System.exit(0);
|
|
|
438 |
}
|
|
|
439 |
if (args.containsOption("sendAttendanceMorningAlert")) {
|
|
|
440 |
scheduledTasks.sendAttendanceMorningAlert();
|
|
|
441 |
System.exit(0);
|
|
|
442 |
}
|
|
|
443 |
if (args.containsOption("sendAttendanceEveningAlert")) {
|
|
|
444 |
scheduledTasks.sendAttendanceEveningAlert();
|
|
|
445 |
System.exit(0);
|
|
|
446 |
}
|
| 25721 |
tejbeer |
447 |
|
| 31753 |
tejbeer |
448 |
if (args.containsOption("checkRazorPayPaymentStatus")) {
|
|
|
449 |
scheduledTasks.checkRazorPayPaymentStatus();
|
|
|
450 |
System.exit(0);
|
|
|
451 |
}
|
|
|
452 |
if (args.containsOption("grouping")) {
|
|
|
453 |
scheduledTasks.grouping();
|
|
|
454 |
System.exit(0);
|
|
|
455 |
}
|
|
|
456 |
if (args.containsOption("fixWallet")) {
|
|
|
457 |
runOnceTasks.fixWallet();
|
|
|
458 |
System.exit(0);
|
|
|
459 |
}
|
| 36511 |
amit |
460 |
if (args.containsOption("reconcileInventorySnapshot")) {
|
|
|
461 |
warehouseStockReconciliation.reconcile();
|
|
|
462 |
System.exit(0);
|
|
|
463 |
}
|
| 37159 |
amit |
464 |
if (args.containsOption("partnerIdentityIntegrityMonitor")) {
|
|
|
465 |
partnerIdentityIntegrityMonitor.monitor();
|
|
|
466 |
System.exit(0);
|
|
|
467 |
}
|
| 31753 |
tejbeer |
468 |
if (args.containsOption("reconcileExpiredFixedSchemes")) {
|
|
|
469 |
reconciliation.reconcileExpiredFixedSchemes();
|
|
|
470 |
System.exit(0);
|
|
|
471 |
}
|
|
|
472 |
if (args.containsOption("dailyReconciliation")) {
|
|
|
473 |
if (args.containsOption("date")) {
|
|
|
474 |
LocalDate date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
475 |
reconciliation.dailyReconciliation(date);
|
|
|
476 |
} else {
|
|
|
477 |
reconciliation.dailyReconciliation(LocalDate.now().minusDays(1));
|
|
|
478 |
}
|
|
|
479 |
System.exit(0);
|
|
|
480 |
}
|
|
|
481 |
/*
|
|
|
482 |
* if (args.containsOption("test")) { schemeService.processSchemeIn(9243,
|
|
|
483 |
* 175138102); throw new Exception(); }
|
|
|
484 |
*/
|
| 28921 |
tejbeer |
485 |
|
| 31753 |
tejbeer |
486 |
if (args.containsOption("sendNotification")) {
|
|
|
487 |
scheduledTasks.sendNotification();
|
|
|
488 |
System.exit(0);
|
|
|
489 |
}
|
| 26291 |
tejbeer |
490 |
|
| 36063 |
ranu |
491 |
if (args.containsOption("processPendingMails")) {
|
|
|
492 |
System.out.println("Processing pending mails...");
|
|
|
493 |
mailOutboxService.processPendingMails();
|
|
|
494 |
System.exit(0);
|
|
|
495 |
}
|
|
|
496 |
|
| 37499 |
ranu |
497 |
// Dispatch any notification_schedule rows whose scheduled_timestamp <= now.
|
|
|
498 |
// Same code path as the hourly cron in NotificationDispatchScheduler, but callable
|
|
|
499 |
// on demand from dev / staging where the isProd gate normally blocks the cron.
|
|
|
500 |
// Usage: --dispatchScheduledNotifications [--batch=200]
|
| 37510 |
ranu |
501 |
if (args.containsOption("dispatchScheduledNotifications")) {
|
| 37499 |
ranu |
502 |
int batch = 200;
|
|
|
503 |
if (args.containsOption("batch")) {
|
|
|
504 |
try { batch = Integer.parseInt(args.getOptionValues("batch").get(0)); }
|
|
|
505 |
catch (Exception ignored) { }
|
|
|
506 |
}
|
|
|
507 |
System.out.println("Dispatching due scheduled notifications (batch=" + batch + ")...");
|
|
|
508 |
int attempted = notificationService.dispatchDueScheduled(batch);
|
|
|
509 |
System.out.println("Attempted: " + attempted + " row(s)");
|
|
|
510 |
System.exit(0);
|
| 37510 |
ranu |
511 |
}
|
| 37499 |
ranu |
512 |
|
| 31753 |
tejbeer |
513 |
if (args.containsOption("ticketClosed")) {
|
| 35568 |
amit |
514 |
// Redirected to TicketRelatedScheduledTask which handles auto-close as part of escalateTicket
|
|
|
515 |
ticketRelatedScheduledTask.escalateTicket();
|
| 31753 |
tejbeer |
516 |
System.exit(0);
|
|
|
517 |
}
|
| 28207 |
tejbeer |
518 |
|
| 31753 |
tejbeer |
519 |
if (args.containsOption("getVendorWarehouses")) {
|
|
|
520 |
int warehouseId = Integer.parseInt(args.getOptionValues("warehouseId").get(0));
|
|
|
521 |
scheduledTasks.getVendorWarehouses(warehouseId);
|
|
|
522 |
System.exit(0);
|
|
|
523 |
}
|
| 29776 |
tejbeer |
524 |
|
| 31753 |
tejbeer |
525 |
if (args.containsOption("checkfocusedModelInPartnerStock")) {
|
| 34344 |
amit.gupta |
526 |
try {
|
|
|
527 |
scheduledTasks.checkfocusedModelInPartnerStock();
|
|
|
528 |
} finally {
|
|
|
529 |
System.exit(0);
|
|
|
530 |
}
|
| 31753 |
tejbeer |
531 |
}
|
| 29451 |
manish |
532 |
|
| 31753 |
tejbeer |
533 |
if (args.containsOption("checkImeiActivation")) {
|
|
|
534 |
scheduledTasks.checkImeiActivation();
|
|
|
535 |
System.exit(0);
|
|
|
536 |
}
|
| 29776 |
tejbeer |
537 |
|
| 31753 |
tejbeer |
538 |
if (args.containsOption("partnerProblemAlert")) {
|
|
|
539 |
scheduledTasks.partnerProblemAlert();
|
|
|
540 |
System.exit(0);
|
|
|
541 |
}
|
|
|
542 |
if (args.containsOption("notify")) {
|
|
|
543 |
if (args.containsOption("fofoId")) {
|
|
|
544 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoId").get(0));
|
|
|
545 |
scheduledTasks.sendDailySalesNotificationToPartner(fofoId);
|
|
|
546 |
}
|
|
|
547 |
System.exit(0);
|
|
|
548 |
}
|
|
|
549 |
if (args.containsOption("findMismatchesInIndent")) {
|
|
|
550 |
runOnceTasks.findMismatchesInIndent();
|
|
|
551 |
System.exit(0);
|
|
|
552 |
}
|
| 29035 |
tejbeer |
553 |
|
| 31753 |
tejbeer |
554 |
if (args.containsOption("onboardingEventDelays")) {
|
|
|
555 |
onBoardingRelatedSchelduleTask.onboardingEventDelays();
|
|
|
556 |
System.exit(0);
|
|
|
557 |
}
|
| 28982 |
tejbeer |
558 |
|
| 31753 |
tejbeer |
559 |
if (args.containsOption("onBoardingCompleteEventEmail")) {
|
|
|
560 |
onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
|
|
|
561 |
System.exit(0);
|
|
|
562 |
}
|
| 28921 |
tejbeer |
563 |
|
| 31753 |
tejbeer |
564 |
if (args.containsOption("onBoardingDocumentsPending")) {
|
|
|
565 |
onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
|
|
|
566 |
System.exit(0);
|
|
|
567 |
}
|
|
|
568 |
if (args.containsOption("onBoardingMigration")) {
|
|
|
569 |
onBoardingRelatedSchelduleTask.onBoardingMigration();
|
|
|
570 |
System.exit(0);
|
|
|
571 |
}
|
| 28921 |
tejbeer |
572 |
|
| 33859 |
tejus.loha |
573 |
// if (args.containsOption("advancePaymentPendingAlert")) {
|
|
|
574 |
// onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
|
|
|
575 |
// System.exit(0);
|
|
|
576 |
// }
|
| 28963 |
tejbeer |
577 |
|
| 31753 |
tejbeer |
578 |
if (args.containsOption("fullPaymentPendingAlert")) {
|
|
|
579 |
onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
|
|
|
580 |
System.exit(0);
|
|
|
581 |
}
|
| 29308 |
tejbeer |
582 |
|
| 33859 |
tejus.loha |
583 |
// if (args.containsOption("advancePaymentPendinglegalAlert")) {
|
|
|
584 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
585 |
// System.exit(0);
|
|
|
586 |
// }
|
| 31117 |
tejbeer |
587 |
|
| 31753 |
tejbeer |
588 |
if (args.containsOption("markDelhiveryOrderDelivered")) {
|
| 32831 |
amit.gupta |
589 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
590 |
System.exit(0);
|
|
|
591 |
}
|
| 32831 |
amit.gupta |
592 |
|
| 31753 |
tejbeer |
593 |
if (args.containsOption("markBlueDartOrderDelivered")) {
|
| 32794 |
raveendra. |
594 |
System.out.println("Marking BlueDart Order Delivered...");
|
| 32831 |
amit.gupta |
595 |
orderTrackingService.markBlueDartOrderDelivered();
|
| 31753 |
tejbeer |
596 |
System.exit(0);
|
|
|
597 |
}
|
|
|
598 |
if (args.containsOption("mergingdata")) {
|
|
|
599 |
onBoardingRelatedSchelduleTask.mergingdata();
|
|
|
600 |
System.exit(0);
|
|
|
601 |
}
|
|
|
602 |
if (args.containsOption("brandingAlert")) {
|
|
|
603 |
onBoardingRelatedSchelduleTask.brandingAlert();
|
|
|
604 |
System.exit(0);
|
|
|
605 |
}
|
| 31089 |
amit.gupta |
606 |
|
| 33859 |
tejus.loha |
607 |
// if (args.containsOption("storeTimelinePromoterPending")) {
|
|
|
608 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
609 |
// System.exit(0);
|
|
|
610 |
// }
|
| 31249 |
tejbeer |
611 |
|
| 31753 |
tejbeer |
612 |
if (args.containsOption("ppl")) {
|
|
|
613 |
runOnceTasks.printPendingLeads();
|
|
|
614 |
System.exit(0);
|
|
|
615 |
}
|
| 31249 |
tejbeer |
616 |
|
| 31753 |
tejbeer |
617 |
if (args.containsOption("notifyAll")) {
|
|
|
618 |
scheduledTasks.sendDailySalesNotificationToPartner(null);
|
|
|
619 |
System.exit(0);
|
|
|
620 |
}
|
| 31249 |
tejbeer |
621 |
|
| 31753 |
tejbeer |
622 |
if (args.containsOption("monthlyTargetForInternalTeam")) {
|
|
|
623 |
scheduledTasks.monthlyTargetForInternalTeam();
|
|
|
624 |
System.exit(0);
|
|
|
625 |
}
|
| 31249 |
tejbeer |
626 |
|
| 31753 |
tejbeer |
627 |
if (args.containsOption("monthlyTargetForPartner")) {
|
|
|
628 |
scheduledTasks.monthlyTargetForPartner();
|
|
|
629 |
System.exit(0);
|
|
|
630 |
}
|
| 33444 |
ranu |
631 |
if (args.containsOption("findAllLiveDemoBrandItemsByBillingDate")) {
|
|
|
632 |
scheduledTasks.findAllLiveDemoBrandItemsByBillingDate();
|
|
|
633 |
System.exit(0);
|
|
|
634 |
}
|
| 33464 |
ranu |
635 |
if (args.containsOption("findTodayPocoBillingItems")) {
|
|
|
636 |
scheduledTasks.findTodayPocoBillingItems();
|
|
|
637 |
System.exit(0);
|
|
|
638 |
}
|
| 28921 |
tejbeer |
639 |
|
| 31753 |
tejbeer |
640 |
if (args.containsOption("hygineAlertForPartner")) {
|
|
|
641 |
scheduledTasks.hygineAlertForPartner();
|
|
|
642 |
System.exit(0);
|
|
|
643 |
}
|
| 28921 |
tejbeer |
644 |
|
| 31753 |
tejbeer |
645 |
if (args.containsOption("hygineAlertForInternalTeam")) {
|
|
|
646 |
scheduledTasks.hygineAlertForInternalTeam();
|
|
|
647 |
System.exit(0);
|
|
|
648 |
}
|
|
|
649 |
|
| 32214 |
jai.hind |
650 |
if (args.containsOption("checkItelImeiActivationNew")) {
|
|
|
651 |
scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 15);
|
|
|
652 |
System.exit(0);
|
|
|
653 |
}
|
| 37479 |
amit |
654 |
// One tick's worth (50 imeis), not a full pass -- the backlog is cleared by the
|
|
|
655 |
// scheduled 5-minute ticks. Useful for checking the endpoint by hand.
|
|
|
656 |
if (args.containsOption("checkCarlcareImeiActivation")) {
|
|
|
657 |
scheduledTasks.checkCarlcareImeiActivation();
|
|
|
658 |
System.exit(0);
|
|
|
659 |
}
|
| 31753 |
tejbeer |
660 |
if (args.containsOption("once")) {
|
| 33274 |
amit.gupta |
661 |
|
|
|
662 |
if (args.containsOption("autoClosePurchaseOrders")) {
|
|
|
663 |
poScheduler.autoClosePurchaseOrders();
|
|
|
664 |
}
|
| 31753 |
tejbeer |
665 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
666 |
if (args.containsOption("invoiceNumber")) {
|
|
|
667 |
String oneAssistInvoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
668 |
runOnceTasks.cancelOnceAssist(oneAssistInvoiceNumber);
|
|
|
669 |
}
|
|
|
670 |
|
| 35266 |
ranu |
671 |
|
| 31753 |
tejbeer |
672 |
}
|
| 34208 |
ranu |
673 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
674 |
if (args.containsOption("MemberShipNumber")) {
|
|
|
675 |
String applicationNo = args.getOptionValues("applicationNo").get(0);
|
|
|
676 |
String membershipId = args.getOptionValues("membershipId").get(0);
|
|
|
677 |
runOnceTasks.cancelOnceAssistByMemberShipNumber(applicationNo, membershipId);
|
|
|
678 |
}
|
|
|
679 |
|
|
|
680 |
}
|
| 33260 |
amit.gupta |
681 |
if (args.containsOption("changeFulfillmentWarehouse")) {
|
|
|
682 |
if (args.containsOption("orderId") && args.containsOption("whId")) {
|
| 35277 |
amit |
683 |
List<Integer> orderIds = Arrays.stream(args.getOptionValues("orderId").get(0).split(","))
|
|
|
684 |
.map(String::trim)
|
|
|
685 |
.map(Integer::parseInt)
|
|
|
686 |
.collect(Collectors.toList());
|
|
|
687 |
|
| 35276 |
amit |
688 |
int warehouseId = Integer.parseInt(args.getOptionValues("whId").get(0));
|
|
|
689 |
for (Integer orderId : orderIds) {
|
|
|
690 |
runOnceTasks.changeFulfillmentWarehouse(orderId, warehouseId);
|
|
|
691 |
}
|
| 33260 |
amit.gupta |
692 |
}
|
|
|
693 |
System.exit(0);
|
|
|
694 |
}
|
| 31753 |
tejbeer |
695 |
if (args.containsOption("1")) {
|
|
|
696 |
if (args.containsOption("test")) {
|
| 31618 |
amit.gupta |
697 |
//scheduledTasks.sendPartnerInvestmentDetails(args.getOptionValues("email"));
|
| 31753 |
tejbeer |
698 |
System.out.println("Calling test method");
|
| 36003 |
aman |
699 |
try {
|
|
|
700 |
scheduledTasks.test();
|
|
|
701 |
} catch (Throwable e) {
|
|
|
702 |
throw new RuntimeException(e);
|
|
|
703 |
}
|
| 35165 |
amit |
704 |
System.exit(0);
|
| 32083 |
tejbeer |
705 |
|
|
|
706 |
if (args.containsOption("migrateVendorItemPricing")) {
|
|
|
707 |
scheduledTasks.migrateVendorItemPricing();
|
|
|
708 |
System.exit(0);
|
|
|
709 |
}
|
|
|
710 |
|
|
|
711 |
if (args.containsOption("approveVendorCatalogPricing")) {
|
|
|
712 |
scheduledTasks.approveVendorCatalogPricing();
|
|
|
713 |
System.exit(0);
|
|
|
714 |
}
|
| 32080 |
tejbeer |
715 |
} else if (args.containsOption("test1")) {
|
| 32008 |
amit.gupta |
716 |
scheduledTasks.test1();
|
| 34845 |
ranu |
717 |
} else if (args.containsOption("scheduleTaskTest1")) {
|
|
|
718 |
|
|
|
719 |
scheduledTasksTest.test();
|
|
|
720 |
}else if (args.containsOption("generateBiReport")) {
|
|
|
721 |
scheduledTasksTest.generateBiReport();
|
| 34945 |
ranu |
722 |
}else if (args.containsOption("abmSendertest")) {
|
| 34946 |
ranu |
723 |
runOnceTasks.setAbmReportSender();
|
| 35788 |
vikas |
724 |
}else if (args.containsOption("syncProductsToShopify")) {
|
| 36058 |
ranu |
725 |
shopifyProductSyncService.syncByWarehouse(ProfitMandiConstants.WAREHOUSE_NAME_MAP.get("UP-WEST/NOIDA"));
|
| 34321 |
ranu |
726 |
}
|
| 34860 |
ranu |
727 |
else if (args.containsOption("fetchPartnerDisburseMentTask")) {
|
|
|
728 |
if(args.containsOption("fetchDisbursements")){
|
|
|
729 |
fetchPartnersDisbursementTask.fetchDisbursementsTest();
|
|
|
730 |
}
|
|
|
731 |
else if(args.containsOption("creditAmountTest")){
|
|
|
732 |
fetchPartnersDisbursementTask.creditAmountTest();
|
|
|
733 |
}
|
|
|
734 |
else if(args.containsOption("createContactsAndFundsForFranchiseeTest")){
|
|
|
735 |
fetchPartnersDisbursementTask.createContactsAndFundsForFranchiseeTest();
|
|
|
736 |
}
|
|
|
737 |
else if(args.containsOption("rabbitTransactionProducertest")){
|
|
|
738 |
fetchPartnersDisbursementTask.rabbitTransactionProducertest();
|
|
|
739 |
}
|
| 34879 |
ranu |
740 |
else if(args.containsOption("sendingDisbursementMail")){
|
|
|
741 |
fetchPartnersDisbursementTask.sendingDisbursementMail();
|
|
|
742 |
}
|
| 34860 |
ranu |
743 |
else {
|
|
|
744 |
fetchPartnersDisbursementTask.test();
|
|
|
745 |
}
|
|
|
746 |
}
|
| 34845 |
ranu |
747 |
else if (args.containsOption("testNew1")) {
|
| 34307 |
ranu |
748 |
List<String> loanIdArgs = args.getOptionValues("loanIds"); // ["34833,36536,37151"]
|
|
|
749 |
List<Integer> loanIds = new ArrayList<>();
|
|
|
750 |
|
|
|
751 |
if (loanIdArgs != null && !loanIdArgs.isEmpty()) {
|
|
|
752 |
String csv = loanIdArgs.get(0);
|
|
|
753 |
loanIds = Arrays.stream(csv.split(","))
|
|
|
754 |
.map(String::trim)
|
|
|
755 |
.map(Integer::parseInt)
|
|
|
756 |
.collect(Collectors.toList());
|
|
|
757 |
}
|
| 34321 |
ranu |
758 |
scheduledTasksTest.findLoanTransactionMapingAccordingLoan(loanIds);
|
| 34309 |
ranu |
759 |
} else if (args.containsOption("testNew2")) {
|
| 34308 |
ranu |
760 |
if (args.containsOption("createLoan")) {
|
|
|
761 |
// Extract each parameter
|
|
|
762 |
int transactionId = 0;
|
|
|
763 |
double invoiceAmount = 0.0;
|
|
|
764 |
String invoiceNumber = "";
|
|
|
765 |
|
|
|
766 |
if (args.containsOption("transactionId")) {
|
|
|
767 |
transactionId = Integer.parseInt(args.getOptionValues("transactionId").get(0));
|
|
|
768 |
}
|
|
|
769 |
|
|
|
770 |
if (args.containsOption("invoiceAmount")) {
|
|
|
771 |
invoiceAmount = Double.parseDouble(args.getOptionValues("invoiceAmount").get(0));
|
|
|
772 |
}
|
|
|
773 |
|
|
|
774 |
if (args.containsOption("invoiceNumber")) {
|
|
|
775 |
invoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
776 |
}
|
|
|
777 |
|
|
|
778 |
// Call your method
|
|
|
779 |
scheduledTasksTest.createLoanForBillingByTransactionIdAndInvoiceNumber(transactionId, invoiceAmount, invoiceNumber);
|
|
|
780 |
}
|
|
|
781 |
|
| 32482 |
amit.gupta |
782 |
} else {
|
| 31753 |
tejbeer |
783 |
System.out.println("Called sendPartnerInvestmentDetails");
|
|
|
784 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
785 |
}
|
|
|
786 |
System.exit(0);
|
|
|
787 |
}
|
|
|
788 |
if (args.containsOption("2")) {
|
|
|
789 |
if (args.containsOption("test")) {
|
|
|
790 |
String[] emails = new String[args.getOptionValues("email").size()];
|
|
|
791 |
scheduledTasks.sendAgeingReport(args.getOptionValues("email").toArray(emails));
|
|
|
792 |
} else {
|
|
|
793 |
scheduledTasks.sendAgeingReport();
|
|
|
794 |
}
|
|
|
795 |
System.exit(0);
|
|
|
796 |
}
|
| 33457 |
amit.gupta |
797 |
|
| 31753 |
tejbeer |
798 |
if (args.containsOption("cancelOrder")) {
|
|
|
799 |
List<String> invoiceNumbers = args.getOptionValues("invoiceNumber");
|
|
|
800 |
runOnceTasks.cancelOrder(invoiceNumbers);
|
|
|
801 |
}
|
| 36554 |
amit |
802 |
if (args.containsOption("postCreditNoteForDuplicateInvoice")) {
|
|
|
803 |
String duplicateInvoice = args.getOptionValues("duplicateInvoice").get(0);
|
|
|
804 |
String activeInvoice = args.getOptionValues("activeInvoice").get(0);
|
|
|
805 |
runOnceTasks.postCreditNoteForDuplicateInvoice(duplicateInvoice, activeInvoice);
|
|
|
806 |
}
|
| 31753 |
tejbeer |
807 |
if (args.containsOption("migratePurchase")) {
|
|
|
808 |
runOnceTasks.migratePurchase();
|
|
|
809 |
}
|
|
|
810 |
if (args.containsOption("migratepd")) {
|
|
|
811 |
scheduledTasks.moveImeisToPriceDropImeis();
|
|
|
812 |
}
|
|
|
813 |
if (args.containsOption("walletmismatch")) {
|
|
|
814 |
scheduledTasks.walletmismatch();
|
|
|
815 |
}
|
|
|
816 |
if (args.containsOption("schemewalletmismatch")) {
|
|
|
817 |
scheduledTasks.schemewalletmismatch();
|
|
|
818 |
}
|
|
|
819 |
if (args.containsOption("gst")) {
|
|
|
820 |
scheduledTasks.gst();
|
|
|
821 |
}
|
|
|
822 |
if (args.containsOption("mailDashboardScreenshots")) {
|
|
|
823 |
runOnceTasks.mailDashboardScreenshots();
|
|
|
824 |
}
|
|
|
825 |
if (args.containsOption("notifyLead")) {
|
|
|
826 |
scheduledTasks.notifyLead();
|
|
|
827 |
scheduledTasks.notifyVisits();
|
|
|
828 |
}
|
|
|
829 |
if (args.containsOption("fixgrn")) {
|
|
|
830 |
runOnceTasks.fixGrn();
|
|
|
831 |
}
|
|
|
832 |
if (args.containsOption("pbfix")) {
|
|
|
833 |
runOnceTasks.pbfix();
|
|
|
834 |
}
|
|
|
835 |
if (args.containsOption("mongom")) {
|
|
|
836 |
runOnceTasks.mongom();
|
|
|
837 |
}
|
|
|
838 |
if (args.containsOption("processPd")) {
|
|
|
839 |
int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
|
|
|
840 |
runOnceTasks.processPd(priceDropId);
|
|
|
841 |
}
|
|
|
842 |
if (args.containsOption("samsung")) {
|
|
|
843 |
if (args.containsOption("ym")) {
|
|
|
844 |
int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
|
|
|
845 |
runOnceTasks.fetchImeiActivation(ym);
|
|
|
846 |
}
|
|
|
847 |
runOnceTasks.fetchImeiActivation(0);
|
|
|
848 |
}
|
|
|
849 |
if (args.containsOption("fixdupimeigrn")) {
|
|
|
850 |
runOnceTasks.fixDupGrns();
|
|
|
851 |
}
|
|
|
852 |
if (args.containsOption("cancel")) {
|
| 36053 |
amit |
853 |
boolean recreatePri = args.containsOption("recreatePri");
|
|
|
854 |
runOnceTasks.cancelDn(args.getOptionValues("dn").get(0), recreatePri);
|
| 31753 |
tejbeer |
855 |
}
|
|
|
856 |
if (args.containsOption("fixScheme")) {
|
|
|
857 |
runOnceTasks.fixScheme();
|
|
|
858 |
}
|
|
|
859 |
if (args.containsOption("syncLeads")) {
|
|
|
860 |
leadSyncRunner.syncLeads();
|
|
|
861 |
}
|
|
|
862 |
if (args.containsOption("testCs")) {
|
|
|
863 |
int category = Integer.parseInt(args.getOptionValues("category").get(0));
|
|
|
864 |
EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
|
|
|
865 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
866 |
csService.getAuthUserId(category, escalationType, fofoId);
|
|
|
867 |
}
|
|
|
868 |
if (args.containsOption("duporder")) {
|
|
|
869 |
runOnceTasks.removeDuplicateOrders();
|
|
|
870 |
}
|
|
|
871 |
if (args.containsOption("createDummyInvoices")) {
|
|
|
872 |
runOnceTasks.createDummyInvoices();
|
|
|
873 |
}
|
| 28921 |
tejbeer |
874 |
|
| 31753 |
tejbeer |
875 |
if (args.containsOption("createGeofence")) {
|
|
|
876 |
runOnceTasks.createGeofence();
|
|
|
877 |
}
|
|
|
878 |
if (args.containsOption("getAllGeofences")) {
|
|
|
879 |
runOnceTasks.getAllGeofences();
|
|
|
880 |
}
|
|
|
881 |
if (args.containsOption("payMonthlyInvestment")) {
|
|
|
882 |
investmentRelatedTasks.payMonthlyInvestment();
|
|
|
883 |
}
|
|
|
884 |
if (args.containsOption("evaluateActualInvestmentPayout")) {
|
|
|
885 |
investmentRelatedTasks.evaluateActualInvestmentPayout();
|
|
|
886 |
}
|
|
|
887 |
if (args.containsOption("deleteGeofences")) {
|
|
|
888 |
List<String> geofenceIds = args.getOptionValues("geofenceId");
|
|
|
889 |
runOnceTasks.deleteGeofences(geofenceIds);
|
|
|
890 |
}
|
|
|
891 |
if (args.containsOption("createOffers")) {
|
|
|
892 |
if (args.containsOption("fileName")) {
|
|
|
893 |
String fileName = args.getOptionValues("fileName").get(0);
|
|
|
894 |
FileInputStream stream = new FileInputStream(fileName);
|
|
|
895 |
runOnceTasks.createOffers(stream);
|
|
|
896 |
}
|
|
|
897 |
}
|
|
|
898 |
if (args.containsOption("schemeout")) {
|
|
|
899 |
if (args.containsOption("invoices")) {
|
|
|
900 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
901 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
902 |
scheduledTasks.processSchemeOut(invoices);
|
|
|
903 |
}
|
|
|
904 |
}
|
|
|
905 |
if (args.containsOption("schemein")) {
|
|
|
906 |
if (args.containsOption("invoices")) {
|
|
|
907 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
908 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
909 |
scheduledTasks.processSchemeIn(invoices);
|
|
|
910 |
}
|
|
|
911 |
}
|
| 28921 |
tejbeer |
912 |
|
| 31753 |
tejbeer |
913 |
if (args.containsOption("fixScans")) {
|
|
|
914 |
runOnceTasks.fixScans();
|
|
|
915 |
}
|
|
|
916 |
if (args.containsOption("fixPrebookingOrderGrn")) {
|
|
|
917 |
runOnceTasks.genericCreateCurrentInventorySnapshot();
|
|
|
918 |
}
|
|
|
919 |
if (args.containsOption("fixOurSerialized")) {
|
|
|
920 |
if (args.containsOption("orderIds")) {
|
|
|
921 |
String orderIdsString = args.getOptionValues("orderIds").get(0);
|
|
|
922 |
List<Integer> orderIds = Arrays.asList(orderIdsString.split(",")).stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
923 |
// runOnceTasks.fixOurSerialized(orderIds);
|
|
|
924 |
}
|
|
|
925 |
}
|
| 29776 |
tejbeer |
926 |
|
| 31753 |
tejbeer |
927 |
if (args.containsOption("reverseMaa")) {
|
|
|
928 |
runOnceTasks.reverseMaa();
|
|
|
929 |
}
|
| 29776 |
tejbeer |
930 |
|
| 31753 |
tejbeer |
931 |
if (args.containsOption("fixOffer")) {
|
|
|
932 |
runOnceTasks.fixOffer();
|
|
|
933 |
}
|
| 29794 |
tejbeer |
934 |
|
| 31753 |
tejbeer |
935 |
if (args.containsOption("opporeno")) {
|
|
|
936 |
runOnceTasks.opporeno();
|
|
|
937 |
}
|
| 30309 |
amit.gupta |
938 |
|
| 31753 |
tejbeer |
939 |
if (args.containsOption("fixorders")) {
|
|
|
940 |
runOnceTasks.fixOrders();
|
|
|
941 |
}
|
|
|
942 |
if (args.containsOption("fixreservations")) {
|
|
|
943 |
runOnceTasks.fixReservations();
|
|
|
944 |
}
|
|
|
945 |
if (args.containsOption("addinvestment")) {
|
|
|
946 |
runOnceTasks.addInvestment();
|
|
|
947 |
}
|
|
|
948 |
if (args.containsOption("brandregion")) {
|
|
|
949 |
runOnceTasks.brandRegion();
|
|
|
950 |
}
|
|
|
951 |
if (args.containsOption("rollOutUpgardedMargins")) {
|
| 35520 |
amit |
952 |
scheduledTasks.rollOutUpgardedMargins(Arrays.asList(175140172, 175140189));
|
| 31753 |
tejbeer |
953 |
}
|
| 34029 |
ranu |
954 |
if (args.containsOption("pushRbmTargets")) {
|
|
|
955 |
scheduledTasks.persistRbmTodayTargets();
|
|
|
956 |
}
|
| 37499 |
ranu |
957 |
if (args.containsOption("pushSalesTargets")) {
|
|
|
958 |
// Run this AFTER pushRbmTargets so today's RBM snapshots exist to roll up.
|
|
|
959 |
scheduledTasks.persistSalesTodayTargets();
|
|
|
960 |
}
|
|
|
961 |
if (args.containsOption("pushSalesTargetsForDate")) {
|
|
|
962 |
// Backfill / seed for a specific date, e.g. --pushSalesTargetsForDate=2026-08-25
|
|
|
963 |
LocalDate d = LocalDate.parse(args.getOptionValues("pushSalesTargetsForDate").get(0));
|
|
|
964 |
scheduledTasks.persistSalesTargetsForDate(d);
|
|
|
965 |
}
|
|
|
966 |
if (args.containsOption("pushSalesAchievements")) {
|
|
|
967 |
// Daily Sales achievement snapshot (audit/history). Independent
|
|
|
968 |
// of pushSalesTargets — can run any time after orders settle.
|
|
|
969 |
scheduledTasks.persistSalesTodayAchievements();
|
|
|
970 |
}
|
|
|
971 |
if (args.containsOption("pushSalesAchievementsForDate")) {
|
|
|
972 |
// Backfill / seed for a specific date, e.g. --pushSalesAchievementsForDate=2026-08-25
|
|
|
973 |
LocalDate d = LocalDate.parse(args.getOptionValues("pushSalesAchievementsForDate").get(0));
|
|
|
974 |
scheduledTasks.persistSalesAchievementsForDate(d);
|
|
|
975 |
}
|
| 31753 |
tejbeer |
976 |
if (args.containsOption("rollOutUpgardedMarginsNextMonth")) {
|
| 35524 |
amit |
977 |
System.out.println("In rollOutUpgardedMarginsNextMonth");
|
| 35532 |
amit |
978 |
scheduledTasks.rollOutUpgardedMarginsNextMonth(Arrays.asList(175140172, 175140189, 175138897));
|
| 31753 |
tejbeer |
979 |
}
|
|
|
980 |
if (args.containsOption("checkCancellationMargin")) {
|
|
|
981 |
scheduledTasks.checkCancellationMargin();
|
|
|
982 |
}
|
|
|
983 |
if (args.containsOption("reviewUncontactablePartner")) {
|
|
|
984 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
985 |
}
|
| 33078 |
ranu |
986 |
if (args.containsOption("reviewNonSdBuyingBrand")) {
|
|
|
987 |
scheduledTasks.reviewNonSdBuyingBrand();
|
|
|
988 |
}
|
| 31753 |
tejbeer |
989 |
if (args.containsOption("sendWelcomeEmail")) {
|
|
|
990 |
onBoardingRelatedSchelduleTask.sendWelcomeEmail();
|
|
|
991 |
}
|
| 29814 |
tejbeer |
992 |
|
| 31753 |
tejbeer |
993 |
if (args.containsOption("partnerOnboardingLegalMigration")) {
|
|
|
994 |
onBoardingRelatedSchelduleTask.partnerOnboardingLegalMigration();
|
|
|
995 |
}
|
| 31031 |
amit.gupta |
996 |
|
| 33526 |
amit.gupta |
997 |
if(args.containsOption("moveOrders")) {
|
|
|
998 |
runOnceTasks.moveOrders();
|
|
|
999 |
}
|
|
|
1000 |
|
| 31753 |
tejbeer |
1001 |
if (args.containsOption("addKycLegalMigration")) {
|
|
|
1002 |
onBoardingRelatedSchelduleTask.addKycLegalMigration();
|
|
|
1003 |
}
|
| 29776 |
tejbeer |
1004 |
|
|
|
1005 |
|
| 31753 |
tejbeer |
1006 |
if (args.containsOption("pushDataToSolr")) {
|
|
|
1007 |
listing.pushDataToSolr();
|
|
|
1008 |
}
|
| 30120 |
amit.gupta |
1009 |
|
| 31753 |
tejbeer |
1010 |
if (args.containsOption("testGstPro")) {
|
|
|
1011 |
System.out.println("TestGstProc called");
|
|
|
1012 |
try {
|
|
|
1013 |
runOnceTasks.updateIrnsToInvoices();
|
|
|
1014 |
} catch (Exception e) {
|
|
|
1015 |
e.printStackTrace();
|
|
|
1016 |
}
|
|
|
1017 |
}
|
| 29308 |
tejbeer |
1018 |
|
| 37058 |
amit |
1019 |
if (args.containsOption("regenerateBilledInvoices")) {
|
|
|
1020 |
if (args.containsOption("fromTime") && args.containsOption("toTime")) {
|
|
|
1021 |
LocalDateTime fromTime = LocalDateTime.parse(args.getOptionValues("fromTime").get(0));
|
|
|
1022 |
LocalDateTime toTime = LocalDateTime.parse(args.getOptionValues("toTime").get(0));
|
|
|
1023 |
runOnceTasks.regenerateBilledInvoices(fromTime, toTime);
|
|
|
1024 |
} else {
|
|
|
1025 |
System.out.println("regenerateBilledInvoices requires --fromTime and --toTime (ISO, e.g. 2026-06-01T00:00:00)");
|
|
|
1026 |
}
|
|
|
1027 |
System.exit(0);
|
|
|
1028 |
}
|
|
|
1029 |
|
| 31753 |
tejbeer |
1030 |
if (args.containsOption("reverseSchemeCancelInvoice")) {
|
|
|
1031 |
if (args.containsOption("invoice")) {
|
|
|
1032 |
String invoice = args.getOptionValues("invoice").get(0);
|
|
|
1033 |
runOnceTasks.reverseSchemes(invoice);
|
|
|
1034 |
}
|
|
|
1035 |
}
|
| 29863 |
tejbeer |
1036 |
|
| 31753 |
tejbeer |
1037 |
if (args.containsOption("reverseInvalidActivation")) {
|
|
|
1038 |
if (args.containsOption("inventoryids")) {
|
|
|
1039 |
String inventoryItemIdsString = args.getOptionValues("inventoryids").get(0);
|
|
|
1040 |
List<Integer> inventoryItemIds = new ArrayList<>();
|
|
|
1041 |
for (String inventoryItemIdString : inventoryItemIdsString.split(",")) {
|
|
|
1042 |
int inventoryItemId = Integer.parseInt(inventoryItemIdString.trim());
|
|
|
1043 |
inventoryItemIds.add(inventoryItemId);
|
|
|
1044 |
}
|
|
|
1045 |
runOnceTasks.reverseInvalidActivation(inventoryItemIds);
|
|
|
1046 |
}
|
|
|
1047 |
}
|
| 29863 |
tejbeer |
1048 |
|
| 31753 |
tejbeer |
1049 |
if (args.containsOption("runme")) {
|
|
|
1050 |
runOnceTasks.runMe();
|
|
|
1051 |
}
|
|
|
1052 |
if (args.containsOption("" + "")) {
|
|
|
1053 |
upgradeOfferService.authenticateUser();
|
|
|
1054 |
}
|
|
|
1055 |
if (args.containsOption("mandiiUser")) {
|
|
|
1056 |
runOnceTasks.mandiiUser(args.getOptionValues("firstName").get(0), args.getOptionValues("lastName").get(0), args.getOptionValues("pan").get(0), args.getOptionValues("dob").get(0), args.getOptionValues("aadhaar").get(0), args.getOptionValues("gender").get(0), args.getOptionValues("father").get(0));
|
|
|
1057 |
}
|
| 30335 |
amit.gupta |
1058 |
|
| 31753 |
tejbeer |
1059 |
if (args.containsOption("mandiiUsers")) {
|
|
|
1060 |
if (args.containsOption("pan")) {
|
|
|
1061 |
runOnceTasks.mandiiUsers(args.getOptionValues("pan").get(0));
|
|
|
1062 |
} else {
|
|
|
1063 |
runOnceTasks.mandiiUsers();
|
|
|
1064 |
}
|
|
|
1065 |
}
|
| 30576 |
amit.gupta |
1066 |
|
| 37472 |
amit |
1067 |
// Oppo and realme are one pass now, so one option drives both. Note this
|
|
|
1068 |
// runs the FULL daily pass -- everything due today, not a 25-imei sample.
|
|
|
1069 |
if (args.containsOption("checkBrowserImeiActivation")) {
|
|
|
1070 |
standAlone.checkBrowserImeiActivation();
|
| 31753 |
tejbeer |
1071 |
}
|
| 30616 |
amit.gupta |
1072 |
|
| 31753 |
tejbeer |
1073 |
/*
|
|
|
1074 |
* if (args.containsOption("checkRealmeImeiStatus")) { try {
|
|
|
1075 |
* standAlone.checkRealmeImeiStatus(); } catch (Exception e) {
|
|
|
1076 |
* e.printStackTrace(); } }
|
|
|
1077 |
*/
|
| 30616 |
amit.gupta |
1078 |
|
| 31753 |
tejbeer |
1079 |
if (args.containsOption("amazonPurchase")) {
|
|
|
1080 |
try {
|
|
|
1081 |
runOnceTasks.amazonPurchase();
|
|
|
1082 |
} catch (Exception e) {
|
|
|
1083 |
e.printStackTrace();
|
|
|
1084 |
}
|
|
|
1085 |
}
|
| 30641 |
amit.gupta |
1086 |
|
| 31753 |
tejbeer |
1087 |
if (args.containsOption("getCaptchaCode")) {
|
|
|
1088 |
try {
|
|
|
1089 |
captchaService.getCaptchaCode("/home/amit/Desktop/generatingCodes.jpg");
|
|
|
1090 |
} catch (Exception e) {
|
|
|
1091 |
e.printStackTrace();
|
|
|
1092 |
}
|
|
|
1093 |
}
|
| 30641 |
amit.gupta |
1094 |
|
| 37326 |
amit |
1095 |
// --backfillMissingEwb --invoiceNumbers=A,B,C [--dryRun]
|
|
|
1096 |
// Recovers EWB details from NIC for invoices whose IRN was recovered via DUPIRN, then
|
|
|
1097 |
// re-renders their PDFs so the e-way bill section appears.
|
|
|
1098 |
if (args.containsOption("backfillMissingEwb")) {
|
|
|
1099 |
try {
|
|
|
1100 |
List<String> invoiceNumbers = Arrays.stream(
|
|
|
1101 |
args.getOptionValues("invoiceNumbers").get(0).split(","))
|
|
|
1102 |
.map(String::trim).filter(x -> !x.isEmpty()).collect(Collectors.toList());
|
|
|
1103 |
boolean dryRun = args.containsOption("dryRun");
|
|
|
1104 |
System.out.println("backfillMissingEwb: " + invoiceNumbers.size()
|
|
|
1105 |
+ " invoice(s), dryRun=" + dryRun);
|
|
|
1106 |
runOnceTasks.backfillMissingEwb(invoiceNumbers, dryRun);
|
|
|
1107 |
} catch (Exception e) {
|
|
|
1108 |
e.printStackTrace();
|
|
|
1109 |
}
|
|
|
1110 |
}
|
|
|
1111 |
|
| 31753 |
tejbeer |
1112 |
if (args.containsOption("testIrnLive")) {
|
|
|
1113 |
try {
|
|
|
1114 |
runOnceTasks.testIrnLive(args.getOptionValues("invoiceNumber").get(0));
|
|
|
1115 |
} catch (Exception e) {
|
|
|
1116 |
e.printStackTrace();
|
|
|
1117 |
}
|
|
|
1118 |
}
|
| 30659 |
amit.gupta |
1119 |
|
| 31753 |
tejbeer |
1120 |
if (args.containsOption("createoffercriteria")) {
|
|
|
1121 |
try {
|
|
|
1122 |
runOnceTasks.createOfferCriteria();
|
|
|
1123 |
} catch (Exception e) {
|
|
|
1124 |
e.printStackTrace();
|
|
|
1125 |
}
|
|
|
1126 |
}
|
| 30659 |
amit.gupta |
1127 |
|
| 31753 |
tejbeer |
1128 |
if (args.containsOption("fix-price-drops")) {
|
|
|
1129 |
runOnceTasks.fixPriceDrop();
|
|
|
1130 |
}
|
| 29035 |
tejbeer |
1131 |
|
| 31753 |
tejbeer |
1132 |
if (args.containsOption("processSchemeByIds")) {
|
|
|
1133 |
List<String> schemeIds = Arrays.asList(args.getOptionValues("ids").get(0).split(","));
|
|
|
1134 |
List<Integer> schemeIdsInt = schemeIds.stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
1135 |
runOnceTasks.processSchemeByIds(schemeIdsInt);
|
|
|
1136 |
}
|
| 30859 |
tejbeer |
1137 |
|
| 31753 |
tejbeer |
1138 |
if (args.containsOption("updateSaholicCISTable")) {
|
|
|
1139 |
runOnceTasks.updateSaholicCISTable();
|
|
|
1140 |
}
|
| 30859 |
tejbeer |
1141 |
|
| 31753 |
tejbeer |
1142 |
if (args.containsOption("mapbag")) {
|
|
|
1143 |
runOnceTasks.mapBag();
|
|
|
1144 |
}
|
| 30859 |
tejbeer |
1145 |
|
| 34579 |
vikas.jang |
1146 |
if (args.containsOption("todayBidPO")) {
|
| 34443 |
vikas.jang |
1147 |
runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
|
|
|
1148 |
}
|
|
|
1149 |
|
| 34579 |
vikas.jang |
1150 |
if (args.containsOption("yesterdayBidPO")) {
|
|
|
1151 |
runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.YESTERDAY);
|
|
|
1152 |
}
|
|
|
1153 |
|
| 34547 |
vikas.jang |
1154 |
if (args.containsOption("biddingConsolidatedMessage")) {
|
|
|
1155 |
runOnceTasks.consolidatedBiddingMessage();
|
|
|
1156 |
}
|
|
|
1157 |
|
|
|
1158 |
if (args.containsOption("sendMailWhatsAppAfterLoanDueDate")) {
|
|
|
1159 |
scheduledTasks.sendMailWhatsAppAfterLoanDueDate();
|
|
|
1160 |
}
|
|
|
1161 |
|
| 34836 |
vikas |
1162 |
if (args.containsOption("yesterdayTrackingReport")) {
|
|
|
1163 |
runOnceTasks.yesterdayTrackingReport();
|
| 34770 |
vikas.jang |
1164 |
}
|
|
|
1165 |
|
| 31753 |
tejbeer |
1166 |
System.exit(0);
|
|
|
1167 |
}
|
| 30859 |
tejbeer |
1168 |
|
| 31753 |
tejbeer |
1169 |
if (args.containsOption("calculateInterestAccured")) {
|
| 30929 |
tejbeer |
1170 |
|
| 31753 |
tejbeer |
1171 |
scheduledTasks.calculateInterestAccured();
|
|
|
1172 |
System.exit(0);
|
|
|
1173 |
}
|
| 30929 |
tejbeer |
1174 |
|
| 31753 |
tejbeer |
1175 |
if (args.containsOption("loanSettlement")) {
|
| 30890 |
amit.gupta |
1176 |
|
| 31753 |
tejbeer |
1177 |
scheduledTasks.loanSettlement();
|
|
|
1178 |
System.exit(0);
|
|
|
1179 |
}
|
| 30896 |
amit.gupta |
1180 |
|
| 31753 |
tejbeer |
1181 |
if (args.containsOption("dailyLoanAlert")) {
|
| 30936 |
tejbeer |
1182 |
|
| 31753 |
tejbeer |
1183 |
scheduledTasks.dailyLoanAlert();
|
|
|
1184 |
System.exit(0);
|
|
|
1185 |
}
|
| 30982 |
tejbeer |
1186 |
|
| 36564 |
amit |
1187 |
if (args.containsOption("testFlagshipBilling")) {
|
|
|
1188 |
int trId = Integer.parseInt(args.getOptionValues("testFlagshipBilling").get(0));
|
|
|
1189 |
double amt = Double.parseDouble(args.getOptionValues("testFlagshipBillingAmount").get(0));
|
|
|
1190 |
String inv = args.getOptionValues("testFlagshipBillingInvoice").get(0);
|
|
|
1191 |
scheduledTasks.testFlagshipBilling(trId, amt, inv);
|
|
|
1192 |
System.exit(0);
|
|
|
1193 |
}
|
|
|
1194 |
|
| 36554 |
amit |
1195 |
if (args.containsOption("convertExpiredFlagshipCredits")) {
|
|
|
1196 |
scheduledTasks.convertExpiredFlagshipCredits();
|
|
|
1197 |
System.exit(0);
|
|
|
1198 |
}
|
|
|
1199 |
|
| 36745 |
ranu |
1200 |
// Manual back-fill for missed-beat detection. Default: today.
|
|
|
1201 |
// Usage: --detectMissedBeats [--date=YYYY-MM-DD]
|
|
|
1202 |
if (args.containsOption("detectMissedBeats")) {
|
|
|
1203 |
LocalDate date = LocalDate.now();
|
|
|
1204 |
if (args.containsOption("date")) {
|
|
|
1205 |
date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
1206 |
}
|
|
|
1207 |
int inserted = beatMissDetectorRunner.syncMissesForDate(date);
|
|
|
1208 |
LOGGER.info("detectMissedBeats: {} miss rows inserted for {}", inserted, date);
|
|
|
1209 |
System.exit(0);
|
|
|
1210 |
}
|
|
|
1211 |
|
| 36554 |
amit |
1212 |
if (args.containsOption("notifyFlagshipExpiryIn2Days")) {
|
|
|
1213 |
scheduledTasks.notifyFlagshipExpiryIn2Days();
|
|
|
1214 |
System.exit(0);
|
|
|
1215 |
}
|
|
|
1216 |
|
| 31753 |
tejbeer |
1217 |
if (args.containsOption("notifyDefaultLoans")) {
|
|
|
1218 |
scheduledTasks.notifyDefaultLoans();
|
|
|
1219 |
System.exit(0);
|
|
|
1220 |
}
|
| 31446 |
amit.gupta |
1221 |
|
| 31753 |
tejbeer |
1222 |
if (args.containsOption("fixinsurance")) {
|
|
|
1223 |
runOnceTasks.addMissingWalletDebitsForInsurance();
|
|
|
1224 |
System.exit(0);
|
|
|
1225 |
}
|
| 31604 |
tejbeer |
1226 |
|
| 31753 |
tejbeer |
1227 |
if (args.containsOption("processActivatedImeisForSchemes")) {
|
|
|
1228 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
1229 |
System.exit(0);
|
|
|
1230 |
}
|
| 31604 |
tejbeer |
1231 |
|
| 36306 |
amit |
1232 |
if (args.containsOption("updatePartnerLimitWithBatch")) {
|
|
|
1233 |
System.out.println("Running updatePartnerLimit with batch tracking");
|
|
|
1234 |
batchScheduledTasks.updatePartnerLimitWithBatch();
|
|
|
1235 |
System.exit(0);
|
|
|
1236 |
}
|
|
|
1237 |
|
|
|
1238 |
if (args.containsOption("processOffersWithBatch")) {
|
|
|
1239 |
for (String val : args.getOptionValues("processOffersWithBatch")) {
|
|
|
1240 |
for (String id : val.split(",")) {
|
|
|
1241 |
int offerId = Integer.parseInt(id.trim());
|
|
|
1242 |
System.out.println("Processing offer with batch: " + offerId);
|
|
|
1243 |
batchScheduledTasks.processOfferWithBatch(offerId);
|
|
|
1244 |
}
|
|
|
1245 |
}
|
|
|
1246 |
System.exit(0);
|
|
|
1247 |
}
|
|
|
1248 |
|
| 31753 |
tejbeer |
1249 |
if (args.containsOption("notifyLoanDueDateCross")) {
|
|
|
1250 |
scheduledTasks.notifyLoanDueDateCross();
|
|
|
1251 |
System.exit(0);
|
|
|
1252 |
}
|
| 34275 |
tejus.loha |
1253 |
if (args.containsOption("sendTenOrMoreOrderStockReport")) {
|
|
|
1254 |
scheduledTasks.send10OrMoreOlderStockReport();
|
|
|
1255 |
System.exit(0);
|
|
|
1256 |
}
|
| 31604 |
tejbeer |
1257 |
|
| 31753 |
tejbeer |
1258 |
if (args.containsOption("alertForDueDate")) {
|
|
|
1259 |
scheduledTasks.alertForDueDate();
|
|
|
1260 |
System.exit(0);
|
|
|
1261 |
}
|
| 31648 |
tejbeer |
1262 |
|
| 31753 |
tejbeer |
1263 |
if (args.containsOption("fetchParnterStats")) {
|
|
|
1264 |
scheduledTasks.fetchParnterStats();
|
|
|
1265 |
System.exit(0);
|
|
|
1266 |
}
|
|
|
1267 |
|
|
|
1268 |
if (args.containsOption("morning")) {
|
|
|
1269 |
if (args.containsOption("0")) {
|
|
|
1270 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
1271 |
}
|
|
|
1272 |
if (args.containsOption("1")) {
|
|
|
1273 |
scheduledTasks.sendIndentTertiary();
|
|
|
1274 |
}
|
|
|
1275 |
// 0
|
|
|
1276 |
if (args.containsOption("2")) {
|
|
|
1277 |
scheduledTasks.calculateInterestAccured();
|
|
|
1278 |
}
|
|
|
1279 |
System.out.println("scheduledTasks.calculateInterestAccured()");
|
|
|
1280 |
// 0
|
|
|
1281 |
if (args.containsOption("3")) {
|
| 32831 |
amit.gupta |
1282 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
1283 |
}
|
|
|
1284 |
System.out.println("scheduledTasks.markDelhiveryOrderDelivered()");
|
|
|
1285 |
// 1
|
|
|
1286 |
if (args.containsOption("4")) {
|
|
|
1287 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
1288 |
}
|
|
|
1289 |
System.out.println("scheduledTasks.processActivatedImeisForSchemes()");
|
|
|
1290 |
// 2
|
|
|
1291 |
if (args.containsOption("5")) {
|
|
|
1292 |
scheduledTasks.processActivation();
|
|
|
1293 |
}
|
|
|
1294 |
System.out.println("scheduledTasks.processActivation()");
|
|
|
1295 |
// 4
|
|
|
1296 |
if (args.containsOption("6")) {
|
|
|
1297 |
scheduledTasks.processPriceDrop();
|
|
|
1298 |
}
|
|
|
1299 |
System.out.println("scheduledTasks.processPriceDrop()");
|
|
|
1300 |
// 5
|
|
|
1301 |
if (args.containsOption("7")) {
|
|
|
1302 |
scheduledTasks.loanSettlement();
|
|
|
1303 |
}
|
|
|
1304 |
System.out.println("scheduledTasks.loanSettlement()");
|
| 36554 |
amit |
1305 |
if (args.containsOption("7a")) {
|
|
|
1306 |
scheduledTasks.convertExpiredFlagshipCredits();
|
|
|
1307 |
scheduledTasks.notifyFlagshipExpiryIn2Days();
|
|
|
1308 |
}
|
|
|
1309 |
System.out.println("scheduledTasks.convertExpiredFlagshipCredits()");
|
| 31753 |
tejbeer |
1310 |
// 8
|
|
|
1311 |
if (args.containsOption("8")) {
|
|
|
1312 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
1313 |
}
|
|
|
1314 |
// 9
|
| 33859 |
tejus.loha |
1315 |
// if (args.containsOption("9")) {
|
|
|
1316 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
1317 |
// }
|
|
|
1318 |
// // 9
|
|
|
1319 |
// if (args.containsOption("10")) {
|
|
|
1320 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
1321 |
// }
|
| 31753 |
tejbeer |
1322 |
// sendPartnerInvestment
|
|
|
1323 |
if (args.containsOption("11")) {
|
|
|
1324 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
1325 |
}
|
| 37236 |
amit |
1326 |
if (args.containsOption("1")) {
|
| 36993 |
amit |
1327 |
// Defaults to a dry-run (harmless dev path); pass --live to run the real pipeline.
|
|
|
1328 |
boolean dryRun = !args.containsOption("live");
|
|
|
1329 |
System.out.println("Calling sendCreditNote (dryRun=" + dryRun + ")");
|
| 34029 |
ranu |
1330 |
YearMonth yearMonth = YearMonth.now().minusMonths(1);
|
| 36993 |
amit |
1331 |
scheduledTasks.sendCreditNote(yearMonth, dryRun);
|
| 31753 |
tejbeer |
1332 |
}
|
| 37258 |
amit |
1333 |
if (args.containsOption("syncHotDealFlags")) {
|
|
|
1334 |
try {
|
|
|
1335 |
System.out.println("Calling syncHotDealFlags");
|
|
|
1336 |
scheduledTasks.syncHotDealFlags();
|
|
|
1337 |
System.out.println("syncHotDealFlags completed successfully");
|
|
|
1338 |
} catch (Exception e) {
|
|
|
1339 |
System.err.println("syncHotDealFlags FAILED: " + e.getMessage());
|
|
|
1340 |
e.printStackTrace(System.err);
|
|
|
1341 |
}
|
|
|
1342 |
}
|
| 37238 |
amit |
1343 |
if (args.containsOption("regenMarginIrns")) {
|
|
|
1344 |
// One-time: generate missing IRNs for issued margin CN/DNs (mixed-sign docs
|
|
|
1345 |
// now netted per GST rate in the payload). Dry-run by default; --live to run.
|
|
|
1346 |
boolean dryRun = !args.containsOption("live");
|
|
|
1347 |
try {
|
|
|
1348 |
String ymStr = args.getOptionValues("regenMarginIrns").isEmpty() ? null : args.getOptionValues("regenMarginIrns").get(0);
|
|
|
1349 |
YearMonth yearMonth = ymStr != null && !ymStr.isEmpty() ? YearMonth.parse(ymStr) : YearMonth.now().minusMonths(1);
|
|
|
1350 |
System.out.println("regenMarginIrns for " + yearMonth + " (dryRun=" + dryRun + ")");
|
|
|
1351 |
scheduledTasks.regenMarginIrns(yearMonth, dryRun);
|
|
|
1352 |
System.out.println("regenMarginIrns completed successfully");
|
|
|
1353 |
} catch (Exception e) {
|
|
|
1354 |
System.err.println("regenMarginIrns FAILED: " + e.getMessage());
|
|
|
1355 |
e.printStackTrace(System.err);
|
|
|
1356 |
}
|
|
|
1357 |
}
|
| 37236 |
amit |
1358 |
if (args.containsOption("cancelMarginDnIrns")) {
|
|
|
1359 |
// One-time: cancel IRNs of margin DNs inflated by the abs bug (24h NIC window!)
|
|
|
1360 |
// and mark them cancelled so a sendCreditNote rerun reissues corrected DNs.
|
|
|
1361 |
// Defaults to dry-run; pass --live to actually cancel.
|
|
|
1362 |
boolean dryRun = !args.containsOption("live");
|
|
|
1363 |
try {
|
|
|
1364 |
String ymStr = args.getOptionValues("cancelMarginDnIrns").isEmpty() ? null : args.getOptionValues("cancelMarginDnIrns").get(0);
|
|
|
1365 |
YearMonth yearMonth = ymStr != null && !ymStr.isEmpty() ? YearMonth.parse(ymStr) : YearMonth.now().minusMonths(1);
|
|
|
1366 |
System.out.println("cancelMarginDnIrns for " + yearMonth + " (dryRun=" + dryRun + ")");
|
|
|
1367 |
scheduledTasks.cancelMarginDnIrns(yearMonth, dryRun);
|
|
|
1368 |
System.out.println("cancelMarginDnIrns completed successfully");
|
|
|
1369 |
} catch (Exception e) {
|
|
|
1370 |
System.err.println("cancelMarginDnIrns FAILED: " + e.getMessage());
|
|
|
1371 |
e.printStackTrace(System.err);
|
|
|
1372 |
}
|
|
|
1373 |
}
|
| 37232 |
amit |
1374 |
if (args.containsOption("corrMarginCNs")) {
|
|
|
1375 |
// One-time corrective CNs against wrongly-inflated margin DNs.
|
|
|
1376 |
// Defaults to dry-run; pass --live to issue real documents.
|
|
|
1377 |
boolean dryRun = !args.containsOption("live");
|
|
|
1378 |
try {
|
|
|
1379 |
String ymStr = args.getOptionValues("corrMarginCNs").isEmpty() ? null : args.getOptionValues("corrMarginCNs").get(0);
|
|
|
1380 |
YearMonth yearMonth = ymStr != null && !ymStr.isEmpty() ? YearMonth.parse(ymStr) : YearMonth.now().minusMonths(1);
|
|
|
1381 |
System.out.println("corrMarginCNs for " + yearMonth + " (dryRun=" + dryRun + ")");
|
|
|
1382 |
scheduledTasks.corrMarginCNs(yearMonth, dryRun);
|
|
|
1383 |
System.out.println("corrMarginCNs completed successfully");
|
|
|
1384 |
} catch (Exception e) {
|
|
|
1385 |
System.err.println("corrMarginCNs FAILED: " + e.getMessage());
|
|
|
1386 |
e.printStackTrace(System.err);
|
|
|
1387 |
}
|
|
|
1388 |
}
|
| 36220 |
amit |
1389 |
if (args.containsOption("genDNs")) {
|
|
|
1390 |
System.out.println("Calling genDNs");
|
| 36254 |
amit |
1391 |
try {
|
|
|
1392 |
String ymStr = args.getOptionValues("genDNs").isEmpty() ? null : args.getOptionValues("genDNs").get(0);
|
|
|
1393 |
YearMonth yearMonth = ymStr != null ? YearMonth.parse(ymStr) : YearMonth.now().minusMonths(1);
|
|
|
1394 |
System.out.println("genDNs for " + yearMonth);
|
|
|
1395 |
scheduledTasks.genDNs(yearMonth);
|
|
|
1396 |
System.out.println("genDNs completed successfully");
|
|
|
1397 |
} catch (Exception e) {
|
|
|
1398 |
System.err.println("genDNs FAILED: " + e.getMessage());
|
|
|
1399 |
e.printStackTrace(System.err);
|
|
|
1400 |
}
|
| 36220 |
amit |
1401 |
}
|
| 36503 |
amit |
1402 |
if (args.containsOption("genDNsForCNs")) {
|
|
|
1403 |
System.out.println("Calling genDNsForCNs");
|
|
|
1404 |
try {
|
|
|
1405 |
String cnList = args.getOptionValues("genDNsForCNs").get(0);
|
|
|
1406 |
List<String> cnNumbers = Arrays.asList(cnList.split(","));
|
|
|
1407 |
System.out.println("genDNsForCNs for " + cnNumbers.size() + " CNs: " + cnNumbers);
|
|
|
1408 |
scheduledTasks.genDNsForCNs(cnNumbers);
|
|
|
1409 |
System.out.println("genDNsForCNs completed successfully");
|
|
|
1410 |
} catch (Exception e) {
|
|
|
1411 |
System.err.println("genDNsForCNs FAILED: " + e.getMessage());
|
|
|
1412 |
e.printStackTrace(System.err);
|
|
|
1413 |
}
|
|
|
1414 |
}
|
| 36433 |
amit |
1415 |
System.exit(0);
|
|
|
1416 |
}
|
|
|
1417 |
|
| 31753 |
tejbeer |
1418 |
}
|
| 24848 |
amit.gupta |
1419 |
}
|