| 23755 |
amit.gupta |
1 |
package com.smartdukaan.cron;
|
| 23723 |
amit.gupta |
2 |
|
| 27746 |
amit.gupta |
3 |
import java.time.LocalDate;
|
| 27892 |
amit.gupta |
4 |
import java.util.Arrays;
|
| 24174 |
govind |
5 |
import java.util.List;
|
| 23906 |
amit.gupta |
6 |
import java.util.Properties;
|
|
|
7 |
|
| 23723 |
amit.gupta |
8 |
import org.apache.logging.log4j.LogManager;
|
|
|
9 |
import org.apache.logging.log4j.Logger;
|
| 23898 |
amit.gupta |
10 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
11 |
import org.springframework.boot.ApplicationArguments;
|
|
|
12 |
import org.springframework.boot.ApplicationRunner;
|
| 23723 |
amit.gupta |
13 |
import org.springframework.boot.WebApplicationType;
|
|
|
14 |
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
15 |
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
16 |
import org.springframework.cache.annotation.EnableCaching;
|
|
|
17 |
import org.springframework.context.annotation.Bean;
|
|
|
18 |
import org.springframework.context.annotation.ComponentScan;
|
| 23935 |
amit.gupta |
19 |
import org.springframework.context.annotation.Primary;
|
| 23723 |
amit.gupta |
20 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
|
21 |
import org.springframework.core.io.ClassPathResource;
|
| 23906 |
amit.gupta |
22 |
import org.springframework.mail.javamail.JavaMailSender;
|
|
|
23 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 23723 |
amit.gupta |
24 |
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
25 |
|
| 23898 |
amit.gupta |
26 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
| 27562 |
amit.gupta |
27 |
import com.smartdukaan.cron.scheduled.InvestmentRelatedTasks;
|
| 24827 |
amit.gupta |
28 |
import com.smartdukaan.cron.scheduled.Reconciliation;
|
| 25563 |
amit.gupta |
29 |
import com.smartdukaan.cron.scheduled.ScheduledSkeleton;
|
| 23929 |
amit.gupta |
30 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
| 27124 |
amit.gupta |
31 |
import com.smartdukaan.cron.scheduled.TicketRelatedScheduledTask;
|
| 27007 |
amit.gupta |
32 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 27077 |
amit.gupta |
33 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
|
|
34 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 23724 |
amit.gupta |
35 |
|
| 23723 |
amit.gupta |
36 |
@SpringBootApplication
|
|
|
37 |
@EnableCaching
|
|
|
38 |
@EnableScheduling
|
| 23755 |
amit.gupta |
39 |
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
|
| 24122 |
govind |
40 |
public class Application implements ApplicationRunner {
|
|
|
41 |
|
|
|
42 |
private static final Logger LOGGER = LogManager.getLogger(Application.class);
|
|
|
43 |
|
| 25563 |
amit.gupta |
44 |
@Autowired
|
| 27007 |
amit.gupta |
45 |
LeadSyncRunner leadSyncRunner;
|
| 27392 |
amit.gupta |
46 |
|
| 27007 |
amit.gupta |
47 |
@Autowired
|
| 25563 |
amit.gupta |
48 |
private ScheduledSkeleton scheduledSkeleton;
|
| 27392 |
amit.gupta |
49 |
|
| 27077 |
amit.gupta |
50 |
@Autowired
|
| 27124 |
amit.gupta |
51 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
| 27562 |
amit.gupta |
52 |
|
|
|
53 |
@Autowired
|
|
|
54 |
private InvestmentRelatedTasks investmentRelatedTasks;
|
| 27392 |
amit.gupta |
55 |
|
| 27124 |
amit.gupta |
56 |
@Autowired
|
| 27077 |
amit.gupta |
57 |
private CsService csService;
|
| 24603 |
amit.gupta |
58 |
|
| 23723 |
amit.gupta |
59 |
public static void main(String[] args) throws Throwable {
|
| 23738 |
amit.gupta |
60 |
new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args);
|
| 23723 |
amit.gupta |
61 |
}
|
| 24122 |
govind |
62 |
|
| 23723 |
amit.gupta |
63 |
@Bean
|
| 23738 |
amit.gupta |
64 |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
|
| 23755 |
amit.gupta |
65 |
LOGGER.info("Called Configuration");
|
| 24122 |
govind |
66 |
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
|
| 23723 |
amit.gupta |
67 |
propertySourcesPlaceholderConfigurer.setLocation(new ClassPathResource("/META-INF/env.properties"));
|
|
|
68 |
return propertySourcesPlaceholderConfigurer;
|
|
|
69 |
}
|
| 24122 |
govind |
70 |
|
|
|
71 |
@Bean(name = "mailSender")
|
| 23935 |
amit.gupta |
72 |
@Primary
|
| 24122 |
govind |
73 |
public JavaMailSender sendGridMailSender() {
|
|
|
74 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 23723 |
amit.gupta |
75 |
|
| 24122 |
govind |
76 |
// Using gmail
|
|
|
77 |
mailSender.setHost("smtp.sendgrid.net");
|
|
|
78 |
mailSender.setPort(587);
|
| 27630 |
amit.gupta |
79 |
mailSender.setUsername("apikey");
|
|
|
80 |
mailSender.setPassword("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");
|
| 24122 |
govind |
81 |
|
|
|
82 |
Properties javaMailProperties = new Properties();
|
|
|
83 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
|
|
84 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
85 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24603 |
amit.gupta |
86 |
// javaMailProperties.put("mail.debug", "true");// Prints out everything on
|
|
|
87 |
// screen
|
| 24122 |
govind |
88 |
|
|
|
89 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
90 |
return mailSender;
|
|
|
91 |
}
|
|
|
92 |
|
| 23935 |
amit.gupta |
93 |
@Bean
|
| 24122 |
govind |
94 |
public JavaMailSender googleMailSender() {
|
| 23935 |
amit.gupta |
95 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 24122 |
govind |
96 |
// Using gmail
|
| 23935 |
amit.gupta |
97 |
mailSender.setHost("smtp.gmail.com");
|
|
|
98 |
mailSender.setPort(587);
|
|
|
99 |
mailSender.setUsername("build@shop2020.in");
|
|
|
100 |
mailSender.setPassword("cafe@nes");
|
| 24122 |
govind |
101 |
|
| 23935 |
amit.gupta |
102 |
Properties javaMailProperties = new Properties();
|
|
|
103 |
javaMailProperties.put("mail.smtp.starttls.enable", "true");
|
|
|
104 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
105 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24122 |
govind |
106 |
javaMailProperties.put("mail.debug", "true");// Prints out everything on screen
|
| 23935 |
amit.gupta |
107 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
108 |
return mailSender;
|
|
|
109 |
}
|
|
|
110 |
|
| 24122 |
govind |
111 |
@Autowired
|
| 23898 |
amit.gupta |
112 |
private RunOnceTasks runOnceTasks;
|
| 24122 |
govind |
113 |
|
|
|
114 |
@Autowired
|
| 23929 |
amit.gupta |
115 |
private ScheduledTasks scheduledTasks;
|
| 24848 |
amit.gupta |
116 |
|
| 24827 |
amit.gupta |
117 |
@Autowired
|
|
|
118 |
private Reconciliation reconciliation;
|
| 24122 |
govind |
119 |
|
| 23898 |
amit.gupta |
120 |
@Override
|
|
|
121 |
public void run(ApplicationArguments args) throws Exception {
|
|
|
122 |
LOGGER.info("Called run method");
|
| 25694 |
amit.gupta |
123 |
if (args.containsOption("tc")) {
|
| 25842 |
amit.gupta |
124 |
System.out.println("Toffee service called");
|
| 27692 |
amit.gupta |
125 |
scheduledTasks.attachToffeeInvoices();
|
| 25694 |
amit.gupta |
126 |
System.exit(0);
|
|
|
127 |
}
|
| 27457 |
tejbeer |
128 |
/*
|
|
|
129 |
* if (args.containsOption("migratetax")) { System.out.println("migratetax");
|
|
|
130 |
* scheduledTasks.migrateTax(); System.exit(0); }
|
|
|
131 |
*/
|
| 27272 |
amit.gupta |
132 |
if (args.containsOption("rw")) {
|
|
|
133 |
System.out.println("Reverse wallet");
|
|
|
134 |
scheduledTasks.reverseWallet();
|
|
|
135 |
System.exit(0);
|
|
|
136 |
}
|
| 27720 |
amit.gupta |
137 |
if (args.containsOption("addHdfcPayment")) {
|
|
|
138 |
runOnceTasks.addPayment();
|
|
|
139 |
System.exit(0);
|
|
|
140 |
}
|
| 27431 |
amit.gupta |
141 |
if (args.containsOption("processSchemeOut")) {
|
|
|
142 |
System.out.println("Process schemeOut");
|
|
|
143 |
int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
|
|
|
144 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
145 |
runOnceTasks.processSchemeOut(fofoId, orderId);
|
|
|
146 |
System.exit(0);
|
|
|
147 |
}
|
| 27124 |
amit.gupta |
148 |
if (args.containsOption("at")) {
|
|
|
149 |
System.out.println("Toffee service called");
|
|
|
150 |
ticketRelatedScheduledTask.alertforTicket();
|
|
|
151 |
System.exit(0);
|
|
|
152 |
}
|
|
|
153 |
if (args.containsOption("et")) {
|
| 27392 |
amit.gupta |
154 |
ticketRelatedScheduledTask.escalateTicket();
|
|
|
155 |
;
|
| 27124 |
amit.gupta |
156 |
System.exit(0);
|
|
|
157 |
}
|
| 26291 |
tejbeer |
158 |
if (args.containsOption("sr")) {
|
| 25694 |
amit.gupta |
159 |
List<String> schemeIds = args.getOptionValues("schemeId");
|
| 25697 |
amit.gupta |
160 |
System.out.println(schemeIds);
|
| 25694 |
amit.gupta |
161 |
scheduledTasks.schemeRollback(schemeIds);
|
| 25695 |
amit.gupta |
162 |
System.exit(0);
|
| 25694 |
amit.gupta |
163 |
}
|
| 27437 |
amit.gupta |
164 |
if (args.containsOption("processActivation")) {
|
|
|
165 |
scheduledTasks.processActivation();
|
|
|
166 |
System.exit(0);
|
|
|
167 |
}
|
| 25503 |
amit.gupta |
168 |
if (args.containsOption("grouping")) {
|
|
|
169 |
scheduledTasks.grouping();
|
|
|
170 |
System.exit(0);
|
|
|
171 |
}
|
| 25530 |
amit.gupta |
172 |
if (args.containsOption("fixWallet")) {
|
|
|
173 |
runOnceTasks.fixWallet();
|
|
|
174 |
System.exit(0);
|
|
|
175 |
}
|
| 25312 |
amit.gupta |
176 |
if (args.containsOption("reconcileExpiredFixedSchemes")) {
|
| 25073 |
amit.gupta |
177 |
reconciliation.reconcileExpiredFixedSchemes();
|
|
|
178 |
System.exit(0);
|
|
|
179 |
}
|
| 27746 |
amit.gupta |
180 |
if (args.containsOption("dailyReconciliation")) {
|
|
|
181 |
if(args.containsOption("date")) {
|
|
|
182 |
LocalDate date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
183 |
reconciliation.dailyReconciliation(date);
|
|
|
184 |
} else {
|
|
|
185 |
reconciliation.dailyReconciliation(LocalDate.now().minusDays(1));
|
|
|
186 |
}
|
|
|
187 |
System.exit(0);
|
|
|
188 |
}
|
| 26291 |
tejbeer |
189 |
/*
|
|
|
190 |
* if (args.containsOption("test")) { schemeService.processSchemeIn(9243,
|
|
|
191 |
* 175138102); throw new Exception(); }
|
|
|
192 |
*/
|
| 25073 |
amit.gupta |
193 |
if (args.containsOption("fixSchemePayouts")) {
|
|
|
194 |
|
| 25029 |
amit.gupta |
195 |
runOnceTasks.fixSchemePayouts();
|
|
|
196 |
System.exit(0);
|
|
|
197 |
}
|
| 25312 |
amit.gupta |
198 |
if (args.containsOption("sendNotification")) {
|
| 25300 |
tejbeer |
199 |
scheduledTasks.sendNotification();
|
|
|
200 |
System.exit(0);
|
|
|
201 |
}
|
| 25721 |
tejbeer |
202 |
|
| 26291 |
tejbeer |
203 |
if (args.containsOption("ticketClosed")) {
|
|
|
204 |
scheduledTasks.ticketClosed();
|
|
|
205 |
System.exit(0);
|
|
|
206 |
}
|
|
|
207 |
|
| 25721 |
tejbeer |
208 |
if (args.containsOption("checkfocusedModelInPartnerStock")) {
|
|
|
209 |
scheduledTasks.checkfocusedModelInPartnerStock();
|
|
|
210 |
System.exit(0);
|
|
|
211 |
}
|
| 25022 |
amit.gupta |
212 |
if (args.containsOption("populateSchemes")) {
|
|
|
213 |
runOnceTasks.populateSchemes();
|
|
|
214 |
System.exit(0);
|
|
|
215 |
}
|
| 24855 |
amit.gupta |
216 |
if (args.containsOption("notify")) {
|
| 25073 |
amit.gupta |
217 |
if (args.containsOption("fofoId")) {
|
| 24988 |
tejbeer |
218 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoId").get(0));
|
| 25837 |
amit.gupta |
219 |
scheduledTasks.sendDailySalesNotificationToPartner(fofoId);
|
| 24988 |
tejbeer |
220 |
}
|
| 24855 |
amit.gupta |
221 |
System.exit(0);
|
|
|
222 |
}
|
| 24955 |
amit.gupta |
223 |
if (args.containsOption("findMismatchesInIndent")) {
|
|
|
224 |
runOnceTasks.findMismatchesInIndent();
|
|
|
225 |
System.exit(0);
|
|
|
226 |
}
|
| 27222 |
amit.gupta |
227 |
if (args.containsOption("ppl")) {
|
|
|
228 |
runOnceTasks.printPendingLeads();
|
|
|
229 |
System.exit(0);
|
|
|
230 |
}
|
| 24862 |
amit.gupta |
231 |
if (args.containsOption("notifyAll")) {
|
| 25837 |
amit.gupta |
232 |
scheduledTasks.sendDailySalesNotificationToPartner(null);
|
| 24862 |
amit.gupta |
233 |
System.exit(0);
|
|
|
234 |
}
|
| 25029 |
amit.gupta |
235 |
if (args.containsOption("OutSchemeReco")) {
|
| 25073 |
amit.gupta |
236 |
scheduledTasks.dryRunOutSchemeReco();
|
| 27252 |
amit.gupta |
237 |
// runOnceTasks.migrateChallansToInvoices();
|
|
|
238 |
// reconciliation.dailyReconciliation();
|
|
|
239 |
System.exit(0);
|
|
|
240 |
}
|
|
|
241 |
if (args.containsOption("dryRunSchemeReco")) {
|
|
|
242 |
scheduledTasks.dryRunSchemeReco();
|
|
|
243 |
// runOnceTasks.migrateChallansToInvoices();
|
|
|
244 |
// reconciliation.dailyReconciliation();
|
|
|
245 |
System.exit(0);
|
|
|
246 |
}
|
|
|
247 |
if (args.containsOption("OutReco1")) {
|
|
|
248 |
scheduledTasks.dryRunSchemeOutReco1();
|
|
|
249 |
System.exit(0);
|
|
|
250 |
}
|
|
|
251 |
if (args.containsOption("once")) {
|
| 24122 |
govind |
252 |
if (args.containsOption("1")) {
|
| 24603 |
amit.gupta |
253 |
if (args.containsOption("test")) {
|
| 24271 |
amit.gupta |
254 |
scheduledTasks.sendPartnerInvestmentDetails(args.getOptionValues("email"));
|
| 24272 |
amit.gupta |
255 |
} else {
|
| 27751 |
amit.gupta |
256 |
System.out.println("Called sendPartnerInvestmentDetails");
|
| 25563 |
amit.gupta |
257 |
scheduledSkeleton.sendPartnerInvestmentDetails();
|
| 24271 |
amit.gupta |
258 |
}
|
| 24122 |
govind |
259 |
System.exit(0);
|
|
|
260 |
}
|
| 24682 |
amit.gupta |
261 |
if (args.containsOption("2")) {
|
| 24696 |
amit.gupta |
262 |
if (args.containsOption("test")) {
|
| 24848 |
amit.gupta |
263 |
String[] emails = new String[args.getOptionValues("email").size()];
|
| 24696 |
amit.gupta |
264 |
scheduledTasks.sendAgeingReport(args.getOptionValues("email").toArray(emails));
|
|
|
265 |
} else {
|
|
|
266 |
scheduledTasks.sendAgeingReport();
|
|
|
267 |
}
|
| 24682 |
amit.gupta |
268 |
System.exit(0);
|
|
|
269 |
}
|
| 24151 |
amit.gupta |
270 |
if (args.containsOption("3")) {
|
| 24603 |
amit.gupta |
271 |
if (args.getOptionNames().contains("offset")) {
|
| 24461 |
amit.gupta |
272 |
int offset = Integer.parseInt(args.getOptionValues("offset").get(0));
|
| 24603 |
amit.gupta |
273 |
if (args.getOptionNames().contains("days")) {
|
| 24461 |
amit.gupta |
274 |
int durationDays = Integer.parseInt(args.getOptionValues("days").get(0));
|
| 25586 |
amit.gupta |
275 |
scheduledTasks.processScheme(offset, durationDays, args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
276 |
} else {
|
| 25586 |
amit.gupta |
277 |
scheduledTasks.processScheme(offset, args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
278 |
}
|
| 24560 |
amit.gupta |
279 |
} else if (args.containsOption("catalogid")) {
|
| 24603 |
amit.gupta |
280 |
// scheduledTasks.processSchemeForModel(args.getOptionValues("catalogid").get(0));
|
| 24461 |
amit.gupta |
281 |
} else {
|
| 25586 |
amit.gupta |
282 |
scheduledTasks.processScheme(args.containsOption("dryRun"));
|
| 24461 |
amit.gupta |
283 |
}
|
| 24151 |
amit.gupta |
284 |
System.exit(0);
|
|
|
285 |
}
|
| 24238 |
amit.gupta |
286 |
if (args.containsOption("4")) {
|
| 24241 |
amit.gupta |
287 |
scheduledTasks.evaluateExcessSchemeOut();
|
| 24256 |
amit.gupta |
288 |
}
|
|
|
289 |
if (args.containsOption("5")) {
|
|
|
290 |
int offset = Integer.parseInt(args.getOptionValues("offset").get(0));
|
| 25586 |
amit.gupta |
291 |
scheduledTasks.processScheme(offset, args.containsOption("dryRun"));
|
| 24238 |
amit.gupta |
292 |
System.exit(0);
|
|
|
293 |
}
|
| 24603 |
amit.gupta |
294 |
if (args.containsOption("cancelOrder")) {
|
| 24265 |
amit.gupta |
295 |
List<String> invoiceNumbers = args.getOptionValues("invoiceNumber");
|
|
|
296 |
runOnceTasks.cancelOrder(invoiceNumbers);
|
|
|
297 |
}
|
| 24641 |
amit.gupta |
298 |
if (args.containsOption("migratePurchase")) {
|
|
|
299 |
runOnceTasks.migratePurchase();
|
|
|
300 |
}
|
| 24603 |
amit.gupta |
301 |
if (args.containsOption("migratepd")) {
|
| 24431 |
amit.gupta |
302 |
scheduledTasks.moveImeisToPriceDropImeis();
|
|
|
303 |
}
|
| 24603 |
amit.gupta |
304 |
if (args.containsOption("walletmismatch")) {
|
| 24542 |
amit.gupta |
305 |
scheduledTasks.walletmismatch();
|
|
|
306 |
}
|
| 24603 |
amit.gupta |
307 |
if (args.containsOption("schemewalletmismatch")) {
|
| 24580 |
amit.gupta |
308 |
scheduledTasks.schemewalletmismatch();
|
|
|
309 |
}
|
| 24603 |
amit.gupta |
310 |
if (args.containsOption("gst")) {
|
| 24542 |
amit.gupta |
311 |
scheduledTasks.gst();
|
|
|
312 |
}
|
| 26291 |
tejbeer |
313 |
if (args.containsOption("mailDashboardScreenshots")) {
|
| 25751 |
amit.gupta |
314 |
runOnceTasks.mailDashboardScreenshots();
|
|
|
315 |
}
|
| 26291 |
tejbeer |
316 |
if (args.containsOption("notifyLead")) {
|
| 25942 |
amit.gupta |
317 |
scheduledTasks.notifyLead();
|
| 25940 |
amit.gupta |
318 |
scheduledTasks.notifyVisits();
|
| 25927 |
amit.gupta |
319 |
}
|
| 26291 |
tejbeer |
320 |
if (args.containsOption("fixgrn")) {
|
| 26092 |
amit.gupta |
321 |
runOnceTasks.fixGrn();
|
|
|
322 |
}
|
| 26291 |
tejbeer |
323 |
if (args.containsOption("pbfix")) {
|
| 26033 |
amit.gupta |
324 |
runOnceTasks.pbfix();
|
|
|
325 |
}
|
| 26579 |
amit.gupta |
326 |
if (args.containsOption("mongom")) {
|
|
|
327 |
runOnceTasks.mongom();
|
|
|
328 |
}
|
| 26797 |
amit.gupta |
329 |
if (args.containsOption("processPd")) {
|
|
|
330 |
int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
|
|
|
331 |
runOnceTasks.processPd(priceDropId);
|
|
|
332 |
}
|
| 26291 |
tejbeer |
333 |
if (args.containsOption("samsung")) {
|
| 27392 |
amit.gupta |
334 |
if (args.containsOption("ym")) {
|
| 26408 |
amit.gupta |
335 |
int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
|
|
|
336 |
runOnceTasks.fetchImeiActivation(ym);
|
|
|
337 |
}
|
|
|
338 |
runOnceTasks.fetchImeiActivation(0);
|
| 26214 |
amit.gupta |
339 |
}
|
| 26291 |
tejbeer |
340 |
if (args.containsOption("fixdupimeigrn")) {
|
| 26265 |
amit.gupta |
341 |
runOnceTasks.fixDupGrns();
|
|
|
342 |
}
|
| 27392 |
amit.gupta |
343 |
if (args.containsOption("cancel")) {
|
| 26759 |
amit.gupta |
344 |
runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
|
|
|
345 |
}
|
| 27392 |
amit.gupta |
346 |
if (args.containsOption("fixScheme")) {
|
| 26929 |
amit.gupta |
347 |
runOnceTasks.fixScheme();
|
|
|
348 |
}
|
| 27392 |
amit.gupta |
349 |
if (args.containsOption("syncLeads")) {
|
| 27007 |
amit.gupta |
350 |
leadSyncRunner.syncLeads();
|
|
|
351 |
}
|
| 27392 |
amit.gupta |
352 |
if (args.containsOption("testCs")) {
|
| 27077 |
amit.gupta |
353 |
int category = Integer.parseInt(args.getOptionValues("category").get(0));
|
|
|
354 |
EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
|
|
|
355 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
356 |
csService.getAuthUserId(category, escalationType, fofoId);
|
|
|
357 |
}
|
| 27392 |
amit.gupta |
358 |
if (args.containsOption("duporder")) {
|
| 27279 |
amit.gupta |
359 |
runOnceTasks.removeDuplicateOrders();
|
|
|
360 |
}
|
| 27511 |
amit.gupta |
361 |
if (args.containsOption("createDummyInvoices")) {
|
|
|
362 |
runOnceTasks.createDummyInvoices();
|
|
|
363 |
}
|
| 27392 |
amit.gupta |
364 |
|
| 27450 |
tejbeer |
365 |
if (args.containsOption("createGeofence")) {
|
|
|
366 |
runOnceTasks.createGeofence();
|
|
|
367 |
}
|
|
|
368 |
if (args.containsOption("getAllGeofences")) {
|
|
|
369 |
runOnceTasks.getAllGeofences();
|
|
|
370 |
}
|
| 27562 |
amit.gupta |
371 |
if (args.containsOption("payMonthlyInvestment")) {
|
|
|
372 |
investmentRelatedTasks.payMonthlyInvestment();
|
|
|
373 |
}
|
| 27457 |
tejbeer |
374 |
if (args.containsOption("deleteGeofences")) {
|
|
|
375 |
List<String> geofenceIds = args.getOptionValues("geofenceId");
|
|
|
376 |
runOnceTasks.deleteGeofences(geofenceIds);
|
|
|
377 |
}
|
| 27948 |
amit.gupta |
378 |
if (args.containsOption("createOffers")) {
|
|
|
379 |
if(args.containsOption("offerId")) {
|
|
|
380 |
int offerId = Integer.parseInt(args.getOptionValues("offerId").get(0));
|
|
|
381 |
runOnceTasks.createOffers(offerId);
|
|
|
382 |
}
|
|
|
383 |
}
|
| 27892 |
amit.gupta |
384 |
if(args.containsOption("schemeout")) {
|
|
|
385 |
if(args.containsOption("invoices")) {
|
|
|
386 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
387 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
388 |
scheduledTasks.processSchemeOut(invoices);
|
|
|
389 |
}
|
|
|
390 |
}
|
| 27987 |
amit.gupta |
391 |
if(args.containsOption("schemein")) {
|
|
|
392 |
if(args.containsOption("invoices")) {
|
|
|
393 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
394 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
395 |
scheduledTasks.processSchemeIn(invoices);
|
|
|
396 |
}
|
|
|
397 |
}
|
| 27746 |
amit.gupta |
398 |
/*
|
|
|
399 |
if (args.containsOption("reverseInvestmentSchemes")) {
|
|
|
400 |
runOnceTasks.reverseSchemes();
|
|
|
401 |
}*/
|
|
|
402 |
|
| 24265 |
amit.gupta |
403 |
System.exit(0);
|
| 23898 |
amit.gupta |
404 |
}
|
|
|
405 |
}
|
| 24603 |
amit.gupta |
406 |
|
| 24848 |
amit.gupta |
407 |
}
|