| 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;
|
|
|
6 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 32831 |
amit.gupta |
7 |
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
|
| 33274 |
amit.gupta |
8 |
import com.smartdukaan.cron.scheduled.purchaseorder.POScheduler;
|
| 34443 |
vikas.jang |
9 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 32782 |
raveendra. |
10 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
|
|
11 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
|
|
12 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
|
|
13 |
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
|
|
|
14 |
import com.spice.profitmandi.service.integrations.samsung.upgradeoffer.UpgradeOfferService;
|
| 23723 |
amit.gupta |
15 |
import org.apache.logging.log4j.LogManager;
|
|
|
16 |
import org.apache.logging.log4j.Logger;
|
| 28389 |
amit.gupta |
17 |
import org.apache.velocity.app.VelocityEngine;
|
|
|
18 |
import org.apache.velocity.exception.VelocityException;
|
| 23898 |
amit.gupta |
19 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
20 |
import org.springframework.boot.ApplicationArguments;
|
|
|
21 |
import org.springframework.boot.ApplicationRunner;
|
| 23723 |
amit.gupta |
22 |
import org.springframework.boot.WebApplicationType;
|
|
|
23 |
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
24 |
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
25 |
import org.springframework.context.annotation.Bean;
|
|
|
26 |
import org.springframework.context.annotation.ComponentScan;
|
| 23935 |
amit.gupta |
27 |
import org.springframework.context.annotation.Primary;
|
| 23723 |
amit.gupta |
28 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
|
29 |
import org.springframework.core.io.ClassPathResource;
|
| 23906 |
amit.gupta |
30 |
import org.springframework.mail.javamail.JavaMailSender;
|
|
|
31 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 28389 |
amit.gupta |
32 |
import org.springframework.ui.velocity.VelocityEngineFactoryBean;
|
| 23723 |
amit.gupta |
33 |
|
| 32782 |
raveendra. |
34 |
import java.io.FileInputStream;
|
|
|
35 |
import java.io.IOException;
|
|
|
36 |
import java.time.LocalDate;
|
|
|
37 |
import java.time.YearMonth;
|
|
|
38 |
import java.util.ArrayList;
|
|
|
39 |
import java.util.Arrays;
|
|
|
40 |
import java.util.List;
|
|
|
41 |
import java.util.Properties;
|
|
|
42 |
import java.util.stream.Collectors;
|
| 23724 |
amit.gupta |
43 |
|
| 23723 |
amit.gupta |
44 |
@SpringBootApplication
|
| 23755 |
amit.gupta |
45 |
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
|
| 24122 |
govind |
46 |
public class Application implements ApplicationRunner {
|
|
|
47 |
|
| 31753 |
tejbeer |
48 |
private static final Logger LOGGER = LogManager.getLogger(Application.class);
|
| 24122 |
govind |
49 |
|
| 31753 |
tejbeer |
50 |
@Autowired
|
|
|
51 |
LeadSyncRunner leadSyncRunner;
|
| 30120 |
amit.gupta |
52 |
|
| 31753 |
tejbeer |
53 |
@Autowired
|
|
|
54 |
StandAlone standAlone;
|
| 30209 |
amit.gupta |
55 |
|
| 31753 |
tejbeer |
56 |
@Autowired
|
|
|
57 |
UpgradeOfferService upgradeOfferService;
|
| 27392 |
amit.gupta |
58 |
|
| 31753 |
tejbeer |
59 |
@Autowired
|
|
|
60 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
| 28368 |
tejbeer |
61 |
|
| 31753 |
tejbeer |
62 |
@Autowired
|
|
|
63 |
private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
|
| 28921 |
tejbeer |
64 |
|
| 31753 |
tejbeer |
65 |
@Autowired
|
|
|
66 |
private InvestmentRelatedTasks investmentRelatedTasks;
|
| 27392 |
amit.gupta |
67 |
|
| 31753 |
tejbeer |
68 |
@Autowired
|
|
|
69 |
private CsService csService;
|
| 29814 |
tejbeer |
70 |
|
| 31753 |
tejbeer |
71 |
@Autowired
|
|
|
72 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
| 24603 |
amit.gupta |
73 |
|
| 31753 |
tejbeer |
74 |
@Autowired
|
|
|
75 |
private ContentPojoPopulator contentPojoPopulator;
|
| 29361 |
tejbeer |
76 |
|
| 31753 |
tejbeer |
77 |
@Autowired
|
|
|
78 |
private Listing listing;
|
| 24122 |
govind |
79 |
|
| 32831 |
amit.gupta |
80 |
@Autowired
|
|
|
81 |
OrderTrackingService orderTrackingService;
|
|
|
82 |
|
| 31753 |
tejbeer |
83 |
public static void main(String[] args) throws Throwable {
|
|
|
84 |
try {
|
|
|
85 |
new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args);
|
|
|
86 |
} catch (Throwable t) {
|
|
|
87 |
t.printStackTrace();
|
|
|
88 |
}
|
|
|
89 |
}
|
| 28389 |
amit.gupta |
90 |
|
| 31753 |
tejbeer |
91 |
@Bean
|
|
|
92 |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
|
|
|
93 |
LOGGER.info("Called Configuration");
|
|
|
94 |
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
|
|
|
95 |
propertySourcesPlaceholderConfigurer.setLocation(new ClassPathResource("/META-INF/env.properties"));
|
|
|
96 |
return propertySourcesPlaceholderConfigurer;
|
|
|
97 |
}
|
| 28389 |
amit.gupta |
98 |
|
| 31753 |
tejbeer |
99 |
@Bean(name = "veloctyEngine")
|
|
|
100 |
public VelocityEngine velocityEngine() throws VelocityException, IOException {
|
|
|
101 |
VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
|
| 28389 |
amit.gupta |
102 |
|
| 31753 |
tejbeer |
103 |
Properties velocityProperties = new Properties();
|
|
|
104 |
velocityProperties.put("resource.loader", "class");
|
|
|
105 |
velocityProperties.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
|
|
106 |
velocityProperties.put("file.resource.loader.cache", true);
|
|
|
107 |
velocityProperties.put("file.resource.loader.unicode", true);
|
|
|
108 |
velocityProperties.put("input.encoding", "UTF-8");
|
|
|
109 |
velocityProperties.put("output.encoding", "UTF-8");
|
|
|
110 |
velocityProperties.put("response.encoding", "UTF-8");
|
|
|
111 |
velocityProperties.put("overrideLogging", true);
|
| 28389 |
amit.gupta |
112 |
|
| 31753 |
tejbeer |
113 |
// velocityProperties.put("file.resource.loader.path", ".");
|
| 28389 |
amit.gupta |
114 |
|
| 31753 |
tejbeer |
115 |
factory.setVelocityProperties(velocityProperties);
|
| 28389 |
amit.gupta |
116 |
|
| 31753 |
tejbeer |
117 |
return factory.createVelocityEngine();
|
| 23723 |
amit.gupta |
118 |
|
| 31753 |
tejbeer |
119 |
}
|
| 24122 |
govind |
120 |
|
| 32661 |
amit.gupta |
121 |
@Bean(name = "mailSender")
|
| 31753 |
tejbeer |
122 |
@Primary
|
|
|
123 |
public JavaMailSender sendGridMailSender() {
|
|
|
124 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 24122 |
govind |
125 |
|
| 31753 |
tejbeer |
126 |
// Using gmail
|
|
|
127 |
mailSender.setHost("smtp.sendgrid.net");
|
|
|
128 |
mailSender.setPort(587);
|
|
|
129 |
mailSender.setUsername("apikey");
|
|
|
130 |
mailSender.setPassword("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");
|
| 24122 |
govind |
131 |
|
| 31753 |
tejbeer |
132 |
Properties javaMailProperties = new Properties();
|
|
|
133 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
|
|
134 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
135 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24122 |
govind |
136 |
|
| 31753 |
tejbeer |
137 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
138 |
return mailSender;
|
| 32661 |
amit.gupta |
139 |
}
|
|
|
140 |
/*
|
| 32659 |
amit.gupta |
141 |
@Bean(name = "mailSender")
|
|
|
142 |
@Primary
|
|
|
143 |
public JavaMailSender sendGridMailSender() {
|
|
|
144 |
return googleMailSender();
|
| 32661 |
amit.gupta |
145 |
}*/
|
| 23935 |
amit.gupta |
146 |
|
| 31753 |
tejbeer |
147 |
@Bean
|
|
|
148 |
public JavaMailSender googleMailSender() {
|
|
|
149 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
|
|
150 |
// Using gmail
|
|
|
151 |
mailSender.setHost("smtp.gmail.com");
|
|
|
152 |
mailSender.setPort(587);
|
| 34336 |
amit.gupta |
153 |
//mailSender.setUsername("build@shop2020.in");
|
|
|
154 |
//mailSender.setPassword("cafe@nes");
|
|
|
155 |
mailSender.setUsername("sdtech@smartdukaan.com");
|
|
|
156 |
mailSender.setPassword("gpdschroalhhirox");
|
| 24122 |
govind |
157 |
|
| 31753 |
tejbeer |
158 |
Properties javaMailProperties = new Properties();
|
|
|
159 |
javaMailProperties.put("mail.smtp.starttls.enable", "true");
|
|
|
160 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
161 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
|
|
162 |
javaMailProperties.put("mail.debug", "true");// Prints out everything on screen
|
|
|
163 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
164 |
return mailSender;
|
|
|
165 |
}
|
| 24848 |
amit.gupta |
166 |
|
| 31753 |
tejbeer |
167 |
@Autowired
|
|
|
168 |
private RunOnceTasks runOnceTasks;
|
| 24122 |
govind |
169 |
|
| 31753 |
tejbeer |
170 |
@Autowired
|
|
|
171 |
private ScheduledTasks scheduledTasks;
|
| 30335 |
amit.gupta |
172 |
|
| 31753 |
tejbeer |
173 |
@Autowired
|
| 34306 |
ranu |
174 |
private ScheduledTasksTest scheduledTasksTest;
|
|
|
175 |
|
|
|
176 |
@Autowired
|
| 31753 |
tejbeer |
177 |
private Reconciliation reconciliation;
|
| 30309 |
amit.gupta |
178 |
|
| 31753 |
tejbeer |
179 |
@Autowired
|
|
|
180 |
CaptchaService captchaService;
|
| 28921 |
tejbeer |
181 |
|
| 33274 |
amit.gupta |
182 |
@Autowired
|
|
|
183 |
POScheduler poScheduler;
|
| 32878 |
amit.gupta |
184 |
|
| 33274 |
amit.gupta |
185 |
|
| 31753 |
tejbeer |
186 |
@Override
|
|
|
187 |
public void run(ApplicationArguments args) throws Exception {
|
| 32008 |
amit.gupta |
188 |
//scheduledTasks.test();
|
|
|
189 |
//System.exit();
|
| 31753 |
tejbeer |
190 |
LOGGER.info("Called run method");
|
| 33260 |
amit.gupta |
191 |
if (args.containsOption("removePartialBillingForTransaction")) {
|
|
|
192 |
if (args.containsOption("trId")) {
|
| 33051 |
amit.gupta |
193 |
int transactionId = Integer.parseInt(args.getOptionValues("trId").get(0));
|
| 33054 |
amit.gupta |
194 |
scheduledTasks.removePartialBillingForTransaction(transactionId);
|
| 33051 |
amit.gupta |
195 |
}
|
|
|
196 |
System.exit(0);
|
|
|
197 |
}
|
| 34523 |
ranu |
198 |
if (args.containsOption("createOpeningStockPartyWise")) {
|
|
|
199 |
scheduledTasks.createOpeningStockPartyWise();
|
|
|
200 |
System.exit(0);
|
|
|
201 |
}
|
| 31753 |
tejbeer |
202 |
if (args.containsOption("tc")) {
|
|
|
203 |
System.out.println("Toffee service called");
|
|
|
204 |
scheduledTasks.toffeeRollback();
|
|
|
205 |
System.exit(0);
|
|
|
206 |
}
|
|
|
207 |
if (args.containsOption("bag")) {
|
|
|
208 |
System.out.println("Bag service called");
|
|
|
209 |
runOnceTasks.testBag();
|
|
|
210 |
System.exit(0);
|
|
|
211 |
}
|
| 29814 |
tejbeer |
212 |
|
| 31753 |
tejbeer |
213 |
if (args.containsOption("rw")) {
|
|
|
214 |
System.out.println("Reverse wallet");
|
|
|
215 |
scheduledTasks.reverseWallet();
|
|
|
216 |
System.exit(0);
|
|
|
217 |
}
|
|
|
218 |
if (args.containsOption("sendIndentTertiary")) {
|
|
|
219 |
System.out.println("sendIndentTertiary");
|
|
|
220 |
scheduledTasks.sendIndentTertiary();
|
|
|
221 |
System.exit(0);
|
|
|
222 |
}
|
|
|
223 |
if (args.containsOption("checkPartnerActiveStore")) {
|
|
|
224 |
System.out.println("checkPartnerActiveStore");
|
|
|
225 |
scheduledTasks.checkPartnerActiveStore();
|
|
|
226 |
System.exit(0);
|
|
|
227 |
}
|
| 29800 |
manish |
228 |
|
| 31753 |
tejbeer |
229 |
if (args.containsOption("selectFinServiceFollowUpDateByCurrDate")) {
|
|
|
230 |
System.out.println("selectfinServiceFollowUpDateByCurrDate");
|
| 28368 |
tejbeer |
231 |
|
| 31753 |
tejbeer |
232 |
scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
|
|
|
233 |
System.exit(0);
|
|
|
234 |
}
|
| 25073 |
amit.gupta |
235 |
|
| 31753 |
tejbeer |
236 |
if (args.containsOption("addHdfcPayment")) {
|
|
|
237 |
runOnceTasks.addPayment();
|
|
|
238 |
System.exit(0);
|
|
|
239 |
}
|
|
|
240 |
if (args.containsOption("processSchemeOut")) {
|
|
|
241 |
System.out.println("Process schemeOut");
|
|
|
242 |
int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
|
|
|
243 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
244 |
runOnceTasks.processSchemeOut(fofoId, orderId);
|
|
|
245 |
System.exit(0);
|
|
|
246 |
}
|
|
|
247 |
if (args.containsOption("at")) {
|
|
|
248 |
System.out.println("Toffee service called");
|
|
|
249 |
ticketRelatedScheduledTask.alertforTicket();
|
|
|
250 |
System.exit(0);
|
|
|
251 |
}
|
|
|
252 |
if (args.containsOption("et")) {
|
|
|
253 |
ticketRelatedScheduledTask.escalateTicket();
|
|
|
254 |
;
|
|
|
255 |
System.exit(0);
|
|
|
256 |
}
|
|
|
257 |
if (args.containsOption("sr")) {
|
|
|
258 |
List<String> schemeIds = args.getOptionValues("schemeId");
|
|
|
259 |
System.out.println(schemeIds);
|
|
|
260 |
scheduledTasks.schemeRollback(schemeIds);
|
|
|
261 |
System.exit(0);
|
|
|
262 |
}
|
|
|
263 |
if (args.containsOption("processActivation")) {
|
|
|
264 |
scheduledTasks.processActivation();
|
|
|
265 |
System.exit(0);
|
|
|
266 |
}
|
|
|
267 |
if (args.containsOption("sendAttendanceMorningAlert")) {
|
|
|
268 |
scheduledTasks.sendAttendanceMorningAlert();
|
|
|
269 |
System.exit(0);
|
|
|
270 |
}
|
|
|
271 |
if (args.containsOption("sendAttendanceEveningAlert")) {
|
|
|
272 |
scheduledTasks.sendAttendanceEveningAlert();
|
|
|
273 |
System.exit(0);
|
|
|
274 |
}
|
| 25721 |
tejbeer |
275 |
|
| 31753 |
tejbeer |
276 |
if (args.containsOption("checkRazorPayPaymentStatus")) {
|
|
|
277 |
scheduledTasks.checkRazorPayPaymentStatus();
|
|
|
278 |
System.exit(0);
|
|
|
279 |
}
|
|
|
280 |
if (args.containsOption("grouping")) {
|
|
|
281 |
scheduledTasks.grouping();
|
|
|
282 |
System.exit(0);
|
|
|
283 |
}
|
|
|
284 |
if (args.containsOption("fixWallet")) {
|
|
|
285 |
runOnceTasks.fixWallet();
|
|
|
286 |
System.exit(0);
|
|
|
287 |
}
|
|
|
288 |
if (args.containsOption("reconcileExpiredFixedSchemes")) {
|
|
|
289 |
reconciliation.reconcileExpiredFixedSchemes();
|
|
|
290 |
System.exit(0);
|
|
|
291 |
}
|
|
|
292 |
if (args.containsOption("dailyReconciliation")) {
|
|
|
293 |
if (args.containsOption("date")) {
|
|
|
294 |
LocalDate date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
295 |
reconciliation.dailyReconciliation(date);
|
|
|
296 |
} else {
|
|
|
297 |
reconciliation.dailyReconciliation(LocalDate.now().minusDays(1));
|
|
|
298 |
}
|
|
|
299 |
System.exit(0);
|
|
|
300 |
}
|
|
|
301 |
/*
|
|
|
302 |
* if (args.containsOption("test")) { schemeService.processSchemeIn(9243,
|
|
|
303 |
* 175138102); throw new Exception(); }
|
|
|
304 |
*/
|
| 28921 |
tejbeer |
305 |
|
| 31753 |
tejbeer |
306 |
if (args.containsOption("sendNotification")) {
|
|
|
307 |
scheduledTasks.sendNotification();
|
|
|
308 |
System.exit(0);
|
|
|
309 |
}
|
| 26291 |
tejbeer |
310 |
|
| 31753 |
tejbeer |
311 |
if (args.containsOption("ticketClosed")) {
|
|
|
312 |
scheduledTasks.ticketClosed();
|
|
|
313 |
System.exit(0);
|
|
|
314 |
}
|
| 28207 |
tejbeer |
315 |
|
| 31753 |
tejbeer |
316 |
if (args.containsOption("getVendorWarehouses")) {
|
|
|
317 |
int warehouseId = Integer.parseInt(args.getOptionValues("warehouseId").get(0));
|
|
|
318 |
scheduledTasks.getVendorWarehouses(warehouseId);
|
|
|
319 |
System.exit(0);
|
|
|
320 |
}
|
| 29776 |
tejbeer |
321 |
|
| 31753 |
tejbeer |
322 |
if (args.containsOption("checkfocusedModelInPartnerStock")) {
|
| 34344 |
amit.gupta |
323 |
try {
|
|
|
324 |
scheduledTasks.checkfocusedModelInPartnerStock();
|
|
|
325 |
} finally {
|
|
|
326 |
System.exit(0);
|
|
|
327 |
}
|
| 31753 |
tejbeer |
328 |
}
|
| 29451 |
manish |
329 |
|
| 31753 |
tejbeer |
330 |
if (args.containsOption("checkImeiActivation")) {
|
|
|
331 |
scheduledTasks.checkImeiActivation();
|
|
|
332 |
System.exit(0);
|
|
|
333 |
}
|
| 29776 |
tejbeer |
334 |
|
| 31753 |
tejbeer |
335 |
if (args.containsOption("checkTecnoImeiActivation")) {
|
| 29776 |
tejbeer |
336 |
|
| 31753 |
tejbeer |
337 |
LocalDate dateTechno = LocalDate.now();
|
| 29532 |
manish |
338 |
|
| 31753 |
tejbeer |
339 |
int days = 25;
|
|
|
340 |
if (args.containsOption("days")) {
|
|
|
341 |
days = Integer.parseInt(args.getOptionValues("days").get(0));
|
|
|
342 |
}
|
|
|
343 |
scheduledTasks.checkTecnoImeiActivation(dateTechno, days);
|
|
|
344 |
System.exit(0);
|
|
|
345 |
}
|
| 28921 |
tejbeer |
346 |
|
| 31753 |
tejbeer |
347 |
if (args.containsOption("checkItelImeiActivation")) {
|
|
|
348 |
LocalDate dateItel = LocalDate.now();
|
|
|
349 |
int days = 25;
|
|
|
350 |
if (args.containsOption("days")) {
|
|
|
351 |
days = Integer.parseInt(args.getOptionValues("days").get(0));
|
|
|
352 |
}
|
|
|
353 |
scheduledTasks.checkItelImeiActivation(dateItel, days);
|
|
|
354 |
System.exit(0);
|
|
|
355 |
}
|
| 28921 |
tejbeer |
356 |
|
| 31753 |
tejbeer |
357 |
if (args.containsOption("partnerProblemAlert")) {
|
|
|
358 |
scheduledTasks.partnerProblemAlert();
|
|
|
359 |
System.exit(0);
|
|
|
360 |
}
|
|
|
361 |
if (args.containsOption("notify")) {
|
|
|
362 |
if (args.containsOption("fofoId")) {
|
|
|
363 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoId").get(0));
|
|
|
364 |
scheduledTasks.sendDailySalesNotificationToPartner(fofoId);
|
|
|
365 |
}
|
|
|
366 |
System.exit(0);
|
|
|
367 |
}
|
|
|
368 |
if (args.containsOption("findMismatchesInIndent")) {
|
|
|
369 |
runOnceTasks.findMismatchesInIndent();
|
|
|
370 |
System.exit(0);
|
|
|
371 |
}
|
| 29035 |
tejbeer |
372 |
|
| 31753 |
tejbeer |
373 |
if (args.containsOption("onboardingEventDelays")) {
|
|
|
374 |
onBoardingRelatedSchelduleTask.onboardingEventDelays();
|
|
|
375 |
System.exit(0);
|
|
|
376 |
}
|
| 28982 |
tejbeer |
377 |
|
| 31753 |
tejbeer |
378 |
if (args.containsOption("onBoardingCompleteEventEmail")) {
|
|
|
379 |
onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
|
|
|
380 |
System.exit(0);
|
|
|
381 |
}
|
| 28921 |
tejbeer |
382 |
|
| 31753 |
tejbeer |
383 |
if (args.containsOption("onBoardingDocumentsPending")) {
|
|
|
384 |
onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
|
|
|
385 |
System.exit(0);
|
|
|
386 |
}
|
|
|
387 |
if (args.containsOption("onBoardingMigration")) {
|
|
|
388 |
onBoardingRelatedSchelduleTask.onBoardingMigration();
|
|
|
389 |
System.exit(0);
|
|
|
390 |
}
|
| 28921 |
tejbeer |
391 |
|
| 33859 |
tejus.loha |
392 |
// if (args.containsOption("advancePaymentPendingAlert")) {
|
|
|
393 |
// onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
|
|
|
394 |
// System.exit(0);
|
|
|
395 |
// }
|
| 28963 |
tejbeer |
396 |
|
| 31753 |
tejbeer |
397 |
if (args.containsOption("fullPaymentPendingAlert")) {
|
|
|
398 |
onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
|
|
|
399 |
System.exit(0);
|
|
|
400 |
}
|
| 29308 |
tejbeer |
401 |
|
| 33859 |
tejus.loha |
402 |
// if (args.containsOption("advancePaymentPendinglegalAlert")) {
|
|
|
403 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
404 |
// System.exit(0);
|
|
|
405 |
// }
|
| 31117 |
tejbeer |
406 |
|
| 31753 |
tejbeer |
407 |
if (args.containsOption("markDelhiveryOrderDelivered")) {
|
| 32831 |
amit.gupta |
408 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
409 |
System.exit(0);
|
|
|
410 |
}
|
| 32831 |
amit.gupta |
411 |
|
| 31753 |
tejbeer |
412 |
if (args.containsOption("markBlueDartOrderDelivered")) {
|
| 32794 |
raveendra. |
413 |
System.out.println("Marking BlueDart Order Delivered...");
|
| 32831 |
amit.gupta |
414 |
orderTrackingService.markBlueDartOrderDelivered();
|
| 31753 |
tejbeer |
415 |
System.exit(0);
|
|
|
416 |
}
|
|
|
417 |
if (args.containsOption("mergingdata")) {
|
|
|
418 |
onBoardingRelatedSchelduleTask.mergingdata();
|
|
|
419 |
System.exit(0);
|
|
|
420 |
}
|
|
|
421 |
if (args.containsOption("brandingAlert")) {
|
|
|
422 |
onBoardingRelatedSchelduleTask.brandingAlert();
|
|
|
423 |
System.exit(0);
|
|
|
424 |
}
|
| 31089 |
amit.gupta |
425 |
|
| 33859 |
tejus.loha |
426 |
// if (args.containsOption("storeTimelinePromoterPending")) {
|
|
|
427 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
428 |
// System.exit(0);
|
|
|
429 |
// }
|
| 31249 |
tejbeer |
430 |
|
| 31753 |
tejbeer |
431 |
if (args.containsOption("ppl")) {
|
|
|
432 |
runOnceTasks.printPendingLeads();
|
|
|
433 |
System.exit(0);
|
|
|
434 |
}
|
| 31249 |
tejbeer |
435 |
|
| 31753 |
tejbeer |
436 |
if (args.containsOption("sweets")) {
|
|
|
437 |
runOnceTasks.getSweet();
|
|
|
438 |
}
|
|
|
439 |
if (args.containsOption("notifyAll")) {
|
|
|
440 |
scheduledTasks.sendDailySalesNotificationToPartner(null);
|
|
|
441 |
System.exit(0);
|
|
|
442 |
}
|
| 31249 |
tejbeer |
443 |
|
| 31753 |
tejbeer |
444 |
if (args.containsOption("monthlyTargetForInternalTeam")) {
|
|
|
445 |
scheduledTasks.monthlyTargetForInternalTeam();
|
|
|
446 |
System.exit(0);
|
|
|
447 |
}
|
| 31249 |
tejbeer |
448 |
|
| 33446 |
ranu |
449 |
|
| 31753 |
tejbeer |
450 |
if (args.containsOption("monthlyTargetForPartner")) {
|
|
|
451 |
scheduledTasks.monthlyTargetForPartner();
|
|
|
452 |
System.exit(0);
|
|
|
453 |
}
|
| 33444 |
ranu |
454 |
if (args.containsOption("findAllLiveDemoBrandItemsByBillingDate")) {
|
|
|
455 |
scheduledTasks.findAllLiveDemoBrandItemsByBillingDate();
|
|
|
456 |
System.exit(0);
|
|
|
457 |
}
|
| 33464 |
ranu |
458 |
if (args.containsOption("findTodayPocoBillingItems")) {
|
|
|
459 |
scheduledTasks.findTodayPocoBillingItems();
|
|
|
460 |
System.exit(0);
|
|
|
461 |
}
|
| 28921 |
tejbeer |
462 |
|
| 31753 |
tejbeer |
463 |
if (args.containsOption("hygineAlertForPartner")) {
|
|
|
464 |
scheduledTasks.hygineAlertForPartner();
|
|
|
465 |
System.exit(0);
|
|
|
466 |
}
|
| 28921 |
tejbeer |
467 |
|
| 31753 |
tejbeer |
468 |
if (args.containsOption("hygineAlertForInternalTeam")) {
|
|
|
469 |
scheduledTasks.hygineAlertForInternalTeam();
|
|
|
470 |
System.exit(0);
|
|
|
471 |
}
|
|
|
472 |
|
| 32214 |
jai.hind |
473 |
if (args.containsOption("checkItelImeiActivationNew")) {
|
|
|
474 |
scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 15);
|
|
|
475 |
System.exit(0);
|
|
|
476 |
}
|
| 31753 |
tejbeer |
477 |
if (args.containsOption("once")) {
|
| 33274 |
amit.gupta |
478 |
|
|
|
479 |
if (args.containsOption("autoClosePurchaseOrders")) {
|
|
|
480 |
poScheduler.autoClosePurchaseOrders();
|
|
|
481 |
}
|
| 31753 |
tejbeer |
482 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
483 |
if (args.containsOption("invoiceNumber")) {
|
|
|
484 |
String oneAssistInvoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
485 |
runOnceTasks.cancelOnceAssist(oneAssistInvoiceNumber);
|
|
|
486 |
}
|
|
|
487 |
|
|
|
488 |
}
|
| 34208 |
ranu |
489 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
490 |
if (args.containsOption("MemberShipNumber")) {
|
|
|
491 |
String applicationNo = args.getOptionValues("applicationNo").get(0);
|
|
|
492 |
String membershipId = args.getOptionValues("membershipId").get(0);
|
|
|
493 |
runOnceTasks.cancelOnceAssistByMemberShipNumber(applicationNo, membershipId);
|
|
|
494 |
}
|
|
|
495 |
|
|
|
496 |
}
|
| 33260 |
amit.gupta |
497 |
if (args.containsOption("changeFulfillmentWarehouse")) {
|
|
|
498 |
if (args.containsOption("orderId") && args.containsOption("whId")) {
|
|
|
499 |
int orderId = Integer.parseInt(args.getOptionValues("orderId").get(0));
|
|
|
500 |
int itemId = Integer.parseInt(args.getOptionValues("whId").get(0));
|
|
|
501 |
runOnceTasks.changeFulfillmentWarehouse(orderId, itemId);
|
|
|
502 |
}
|
|
|
503 |
System.exit(0);
|
|
|
504 |
}
|
| 31753 |
tejbeer |
505 |
if (args.containsOption("1")) {
|
|
|
506 |
if (args.containsOption("test")) {
|
| 31618 |
amit.gupta |
507 |
//scheduledTasks.sendPartnerInvestmentDetails(args.getOptionValues("email"));
|
| 31753 |
tejbeer |
508 |
System.out.println("Calling test method");
|
| 32482 |
amit.gupta |
509 |
scheduledTasks.test();
|
| 32083 |
tejbeer |
510 |
|
| 32482 |
amit.gupta |
511 |
|
| 32083 |
tejbeer |
512 |
if (args.containsOption("migrateVendorItemPricing")) {
|
|
|
513 |
scheduledTasks.migrateVendorItemPricing();
|
|
|
514 |
System.exit(0);
|
|
|
515 |
}
|
|
|
516 |
|
|
|
517 |
if (args.containsOption("approveVendorCatalogPricing")) {
|
|
|
518 |
scheduledTasks.approveVendorCatalogPricing();
|
|
|
519 |
System.exit(0);
|
|
|
520 |
}
|
| 32080 |
tejbeer |
521 |
} else if (args.containsOption("test1")) {
|
| 32008 |
amit.gupta |
522 |
scheduledTasks.test1();
|
| 34321 |
ranu |
523 |
}
|
|
|
524 |
else if (args.containsOption("scheduleTaskTest1")) {
|
|
|
525 |
|
|
|
526 |
scheduledTasksTest.test();
|
| 34306 |
ranu |
527 |
} else if (args.containsOption("testNew1")) {
|
| 34307 |
ranu |
528 |
List<String> loanIdArgs = args.getOptionValues("loanIds"); // ["34833,36536,37151"]
|
|
|
529 |
List<Integer> loanIds = new ArrayList<>();
|
|
|
530 |
|
|
|
531 |
if (loanIdArgs != null && !loanIdArgs.isEmpty()) {
|
|
|
532 |
String csv = loanIdArgs.get(0);
|
|
|
533 |
loanIds = Arrays.stream(csv.split(","))
|
|
|
534 |
.map(String::trim)
|
|
|
535 |
.map(Integer::parseInt)
|
|
|
536 |
.collect(Collectors.toList());
|
|
|
537 |
}
|
| 34321 |
ranu |
538 |
scheduledTasksTest.findLoanTransactionMapingAccordingLoan(loanIds);
|
| 34309 |
ranu |
539 |
} else if (args.containsOption("testNew2")) {
|
| 34308 |
ranu |
540 |
if (args.containsOption("createLoan")) {
|
|
|
541 |
// Extract each parameter
|
|
|
542 |
int transactionId = 0;
|
|
|
543 |
double invoiceAmount = 0.0;
|
|
|
544 |
String invoiceNumber = "";
|
|
|
545 |
|
|
|
546 |
if (args.containsOption("transactionId")) {
|
|
|
547 |
transactionId = Integer.parseInt(args.getOptionValues("transactionId").get(0));
|
|
|
548 |
}
|
|
|
549 |
|
|
|
550 |
if (args.containsOption("invoiceAmount")) {
|
|
|
551 |
invoiceAmount = Double.parseDouble(args.getOptionValues("invoiceAmount").get(0));
|
|
|
552 |
}
|
|
|
553 |
|
|
|
554 |
if (args.containsOption("invoiceNumber")) {
|
|
|
555 |
invoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
556 |
}
|
|
|
557 |
|
|
|
558 |
// Call your method
|
|
|
559 |
scheduledTasksTest.createLoanForBillingByTransactionIdAndInvoiceNumber(transactionId, invoiceAmount, invoiceNumber);
|
|
|
560 |
}
|
|
|
561 |
|
| 32482 |
amit.gupta |
562 |
} else {
|
| 31753 |
tejbeer |
563 |
System.out.println("Called sendPartnerInvestmentDetails");
|
|
|
564 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
565 |
}
|
|
|
566 |
System.exit(0);
|
|
|
567 |
}
|
|
|
568 |
if (args.containsOption("2")) {
|
|
|
569 |
if (args.containsOption("test")) {
|
|
|
570 |
String[] emails = new String[args.getOptionValues("email").size()];
|
|
|
571 |
scheduledTasks.sendAgeingReport(args.getOptionValues("email").toArray(emails));
|
|
|
572 |
} else {
|
|
|
573 |
scheduledTasks.sendAgeingReport();
|
|
|
574 |
}
|
|
|
575 |
System.exit(0);
|
|
|
576 |
}
|
| 33457 |
amit.gupta |
577 |
|
| 31753 |
tejbeer |
578 |
if (args.containsOption("cancelOrder")) {
|
|
|
579 |
List<String> invoiceNumbers = args.getOptionValues("invoiceNumber");
|
|
|
580 |
runOnceTasks.cancelOrder(invoiceNumbers);
|
|
|
581 |
}
|
|
|
582 |
if (args.containsOption("migratePurchase")) {
|
|
|
583 |
runOnceTasks.migratePurchase();
|
|
|
584 |
}
|
|
|
585 |
if (args.containsOption("migratepd")) {
|
|
|
586 |
scheduledTasks.moveImeisToPriceDropImeis();
|
|
|
587 |
}
|
|
|
588 |
if (args.containsOption("walletmismatch")) {
|
|
|
589 |
scheduledTasks.walletmismatch();
|
|
|
590 |
}
|
|
|
591 |
if (args.containsOption("schemewalletmismatch")) {
|
|
|
592 |
scheduledTasks.schemewalletmismatch();
|
|
|
593 |
}
|
|
|
594 |
if (args.containsOption("gst")) {
|
|
|
595 |
scheduledTasks.gst();
|
|
|
596 |
}
|
|
|
597 |
if (args.containsOption("mailDashboardScreenshots")) {
|
|
|
598 |
runOnceTasks.mailDashboardScreenshots();
|
|
|
599 |
}
|
|
|
600 |
if (args.containsOption("notifyLead")) {
|
|
|
601 |
scheduledTasks.notifyLead();
|
|
|
602 |
scheduledTasks.notifyVisits();
|
|
|
603 |
}
|
|
|
604 |
if (args.containsOption("fixgrn")) {
|
|
|
605 |
runOnceTasks.fixGrn();
|
|
|
606 |
}
|
|
|
607 |
if (args.containsOption("pbfix")) {
|
|
|
608 |
runOnceTasks.pbfix();
|
|
|
609 |
}
|
|
|
610 |
if (args.containsOption("mongom")) {
|
|
|
611 |
runOnceTasks.mongom();
|
|
|
612 |
}
|
|
|
613 |
if (args.containsOption("processPd")) {
|
|
|
614 |
int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
|
|
|
615 |
runOnceTasks.processPd(priceDropId);
|
|
|
616 |
}
|
|
|
617 |
if (args.containsOption("samsung")) {
|
|
|
618 |
if (args.containsOption("ym")) {
|
|
|
619 |
int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
|
|
|
620 |
runOnceTasks.fetchImeiActivation(ym);
|
|
|
621 |
}
|
|
|
622 |
runOnceTasks.fetchImeiActivation(0);
|
|
|
623 |
}
|
|
|
624 |
if (args.containsOption("fixdupimeigrn")) {
|
|
|
625 |
runOnceTasks.fixDupGrns();
|
|
|
626 |
}
|
|
|
627 |
if (args.containsOption("cancel")) {
|
|
|
628 |
runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
|
|
|
629 |
}
|
|
|
630 |
if (args.containsOption("fixScheme")) {
|
|
|
631 |
runOnceTasks.fixScheme();
|
|
|
632 |
}
|
|
|
633 |
if (args.containsOption("syncLeads")) {
|
|
|
634 |
leadSyncRunner.syncLeads();
|
|
|
635 |
}
|
|
|
636 |
if (args.containsOption("testCs")) {
|
|
|
637 |
int category = Integer.parseInt(args.getOptionValues("category").get(0));
|
|
|
638 |
EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
|
|
|
639 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
640 |
csService.getAuthUserId(category, escalationType, fofoId);
|
|
|
641 |
}
|
|
|
642 |
if (args.containsOption("duporder")) {
|
|
|
643 |
runOnceTasks.removeDuplicateOrders();
|
|
|
644 |
}
|
|
|
645 |
if (args.containsOption("createDummyInvoices")) {
|
|
|
646 |
runOnceTasks.createDummyInvoices();
|
|
|
647 |
}
|
| 28921 |
tejbeer |
648 |
|
| 31753 |
tejbeer |
649 |
if (args.containsOption("createGeofence")) {
|
|
|
650 |
runOnceTasks.createGeofence();
|
|
|
651 |
}
|
|
|
652 |
if (args.containsOption("getAllGeofences")) {
|
|
|
653 |
runOnceTasks.getAllGeofences();
|
|
|
654 |
}
|
|
|
655 |
if (args.containsOption("payMonthlyInvestment")) {
|
|
|
656 |
investmentRelatedTasks.payMonthlyInvestment();
|
|
|
657 |
}
|
|
|
658 |
if (args.containsOption("evaluateActualInvestmentPayout")) {
|
|
|
659 |
investmentRelatedTasks.evaluateActualInvestmentPayout();
|
|
|
660 |
}
|
|
|
661 |
if (args.containsOption("deleteGeofences")) {
|
|
|
662 |
List<String> geofenceIds = args.getOptionValues("geofenceId");
|
|
|
663 |
runOnceTasks.deleteGeofences(geofenceIds);
|
|
|
664 |
}
|
|
|
665 |
if (args.containsOption("createOffers")) {
|
|
|
666 |
if (args.containsOption("fileName")) {
|
|
|
667 |
String fileName = args.getOptionValues("fileName").get(0);
|
|
|
668 |
FileInputStream stream = new FileInputStream(fileName);
|
|
|
669 |
runOnceTasks.createOffers(stream);
|
|
|
670 |
}
|
|
|
671 |
}
|
|
|
672 |
if (args.containsOption("schemeout")) {
|
|
|
673 |
if (args.containsOption("invoices")) {
|
|
|
674 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
675 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
676 |
scheduledTasks.processSchemeOut(invoices);
|
|
|
677 |
}
|
|
|
678 |
}
|
|
|
679 |
if (args.containsOption("schemein")) {
|
|
|
680 |
if (args.containsOption("invoices")) {
|
|
|
681 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
682 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
683 |
scheduledTasks.processSchemeIn(invoices);
|
|
|
684 |
}
|
|
|
685 |
}
|
| 28921 |
tejbeer |
686 |
|
| 31753 |
tejbeer |
687 |
if (args.containsOption("fixScans")) {
|
|
|
688 |
runOnceTasks.fixScans();
|
|
|
689 |
}
|
|
|
690 |
if (args.containsOption("fixPrebookingOrderGrn")) {
|
|
|
691 |
runOnceTasks.genericCreateCurrentInventorySnapshot();
|
|
|
692 |
}
|
|
|
693 |
if (args.containsOption("fixOurSerialized")) {
|
|
|
694 |
if (args.containsOption("orderIds")) {
|
|
|
695 |
String orderIdsString = args.getOptionValues("orderIds").get(0);
|
|
|
696 |
List<Integer> orderIds = Arrays.asList(orderIdsString.split(",")).stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
697 |
// runOnceTasks.fixOurSerialized(orderIds);
|
|
|
698 |
}
|
|
|
699 |
}
|
| 29776 |
tejbeer |
700 |
|
| 31753 |
tejbeer |
701 |
if (args.containsOption("reverseMaa")) {
|
|
|
702 |
runOnceTasks.reverseMaa();
|
|
|
703 |
}
|
| 29776 |
tejbeer |
704 |
|
| 31753 |
tejbeer |
705 |
if (args.containsOption("fixOffer")) {
|
|
|
706 |
runOnceTasks.fixOffer();
|
|
|
707 |
}
|
| 29794 |
tejbeer |
708 |
|
| 31753 |
tejbeer |
709 |
if (args.containsOption("opporeno")) {
|
|
|
710 |
runOnceTasks.opporeno();
|
|
|
711 |
}
|
| 30309 |
amit.gupta |
712 |
|
| 31753 |
tejbeer |
713 |
if (args.containsOption("fixorders")) {
|
|
|
714 |
runOnceTasks.fixOrders();
|
|
|
715 |
}
|
|
|
716 |
if (args.containsOption("fixreservations")) {
|
|
|
717 |
runOnceTasks.fixReservations();
|
|
|
718 |
}
|
|
|
719 |
if (args.containsOption("addinvestment")) {
|
|
|
720 |
runOnceTasks.addInvestment();
|
|
|
721 |
}
|
|
|
722 |
if (args.containsOption("brandregion")) {
|
|
|
723 |
runOnceTasks.brandRegion();
|
|
|
724 |
}
|
|
|
725 |
if (args.containsOption("rollOutUpgardedMargins")) {
|
|
|
726 |
scheduledTasks.rollOutUpgardedMargins();
|
|
|
727 |
}
|
| 34029 |
ranu |
728 |
if (args.containsOption("pushRbmTargets")) {
|
|
|
729 |
scheduledTasks.persistRbmTodayTargets();
|
|
|
730 |
}
|
| 31753 |
tejbeer |
731 |
if (args.containsOption("rollOutUpgardedMarginsNextMonth")) {
|
|
|
732 |
scheduledTasks.rollOutUpgardedMarginsNextMonth();
|
|
|
733 |
}
|
|
|
734 |
if (args.containsOption("checkCancellationMargin")) {
|
|
|
735 |
scheduledTasks.checkCancellationMargin();
|
|
|
736 |
}
|
|
|
737 |
if (args.containsOption("reviewUncontactablePartner")) {
|
|
|
738 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
739 |
}
|
| 33078 |
ranu |
740 |
if (args.containsOption("reviewNonSdBuyingBrand")) {
|
|
|
741 |
scheduledTasks.reviewNonSdBuyingBrand();
|
|
|
742 |
}
|
| 31753 |
tejbeer |
743 |
if (args.containsOption("sendWelcomeEmail")) {
|
|
|
744 |
onBoardingRelatedSchelduleTask.sendWelcomeEmail();
|
|
|
745 |
}
|
| 29814 |
tejbeer |
746 |
|
| 31753 |
tejbeer |
747 |
if (args.containsOption("partnerOnboardingLegalMigration")) {
|
|
|
748 |
onBoardingRelatedSchelduleTask.partnerOnboardingLegalMigration();
|
|
|
749 |
}
|
| 31031 |
amit.gupta |
750 |
|
| 33526 |
amit.gupta |
751 |
if(args.containsOption("moveOrders")) {
|
|
|
752 |
runOnceTasks.moveOrders();
|
|
|
753 |
}
|
|
|
754 |
|
| 31753 |
tejbeer |
755 |
if (args.containsOption("addKycLegalMigration")) {
|
|
|
756 |
onBoardingRelatedSchelduleTask.addKycLegalMigration();
|
|
|
757 |
}
|
| 29776 |
tejbeer |
758 |
|
|
|
759 |
|
| 31753 |
tejbeer |
760 |
if (args.containsOption("pushDataToSolr")) {
|
|
|
761 |
listing.pushDataToSolr();
|
|
|
762 |
}
|
| 30120 |
amit.gupta |
763 |
|
| 31753 |
tejbeer |
764 |
if (args.containsOption("testGstPro")) {
|
|
|
765 |
System.out.println("TestGstProc called");
|
|
|
766 |
try {
|
|
|
767 |
runOnceTasks.updateIrnsToInvoices();
|
|
|
768 |
} catch (Exception e) {
|
|
|
769 |
e.printStackTrace();
|
|
|
770 |
}
|
|
|
771 |
}
|
| 29308 |
tejbeer |
772 |
|
| 31753 |
tejbeer |
773 |
if (args.containsOption("reverseSchemeCancelInvoice")) {
|
|
|
774 |
if (args.containsOption("invoice")) {
|
|
|
775 |
String invoice = args.getOptionValues("invoice").get(0);
|
|
|
776 |
runOnceTasks.reverseSchemes(invoice);
|
|
|
777 |
}
|
|
|
778 |
}
|
| 29863 |
tejbeer |
779 |
|
| 31753 |
tejbeer |
780 |
if (args.containsOption("reverseInvalidActivation")) {
|
|
|
781 |
if (args.containsOption("inventoryids")) {
|
|
|
782 |
String inventoryItemIdsString = args.getOptionValues("inventoryids").get(0);
|
|
|
783 |
List<Integer> inventoryItemIds = new ArrayList<>();
|
|
|
784 |
for (String inventoryItemIdString : inventoryItemIdsString.split(",")) {
|
|
|
785 |
int inventoryItemId = Integer.parseInt(inventoryItemIdString.trim());
|
|
|
786 |
inventoryItemIds.add(inventoryItemId);
|
|
|
787 |
}
|
|
|
788 |
runOnceTasks.reverseInvalidActivation(inventoryItemIds);
|
|
|
789 |
}
|
|
|
790 |
}
|
| 29863 |
tejbeer |
791 |
|
| 31753 |
tejbeer |
792 |
if (args.containsOption("runme")) {
|
|
|
793 |
runOnceTasks.runMe();
|
| 30209 |
amit.gupta |
794 |
|
| 31753 |
tejbeer |
795 |
}
|
|
|
796 |
if (args.containsOption("" + "")) {
|
|
|
797 |
upgradeOfferService.authenticateUser();
|
| 30449 |
amit.gupta |
798 |
|
| 31753 |
tejbeer |
799 |
}
|
|
|
800 |
if (args.containsOption("mandiiUser")) {
|
|
|
801 |
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));
|
| 30335 |
amit.gupta |
802 |
|
| 31753 |
tejbeer |
803 |
}
|
| 30335 |
amit.gupta |
804 |
|
| 31753 |
tejbeer |
805 |
if (args.containsOption("mandiiUsers")) {
|
|
|
806 |
if (args.containsOption("pan")) {
|
|
|
807 |
runOnceTasks.mandiiUsers(args.getOptionValues("pan").get(0));
|
|
|
808 |
} else {
|
|
|
809 |
runOnceTasks.mandiiUsers();
|
|
|
810 |
}
|
| 30313 |
amit.gupta |
811 |
|
| 31753 |
tejbeer |
812 |
}
|
| 30576 |
amit.gupta |
813 |
|
| 31753 |
tejbeer |
814 |
if (args.containsOption("checkOppoImeiStatus")) {
|
|
|
815 |
try {
|
|
|
816 |
standAlone.checkOppoImeiStatus();
|
|
|
817 |
} catch (Exception e) {
|
|
|
818 |
e.printStackTrace();
|
|
|
819 |
}
|
|
|
820 |
}
|
| 30616 |
amit.gupta |
821 |
|
| 34417 |
amit.gupta |
822 |
if (args.containsOption("checkRealmeImeiStatus")) {
|
|
|
823 |
try {
|
|
|
824 |
standAlone.checkRealmeImeiStatus();
|
|
|
825 |
} catch (Exception e) {
|
|
|
826 |
e.printStackTrace();
|
|
|
827 |
}
|
|
|
828 |
}
|
|
|
829 |
|
| 31753 |
tejbeer |
830 |
/*
|
|
|
831 |
* if (args.containsOption("checkRealmeImeiStatus")) { try {
|
|
|
832 |
* standAlone.checkRealmeImeiStatus(); } catch (Exception e) {
|
|
|
833 |
* e.printStackTrace(); } }
|
|
|
834 |
*/
|
| 30616 |
amit.gupta |
835 |
|
| 31753 |
tejbeer |
836 |
if (args.containsOption("amazonPurchase")) {
|
|
|
837 |
try {
|
|
|
838 |
runOnceTasks.amazonPurchase();
|
|
|
839 |
} catch (Exception e) {
|
|
|
840 |
e.printStackTrace();
|
|
|
841 |
}
|
|
|
842 |
}
|
| 30641 |
amit.gupta |
843 |
|
| 31753 |
tejbeer |
844 |
if (args.containsOption("getCaptchaCode")) {
|
|
|
845 |
try {
|
|
|
846 |
captchaService.getCaptchaCode("/home/amit/Desktop/generatingCodes.jpg");
|
|
|
847 |
} catch (Exception e) {
|
|
|
848 |
e.printStackTrace();
|
|
|
849 |
}
|
|
|
850 |
}
|
| 30641 |
amit.gupta |
851 |
|
| 31753 |
tejbeer |
852 |
if (args.containsOption("testIrnLive")) {
|
|
|
853 |
try {
|
|
|
854 |
runOnceTasks.testIrnLive(args.getOptionValues("invoiceNumber").get(0));
|
|
|
855 |
} catch (Exception e) {
|
|
|
856 |
e.printStackTrace();
|
|
|
857 |
}
|
|
|
858 |
}
|
| 30659 |
amit.gupta |
859 |
|
| 31753 |
tejbeer |
860 |
if (args.containsOption("createoffercriteria")) {
|
|
|
861 |
try {
|
|
|
862 |
runOnceTasks.createOfferCriteria();
|
|
|
863 |
} catch (Exception e) {
|
|
|
864 |
e.printStackTrace();
|
|
|
865 |
}
|
|
|
866 |
}
|
| 30659 |
amit.gupta |
867 |
|
| 31753 |
tejbeer |
868 |
if (args.containsOption("fix-price-drops")) {
|
|
|
869 |
runOnceTasks.fixPriceDrop();
|
| 30739 |
amit.gupta |
870 |
|
| 31753 |
tejbeer |
871 |
}
|
| 29035 |
tejbeer |
872 |
|
| 31753 |
tejbeer |
873 |
if (args.containsOption("processSchemeByIds")) {
|
|
|
874 |
List<String> schemeIds = Arrays.asList(args.getOptionValues("ids").get(0).split(","));
|
|
|
875 |
List<Integer> schemeIdsInt = schemeIds.stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
876 |
runOnceTasks.processSchemeByIds(schemeIdsInt);
|
| 30859 |
tejbeer |
877 |
|
| 31753 |
tejbeer |
878 |
}
|
| 30859 |
tejbeer |
879 |
|
| 31753 |
tejbeer |
880 |
if (args.containsOption("updateSaholicCISTable")) {
|
|
|
881 |
runOnceTasks.updateSaholicCISTable();
|
| 30859 |
tejbeer |
882 |
|
| 31753 |
tejbeer |
883 |
}
|
| 30859 |
tejbeer |
884 |
|
| 31753 |
tejbeer |
885 |
if (args.containsOption("mapbag")) {
|
|
|
886 |
runOnceTasks.mapBag();
|
|
|
887 |
}
|
| 30859 |
tejbeer |
888 |
|
| 34443 |
vikas.jang |
889 |
if (args.containsOption("bidPurchaseOrder")) {
|
|
|
890 |
runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
|
|
|
891 |
}
|
|
|
892 |
|
| 34547 |
vikas.jang |
893 |
if (args.containsOption("biddingConsolidatedMessage")) {
|
|
|
894 |
runOnceTasks.consolidatedBiddingMessage();
|
|
|
895 |
}
|
|
|
896 |
|
|
|
897 |
if (args.containsOption("sendMailWhatsAppAfterLoanDueDate")) {
|
|
|
898 |
scheduledTasks.sendMailWhatsAppAfterLoanDueDate();
|
|
|
899 |
}
|
|
|
900 |
|
| 31753 |
tejbeer |
901 |
System.exit(0);
|
|
|
902 |
}
|
| 30859 |
tejbeer |
903 |
|
| 31753 |
tejbeer |
904 |
if (args.containsOption("calculateInterestAccured")) {
|
| 30929 |
tejbeer |
905 |
|
| 31753 |
tejbeer |
906 |
scheduledTasks.calculateInterestAccured();
|
|
|
907 |
System.exit(0);
|
|
|
908 |
}
|
| 30929 |
tejbeer |
909 |
|
| 31753 |
tejbeer |
910 |
if (args.containsOption("loanSettlement")) {
|
| 30890 |
amit.gupta |
911 |
|
| 31753 |
tejbeer |
912 |
scheduledTasks.loanSettlement();
|
|
|
913 |
System.exit(0);
|
|
|
914 |
}
|
| 30896 |
amit.gupta |
915 |
|
| 31753 |
tejbeer |
916 |
if (args.containsOption("dailyLoanAlert")) {
|
| 30936 |
tejbeer |
917 |
|
| 31753 |
tejbeer |
918 |
scheduledTasks.dailyLoanAlert();
|
|
|
919 |
System.exit(0);
|
|
|
920 |
}
|
| 30982 |
tejbeer |
921 |
|
| 31753 |
tejbeer |
922 |
if (args.containsOption("updatePartnerLimit")) {
|
|
|
923 |
scheduledTasks.updatePartnerLimit();
|
|
|
924 |
System.exit(0);
|
|
|
925 |
}
|
| 30982 |
tejbeer |
926 |
|
| 31753 |
tejbeer |
927 |
if (args.containsOption("notifyDefaultLoans")) {
|
|
|
928 |
scheduledTasks.notifyDefaultLoans();
|
|
|
929 |
System.exit(0);
|
|
|
930 |
}
|
| 31446 |
amit.gupta |
931 |
|
| 31753 |
tejbeer |
932 |
if (args.containsOption("fixinsurance")) {
|
|
|
933 |
runOnceTasks.addMissingWalletDebitsForInsurance();
|
|
|
934 |
System.exit(0);
|
|
|
935 |
}
|
| 31604 |
tejbeer |
936 |
|
| 31753 |
tejbeer |
937 |
if (args.containsOption("processActivatedImeisForSchemes")) {
|
|
|
938 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
939 |
System.exit(0);
|
|
|
940 |
}
|
| 31604 |
tejbeer |
941 |
|
| 31753 |
tejbeer |
942 |
if (args.containsOption("notifyLoanDueDateCross")) {
|
|
|
943 |
scheduledTasks.notifyLoanDueDateCross();
|
|
|
944 |
System.exit(0);
|
|
|
945 |
}
|
| 34275 |
tejus.loha |
946 |
if (args.containsOption("sendTenOrMoreOrderStockReport")) {
|
|
|
947 |
scheduledTasks.send10OrMoreOlderStockReport();
|
|
|
948 |
System.exit(0);
|
|
|
949 |
}
|
| 31604 |
tejbeer |
950 |
|
| 31753 |
tejbeer |
951 |
if (args.containsOption("alertForDueDate")) {
|
|
|
952 |
scheduledTasks.alertForDueDate();
|
|
|
953 |
System.exit(0);
|
|
|
954 |
}
|
| 31648 |
tejbeer |
955 |
|
| 31753 |
tejbeer |
956 |
if (args.containsOption("userMobileNumberOptIn")) {
|
|
|
957 |
scheduledTasks.userMobileNumberOptIn();
|
|
|
958 |
System.exit(0);
|
|
|
959 |
}
|
|
|
960 |
|
|
|
961 |
if (args.containsOption("fetchParnterStats")) {
|
|
|
962 |
scheduledTasks.fetchParnterStats();
|
|
|
963 |
System.exit(0);
|
|
|
964 |
}
|
|
|
965 |
|
|
|
966 |
if (args.containsOption("authUserMobileNumberOptIn")) {
|
|
|
967 |
scheduledTasks.authUserMobileNumberOptIn();
|
|
|
968 |
System.exit(0);
|
|
|
969 |
}
|
|
|
970 |
if (args.containsOption("morning")) {
|
|
|
971 |
if (args.containsOption("0")) {
|
|
|
972 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
973 |
}
|
|
|
974 |
if (args.containsOption("1")) {
|
|
|
975 |
scheduledTasks.sendIndentTertiary();
|
|
|
976 |
}
|
|
|
977 |
// 0
|
|
|
978 |
if (args.containsOption("2")) {
|
|
|
979 |
scheduledTasks.calculateInterestAccured();
|
|
|
980 |
}
|
|
|
981 |
System.out.println("scheduledTasks.calculateInterestAccured()");
|
|
|
982 |
// 0
|
|
|
983 |
if (args.containsOption("3")) {
|
| 32831 |
amit.gupta |
984 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
985 |
}
|
|
|
986 |
System.out.println("scheduledTasks.markDelhiveryOrderDelivered()");
|
|
|
987 |
// 1
|
|
|
988 |
if (args.containsOption("4")) {
|
|
|
989 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
990 |
}
|
|
|
991 |
System.out.println("scheduledTasks.processActivatedImeisForSchemes()");
|
|
|
992 |
// 2
|
|
|
993 |
if (args.containsOption("5")) {
|
|
|
994 |
scheduledTasks.processActivation();
|
|
|
995 |
}
|
|
|
996 |
System.out.println("scheduledTasks.processActivation()");
|
|
|
997 |
// 4
|
|
|
998 |
if (args.containsOption("6")) {
|
|
|
999 |
scheduledTasks.processPriceDrop();
|
|
|
1000 |
}
|
|
|
1001 |
System.out.println("scheduledTasks.processPriceDrop()");
|
|
|
1002 |
// 5
|
|
|
1003 |
if (args.containsOption("7")) {
|
|
|
1004 |
scheduledTasks.loanSettlement();
|
|
|
1005 |
}
|
|
|
1006 |
System.out.println("scheduledTasks.loanSettlement()");
|
|
|
1007 |
// 8
|
|
|
1008 |
if (args.containsOption("8")) {
|
|
|
1009 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
1010 |
}
|
|
|
1011 |
// 9
|
| 33859 |
tejus.loha |
1012 |
// if (args.containsOption("9")) {
|
|
|
1013 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
1014 |
// }
|
|
|
1015 |
// // 9
|
|
|
1016 |
// if (args.containsOption("10")) {
|
|
|
1017 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
1018 |
// }
|
| 31753 |
tejbeer |
1019 |
// sendPartnerInvestment
|
|
|
1020 |
if (args.containsOption("11")) {
|
|
|
1021 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
1022 |
}
|
|
|
1023 |
if (args.containsOption("sendCreditNote")) {
|
| 34029 |
ranu |
1024 |
YearMonth yearMonth = YearMonth.now().minusMonths(1);
|
| 31753 |
tejbeer |
1025 |
/*
|
|
|
1026 |
* if
|
|
|
1027 |
* (localDateTime.toLocalDate().equals(yearMonth.atEndOfMonth().getDayOfMonth())
|
|
|
1028 |
* && Arrays.asList(20,21,22,23).contains(localDateTime.getHour())) {
|
|
|
1029 |
* scheduledTasks.sendCreditNote(yearMonth); }
|
|
|
1030 |
*/
|
|
|
1031 |
scheduledTasks.sendCreditNote(yearMonth);
|
|
|
1032 |
}
|
|
|
1033 |
System.exit(0);
|
|
|
1034 |
}
|
|
|
1035 |
}
|
| 24848 |
amit.gupta |
1036 |
}
|