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