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