| 23755 |
amit.gupta |
1 |
package com.smartdukaan.cron;
|
| 23723 |
amit.gupta |
2 |
|
| 28389 |
amit.gupta |
3 |
import java.io.IOException;
|
| 27746 |
amit.gupta |
4 |
import java.time.LocalDate;
|
| 27892 |
amit.gupta |
5 |
import java.util.Arrays;
|
| 24174 |
govind |
6 |
import java.util.List;
|
| 23906 |
amit.gupta |
7 |
import java.util.Properties;
|
|
|
8 |
|
| 23723 |
amit.gupta |
9 |
import org.apache.logging.log4j.LogManager;
|
|
|
10 |
import org.apache.logging.log4j.Logger;
|
| 28389 |
amit.gupta |
11 |
import org.apache.velocity.app.VelocityEngine;
|
|
|
12 |
import org.apache.velocity.exception.VelocityException;
|
| 23898 |
amit.gupta |
13 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
14 |
import org.springframework.boot.ApplicationArguments;
|
|
|
15 |
import org.springframework.boot.ApplicationRunner;
|
| 23723 |
amit.gupta |
16 |
import org.springframework.boot.WebApplicationType;
|
|
|
17 |
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
18 |
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
19 |
import org.springframework.cache.annotation.EnableCaching;
|
|
|
20 |
import org.springframework.context.annotation.Bean;
|
|
|
21 |
import org.springframework.context.annotation.ComponentScan;
|
| 23935 |
amit.gupta |
22 |
import org.springframework.context.annotation.Primary;
|
| 23723 |
amit.gupta |
23 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
|
24 |
import org.springframework.core.io.ClassPathResource;
|
| 23906 |
amit.gupta |
25 |
import org.springframework.mail.javamail.JavaMailSender;
|
|
|
26 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 23723 |
amit.gupta |
27 |
import org.springframework.scheduling.annotation.EnableScheduling;
|
| 28389 |
amit.gupta |
28 |
import org.springframework.ui.velocity.VelocityEngineFactoryBean;
|
| 23723 |
amit.gupta |
29 |
|
| 23898 |
amit.gupta |
30 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
| 27562 |
amit.gupta |
31 |
import com.smartdukaan.cron.scheduled.InvestmentRelatedTasks;
|
| 28921 |
tejbeer |
32 |
import com.smartdukaan.cron.scheduled.OnBoardingRelatedSchelduleTask;
|
| 24827 |
amit.gupta |
33 |
import com.smartdukaan.cron.scheduled.Reconciliation;
|
| 25563 |
amit.gupta |
34 |
import com.smartdukaan.cron.scheduled.ScheduledSkeleton;
|
| 23929 |
amit.gupta |
35 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
| 27124 |
amit.gupta |
36 |
import com.smartdukaan.cron.scheduled.TicketRelatedScheduledTask;
|
| 27007 |
amit.gupta |
37 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 27077 |
amit.gupta |
38 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
|
|
39 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 29361 |
tejbeer |
40 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
|
|
41 |
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
|
| 23724 |
amit.gupta |
42 |
|
| 23723 |
amit.gupta |
43 |
@SpringBootApplication
|
|
|
44 |
@EnableCaching
|
|
|
45 |
@EnableScheduling
|
| 23755 |
amit.gupta |
46 |
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
|
| 24122 |
govind |
47 |
public class Application implements ApplicationRunner {
|
|
|
48 |
|
|
|
49 |
private static final Logger LOGGER = LogManager.getLogger(Application.class);
|
|
|
50 |
|
| 25563 |
amit.gupta |
51 |
@Autowired
|
| 27007 |
amit.gupta |
52 |
LeadSyncRunner leadSyncRunner;
|
| 27392 |
amit.gupta |
53 |
|
| 27007 |
amit.gupta |
54 |
@Autowired
|
| 25563 |
amit.gupta |
55 |
private ScheduledSkeleton scheduledSkeleton;
|
| 27392 |
amit.gupta |
56 |
|
| 27077 |
amit.gupta |
57 |
@Autowired
|
| 27124 |
amit.gupta |
58 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
| 28368 |
tejbeer |
59 |
|
| 27562 |
amit.gupta |
60 |
@Autowired
|
| 28921 |
tejbeer |
61 |
private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
|
|
|
62 |
|
|
|
63 |
@Autowired
|
| 27562 |
amit.gupta |
64 |
private InvestmentRelatedTasks investmentRelatedTasks;
|
| 27392 |
amit.gupta |
65 |
|
| 27124 |
amit.gupta |
66 |
@Autowired
|
| 27077 |
amit.gupta |
67 |
private CsService csService;
|
| 24603 |
amit.gupta |
68 |
|
| 29361 |
tejbeer |
69 |
@Autowired
|
|
|
70 |
private ContentPojoPopulator contentPojoPopulator;
|
|
|
71 |
|
| 23723 |
amit.gupta |
72 |
public static void main(String[] args) throws Throwable {
|
| 23738 |
amit.gupta |
73 |
new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args);
|
| 23723 |
amit.gupta |
74 |
}
|
| 24122 |
govind |
75 |
|
| 23723 |
amit.gupta |
76 |
@Bean
|
| 23738 |
amit.gupta |
77 |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
|
| 23755 |
amit.gupta |
78 |
LOGGER.info("Called Configuration");
|
| 24122 |
govind |
79 |
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
|
| 23723 |
amit.gupta |
80 |
propertySourcesPlaceholderConfigurer.setLocation(new ClassPathResource("/META-INF/env.properties"));
|
|
|
81 |
return propertySourcesPlaceholderConfigurer;
|
|
|
82 |
}
|
| 24122 |
govind |
83 |
|
| 28389 |
amit.gupta |
84 |
@Bean(name = "veloctyEngine")
|
|
|
85 |
public VelocityEngine velocityEngine() throws VelocityException, IOException {
|
|
|
86 |
VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
|
|
|
87 |
// Properties props = new Properties();
|
|
|
88 |
// props.put("resource.loader", "file");
|
|
|
89 |
|
|
|
90 |
// props.put("file.resource.loader.description", "Velocity File Resource
|
|
|
91 |
// Loader");
|
|
|
92 |
// props.put("file.resource.loader.class",
|
|
|
93 |
// "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
|
|
|
94 |
// props.put("file.resource.loader.cache", true);
|
|
|
95 |
// props.put("file.resource.loader.path", ".");
|
|
|
96 |
|
|
|
97 |
Properties velocityProperties = new Properties();
|
|
|
98 |
velocityProperties.put("resource.loader", "class");
|
|
|
99 |
velocityProperties.put("class.resource.loader.class",
|
|
|
100 |
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
|
|
101 |
velocityProperties.put("file.resource.loader.cache", true);
|
|
|
102 |
velocityProperties.put("file.resource.loader.unicode", true);
|
|
|
103 |
velocityProperties.put("input.encoding", "UTF-8");
|
|
|
104 |
velocityProperties.put("output.encoding", "UTF-8");
|
| 29378 |
tejbeer |
105 |
velocityProperties.put("response.encoding", "UTF-8");
|
| 28389 |
amit.gupta |
106 |
velocityProperties.put("overrideLogging", true);
|
|
|
107 |
|
| 28921 |
tejbeer |
108 |
// velocityProperties.put("file.resource.loader.path", ".");
|
| 28389 |
amit.gupta |
109 |
|
|
|
110 |
factory.setVelocityProperties(velocityProperties);
|
|
|
111 |
|
|
|
112 |
return factory.createVelocityEngine();
|
|
|
113 |
|
|
|
114 |
}
|
|
|
115 |
|
| 24122 |
govind |
116 |
@Bean(name = "mailSender")
|
| 23935 |
amit.gupta |
117 |
@Primary
|
| 24122 |
govind |
118 |
public JavaMailSender sendGridMailSender() {
|
|
|
119 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 23723 |
amit.gupta |
120 |
|
| 24122 |
govind |
121 |
// Using gmail
|
|
|
122 |
mailSender.setHost("smtp.sendgrid.net");
|
|
|
123 |
mailSender.setPort(587);
|
| 27630 |
amit.gupta |
124 |
mailSender.setUsername("apikey");
|
|
|
125 |
mailSender.setPassword("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");
|
| 24122 |
govind |
126 |
|
|
|
127 |
Properties javaMailProperties = new Properties();
|
|
|
128 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
|
|
129 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
130 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24603 |
amit.gupta |
131 |
// javaMailProperties.put("mail.debug", "true");// Prints out everything on
|
|
|
132 |
// screen
|
| 24122 |
govind |
133 |
|
|
|
134 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
135 |
return mailSender;
|
|
|
136 |
}
|
|
|
137 |
|
| 23935 |
amit.gupta |
138 |
@Bean
|
| 24122 |
govind |
139 |
public JavaMailSender googleMailSender() {
|
| 23935 |
amit.gupta |
140 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 24122 |
govind |
141 |
// Using gmail
|
| 23935 |
amit.gupta |
142 |
mailSender.setHost("smtp.gmail.com");
|
|
|
143 |
mailSender.setPort(587);
|
|
|
144 |
mailSender.setUsername("build@shop2020.in");
|
|
|
145 |
mailSender.setPassword("cafe@nes");
|
| 24122 |
govind |
146 |
|
| 23935 |
amit.gupta |
147 |
Properties javaMailProperties = new Properties();
|
|
|
148 |
javaMailProperties.put("mail.smtp.starttls.enable", "true");
|
|
|
149 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
150 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24122 |
govind |
151 |
javaMailProperties.put("mail.debug", "true");// Prints out everything on screen
|
| 23935 |
amit.gupta |
152 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
153 |
return mailSender;
|
|
|
154 |
}
|
|
|
155 |
|
| 24122 |
govind |
156 |
@Autowired
|
| 23898 |
amit.gupta |
157 |
private RunOnceTasks runOnceTasks;
|
| 24122 |
govind |
158 |
|
|
|
159 |
@Autowired
|
| 23929 |
amit.gupta |
160 |
private ScheduledTasks scheduledTasks;
|
| 24848 |
amit.gupta |
161 |
|
| 24827 |
amit.gupta |
162 |
@Autowired
|
|
|
163 |
private Reconciliation reconciliation;
|
| 24122 |
govind |
164 |
|
| 23898 |
amit.gupta |
165 |
@Override
|
|
|
166 |
public void run(ApplicationArguments args) throws Exception {
|
|
|
167 |
LOGGER.info("Called run method");
|
| 25694 |
amit.gupta |
168 |
if (args.containsOption("tc")) {
|
| 25842 |
amit.gupta |
169 |
System.out.println("Toffee service called");
|
| 27692 |
amit.gupta |
170 |
scheduledTasks.attachToffeeInvoices();
|
| 25694 |
amit.gupta |
171 |
System.exit(0);
|
|
|
172 |
}
|
| 27457 |
tejbeer |
173 |
/*
|
|
|
174 |
* if (args.containsOption("migratetax")) { System.out.println("migratetax");
|
|
|
175 |
* scheduledTasks.migrateTax(); System.exit(0); }
|
|
|
176 |
*/
|
| 27272 |
amit.gupta |
177 |
if (args.containsOption("rw")) {
|
|
|
178 |
System.out.println("Reverse wallet");
|
|
|
179 |
scheduledTasks.reverseWallet();
|
|
|
180 |
System.exit(0);
|
|
|
181 |
}
|
| 28633 |
amit.gupta |
182 |
if (args.containsOption("sendIndentTertiary")) {
|
|
|
183 |
System.out.println("sendIndentTertiary");
|
|
|
184 |
scheduledTasks.sendIndentTertiary();
|
|
|
185 |
System.exit(0);
|
|
|
186 |
}
|
| 28709 |
amit.gupta |
187 |
if (args.containsOption("checkPartnerActiveStore")) {
|
|
|
188 |
System.out.println("checkPartnerActiveStore");
|
|
|
189 |
scheduledTasks.checkPartnerActiveStore();
|
|
|
190 |
System.exit(0);
|
|
|
191 |
}
|
| 28921 |
tejbeer |
192 |
|
| 27720 |
amit.gupta |
193 |
if (args.containsOption("addHdfcPayment")) {
|
|
|
194 |
runOnceTasks.addPayment();
|
|
|
195 |
System.exit(0);
|
|
|
196 |
}
|
| 27431 |
amit.gupta |
197 |
if (args.containsOption("processSchemeOut")) {
|
|
|
198 |
System.out.println("Process schemeOut");
|
|
|
199 |
int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
|
|
|
200 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
201 |
runOnceTasks.processSchemeOut(fofoId, orderId);
|
|
|
202 |
System.exit(0);
|
|
|
203 |
}
|
| 27124 |
amit.gupta |
204 |
if (args.containsOption("at")) {
|
|
|
205 |
System.out.println("Toffee service called");
|
|
|
206 |
ticketRelatedScheduledTask.alertforTicket();
|
|
|
207 |
System.exit(0);
|
|
|
208 |
}
|
|
|
209 |
if (args.containsOption("et")) {
|
| 27392 |
amit.gupta |
210 |
ticketRelatedScheduledTask.escalateTicket();
|
|
|
211 |
;
|
| 27124 |
amit.gupta |
212 |
System.exit(0);
|
|
|
213 |
}
|
| 26291 |
tejbeer |
214 |
if (args.containsOption("sr")) {
|
| 25694 |
amit.gupta |
215 |
List<String> schemeIds = args.getOptionValues("schemeId");
|
| 25697 |
amit.gupta |
216 |
System.out.println(schemeIds);
|
| 25694 |
amit.gupta |
217 |
scheduledTasks.schemeRollback(schemeIds);
|
| 25695 |
amit.gupta |
218 |
System.exit(0);
|
| 25694 |
amit.gupta |
219 |
}
|
| 27437 |
amit.gupta |
220 |
if (args.containsOption("processActivation")) {
|
|
|
221 |
scheduledTasks.processActivation();
|
|
|
222 |
System.exit(0);
|
|
|
223 |
}
|
| 28769 |
amit.gupta |
224 |
if (args.containsOption("sendAttendanceMorningAlert")) {
|
|
|
225 |
scheduledTasks.sendAttendanceMorningAlert();
|
|
|
226 |
System.exit(0);
|
|
|
227 |
}
|
| 28779 |
amit.gupta |
228 |
if (args.containsOption("sendAttendanceEveningAlert")) {
|
|
|
229 |
scheduledTasks.sendAttendanceEveningAlert();
|
|
|
230 |
System.exit(0);
|
|
|
231 |
}
|
| 28368 |
tejbeer |
232 |
|
|
|
233 |
if (args.containsOption("checkRazorPayPaymentStatus")) {
|
|
|
234 |
scheduledTasks.checkRazorPayPaymentStatus();
|
|
|
235 |
System.exit(0);
|
|
|
236 |
}
|
| 25503 |
amit.gupta |
237 |
if (args.containsOption("grouping")) {
|
|
|
238 |
scheduledTasks.grouping();
|
|
|
239 |
System.exit(0);
|
|
|
240 |
}
|
| 25530 |
amit.gupta |
241 |
if (args.containsOption("fixWallet")) {
|
|
|
242 |
runOnceTasks.fixWallet();
|
|
|
243 |
System.exit(0);
|
|
|
244 |
}
|
| 25312 |
amit.gupta |
245 |
if (args.containsOption("reconcileExpiredFixedSchemes")) {
|
| 25073 |
amit.gupta |
246 |
reconciliation.reconcileExpiredFixedSchemes();
|
|
|
247 |
System.exit(0);
|
|
|
248 |
}
|
| 27746 |
amit.gupta |
249 |
if (args.containsOption("dailyReconciliation")) {
|
| 28207 |
tejbeer |
250 |
if (args.containsOption("date")) {
|
| 27746 |
amit.gupta |
251 |
LocalDate date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
252 |
reconciliation.dailyReconciliation(date);
|
|
|
253 |
} else {
|
|
|
254 |
reconciliation.dailyReconciliation(LocalDate.now().minusDays(1));
|
|
|
255 |
}
|
|
|
256 |
System.exit(0);
|
|
|
257 |
}
|
| 26291 |
tejbeer |
258 |
/*
|
|
|
259 |
* if (args.containsOption("test")) { schemeService.processSchemeIn(9243,
|
|
|
260 |
* 175138102); throw new Exception(); }
|
|
|
261 |
*/
|
| 25073 |
amit.gupta |
262 |
if (args.containsOption("fixSchemePayouts")) {
|
|
|
263 |
|
| 25029 |
amit.gupta |
264 |
runOnceTasks.fixSchemePayouts();
|
|
|
265 |
System.exit(0);
|
|
|
266 |
}
|
| 25312 |
amit.gupta |
267 |
if (args.containsOption("sendNotification")) {
|
| 25300 |
tejbeer |
268 |
scheduledTasks.sendNotification();
|
|
|
269 |
System.exit(0);
|
|
|
270 |
}
|
| 25721 |
tejbeer |
271 |
|
| 26291 |
tejbeer |
272 |
if (args.containsOption("ticketClosed")) {
|
|
|
273 |
scheduledTasks.ticketClosed();
|
|
|
274 |
System.exit(0);
|
|
|
275 |
}
|
| 28921 |
tejbeer |
276 |
|
| 28776 |
amit.gupta |
277 |
if (args.containsOption("getVendorWarehouses")) {
|
|
|
278 |
int warehouseId = Integer.parseInt(args.getOptionValues("warehouseId").get(0));
|
|
|
279 |
scheduledTasks.getVendorWarehouses(warehouseId);
|
|
|
280 |
System.exit(0);
|
|
|
281 |
}
|
| 26291 |
tejbeer |
282 |
|
| 25721 |
tejbeer |
283 |
if (args.containsOption("checkfocusedModelInPartnerStock")) {
|
|
|
284 |
scheduledTasks.checkfocusedModelInPartnerStock();
|
|
|
285 |
System.exit(0);
|
|
|
286 |
}
|
| 28207 |
tejbeer |
287 |
|
|
|
288 |
if (args.containsOption("partnerProblemAlert")) {
|
|
|
289 |
scheduledTasks.partnerProblemAlert();
|
|
|
290 |
System.exit(0);
|
|
|
291 |
}
|
| 25022 |
amit.gupta |
292 |
if (args.containsOption("populateSchemes")) {
|
|
|
293 |
runOnceTasks.populateSchemes();
|
|
|
294 |
System.exit(0);
|
|
|
295 |
}
|
| 24855 |
amit.gupta |
296 |
if (args.containsOption("notify")) {
|
| 25073 |
amit.gupta |
297 |
if (args.containsOption("fofoId")) {
|
| 24988 |
tejbeer |
298 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoId").get(0));
|
| 25837 |
amit.gupta |
299 |
scheduledTasks.sendDailySalesNotificationToPartner(fofoId);
|
| 24988 |
tejbeer |
300 |
}
|
| 24855 |
amit.gupta |
301 |
System.exit(0);
|
|
|
302 |
}
|
| 24955 |
amit.gupta |
303 |
if (args.containsOption("findMismatchesInIndent")) {
|
|
|
304 |
runOnceTasks.findMismatchesInIndent();
|
|
|
305 |
System.exit(0);
|
|
|
306 |
}
|
| 28921 |
tejbeer |
307 |
|
|
|
308 |
if (args.containsOption("onboardingEventDelays")) {
|
|
|
309 |
onBoardingRelatedSchelduleTask.onboardingEventDelays();
|
|
|
310 |
System.exit(0);
|
|
|
311 |
}
|
|
|
312 |
|
| 29035 |
tejbeer |
313 |
if (args.containsOption("onBoardingCompleteEventEmail")) {
|
|
|
314 |
onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
|
|
|
315 |
System.exit(0);
|
|
|
316 |
}
|
|
|
317 |
|
| 29040 |
tejbeer |
318 |
if (args.containsOption("onBoardingDocumentsPending")) {
|
|
|
319 |
onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
|
|
|
320 |
System.exit(0);
|
|
|
321 |
}
|
| 28982 |
tejbeer |
322 |
if (args.containsOption("onBoardingMigration")) {
|
|
|
323 |
onBoardingRelatedSchelduleTask.onBoardingMigration();
|
|
|
324 |
System.exit(0);
|
|
|
325 |
}
|
|
|
326 |
|
| 28921 |
tejbeer |
327 |
if (args.containsOption("advancePaymentPendingAlert")) {
|
|
|
328 |
onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
|
|
|
329 |
System.exit(0);
|
|
|
330 |
}
|
|
|
331 |
|
|
|
332 |
if (args.containsOption("fullPaymentPendingAlert")) {
|
|
|
333 |
onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
|
|
|
334 |
System.exit(0);
|
|
|
335 |
}
|
|
|
336 |
|
| 28963 |
tejbeer |
337 |
if (args.containsOption("advancePaymentPendinglegalAlert")) {
|
|
|
338 |
onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
339 |
System.exit(0);
|
|
|
340 |
}
|
|
|
341 |
|
| 29308 |
tejbeer |
342 |
if (args.containsOption("markDelhiveryOrderDelivered")) {
|
|
|
343 |
scheduledTasks.markDelhiveryOrderDelivered();
|
|
|
344 |
System.exit(0);
|
|
|
345 |
}
|
|
|
346 |
|
| 29109 |
tejbeer |
347 |
if (args.containsOption("mergingdata")) {
|
|
|
348 |
onBoardingRelatedSchelduleTask.mergingdata();
|
|
|
349 |
System.exit(0);
|
|
|
350 |
}
|
| 28921 |
tejbeer |
351 |
if (args.containsOption("brandingAlert")) {
|
|
|
352 |
onBoardingRelatedSchelduleTask.brandingAlert();
|
|
|
353 |
System.exit(0);
|
|
|
354 |
}
|
| 29255 |
tejbeer |
355 |
|
|
|
356 |
if (args.containsOption("storeTimelinePromoterPending")) {
|
|
|
357 |
onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
358 |
System.exit(0);
|
|
|
359 |
}
|
|
|
360 |
|
| 27222 |
amit.gupta |
361 |
if (args.containsOption("ppl")) {
|
|
|
362 |
runOnceTasks.printPendingLeads();
|
|
|
363 |
System.exit(0);
|
|
|
364 |
}
|
| 24862 |
amit.gupta |
365 |
if (args.containsOption("notifyAll")) {
|
| 25837 |
amit.gupta |
366 |
scheduledTasks.sendDailySalesNotificationToPartner(null);
|
| 24862 |
amit.gupta |
367 |
System.exit(0);
|
|
|
368 |
}
|
| 25029 |
amit.gupta |
369 |
if (args.containsOption("OutSchemeReco")) {
|
| 25073 |
amit.gupta |
370 |
scheduledTasks.dryRunOutSchemeReco();
|
| 27252 |
amit.gupta |
371 |
// runOnceTasks.migrateChallansToInvoices();
|
|
|
372 |
// reconciliation.dailyReconciliation();
|
|
|
373 |
System.exit(0);
|
|
|
374 |
}
|
|
|
375 |
if (args.containsOption("dryRunSchemeReco")) {
|
|
|
376 |
scheduledTasks.dryRunSchemeReco();
|
|
|
377 |
// runOnceTasks.migrateChallansToInvoices();
|
|
|
378 |
// reconciliation.dailyReconciliation();
|
|
|
379 |
System.exit(0);
|
|
|
380 |
}
|
|
|
381 |
if (args.containsOption("OutReco1")) {
|
|
|
382 |
scheduledTasks.dryRunSchemeOutReco1();
|
|
|
383 |
System.exit(0);
|
|
|
384 |
}
|
|
|
385 |
if (args.containsOption("once")) {
|
| 24122 |
govind |
386 |
if (args.containsOption("1")) {
|
| 24603 |
amit.gupta |
387 |
if (args.containsOption("test")) {
|
| 24271 |
amit.gupta |
388 |
scheduledTasks.sendPartnerInvestmentDetails(args.getOptionValues("email"));
|
| 24272 |
amit.gupta |
389 |
} else {
|
| 27751 |
amit.gupta |
390 |
System.out.println("Called sendPartnerInvestmentDetails");
|
| 25563 |
amit.gupta |
391 |
scheduledSkeleton.sendPartnerInvestmentDetails();
|
| 24271 |
amit.gupta |
392 |
}
|
| 24122 |
govind |
393 |
System.exit(0);
|
|
|
394 |
}
|
| 24682 |
amit.gupta |
395 |
if (args.containsOption("2")) {
|
| 24696 |
amit.gupta |
396 |
if (args.containsOption("test")) {
|
| 24848 |
amit.gupta |
397 |
String[] emails = new String[args.getOptionValues("email").size()];
|
| 24696 |
amit.gupta |
398 |
scheduledTasks.sendAgeingReport(args.getOptionValues("email").toArray(emails));
|
|
|
399 |
} else {
|
|
|
400 |
scheduledTasks.sendAgeingReport();
|
|
|
401 |
}
|
| 24682 |
amit.gupta |
402 |
System.exit(0);
|
|
|
403 |
}
|
| 24151 |
amit.gupta |
404 |
if (args.containsOption("3")) {
|
| 24603 |
amit.gupta |
405 |
if (args.getOptionNames().contains("offset")) {
|
| 24461 |
amit.gupta |
406 |
int offset = Integer.parseInt(args.getOptionValues("offset").get(0));
|
| 24603 |
amit.gupta |
407 |
if (args.getOptionNames().contains("days")) {
|
| 24461 |
amit.gupta |
408 |
int durationDays = Integer.parseInt(args.getOptionValues("days").get(0));
|
| 25586 |
amit.gupta |
409 |
scheduledTasks.processScheme(offset, durationDays, args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
410 |
} else {
|
| 25586 |
amit.gupta |
411 |
scheduledTasks.processScheme(offset, args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
412 |
}
|
| 24560 |
amit.gupta |
413 |
} else if (args.containsOption("catalogid")) {
|
| 24603 |
amit.gupta |
414 |
// scheduledTasks.processSchemeForModel(args.getOptionValues("catalogid").get(0));
|
| 24461 |
amit.gupta |
415 |
} else {
|
| 25586 |
amit.gupta |
416 |
scheduledTasks.processScheme(args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
417 |
}
|
| 24151 |
amit.gupta |
418 |
System.exit(0);
|
|
|
419 |
}
|
| 24238 |
amit.gupta |
420 |
if (args.containsOption("4")) {
|
| 24241 |
amit.gupta |
421 |
scheduledTasks.evaluateExcessSchemeOut();
|
| 24256 |
amit.gupta |
422 |
}
|
|
|
423 |
if (args.containsOption("5")) {
|
|
|
424 |
int offset = Integer.parseInt(args.getOptionValues("offset").get(0));
|
| 25586 |
amit.gupta |
425 |
scheduledTasks.processScheme(offset, args.containsOption("dryRun"));
|
| 24238 |
amit.gupta |
426 |
System.exit(0);
|
|
|
427 |
}
|
| 24603 |
amit.gupta |
428 |
if (args.containsOption("cancelOrder")) {
|
| 24265 |
amit.gupta |
429 |
List<String> invoiceNumbers = args.getOptionValues("invoiceNumber");
|
|
|
430 |
runOnceTasks.cancelOrder(invoiceNumbers);
|
|
|
431 |
}
|
| 24641 |
amit.gupta |
432 |
if (args.containsOption("migratePurchase")) {
|
|
|
433 |
runOnceTasks.migratePurchase();
|
|
|
434 |
}
|
| 24603 |
amit.gupta |
435 |
if (args.containsOption("migratepd")) {
|
| 24431 |
amit.gupta |
436 |
scheduledTasks.moveImeisToPriceDropImeis();
|
|
|
437 |
}
|
| 24603 |
amit.gupta |
438 |
if (args.containsOption("walletmismatch")) {
|
| 24542 |
amit.gupta |
439 |
scheduledTasks.walletmismatch();
|
|
|
440 |
}
|
| 24603 |
amit.gupta |
441 |
if (args.containsOption("schemewalletmismatch")) {
|
| 24580 |
amit.gupta |
442 |
scheduledTasks.schemewalletmismatch();
|
|
|
443 |
}
|
| 24603 |
amit.gupta |
444 |
if (args.containsOption("gst")) {
|
| 24542 |
amit.gupta |
445 |
scheduledTasks.gst();
|
|
|
446 |
}
|
| 26291 |
tejbeer |
447 |
if (args.containsOption("mailDashboardScreenshots")) {
|
| 25751 |
amit.gupta |
448 |
runOnceTasks.mailDashboardScreenshots();
|
|
|
449 |
}
|
| 26291 |
tejbeer |
450 |
if (args.containsOption("notifyLead")) {
|
| 25942 |
amit.gupta |
451 |
scheduledTasks.notifyLead();
|
| 25940 |
amit.gupta |
452 |
scheduledTasks.notifyVisits();
|
| 25927 |
amit.gupta |
453 |
}
|
| 26291 |
tejbeer |
454 |
if (args.containsOption("fixgrn")) {
|
| 26092 |
amit.gupta |
455 |
runOnceTasks.fixGrn();
|
|
|
456 |
}
|
| 26291 |
tejbeer |
457 |
if (args.containsOption("pbfix")) {
|
| 26033 |
amit.gupta |
458 |
runOnceTasks.pbfix();
|
|
|
459 |
}
|
| 26579 |
amit.gupta |
460 |
if (args.containsOption("mongom")) {
|
|
|
461 |
runOnceTasks.mongom();
|
|
|
462 |
}
|
| 26797 |
amit.gupta |
463 |
if (args.containsOption("processPd")) {
|
|
|
464 |
int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
|
|
|
465 |
runOnceTasks.processPd(priceDropId);
|
|
|
466 |
}
|
| 26291 |
tejbeer |
467 |
if (args.containsOption("samsung")) {
|
| 27392 |
amit.gupta |
468 |
if (args.containsOption("ym")) {
|
| 26408 |
amit.gupta |
469 |
int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
|
|
|
470 |
runOnceTasks.fetchImeiActivation(ym);
|
|
|
471 |
}
|
|
|
472 |
runOnceTasks.fetchImeiActivation(0);
|
| 26214 |
amit.gupta |
473 |
}
|
| 26291 |
tejbeer |
474 |
if (args.containsOption("fixdupimeigrn")) {
|
| 26265 |
amit.gupta |
475 |
runOnceTasks.fixDupGrns();
|
|
|
476 |
}
|
| 27392 |
amit.gupta |
477 |
if (args.containsOption("cancel")) {
|
| 26759 |
amit.gupta |
478 |
runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
|
|
|
479 |
}
|
| 27392 |
amit.gupta |
480 |
if (args.containsOption("fixScheme")) {
|
| 26929 |
amit.gupta |
481 |
runOnceTasks.fixScheme();
|
|
|
482 |
}
|
| 27392 |
amit.gupta |
483 |
if (args.containsOption("syncLeads")) {
|
| 27007 |
amit.gupta |
484 |
leadSyncRunner.syncLeads();
|
|
|
485 |
}
|
| 27392 |
amit.gupta |
486 |
if (args.containsOption("testCs")) {
|
| 27077 |
amit.gupta |
487 |
int category = Integer.parseInt(args.getOptionValues("category").get(0));
|
|
|
488 |
EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
|
|
|
489 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
490 |
csService.getAuthUserId(category, escalationType, fofoId);
|
|
|
491 |
}
|
| 27392 |
amit.gupta |
492 |
if (args.containsOption("duporder")) {
|
| 27279 |
amit.gupta |
493 |
runOnceTasks.removeDuplicateOrders();
|
|
|
494 |
}
|
| 27511 |
amit.gupta |
495 |
if (args.containsOption("createDummyInvoices")) {
|
|
|
496 |
runOnceTasks.createDummyInvoices();
|
|
|
497 |
}
|
| 27392 |
amit.gupta |
498 |
|
| 27450 |
tejbeer |
499 |
if (args.containsOption("createGeofence")) {
|
|
|
500 |
runOnceTasks.createGeofence();
|
|
|
501 |
}
|
|
|
502 |
if (args.containsOption("getAllGeofences")) {
|
|
|
503 |
runOnceTasks.getAllGeofences();
|
|
|
504 |
}
|
| 27562 |
amit.gupta |
505 |
if (args.containsOption("payMonthlyInvestment")) {
|
|
|
506 |
investmentRelatedTasks.payMonthlyInvestment();
|
|
|
507 |
}
|
| 28531 |
amit.gupta |
508 |
if (args.containsOption("evaluateActualInvestmentPayout")) {
|
|
|
509 |
investmentRelatedTasks.evaluateActualInvestmentPayout();
|
|
|
510 |
}
|
| 27457 |
tejbeer |
511 |
if (args.containsOption("deleteGeofences")) {
|
|
|
512 |
List<String> geofenceIds = args.getOptionValues("geofenceId");
|
|
|
513 |
runOnceTasks.deleteGeofences(geofenceIds);
|
|
|
514 |
}
|
| 27948 |
amit.gupta |
515 |
if (args.containsOption("createOffers")) {
|
| 28866 |
amit.gupta |
516 |
if (args.containsOption("fileName")) {
|
| 28865 |
amit.gupta |
517 |
String fileName = args.getOptionValues("fileName").get(0);
|
|
|
518 |
runOnceTasks.createOffers(fileName);
|
| 27948 |
amit.gupta |
519 |
}
|
|
|
520 |
}
|
| 28207 |
tejbeer |
521 |
if (args.containsOption("schemeout")) {
|
|
|
522 |
if (args.containsOption("invoices")) {
|
| 27892 |
amit.gupta |
523 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
524 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
525 |
scheduledTasks.processSchemeOut(invoices);
|
|
|
526 |
}
|
|
|
527 |
}
|
| 28207 |
tejbeer |
528 |
if (args.containsOption("schemein")) {
|
|
|
529 |
if (args.containsOption("invoices")) {
|
| 27987 |
amit.gupta |
530 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
531 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
532 |
scheduledTasks.processSchemeIn(invoices);
|
|
|
533 |
}
|
|
|
534 |
}
|
| 28207 |
tejbeer |
535 |
|
|
|
536 |
if (args.containsOption("fixScans")) {
|
| 28038 |
amit.gupta |
537 |
runOnceTasks.fixScans();
|
|
|
538 |
}
|
| 28921 |
tejbeer |
539 |
|
| 28622 |
amit.gupta |
540 |
if (args.containsOption("reverseMaa")) {
|
|
|
541 |
runOnceTasks.reverseMaa();
|
|
|
542 |
}
|
| 28921 |
tejbeer |
543 |
|
| 28558 |
amit.gupta |
544 |
if (args.containsOption("fixOffer")) {
|
|
|
545 |
runOnceTasks.fixOffer();
|
|
|
546 |
}
|
| 28921 |
tejbeer |
547 |
|
| 28661 |
amit.gupta |
548 |
if (args.containsOption("opporeno")) {
|
|
|
549 |
runOnceTasks.opporeno();
|
|
|
550 |
}
|
| 28921 |
tejbeer |
551 |
|
| 28675 |
amit.gupta |
552 |
if (args.containsOption("fixorders")) {
|
|
|
553 |
runOnceTasks.fixOrders();
|
|
|
554 |
}
|
| 28736 |
amit.gupta |
555 |
if (args.containsOption("fixreservations")) {
|
|
|
556 |
runOnceTasks.fixReservations();
|
|
|
557 |
}
|
| 28809 |
amit.gupta |
558 |
if (args.containsOption("addinvestment")) {
|
|
|
559 |
runOnceTasks.addInvestment();
|
|
|
560 |
}
|
| 28841 |
amit.gupta |
561 |
if (args.containsOption("brandregion")) {
|
|
|
562 |
runOnceTasks.brandRegion();
|
|
|
563 |
}
|
| 28972 |
amit.gupta |
564 |
if (args.containsOption("rollOutUpgardedMargins")) {
|
|
|
565 |
scheduledTasks.rollOutUpgardedMargins();
|
|
|
566 |
}
|
| 29251 |
amit.gupta |
567 |
if (args.containsOption("rollOutUpgardedMarginsNextMonth")) {
|
|
|
568 |
scheduledTasks.rollOutUpgardedMarginsNextMonth();
|
|
|
569 |
}
|
|
|
570 |
if (args.containsOption("checkCancellationMargin")) {
|
|
|
571 |
scheduledTasks.checkCancellationMargin();
|
|
|
572 |
}
|
| 29366 |
tejbeer |
573 |
if (args.containsOption("sendWelcomeEmail")) {
|
|
|
574 |
onBoardingRelatedSchelduleTask.sendWelcomeEmail();
|
| 29361 |
tejbeer |
575 |
}
|
| 29308 |
tejbeer |
576 |
|
| 24265 |
amit.gupta |
577 |
System.exit(0);
|
| 23898 |
amit.gupta |
578 |
}
|
| 29035 |
tejbeer |
579 |
|
| 23898 |
amit.gupta |
580 |
}
|
| 24603 |
amit.gupta |
581 |
|
| 24848 |
amit.gupta |
582 |
}
|