| 23755 |
amit.gupta |
1 |
package com.smartdukaan.cron;
|
| 23723 |
amit.gupta |
2 |
|
| 32782 |
raveendra. |
3 |
import com.smartdukaan.cron.migrations.RunOnceTasks;
|
|
|
4 |
import com.smartdukaan.cron.scheduled.*;
|
| 34945 |
ranu |
5 |
import com.smartdukaan.cron.scheduled.ambreports.AbmReportSender;
|
| 32782 |
raveendra. |
6 |
import com.smartdukaan.cron.scheduled.b2b.Listing;
|
|
|
7 |
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
|
| 32831 |
amit.gupta |
8 |
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
|
| 33274 |
amit.gupta |
9 |
import com.smartdukaan.cron.scheduled.purchaseorder.POScheduler;
|
| 34860 |
ranu |
10 |
import com.smartdukaan.cron.scheduled.razorpay.FetchPartnersDisbursementTask;
|
| 35165 |
amit |
11 |
import com.spice.profitmandi.common.model.InvoicePdfModel;
|
| 34443 |
vikas.jang |
12 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 35165 |
amit |
13 |
import com.spice.profitmandi.common.util.InvoiceFormatter;
|
| 32782 |
raveendra. |
14 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
|
|
15 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
|
|
16 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
|
|
17 |
import com.spice.profitmandi.dao.util.ContentPojoPopulator;
|
|
|
18 |
import com.spice.profitmandi.service.integrations.samsung.upgradeoffer.UpgradeOfferService;
|
| 35165 |
amit |
19 |
import com.spice.profitmandi.service.order.OrderService;
|
| 23723 |
amit.gupta |
20 |
import org.apache.logging.log4j.LogManager;
|
|
|
21 |
import org.apache.logging.log4j.Logger;
|
| 28389 |
amit.gupta |
22 |
import org.apache.velocity.app.VelocityEngine;
|
|
|
23 |
import org.apache.velocity.exception.VelocityException;
|
| 34860 |
ranu |
24 |
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
|
| 23898 |
amit.gupta |
25 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 35165 |
amit |
26 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| 23898 |
amit.gupta |
27 |
import org.springframework.boot.ApplicationArguments;
|
|
|
28 |
import org.springframework.boot.ApplicationRunner;
|
| 23723 |
amit.gupta |
29 |
import org.springframework.boot.WebApplicationType;
|
|
|
30 |
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
31 |
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
32 |
import org.springframework.context.annotation.Bean;
|
|
|
33 |
import org.springframework.context.annotation.ComponentScan;
|
| 34554 |
tejus.loha |
34 |
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
| 23935 |
amit.gupta |
35 |
import org.springframework.context.annotation.Primary;
|
| 23723 |
amit.gupta |
36 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
|
37 |
import org.springframework.core.io.ClassPathResource;
|
| 23906 |
amit.gupta |
38 |
import org.springframework.mail.javamail.JavaMailSender;
|
|
|
39 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 28389 |
amit.gupta |
40 |
import org.springframework.ui.velocity.VelocityEngineFactoryBean;
|
| 23723 |
amit.gupta |
41 |
|
| 32782 |
raveendra. |
42 |
import java.io.FileInputStream;
|
|
|
43 |
import java.io.IOException;
|
|
|
44 |
import java.time.LocalDate;
|
|
|
45 |
import java.time.YearMonth;
|
|
|
46 |
import java.util.ArrayList;
|
|
|
47 |
import java.util.Arrays;
|
|
|
48 |
import java.util.List;
|
|
|
49 |
import java.util.Properties;
|
|
|
50 |
import java.util.stream.Collectors;
|
| 23724 |
amit.gupta |
51 |
|
| 23723 |
amit.gupta |
52 |
@SpringBootApplication
|
| 34554 |
tejus.loha |
53 |
@EnableAspectJAutoProxy
|
| 23755 |
amit.gupta |
54 |
@ComponentScan("com.smartdukaan.cron.*, com.spice.profitmandi.common.*")
|
| 24122 |
govind |
55 |
public class Application implements ApplicationRunner {
|
|
|
56 |
|
| 31753 |
tejbeer |
57 |
private static final Logger LOGGER = LogManager.getLogger(Application.class);
|
| 24122 |
govind |
58 |
|
| 31753 |
tejbeer |
59 |
@Autowired
|
|
|
60 |
LeadSyncRunner leadSyncRunner;
|
| 30120 |
amit.gupta |
61 |
|
| 31753 |
tejbeer |
62 |
@Autowired
|
|
|
63 |
StandAlone standAlone;
|
| 30209 |
amit.gupta |
64 |
|
| 31753 |
tejbeer |
65 |
@Autowired
|
|
|
66 |
UpgradeOfferService upgradeOfferService;
|
| 27392 |
amit.gupta |
67 |
|
| 31753 |
tejbeer |
68 |
@Autowired
|
|
|
69 |
private TicketRelatedScheduledTask ticketRelatedScheduledTask;
|
| 28368 |
tejbeer |
70 |
|
| 31753 |
tejbeer |
71 |
@Autowired
|
|
|
72 |
private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
|
| 28921 |
tejbeer |
73 |
|
| 31753 |
tejbeer |
74 |
@Autowired
|
|
|
75 |
private InvestmentRelatedTasks investmentRelatedTasks;
|
| 27392 |
amit.gupta |
76 |
|
| 31753 |
tejbeer |
77 |
@Autowired
|
|
|
78 |
private CsService csService;
|
| 29814 |
tejbeer |
79 |
|
| 31753 |
tejbeer |
80 |
@Autowired
|
|
|
81 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
| 24603 |
amit.gupta |
82 |
|
| 31753 |
tejbeer |
83 |
@Autowired
|
|
|
84 |
private ContentPojoPopulator contentPojoPopulator;
|
| 29361 |
tejbeer |
85 |
|
| 31753 |
tejbeer |
86 |
@Autowired
|
|
|
87 |
private Listing listing;
|
| 24122 |
govind |
88 |
|
| 32831 |
amit.gupta |
89 |
@Autowired
|
|
|
90 |
OrderTrackingService orderTrackingService;
|
|
|
91 |
|
| 31753 |
tejbeer |
92 |
public static void main(String[] args) throws Throwable {
|
|
|
93 |
try {
|
| 34554 |
tejus.loha |
94 |
new SpringApplicationBuilder(Application.class).web(WebApplicationType.SERVLET).run(args);
|
| 31753 |
tejbeer |
95 |
} catch (Throwable t) {
|
|
|
96 |
t.printStackTrace();
|
|
|
97 |
}
|
|
|
98 |
}
|
| 28389 |
amit.gupta |
99 |
|
| 31753 |
tejbeer |
100 |
@Bean
|
|
|
101 |
public static PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
|
|
|
102 |
LOGGER.info("Called Configuration");
|
|
|
103 |
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
|
|
|
104 |
propertySourcesPlaceholderConfigurer.setLocation(new ClassPathResource("/META-INF/env.properties"));
|
|
|
105 |
return propertySourcesPlaceholderConfigurer;
|
|
|
106 |
}
|
| 28389 |
amit.gupta |
107 |
|
| 31753 |
tejbeer |
108 |
@Bean(name = "veloctyEngine")
|
|
|
109 |
public VelocityEngine velocityEngine() throws VelocityException, IOException {
|
|
|
110 |
VelocityEngineFactoryBean factory = new VelocityEngineFactoryBean();
|
| 28389 |
amit.gupta |
111 |
|
| 31753 |
tejbeer |
112 |
Properties velocityProperties = new Properties();
|
|
|
113 |
velocityProperties.put("resource.loader", "class");
|
|
|
114 |
velocityProperties.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
|
|
115 |
velocityProperties.put("file.resource.loader.cache", true);
|
|
|
116 |
velocityProperties.put("file.resource.loader.unicode", true);
|
|
|
117 |
velocityProperties.put("input.encoding", "UTF-8");
|
|
|
118 |
velocityProperties.put("output.encoding", "UTF-8");
|
|
|
119 |
velocityProperties.put("response.encoding", "UTF-8");
|
|
|
120 |
velocityProperties.put("overrideLogging", true);
|
| 28389 |
amit.gupta |
121 |
|
| 31753 |
tejbeer |
122 |
// velocityProperties.put("file.resource.loader.path", ".");
|
| 28389 |
amit.gupta |
123 |
|
| 31753 |
tejbeer |
124 |
factory.setVelocityProperties(velocityProperties);
|
| 28389 |
amit.gupta |
125 |
|
| 31753 |
tejbeer |
126 |
return factory.createVelocityEngine();
|
| 23723 |
amit.gupta |
127 |
|
| 31753 |
tejbeer |
128 |
}
|
| 24122 |
govind |
129 |
|
| 34668 |
amit.gupta |
130 |
@Bean(name = "mailSender")
|
| 31753 |
tejbeer |
131 |
@Primary
|
|
|
132 |
public JavaMailSender sendGridMailSender() {
|
|
|
133 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 24122 |
govind |
134 |
|
| 31753 |
tejbeer |
135 |
// Using gmail
|
|
|
136 |
mailSender.setHost("smtp.sendgrid.net");
|
|
|
137 |
mailSender.setPort(587);
|
|
|
138 |
mailSender.setUsername("apikey");
|
| 34668 |
amit.gupta |
139 |
mailSender.setPassword("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");
|
| 24122 |
govind |
140 |
|
| 31753 |
tejbeer |
141 |
Properties javaMailProperties = new Properties();
|
|
|
142 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
|
|
143 |
javaMailProperties.put("mail.smtp.auth", "true");
|
|
|
144 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| 24122 |
govind |
145 |
|
| 31753 |
tejbeer |
146 |
mailSender.setJavaMailProperties(javaMailProperties);
|
|
|
147 |
return mailSender;
|
| 34632 |
ranu |
148 |
}
|
| 23935 |
amit.gupta |
149 |
|
| 31753 |
tejbeer |
150 |
@Bean
|
|
|
151 |
public JavaMailSender googleMailSender() {
|
|
|
152 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| 34612 |
ranu |
153 |
mailSender.setHost("smtp.gmail.com");
|
|
|
154 |
mailSender.setPort(465);
|
|
|
155 |
mailSender.setUsername("sdtech@smartdukaan.com");
|
|
|
156 |
mailSender.setPassword("gpdschroalhhirox"); // App Password
|
|
|
157 |
|
|
|
158 |
Properties props = mailSender.getJavaMailProperties();
|
|
|
159 |
props.put("mail.smtp.auth", "true");
|
|
|
160 |
props.put("mail.smtp.ssl.enable", "true");
|
|
|
161 |
props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
|
|
|
162 |
props.put("mail.smtp.socketFactory.port", "465");
|
|
|
163 |
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
|
|
164 |
props.put("mail.debug", "true");
|
|
|
165 |
|
|
|
166 |
return mailSender;
|
|
|
167 |
}
|
|
|
168 |
|
| 31753 |
tejbeer |
169 |
@Autowired
|
|
|
170 |
private RunOnceTasks runOnceTasks;
|
| 24122 |
govind |
171 |
|
| 31753 |
tejbeer |
172 |
@Autowired
|
|
|
173 |
private ScheduledTasks scheduledTasks;
|
| 30335 |
amit.gupta |
174 |
|
| 31753 |
tejbeer |
175 |
@Autowired
|
| 34306 |
ranu |
176 |
private ScheduledTasksTest scheduledTasksTest;
|
|
|
177 |
|
|
|
178 |
@Autowired
|
| 34860 |
ranu |
179 |
private FetchPartnersDisbursementTask fetchPartnersDisbursementTask;
|
|
|
180 |
|
|
|
181 |
@Autowired
|
| 31753 |
tejbeer |
182 |
private Reconciliation reconciliation;
|
| 30309 |
amit.gupta |
183 |
|
| 31753 |
tejbeer |
184 |
@Autowired
|
| 35250 |
amit |
185 |
private Migrations migrations;
|
|
|
186 |
|
|
|
187 |
@Autowired
|
| 31753 |
tejbeer |
188 |
CaptchaService captchaService;
|
| 28921 |
tejbeer |
189 |
|
| 33274 |
amit.gupta |
190 |
@Autowired
|
|
|
191 |
POScheduler poScheduler;
|
| 32878 |
amit.gupta |
192 |
|
| 33274 |
amit.gupta |
193 |
|
| 31753 |
tejbeer |
194 |
@Override
|
|
|
195 |
public void run(ApplicationArguments args) throws Exception {
|
| 32008 |
amit.gupta |
196 |
//scheduledTasks.test();
|
|
|
197 |
//System.exit();
|
| 31753 |
tejbeer |
198 |
LOGGER.info("Called run method");
|
| 33260 |
amit.gupta |
199 |
if (args.containsOption("removePartialBillingForTransaction")) {
|
|
|
200 |
if (args.containsOption("trId")) {
|
| 33051 |
amit.gupta |
201 |
int transactionId = Integer.parseInt(args.getOptionValues("trId").get(0));
|
| 33054 |
amit.gupta |
202 |
scheduledTasks.removePartialBillingForTransaction(transactionId);
|
| 33051 |
amit.gupta |
203 |
}
|
|
|
204 |
System.exit(0);
|
|
|
205 |
}
|
| 34523 |
ranu |
206 |
if (args.containsOption("createOpeningStockPartyWise")) {
|
|
|
207 |
scheduledTasks.createOpeningStockPartyWise();
|
|
|
208 |
System.exit(0);
|
|
|
209 |
}
|
| 31753 |
tejbeer |
210 |
if (args.containsOption("tc")) {
|
|
|
211 |
System.out.println("Toffee service called");
|
|
|
212 |
scheduledTasks.toffeeRollback();
|
|
|
213 |
System.exit(0);
|
|
|
214 |
}
|
|
|
215 |
if (args.containsOption("bag")) {
|
|
|
216 |
System.out.println("Bag service called");
|
|
|
217 |
runOnceTasks.testBag();
|
|
|
218 |
System.exit(0);
|
|
|
219 |
}
|
| 29814 |
tejbeer |
220 |
|
| 31753 |
tejbeer |
221 |
if (args.containsOption("rw")) {
|
|
|
222 |
System.out.println("Reverse wallet");
|
|
|
223 |
scheduledTasks.reverseWallet();
|
|
|
224 |
System.exit(0);
|
|
|
225 |
}
|
|
|
226 |
if (args.containsOption("sendIndentTertiary")) {
|
|
|
227 |
System.out.println("sendIndentTertiary");
|
|
|
228 |
scheduledTasks.sendIndentTertiary();
|
|
|
229 |
System.exit(0);
|
|
|
230 |
}
|
|
|
231 |
if (args.containsOption("checkPartnerActiveStore")) {
|
|
|
232 |
System.out.println("checkPartnerActiveStore");
|
|
|
233 |
scheduledTasks.checkPartnerActiveStore();
|
|
|
234 |
System.exit(0);
|
|
|
235 |
}
|
| 29800 |
manish |
236 |
|
| 31753 |
tejbeer |
237 |
if (args.containsOption("selectFinServiceFollowUpDateByCurrDate")) {
|
|
|
238 |
System.out.println("selectfinServiceFollowUpDateByCurrDate");
|
| 28368 |
tejbeer |
239 |
|
| 31753 |
tejbeer |
240 |
scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
|
|
|
241 |
System.exit(0);
|
|
|
242 |
}
|
| 25073 |
amit.gupta |
243 |
|
| 31753 |
tejbeer |
244 |
if (args.containsOption("addHdfcPayment")) {
|
|
|
245 |
runOnceTasks.addPayment();
|
|
|
246 |
System.exit(0);
|
|
|
247 |
}
|
| 35250 |
amit |
248 |
if (args.containsOption("migrateOriginalInventoryItemId")) {
|
|
|
249 |
int batchSize = 10_000;
|
|
|
250 |
if (args.containsOption("batchSize")) {
|
|
|
251 |
try {
|
|
|
252 |
batchSize = Integer.parseInt(args.getOptionValues("batchSize").get(0));
|
|
|
253 |
} catch (Exception e) {
|
|
|
254 |
LOGGER.warn("Invalid batchSize provided, defaulting to {}", batchSize);
|
|
|
255 |
}
|
|
|
256 |
}
|
|
|
257 |
LOGGER.info("Starting migration for warehouse.inventoryItem.originalInventoryItemId with batchSize={}", batchSize);
|
|
|
258 |
migrations.migrateWarehouseOriginalInventoryItemId(batchSize);
|
|
|
259 |
LOGGER.info("Migration completed.");
|
|
|
260 |
System.exit(0);
|
|
|
261 |
}
|
| 31753 |
tejbeer |
262 |
if (args.containsOption("processSchemeOut")) {
|
|
|
263 |
System.out.println("Process schemeOut");
|
|
|
264 |
int orderId = Integer.parseInt(args.getOptionValues("orderid").get(0));
|
|
|
265 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
266 |
runOnceTasks.processSchemeOut(fofoId, orderId);
|
|
|
267 |
System.exit(0);
|
|
|
268 |
}
|
|
|
269 |
if (args.containsOption("at")) {
|
|
|
270 |
System.out.println("Toffee service called");
|
|
|
271 |
ticketRelatedScheduledTask.alertforTicket();
|
|
|
272 |
System.exit(0);
|
|
|
273 |
}
|
|
|
274 |
if (args.containsOption("et")) {
|
|
|
275 |
ticketRelatedScheduledTask.escalateTicket();
|
|
|
276 |
;
|
|
|
277 |
System.exit(0);
|
|
|
278 |
}
|
|
|
279 |
if (args.containsOption("sr")) {
|
|
|
280 |
List<String> schemeIds = args.getOptionValues("schemeId");
|
|
|
281 |
System.out.println(schemeIds);
|
|
|
282 |
scheduledTasks.schemeRollback(schemeIds);
|
|
|
283 |
System.exit(0);
|
|
|
284 |
}
|
|
|
285 |
if (args.containsOption("processActivation")) {
|
|
|
286 |
scheduledTasks.processActivation();
|
|
|
287 |
System.exit(0);
|
|
|
288 |
}
|
|
|
289 |
if (args.containsOption("sendAttendanceMorningAlert")) {
|
|
|
290 |
scheduledTasks.sendAttendanceMorningAlert();
|
|
|
291 |
System.exit(0);
|
|
|
292 |
}
|
|
|
293 |
if (args.containsOption("sendAttendanceEveningAlert")) {
|
|
|
294 |
scheduledTasks.sendAttendanceEveningAlert();
|
|
|
295 |
System.exit(0);
|
|
|
296 |
}
|
| 25721 |
tejbeer |
297 |
|
| 31753 |
tejbeer |
298 |
if (args.containsOption("checkRazorPayPaymentStatus")) {
|
|
|
299 |
scheduledTasks.checkRazorPayPaymentStatus();
|
|
|
300 |
System.exit(0);
|
|
|
301 |
}
|
|
|
302 |
if (args.containsOption("grouping")) {
|
|
|
303 |
scheduledTasks.grouping();
|
|
|
304 |
System.exit(0);
|
|
|
305 |
}
|
|
|
306 |
if (args.containsOption("fixWallet")) {
|
|
|
307 |
runOnceTasks.fixWallet();
|
|
|
308 |
System.exit(0);
|
|
|
309 |
}
|
|
|
310 |
if (args.containsOption("reconcileExpiredFixedSchemes")) {
|
|
|
311 |
reconciliation.reconcileExpiredFixedSchemes();
|
|
|
312 |
System.exit(0);
|
|
|
313 |
}
|
|
|
314 |
if (args.containsOption("dailyReconciliation")) {
|
|
|
315 |
if (args.containsOption("date")) {
|
|
|
316 |
LocalDate date = LocalDate.parse(args.getOptionValues("date").get(0));
|
|
|
317 |
reconciliation.dailyReconciliation(date);
|
|
|
318 |
} else {
|
|
|
319 |
reconciliation.dailyReconciliation(LocalDate.now().minusDays(1));
|
|
|
320 |
}
|
|
|
321 |
System.exit(0);
|
|
|
322 |
}
|
|
|
323 |
/*
|
|
|
324 |
* if (args.containsOption("test")) { schemeService.processSchemeIn(9243,
|
|
|
325 |
* 175138102); throw new Exception(); }
|
|
|
326 |
*/
|
| 28921 |
tejbeer |
327 |
|
| 31753 |
tejbeer |
328 |
if (args.containsOption("sendNotification")) {
|
|
|
329 |
scheduledTasks.sendNotification();
|
|
|
330 |
System.exit(0);
|
|
|
331 |
}
|
| 26291 |
tejbeer |
332 |
|
| 31753 |
tejbeer |
333 |
if (args.containsOption("ticketClosed")) {
|
|
|
334 |
scheduledTasks.ticketClosed();
|
|
|
335 |
System.exit(0);
|
|
|
336 |
}
|
| 28207 |
tejbeer |
337 |
|
| 31753 |
tejbeer |
338 |
if (args.containsOption("getVendorWarehouses")) {
|
|
|
339 |
int warehouseId = Integer.parseInt(args.getOptionValues("warehouseId").get(0));
|
|
|
340 |
scheduledTasks.getVendorWarehouses(warehouseId);
|
|
|
341 |
System.exit(0);
|
|
|
342 |
}
|
| 29776 |
tejbeer |
343 |
|
| 31753 |
tejbeer |
344 |
if (args.containsOption("checkfocusedModelInPartnerStock")) {
|
| 34344 |
amit.gupta |
345 |
try {
|
|
|
346 |
scheduledTasks.checkfocusedModelInPartnerStock();
|
|
|
347 |
} finally {
|
|
|
348 |
System.exit(0);
|
|
|
349 |
}
|
| 31753 |
tejbeer |
350 |
}
|
| 29451 |
manish |
351 |
|
| 31753 |
tejbeer |
352 |
if (args.containsOption("checkImeiActivation")) {
|
|
|
353 |
scheduledTasks.checkImeiActivation();
|
|
|
354 |
System.exit(0);
|
|
|
355 |
}
|
| 29776 |
tejbeer |
356 |
|
| 31753 |
tejbeer |
357 |
if (args.containsOption("checkTecnoImeiActivation")) {
|
| 29776 |
tejbeer |
358 |
|
| 31753 |
tejbeer |
359 |
LocalDate dateTechno = LocalDate.now();
|
| 29532 |
manish |
360 |
|
| 31753 |
tejbeer |
361 |
int days = 25;
|
|
|
362 |
if (args.containsOption("days")) {
|
|
|
363 |
days = Integer.parseInt(args.getOptionValues("days").get(0));
|
|
|
364 |
}
|
|
|
365 |
scheduledTasks.checkTecnoImeiActivation(dateTechno, days);
|
|
|
366 |
System.exit(0);
|
|
|
367 |
}
|
| 28921 |
tejbeer |
368 |
|
| 31753 |
tejbeer |
369 |
if (args.containsOption("checkItelImeiActivation")) {
|
|
|
370 |
LocalDate dateItel = LocalDate.now();
|
|
|
371 |
int days = 25;
|
|
|
372 |
if (args.containsOption("days")) {
|
|
|
373 |
days = Integer.parseInt(args.getOptionValues("days").get(0));
|
|
|
374 |
}
|
|
|
375 |
scheduledTasks.checkItelImeiActivation(dateItel, days);
|
|
|
376 |
System.exit(0);
|
|
|
377 |
}
|
| 28921 |
tejbeer |
378 |
|
| 31753 |
tejbeer |
379 |
if (args.containsOption("partnerProblemAlert")) {
|
|
|
380 |
scheduledTasks.partnerProblemAlert();
|
|
|
381 |
System.exit(0);
|
|
|
382 |
}
|
|
|
383 |
if (args.containsOption("notify")) {
|
|
|
384 |
if (args.containsOption("fofoId")) {
|
|
|
385 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoId").get(0));
|
|
|
386 |
scheduledTasks.sendDailySalesNotificationToPartner(fofoId);
|
|
|
387 |
}
|
|
|
388 |
System.exit(0);
|
|
|
389 |
}
|
|
|
390 |
if (args.containsOption("findMismatchesInIndent")) {
|
|
|
391 |
runOnceTasks.findMismatchesInIndent();
|
|
|
392 |
System.exit(0);
|
|
|
393 |
}
|
| 29035 |
tejbeer |
394 |
|
| 31753 |
tejbeer |
395 |
if (args.containsOption("onboardingEventDelays")) {
|
|
|
396 |
onBoardingRelatedSchelduleTask.onboardingEventDelays();
|
|
|
397 |
System.exit(0);
|
|
|
398 |
}
|
| 28982 |
tejbeer |
399 |
|
| 31753 |
tejbeer |
400 |
if (args.containsOption("onBoardingCompleteEventEmail")) {
|
|
|
401 |
onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
|
|
|
402 |
System.exit(0);
|
|
|
403 |
}
|
| 28921 |
tejbeer |
404 |
|
| 31753 |
tejbeer |
405 |
if (args.containsOption("onBoardingDocumentsPending")) {
|
|
|
406 |
onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
|
|
|
407 |
System.exit(0);
|
|
|
408 |
}
|
|
|
409 |
if (args.containsOption("onBoardingMigration")) {
|
|
|
410 |
onBoardingRelatedSchelduleTask.onBoardingMigration();
|
|
|
411 |
System.exit(0);
|
|
|
412 |
}
|
| 28921 |
tejbeer |
413 |
|
| 33859 |
tejus.loha |
414 |
// if (args.containsOption("advancePaymentPendingAlert")) {
|
|
|
415 |
// onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
|
|
|
416 |
// System.exit(0);
|
|
|
417 |
// }
|
| 28963 |
tejbeer |
418 |
|
| 31753 |
tejbeer |
419 |
if (args.containsOption("fullPaymentPendingAlert")) {
|
|
|
420 |
onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
|
|
|
421 |
System.exit(0);
|
|
|
422 |
}
|
| 29308 |
tejbeer |
423 |
|
| 33859 |
tejus.loha |
424 |
// if (args.containsOption("advancePaymentPendinglegalAlert")) {
|
|
|
425 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
426 |
// System.exit(0);
|
|
|
427 |
// }
|
| 31117 |
tejbeer |
428 |
|
| 31753 |
tejbeer |
429 |
if (args.containsOption("markDelhiveryOrderDelivered")) {
|
| 32831 |
amit.gupta |
430 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
431 |
System.exit(0);
|
|
|
432 |
}
|
| 32831 |
amit.gupta |
433 |
|
| 31753 |
tejbeer |
434 |
if (args.containsOption("markBlueDartOrderDelivered")) {
|
| 32794 |
raveendra. |
435 |
System.out.println("Marking BlueDart Order Delivered...");
|
| 32831 |
amit.gupta |
436 |
orderTrackingService.markBlueDartOrderDelivered();
|
| 31753 |
tejbeer |
437 |
System.exit(0);
|
|
|
438 |
}
|
|
|
439 |
if (args.containsOption("mergingdata")) {
|
|
|
440 |
onBoardingRelatedSchelduleTask.mergingdata();
|
|
|
441 |
System.exit(0);
|
|
|
442 |
}
|
|
|
443 |
if (args.containsOption("brandingAlert")) {
|
|
|
444 |
onBoardingRelatedSchelduleTask.brandingAlert();
|
|
|
445 |
System.exit(0);
|
|
|
446 |
}
|
| 31089 |
amit.gupta |
447 |
|
| 33859 |
tejus.loha |
448 |
// if (args.containsOption("storeTimelinePromoterPending")) {
|
|
|
449 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
450 |
// System.exit(0);
|
|
|
451 |
// }
|
| 31249 |
tejbeer |
452 |
|
| 31753 |
tejbeer |
453 |
if (args.containsOption("ppl")) {
|
|
|
454 |
runOnceTasks.printPendingLeads();
|
|
|
455 |
System.exit(0);
|
|
|
456 |
}
|
| 31249 |
tejbeer |
457 |
|
| 31753 |
tejbeer |
458 |
if (args.containsOption("notifyAll")) {
|
|
|
459 |
scheduledTasks.sendDailySalesNotificationToPartner(null);
|
|
|
460 |
System.exit(0);
|
|
|
461 |
}
|
| 31249 |
tejbeer |
462 |
|
| 31753 |
tejbeer |
463 |
if (args.containsOption("monthlyTargetForInternalTeam")) {
|
|
|
464 |
scheduledTasks.monthlyTargetForInternalTeam();
|
|
|
465 |
System.exit(0);
|
|
|
466 |
}
|
| 31249 |
tejbeer |
467 |
|
| 31753 |
tejbeer |
468 |
if (args.containsOption("monthlyTargetForPartner")) {
|
|
|
469 |
scheduledTasks.monthlyTargetForPartner();
|
|
|
470 |
System.exit(0);
|
|
|
471 |
}
|
| 33444 |
ranu |
472 |
if (args.containsOption("findAllLiveDemoBrandItemsByBillingDate")) {
|
|
|
473 |
scheduledTasks.findAllLiveDemoBrandItemsByBillingDate();
|
|
|
474 |
System.exit(0);
|
|
|
475 |
}
|
| 33464 |
ranu |
476 |
if (args.containsOption("findTodayPocoBillingItems")) {
|
|
|
477 |
scheduledTasks.findTodayPocoBillingItems();
|
|
|
478 |
System.exit(0);
|
|
|
479 |
}
|
| 28921 |
tejbeer |
480 |
|
| 31753 |
tejbeer |
481 |
if (args.containsOption("hygineAlertForPartner")) {
|
|
|
482 |
scheduledTasks.hygineAlertForPartner();
|
|
|
483 |
System.exit(0);
|
|
|
484 |
}
|
| 28921 |
tejbeer |
485 |
|
| 31753 |
tejbeer |
486 |
if (args.containsOption("hygineAlertForInternalTeam")) {
|
|
|
487 |
scheduledTasks.hygineAlertForInternalTeam();
|
|
|
488 |
System.exit(0);
|
|
|
489 |
}
|
|
|
490 |
|
| 32214 |
jai.hind |
491 |
if (args.containsOption("checkItelImeiActivationNew")) {
|
|
|
492 |
scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 15);
|
|
|
493 |
System.exit(0);
|
|
|
494 |
}
|
| 31753 |
tejbeer |
495 |
if (args.containsOption("once")) {
|
| 33274 |
amit.gupta |
496 |
|
|
|
497 |
if (args.containsOption("autoClosePurchaseOrders")) {
|
|
|
498 |
poScheduler.autoClosePurchaseOrders();
|
|
|
499 |
}
|
| 31753 |
tejbeer |
500 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
501 |
if (args.containsOption("invoiceNumber")) {
|
|
|
502 |
String oneAssistInvoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
503 |
runOnceTasks.cancelOnceAssist(oneAssistInvoiceNumber);
|
|
|
504 |
}
|
|
|
505 |
|
|
|
506 |
}
|
| 34208 |
ranu |
507 |
if (args.containsOption("cancelOnceAssist")) {
|
|
|
508 |
if (args.containsOption("MemberShipNumber")) {
|
|
|
509 |
String applicationNo = args.getOptionValues("applicationNo").get(0);
|
|
|
510 |
String membershipId = args.getOptionValues("membershipId").get(0);
|
|
|
511 |
runOnceTasks.cancelOnceAssistByMemberShipNumber(applicationNo, membershipId);
|
|
|
512 |
}
|
|
|
513 |
|
|
|
514 |
}
|
| 33260 |
amit.gupta |
515 |
if (args.containsOption("changeFulfillmentWarehouse")) {
|
|
|
516 |
if (args.containsOption("orderId") && args.containsOption("whId")) {
|
|
|
517 |
int orderId = Integer.parseInt(args.getOptionValues("orderId").get(0));
|
|
|
518 |
int itemId = Integer.parseInt(args.getOptionValues("whId").get(0));
|
|
|
519 |
runOnceTasks.changeFulfillmentWarehouse(orderId, itemId);
|
|
|
520 |
}
|
|
|
521 |
System.exit(0);
|
|
|
522 |
}
|
| 31753 |
tejbeer |
523 |
if (args.containsOption("1")) {
|
|
|
524 |
if (args.containsOption("test")) {
|
| 31618 |
amit.gupta |
525 |
//scheduledTasks.sendPartnerInvestmentDetails(args.getOptionValues("email"));
|
| 31753 |
tejbeer |
526 |
System.out.println("Calling test method");
|
| 32482 |
amit.gupta |
527 |
scheduledTasks.test();
|
| 35165 |
amit |
528 |
System.exit(0);
|
| 32083 |
tejbeer |
529 |
|
|
|
530 |
if (args.containsOption("migrateVendorItemPricing")) {
|
|
|
531 |
scheduledTasks.migrateVendorItemPricing();
|
|
|
532 |
System.exit(0);
|
|
|
533 |
}
|
|
|
534 |
|
|
|
535 |
if (args.containsOption("approveVendorCatalogPricing")) {
|
|
|
536 |
scheduledTasks.approveVendorCatalogPricing();
|
|
|
537 |
System.exit(0);
|
|
|
538 |
}
|
| 32080 |
tejbeer |
539 |
} else if (args.containsOption("test1")) {
|
| 32008 |
amit.gupta |
540 |
scheduledTasks.test1();
|
| 34845 |
ranu |
541 |
} else if (args.containsOption("scheduleTaskTest1")) {
|
|
|
542 |
|
|
|
543 |
scheduledTasksTest.test();
|
|
|
544 |
}else if (args.containsOption("generateBiReport")) {
|
|
|
545 |
scheduledTasksTest.generateBiReport();
|
| 34945 |
ranu |
546 |
}else if (args.containsOption("abmSendertest")) {
|
| 34946 |
ranu |
547 |
runOnceTasks.setAbmReportSender();
|
| 34321 |
ranu |
548 |
}
|
| 34860 |
ranu |
549 |
else if (args.containsOption("fetchPartnerDisburseMentTask")) {
|
|
|
550 |
if(args.containsOption("fetchDisbursements")){
|
|
|
551 |
fetchPartnersDisbursementTask.fetchDisbursementsTest();
|
|
|
552 |
}
|
|
|
553 |
else if(args.containsOption("creditAmountTest")){
|
|
|
554 |
fetchPartnersDisbursementTask.creditAmountTest();
|
|
|
555 |
}
|
|
|
556 |
else if(args.containsOption("createContactsAndFundsForFranchiseeTest")){
|
|
|
557 |
fetchPartnersDisbursementTask.createContactsAndFundsForFranchiseeTest();
|
|
|
558 |
}
|
|
|
559 |
else if(args.containsOption("rabbitTransactionProducertest")){
|
|
|
560 |
fetchPartnersDisbursementTask.rabbitTransactionProducertest();
|
|
|
561 |
}
|
| 34879 |
ranu |
562 |
else if(args.containsOption("sendingDisbursementMail")){
|
|
|
563 |
fetchPartnersDisbursementTask.sendingDisbursementMail();
|
|
|
564 |
}
|
| 34860 |
ranu |
565 |
else {
|
|
|
566 |
fetchPartnersDisbursementTask.test();
|
|
|
567 |
}
|
|
|
568 |
}
|
| 34845 |
ranu |
569 |
else if (args.containsOption("testNew1")) {
|
| 34307 |
ranu |
570 |
List<String> loanIdArgs = args.getOptionValues("loanIds"); // ["34833,36536,37151"]
|
|
|
571 |
List<Integer> loanIds = new ArrayList<>();
|
|
|
572 |
|
|
|
573 |
if (loanIdArgs != null && !loanIdArgs.isEmpty()) {
|
|
|
574 |
String csv = loanIdArgs.get(0);
|
|
|
575 |
loanIds = Arrays.stream(csv.split(","))
|
|
|
576 |
.map(String::trim)
|
|
|
577 |
.map(Integer::parseInt)
|
|
|
578 |
.collect(Collectors.toList());
|
|
|
579 |
}
|
| 34321 |
ranu |
580 |
scheduledTasksTest.findLoanTransactionMapingAccordingLoan(loanIds);
|
| 34309 |
ranu |
581 |
} else if (args.containsOption("testNew2")) {
|
| 34308 |
ranu |
582 |
if (args.containsOption("createLoan")) {
|
|
|
583 |
// Extract each parameter
|
|
|
584 |
int transactionId = 0;
|
|
|
585 |
double invoiceAmount = 0.0;
|
|
|
586 |
String invoiceNumber = "";
|
|
|
587 |
|
|
|
588 |
if (args.containsOption("transactionId")) {
|
|
|
589 |
transactionId = Integer.parseInt(args.getOptionValues("transactionId").get(0));
|
|
|
590 |
}
|
|
|
591 |
|
|
|
592 |
if (args.containsOption("invoiceAmount")) {
|
|
|
593 |
invoiceAmount = Double.parseDouble(args.getOptionValues("invoiceAmount").get(0));
|
|
|
594 |
}
|
|
|
595 |
|
|
|
596 |
if (args.containsOption("invoiceNumber")) {
|
|
|
597 |
invoiceNumber = args.getOptionValues("invoiceNumber").get(0);
|
|
|
598 |
}
|
|
|
599 |
|
|
|
600 |
// Call your method
|
|
|
601 |
scheduledTasksTest.createLoanForBillingByTransactionIdAndInvoiceNumber(transactionId, invoiceAmount, invoiceNumber);
|
|
|
602 |
}
|
|
|
603 |
|
| 32482 |
amit.gupta |
604 |
} else {
|
| 31753 |
tejbeer |
605 |
System.out.println("Called sendPartnerInvestmentDetails");
|
|
|
606 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
607 |
}
|
|
|
608 |
System.exit(0);
|
|
|
609 |
}
|
|
|
610 |
if (args.containsOption("2")) {
|
|
|
611 |
if (args.containsOption("test")) {
|
|
|
612 |
String[] emails = new String[args.getOptionValues("email").size()];
|
|
|
613 |
scheduledTasks.sendAgeingReport(args.getOptionValues("email").toArray(emails));
|
|
|
614 |
} else {
|
|
|
615 |
scheduledTasks.sendAgeingReport();
|
|
|
616 |
}
|
|
|
617 |
System.exit(0);
|
|
|
618 |
}
|
| 33457 |
amit.gupta |
619 |
|
| 31753 |
tejbeer |
620 |
if (args.containsOption("cancelOrder")) {
|
|
|
621 |
List<String> invoiceNumbers = args.getOptionValues("invoiceNumber");
|
|
|
622 |
runOnceTasks.cancelOrder(invoiceNumbers);
|
|
|
623 |
}
|
|
|
624 |
if (args.containsOption("migratePurchase")) {
|
|
|
625 |
runOnceTasks.migratePurchase();
|
|
|
626 |
}
|
|
|
627 |
if (args.containsOption("migratepd")) {
|
|
|
628 |
scheduledTasks.moveImeisToPriceDropImeis();
|
|
|
629 |
}
|
|
|
630 |
if (args.containsOption("walletmismatch")) {
|
|
|
631 |
scheduledTasks.walletmismatch();
|
|
|
632 |
}
|
|
|
633 |
if (args.containsOption("schemewalletmismatch")) {
|
|
|
634 |
scheduledTasks.schemewalletmismatch();
|
|
|
635 |
}
|
|
|
636 |
if (args.containsOption("gst")) {
|
|
|
637 |
scheduledTasks.gst();
|
|
|
638 |
}
|
|
|
639 |
if (args.containsOption("mailDashboardScreenshots")) {
|
|
|
640 |
runOnceTasks.mailDashboardScreenshots();
|
|
|
641 |
}
|
|
|
642 |
if (args.containsOption("notifyLead")) {
|
|
|
643 |
scheduledTasks.notifyLead();
|
|
|
644 |
scheduledTasks.notifyVisits();
|
|
|
645 |
}
|
|
|
646 |
if (args.containsOption("fixgrn")) {
|
|
|
647 |
runOnceTasks.fixGrn();
|
|
|
648 |
}
|
|
|
649 |
if (args.containsOption("pbfix")) {
|
|
|
650 |
runOnceTasks.pbfix();
|
|
|
651 |
}
|
|
|
652 |
if (args.containsOption("mongom")) {
|
|
|
653 |
runOnceTasks.mongom();
|
|
|
654 |
}
|
|
|
655 |
if (args.containsOption("processPd")) {
|
|
|
656 |
int priceDropId = Integer.parseInt(args.getOptionValues("processPd").get(0));
|
|
|
657 |
runOnceTasks.processPd(priceDropId);
|
|
|
658 |
}
|
|
|
659 |
if (args.containsOption("samsung")) {
|
|
|
660 |
if (args.containsOption("ym")) {
|
|
|
661 |
int ym = Integer.parseInt(args.getOptionValues("ym").get(0));
|
|
|
662 |
runOnceTasks.fetchImeiActivation(ym);
|
|
|
663 |
}
|
|
|
664 |
runOnceTasks.fetchImeiActivation(0);
|
|
|
665 |
}
|
|
|
666 |
if (args.containsOption("fixdupimeigrn")) {
|
|
|
667 |
runOnceTasks.fixDupGrns();
|
|
|
668 |
}
|
|
|
669 |
if (args.containsOption("cancel")) {
|
|
|
670 |
runOnceTasks.cancelDn(args.getOptionValues("dn").get(0));
|
|
|
671 |
}
|
|
|
672 |
if (args.containsOption("fixScheme")) {
|
|
|
673 |
runOnceTasks.fixScheme();
|
|
|
674 |
}
|
|
|
675 |
if (args.containsOption("syncLeads")) {
|
|
|
676 |
leadSyncRunner.syncLeads();
|
|
|
677 |
}
|
|
|
678 |
if (args.containsOption("testCs")) {
|
|
|
679 |
int category = Integer.parseInt(args.getOptionValues("category").get(0));
|
|
|
680 |
EscalationType escalationType = EscalationType.valueOf(args.getOptionValues("escalation").get(0));
|
|
|
681 |
int fofoId = Integer.parseInt(args.getOptionValues("fofoid").get(0));
|
|
|
682 |
csService.getAuthUserId(category, escalationType, fofoId);
|
|
|
683 |
}
|
|
|
684 |
if (args.containsOption("duporder")) {
|
|
|
685 |
runOnceTasks.removeDuplicateOrders();
|
|
|
686 |
}
|
|
|
687 |
if (args.containsOption("createDummyInvoices")) {
|
|
|
688 |
runOnceTasks.createDummyInvoices();
|
|
|
689 |
}
|
| 28921 |
tejbeer |
690 |
|
| 31753 |
tejbeer |
691 |
if (args.containsOption("createGeofence")) {
|
|
|
692 |
runOnceTasks.createGeofence();
|
|
|
693 |
}
|
|
|
694 |
if (args.containsOption("getAllGeofences")) {
|
|
|
695 |
runOnceTasks.getAllGeofences();
|
|
|
696 |
}
|
|
|
697 |
if (args.containsOption("payMonthlyInvestment")) {
|
|
|
698 |
investmentRelatedTasks.payMonthlyInvestment();
|
|
|
699 |
}
|
|
|
700 |
if (args.containsOption("evaluateActualInvestmentPayout")) {
|
|
|
701 |
investmentRelatedTasks.evaluateActualInvestmentPayout();
|
|
|
702 |
}
|
|
|
703 |
if (args.containsOption("deleteGeofences")) {
|
|
|
704 |
List<String> geofenceIds = args.getOptionValues("geofenceId");
|
|
|
705 |
runOnceTasks.deleteGeofences(geofenceIds);
|
|
|
706 |
}
|
|
|
707 |
if (args.containsOption("createOffers")) {
|
|
|
708 |
if (args.containsOption("fileName")) {
|
|
|
709 |
String fileName = args.getOptionValues("fileName").get(0);
|
|
|
710 |
FileInputStream stream = new FileInputStream(fileName);
|
|
|
711 |
runOnceTasks.createOffers(stream);
|
|
|
712 |
}
|
|
|
713 |
}
|
|
|
714 |
if (args.containsOption("schemeout")) {
|
|
|
715 |
if (args.containsOption("invoices")) {
|
|
|
716 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
717 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
718 |
scheduledTasks.processSchemeOut(invoices);
|
|
|
719 |
}
|
|
|
720 |
}
|
|
|
721 |
if (args.containsOption("schemein")) {
|
|
|
722 |
if (args.containsOption("invoices")) {
|
|
|
723 |
String invoicesString = args.getOptionValues("invoices").get(0);
|
|
|
724 |
List<String> invoices = Arrays.asList(invoicesString.split(","));
|
|
|
725 |
scheduledTasks.processSchemeIn(invoices);
|
|
|
726 |
}
|
|
|
727 |
}
|
| 28921 |
tejbeer |
728 |
|
| 31753 |
tejbeer |
729 |
if (args.containsOption("fixScans")) {
|
|
|
730 |
runOnceTasks.fixScans();
|
|
|
731 |
}
|
|
|
732 |
if (args.containsOption("fixPrebookingOrderGrn")) {
|
|
|
733 |
runOnceTasks.genericCreateCurrentInventorySnapshot();
|
|
|
734 |
}
|
|
|
735 |
if (args.containsOption("fixOurSerialized")) {
|
|
|
736 |
if (args.containsOption("orderIds")) {
|
|
|
737 |
String orderIdsString = args.getOptionValues("orderIds").get(0);
|
|
|
738 |
List<Integer> orderIds = Arrays.asList(orderIdsString.split(",")).stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
739 |
// runOnceTasks.fixOurSerialized(orderIds);
|
|
|
740 |
}
|
|
|
741 |
}
|
| 29776 |
tejbeer |
742 |
|
| 31753 |
tejbeer |
743 |
if (args.containsOption("reverseMaa")) {
|
|
|
744 |
runOnceTasks.reverseMaa();
|
|
|
745 |
}
|
| 29776 |
tejbeer |
746 |
|
| 31753 |
tejbeer |
747 |
if (args.containsOption("fixOffer")) {
|
|
|
748 |
runOnceTasks.fixOffer();
|
|
|
749 |
}
|
| 29794 |
tejbeer |
750 |
|
| 31753 |
tejbeer |
751 |
if (args.containsOption("opporeno")) {
|
|
|
752 |
runOnceTasks.opporeno();
|
|
|
753 |
}
|
| 30309 |
amit.gupta |
754 |
|
| 31753 |
tejbeer |
755 |
if (args.containsOption("fixorders")) {
|
|
|
756 |
runOnceTasks.fixOrders();
|
|
|
757 |
}
|
|
|
758 |
if (args.containsOption("fixreservations")) {
|
|
|
759 |
runOnceTasks.fixReservations();
|
|
|
760 |
}
|
|
|
761 |
if (args.containsOption("addinvestment")) {
|
|
|
762 |
runOnceTasks.addInvestment();
|
|
|
763 |
}
|
|
|
764 |
if (args.containsOption("brandregion")) {
|
|
|
765 |
runOnceTasks.brandRegion();
|
|
|
766 |
}
|
|
|
767 |
if (args.containsOption("rollOutUpgardedMargins")) {
|
|
|
768 |
scheduledTasks.rollOutUpgardedMargins();
|
|
|
769 |
}
|
| 34029 |
ranu |
770 |
if (args.containsOption("pushRbmTargets")) {
|
|
|
771 |
scheduledTasks.persistRbmTodayTargets();
|
|
|
772 |
}
|
| 31753 |
tejbeer |
773 |
if (args.containsOption("rollOutUpgardedMarginsNextMonth")) {
|
|
|
774 |
scheduledTasks.rollOutUpgardedMarginsNextMonth();
|
|
|
775 |
}
|
|
|
776 |
if (args.containsOption("checkCancellationMargin")) {
|
|
|
777 |
scheduledTasks.checkCancellationMargin();
|
|
|
778 |
}
|
|
|
779 |
if (args.containsOption("reviewUncontactablePartner")) {
|
|
|
780 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
781 |
}
|
| 33078 |
ranu |
782 |
if (args.containsOption("reviewNonSdBuyingBrand")) {
|
|
|
783 |
scheduledTasks.reviewNonSdBuyingBrand();
|
|
|
784 |
}
|
| 31753 |
tejbeer |
785 |
if (args.containsOption("sendWelcomeEmail")) {
|
|
|
786 |
onBoardingRelatedSchelduleTask.sendWelcomeEmail();
|
|
|
787 |
}
|
| 29814 |
tejbeer |
788 |
|
| 31753 |
tejbeer |
789 |
if (args.containsOption("partnerOnboardingLegalMigration")) {
|
|
|
790 |
onBoardingRelatedSchelduleTask.partnerOnboardingLegalMigration();
|
|
|
791 |
}
|
| 31031 |
amit.gupta |
792 |
|
| 33526 |
amit.gupta |
793 |
if(args.containsOption("moveOrders")) {
|
|
|
794 |
runOnceTasks.moveOrders();
|
|
|
795 |
}
|
|
|
796 |
|
| 31753 |
tejbeer |
797 |
if (args.containsOption("addKycLegalMigration")) {
|
|
|
798 |
onBoardingRelatedSchelduleTask.addKycLegalMigration();
|
|
|
799 |
}
|
| 29776 |
tejbeer |
800 |
|
|
|
801 |
|
| 31753 |
tejbeer |
802 |
if (args.containsOption("pushDataToSolr")) {
|
|
|
803 |
listing.pushDataToSolr();
|
|
|
804 |
}
|
| 30120 |
amit.gupta |
805 |
|
| 31753 |
tejbeer |
806 |
if (args.containsOption("testGstPro")) {
|
|
|
807 |
System.out.println("TestGstProc called");
|
|
|
808 |
try {
|
|
|
809 |
runOnceTasks.updateIrnsToInvoices();
|
|
|
810 |
} catch (Exception e) {
|
|
|
811 |
e.printStackTrace();
|
|
|
812 |
}
|
|
|
813 |
}
|
| 29308 |
tejbeer |
814 |
|
| 31753 |
tejbeer |
815 |
if (args.containsOption("reverseSchemeCancelInvoice")) {
|
|
|
816 |
if (args.containsOption("invoice")) {
|
|
|
817 |
String invoice = args.getOptionValues("invoice").get(0);
|
|
|
818 |
runOnceTasks.reverseSchemes(invoice);
|
|
|
819 |
}
|
|
|
820 |
}
|
| 29863 |
tejbeer |
821 |
|
| 31753 |
tejbeer |
822 |
if (args.containsOption("reverseInvalidActivation")) {
|
|
|
823 |
if (args.containsOption("inventoryids")) {
|
|
|
824 |
String inventoryItemIdsString = args.getOptionValues("inventoryids").get(0);
|
|
|
825 |
List<Integer> inventoryItemIds = new ArrayList<>();
|
|
|
826 |
for (String inventoryItemIdString : inventoryItemIdsString.split(",")) {
|
|
|
827 |
int inventoryItemId = Integer.parseInt(inventoryItemIdString.trim());
|
|
|
828 |
inventoryItemIds.add(inventoryItemId);
|
|
|
829 |
}
|
|
|
830 |
runOnceTasks.reverseInvalidActivation(inventoryItemIds);
|
|
|
831 |
}
|
|
|
832 |
}
|
| 29863 |
tejbeer |
833 |
|
| 31753 |
tejbeer |
834 |
if (args.containsOption("runme")) {
|
|
|
835 |
runOnceTasks.runMe();
|
|
|
836 |
}
|
|
|
837 |
if (args.containsOption("" + "")) {
|
|
|
838 |
upgradeOfferService.authenticateUser();
|
|
|
839 |
}
|
|
|
840 |
if (args.containsOption("mandiiUser")) {
|
|
|
841 |
runOnceTasks.mandiiUser(args.getOptionValues("firstName").get(0), args.getOptionValues("lastName").get(0), args.getOptionValues("pan").get(0), args.getOptionValues("dob").get(0), args.getOptionValues("aadhaar").get(0), args.getOptionValues("gender").get(0), args.getOptionValues("father").get(0));
|
|
|
842 |
}
|
| 30335 |
amit.gupta |
843 |
|
| 31753 |
tejbeer |
844 |
if (args.containsOption("mandiiUsers")) {
|
|
|
845 |
if (args.containsOption("pan")) {
|
|
|
846 |
runOnceTasks.mandiiUsers(args.getOptionValues("pan").get(0));
|
|
|
847 |
} else {
|
|
|
848 |
runOnceTasks.mandiiUsers();
|
|
|
849 |
}
|
|
|
850 |
}
|
| 30576 |
amit.gupta |
851 |
|
| 31753 |
tejbeer |
852 |
if (args.containsOption("checkOppoImeiStatus")) {
|
|
|
853 |
try {
|
|
|
854 |
standAlone.checkOppoImeiStatus();
|
|
|
855 |
} catch (Exception e) {
|
|
|
856 |
e.printStackTrace();
|
|
|
857 |
}
|
|
|
858 |
}
|
| 30616 |
amit.gupta |
859 |
|
| 34417 |
amit.gupta |
860 |
if (args.containsOption("checkRealmeImeiStatus")) {
|
|
|
861 |
try {
|
|
|
862 |
standAlone.checkRealmeImeiStatus();
|
|
|
863 |
} catch (Exception e) {
|
|
|
864 |
e.printStackTrace();
|
|
|
865 |
}
|
|
|
866 |
}
|
|
|
867 |
|
| 31753 |
tejbeer |
868 |
/*
|
|
|
869 |
* if (args.containsOption("checkRealmeImeiStatus")) { try {
|
|
|
870 |
* standAlone.checkRealmeImeiStatus(); } catch (Exception e) {
|
|
|
871 |
* e.printStackTrace(); } }
|
|
|
872 |
*/
|
| 30616 |
amit.gupta |
873 |
|
| 31753 |
tejbeer |
874 |
if (args.containsOption("amazonPurchase")) {
|
|
|
875 |
try {
|
|
|
876 |
runOnceTasks.amazonPurchase();
|
|
|
877 |
} catch (Exception e) {
|
|
|
878 |
e.printStackTrace();
|
|
|
879 |
}
|
|
|
880 |
}
|
| 30641 |
amit.gupta |
881 |
|
| 31753 |
tejbeer |
882 |
if (args.containsOption("getCaptchaCode")) {
|
|
|
883 |
try {
|
|
|
884 |
captchaService.getCaptchaCode("/home/amit/Desktop/generatingCodes.jpg");
|
|
|
885 |
} catch (Exception e) {
|
|
|
886 |
e.printStackTrace();
|
|
|
887 |
}
|
|
|
888 |
}
|
| 30641 |
amit.gupta |
889 |
|
| 31753 |
tejbeer |
890 |
if (args.containsOption("testIrnLive")) {
|
|
|
891 |
try {
|
|
|
892 |
runOnceTasks.testIrnLive(args.getOptionValues("invoiceNumber").get(0));
|
|
|
893 |
} catch (Exception e) {
|
|
|
894 |
e.printStackTrace();
|
|
|
895 |
}
|
|
|
896 |
}
|
| 30659 |
amit.gupta |
897 |
|
| 31753 |
tejbeer |
898 |
if (args.containsOption("createoffercriteria")) {
|
|
|
899 |
try {
|
|
|
900 |
runOnceTasks.createOfferCriteria();
|
|
|
901 |
} catch (Exception e) {
|
|
|
902 |
e.printStackTrace();
|
|
|
903 |
}
|
|
|
904 |
}
|
| 30659 |
amit.gupta |
905 |
|
| 31753 |
tejbeer |
906 |
if (args.containsOption("fix-price-drops")) {
|
|
|
907 |
runOnceTasks.fixPriceDrop();
|
|
|
908 |
}
|
| 29035 |
tejbeer |
909 |
|
| 31753 |
tejbeer |
910 |
if (args.containsOption("processSchemeByIds")) {
|
|
|
911 |
List<String> schemeIds = Arrays.asList(args.getOptionValues("ids").get(0).split(","));
|
|
|
912 |
List<Integer> schemeIdsInt = schemeIds.stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
|
|
|
913 |
runOnceTasks.processSchemeByIds(schemeIdsInt);
|
|
|
914 |
}
|
| 30859 |
tejbeer |
915 |
|
| 31753 |
tejbeer |
916 |
if (args.containsOption("updateSaholicCISTable")) {
|
|
|
917 |
runOnceTasks.updateSaholicCISTable();
|
|
|
918 |
}
|
| 30859 |
tejbeer |
919 |
|
| 31753 |
tejbeer |
920 |
if (args.containsOption("mapbag")) {
|
|
|
921 |
runOnceTasks.mapBag();
|
|
|
922 |
}
|
| 30859 |
tejbeer |
923 |
|
| 34579 |
vikas.jang |
924 |
if (args.containsOption("todayBidPO")) {
|
| 34443 |
vikas.jang |
925 |
runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
|
|
|
926 |
}
|
|
|
927 |
|
| 34579 |
vikas.jang |
928 |
if (args.containsOption("yesterdayBidPO")) {
|
|
|
929 |
runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.YESTERDAY);
|
|
|
930 |
}
|
|
|
931 |
|
| 34547 |
vikas.jang |
932 |
if (args.containsOption("biddingConsolidatedMessage")) {
|
|
|
933 |
runOnceTasks.consolidatedBiddingMessage();
|
|
|
934 |
}
|
|
|
935 |
|
|
|
936 |
if (args.containsOption("sendMailWhatsAppAfterLoanDueDate")) {
|
|
|
937 |
scheduledTasks.sendMailWhatsAppAfterLoanDueDate();
|
|
|
938 |
}
|
|
|
939 |
|
| 34836 |
vikas |
940 |
if (args.containsOption("yesterdayTrackingReport")) {
|
|
|
941 |
runOnceTasks.yesterdayTrackingReport();
|
| 34770 |
vikas.jang |
942 |
}
|
|
|
943 |
|
| 31753 |
tejbeer |
944 |
System.exit(0);
|
|
|
945 |
}
|
| 30859 |
tejbeer |
946 |
|
| 31753 |
tejbeer |
947 |
if (args.containsOption("calculateInterestAccured")) {
|
| 30929 |
tejbeer |
948 |
|
| 31753 |
tejbeer |
949 |
scheduledTasks.calculateInterestAccured();
|
|
|
950 |
System.exit(0);
|
|
|
951 |
}
|
| 30929 |
tejbeer |
952 |
|
| 31753 |
tejbeer |
953 |
if (args.containsOption("loanSettlement")) {
|
| 30890 |
amit.gupta |
954 |
|
| 31753 |
tejbeer |
955 |
scheduledTasks.loanSettlement();
|
|
|
956 |
System.exit(0);
|
|
|
957 |
}
|
| 30896 |
amit.gupta |
958 |
|
| 31753 |
tejbeer |
959 |
if (args.containsOption("dailyLoanAlert")) {
|
| 30936 |
tejbeer |
960 |
|
| 31753 |
tejbeer |
961 |
scheduledTasks.dailyLoanAlert();
|
|
|
962 |
System.exit(0);
|
|
|
963 |
}
|
| 30982 |
tejbeer |
964 |
|
| 31753 |
tejbeer |
965 |
if (args.containsOption("updatePartnerLimit")) {
|
|
|
966 |
scheduledTasks.updatePartnerLimit();
|
|
|
967 |
System.exit(0);
|
|
|
968 |
}
|
| 30982 |
tejbeer |
969 |
|
| 31753 |
tejbeer |
970 |
if (args.containsOption("notifyDefaultLoans")) {
|
|
|
971 |
scheduledTasks.notifyDefaultLoans();
|
|
|
972 |
System.exit(0);
|
|
|
973 |
}
|
| 31446 |
amit.gupta |
974 |
|
| 31753 |
tejbeer |
975 |
if (args.containsOption("fixinsurance")) {
|
|
|
976 |
runOnceTasks.addMissingWalletDebitsForInsurance();
|
|
|
977 |
System.exit(0);
|
|
|
978 |
}
|
| 31604 |
tejbeer |
979 |
|
| 31753 |
tejbeer |
980 |
if (args.containsOption("processActivatedImeisForSchemes")) {
|
|
|
981 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
982 |
System.exit(0);
|
|
|
983 |
}
|
| 31604 |
tejbeer |
984 |
|
| 31753 |
tejbeer |
985 |
if (args.containsOption("notifyLoanDueDateCross")) {
|
|
|
986 |
scheduledTasks.notifyLoanDueDateCross();
|
|
|
987 |
System.exit(0);
|
|
|
988 |
}
|
| 34275 |
tejus.loha |
989 |
if (args.containsOption("sendTenOrMoreOrderStockReport")) {
|
|
|
990 |
scheduledTasks.send10OrMoreOlderStockReport();
|
|
|
991 |
System.exit(0);
|
|
|
992 |
}
|
| 31604 |
tejbeer |
993 |
|
| 31753 |
tejbeer |
994 |
if (args.containsOption("alertForDueDate")) {
|
|
|
995 |
scheduledTasks.alertForDueDate();
|
|
|
996 |
System.exit(0);
|
|
|
997 |
}
|
| 31648 |
tejbeer |
998 |
|
| 31753 |
tejbeer |
999 |
if (args.containsOption("userMobileNumberOptIn")) {
|
|
|
1000 |
scheduledTasks.userMobileNumberOptIn();
|
|
|
1001 |
System.exit(0);
|
|
|
1002 |
}
|
|
|
1003 |
|
|
|
1004 |
if (args.containsOption("fetchParnterStats")) {
|
|
|
1005 |
scheduledTasks.fetchParnterStats();
|
|
|
1006 |
System.exit(0);
|
|
|
1007 |
}
|
|
|
1008 |
|
|
|
1009 |
if (args.containsOption("authUserMobileNumberOptIn")) {
|
|
|
1010 |
scheduledTasks.authUserMobileNumberOptIn();
|
|
|
1011 |
System.exit(0);
|
|
|
1012 |
}
|
|
|
1013 |
if (args.containsOption("morning")) {
|
|
|
1014 |
if (args.containsOption("0")) {
|
|
|
1015 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
1016 |
}
|
|
|
1017 |
if (args.containsOption("1")) {
|
|
|
1018 |
scheduledTasks.sendIndentTertiary();
|
|
|
1019 |
}
|
|
|
1020 |
// 0
|
|
|
1021 |
if (args.containsOption("2")) {
|
|
|
1022 |
scheduledTasks.calculateInterestAccured();
|
|
|
1023 |
}
|
|
|
1024 |
System.out.println("scheduledTasks.calculateInterestAccured()");
|
|
|
1025 |
// 0
|
|
|
1026 |
if (args.containsOption("3")) {
|
| 32831 |
amit.gupta |
1027 |
orderTrackingService.markDelhiveryOrderDelivered();
|
| 31753 |
tejbeer |
1028 |
}
|
|
|
1029 |
System.out.println("scheduledTasks.markDelhiveryOrderDelivered()");
|
|
|
1030 |
// 1
|
|
|
1031 |
if (args.containsOption("4")) {
|
|
|
1032 |
scheduledTasks.processActivatedImeisForSchemes();
|
|
|
1033 |
}
|
|
|
1034 |
System.out.println("scheduledTasks.processActivatedImeisForSchemes()");
|
|
|
1035 |
// 2
|
|
|
1036 |
if (args.containsOption("5")) {
|
|
|
1037 |
scheduledTasks.processActivation();
|
|
|
1038 |
}
|
|
|
1039 |
System.out.println("scheduledTasks.processActivation()");
|
|
|
1040 |
// 4
|
|
|
1041 |
if (args.containsOption("6")) {
|
|
|
1042 |
scheduledTasks.processPriceDrop();
|
|
|
1043 |
}
|
|
|
1044 |
System.out.println("scheduledTasks.processPriceDrop()");
|
|
|
1045 |
// 5
|
|
|
1046 |
if (args.containsOption("7")) {
|
|
|
1047 |
scheduledTasks.loanSettlement();
|
|
|
1048 |
}
|
|
|
1049 |
System.out.println("scheduledTasks.loanSettlement()");
|
|
|
1050 |
// 8
|
|
|
1051 |
if (args.containsOption("8")) {
|
|
|
1052 |
scheduledTasks.reviewUncontactablePartner();
|
|
|
1053 |
}
|
|
|
1054 |
// 9
|
| 33859 |
tejus.loha |
1055 |
// if (args.containsOption("9")) {
|
|
|
1056 |
// onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
|
|
|
1057 |
// }
|
|
|
1058 |
// // 9
|
|
|
1059 |
// if (args.containsOption("10")) {
|
|
|
1060 |
// onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
|
|
|
1061 |
// }
|
| 31753 |
tejbeer |
1062 |
// sendPartnerInvestment
|
|
|
1063 |
if (args.containsOption("11")) {
|
|
|
1064 |
scheduledTasks.sendPartnerInvestmentDetails();
|
|
|
1065 |
}
|
|
|
1066 |
if (args.containsOption("sendCreditNote")) {
|
| 34029 |
ranu |
1067 |
YearMonth yearMonth = YearMonth.now().minusMonths(1);
|
| 31753 |
tejbeer |
1068 |
/*
|
|
|
1069 |
* if
|
|
|
1070 |
* (localDateTime.toLocalDate().equals(yearMonth.atEndOfMonth().getDayOfMonth())
|
|
|
1071 |
* && Arrays.asList(20,21,22,23).contains(localDateTime.getHour())) {
|
|
|
1072 |
* scheduledTasks.sendCreditNote(yearMonth); }
|
|
|
1073 |
*/
|
|
|
1074 |
scheduledTasks.sendCreditNote(yearMonth);
|
|
|
1075 |
}
|
|
|
1076 |
System.exit(0);
|
|
|
1077 |
}
|
|
|
1078 |
}
|
| 24848 |
amit.gupta |
1079 |
}
|