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