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