Subversion Repositories SmartDukaan

Rev

Rev 30882 | Rev 30884 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23756 amit.gupta 1
package com.smartdukaan.cron.scheduled;
2
 
30049 amit.gupta 3
import com.smartdukaan.cron.migrations.RunOnceTasks;
4
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
5
import com.smartdukaan.cron.properties.WriteToPropertiesFile;
6
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
23756 amit.gupta 7
import org.apache.logging.log4j.LogManager;
8
import org.apache.logging.log4j.Logger;
9
import org.springframework.beans.factory.annotation.Autowired;
30858 amit.gupta 10
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
23756 amit.gupta 11
import org.springframework.scheduling.annotation.Scheduled;
12
import org.springframework.stereotype.Component;
13
 
30049 amit.gupta 14
import java.time.LocalDate;
15
import java.time.LocalDateTime;
16
import java.util.Date;
17
import java.util.LinkedHashMap;
23756 amit.gupta 18
 
19
@Component
30883 amit.gupta 20
@ConditionalOnProperty(prefix = "", name = "scheduled", havingValue = "true", matchIfMissing = true)
23756 amit.gupta 21
public class ScheduledSkeleton {
23794 govind 22
 
23756 amit.gupta 23
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
24
 
25
	@Autowired
24784 amit.gupta 26
	private ScheduledTasks scheduledTasks;
28205 tejbeer 27
 
27007 amit.gupta 28
	@Autowired
29
	private LeadSyncRunner leadSyncRunner;
24841 govind 30
 
24784 amit.gupta 31
	@Autowired
32
	private Reconciliation reconciliation;
25822 amit.gupta 33
 
25782 amit.gupta 34
	@Autowired
35
	private RunOnceTasks runOnceTasks;
23756 amit.gupta 36
 
37
	@Autowired
38
	NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 39
 
24135 govind 40
	@Autowired
24841 govind 41
	private TicketRelatedScheduledTask ticketRelatedScheduledTask;
42
 
28921 tejbeer 43
	@Autowired
44
	private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
45
 
29673 manish 46
	@Autowired
47
	private WriteToPropertiesFile writeToPropertiesFile;
48
 
29674 manish 49
	String nagiosCronPropertiesFile = "/var/log/services/nagios-Cron-Monitoring.properties";
29757 tejbeer 50
 
30049 amit.gupta 51
	@Scheduled(cron = "0 0 2 * * *")
24420 amit.gupta 52
	public void processDailySchemes() throws Exception {
29757 tejbeer 53
 
29673 manish 54
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
55
		propertiesDetails.put("processDailySchemes", "0");
56
 
57
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
30049 amit.gupta 58
		int maxMinusDays = 5;
59
		int currentDayOfMonth = LocalDate.now().getDayOfMonth();
60
		int minusDays = currentDayOfMonth > maxMinusDays ? maxMinusDays : currentDayOfMonth - 1;
61
		if (minusDays > 0) {
62
			scheduledTasks.processScheme(LocalDateTime.now().minusDays(minusDays), LocalDateTime.now(), false);
63
		}
29673 manish 64
		propertiesDetails.put("processDailySchemes", "1");
65
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
66
 
24420 amit.gupta 67
	}
24841 govind 68
 
23761 amit.gupta 69
	@Scheduled(cron = "0 15 0 * * *")
25782 amit.gupta 70
	public void runOnceTasks() throws Exception {
29757 tejbeer 71
 
29673 manish 72
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
73
		propertiesDetails.put("runOnceTasks", "0");
74
 
75
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
76
 
23756 amit.gupta 77
		scheduledTasks.reconcileRecharge();
29757 tejbeer 78
 
29673 manish 79
		propertiesDetails.put("runOnceTasks", "1");
80
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
23756 amit.gupta 81
	}
25822 amit.gupta 82
 
28205 tejbeer 83
	/*
84
	 * @Scheduled(cron = "0 0 8 * * *") public void mailDashboardScreenshots()
85
	 * throws Exception { runOnceTasks.mailDashboardScreenshots(); }
86
	 */
25721 tejbeer 87
 
23759 amit.gupta 88
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 89
	public void processRechargeCashback() throws Throwable {
29673 manish 90
 
91
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
92
		propertiesDetails.put("processRechargeCashback", "0");
93
 
94
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
23756 amit.gupta 95
		scheduledTasks.processRechargeCashback();
29673 manish 96
 
97
		propertiesDetails.put("processRechargeCashback", "1");
98
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
99
 
23756 amit.gupta 100
	}
23794 govind 101
 
27267 amit.gupta 102
	@Scheduled(cron = "0 0 6 * * *")
25563 amit.gupta 103
	public void sendPartnerInvestmentDetails() throws Exception {
29673 manish 104
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
105
		propertiesDetails.put("sendPartnerInvestmentDetails", "0");
106
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
23929 amit.gupta 107
		scheduledTasks.sendPartnerInvestmentDetails();
29757 tejbeer 108
		long secs = (new Date().getTime()) / 1000;
29696 manish 109
		log.info("sendPartnerInvestmentDetails" + LocalDateTime.now());
29757 tejbeer 110
 
29695 manish 111
		propertiesDetails.put("investmentDate", Long.toString(secs));
29673 manish 112
		propertiesDetails.put("sendPartnerInvestmentDetails", "1");
113
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
114
 
25893 amit.gupta 115
	}
28921 tejbeer 116
 
28632 amit.gupta 117
	@Scheduled(cron = "0 0 10,15,17 * * *")
118
	public void sendIndentTertiaryReport() throws Exception {
29757 tejbeer 119
 
29673 manish 120
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
121
		propertiesDetails.put("sendIndentTertiaryReport", "0");
122
 
123
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
124
 
28632 amit.gupta 125
		scheduledTasks.sendIndentTertiary();
29757 tejbeer 126
 
29673 manish 127
		propertiesDetails.put("sendIndentTertiaryReport", "1");
128
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
129
 
28632 amit.gupta 130
	}
28921 tejbeer 131
 
28709 amit.gupta 132
	@Scheduled(cron = "0 0 6 * * *")
133
	public void checkPartnerActiveStoreByStatus() throws Exception {
29673 manish 134
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
135
		propertiesDetails.put("checkPartnerActiveStoreByStatus", "0");
136
 
137
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
138
 
28709 amit.gupta 139
		scheduledTasks.checkPartnerActiveStore();
29673 manish 140
		propertiesDetails.put("checkPartnerActiveStoreByStatus", "1");
141
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
142
 
28709 amit.gupta 143
	}
26790 tejbeer 144
 
28921 tejbeer 145
	// @Scheduled(cron = "0 0 8 * * *")
24681 amit.gupta 146
	public void sendStockAgeingReport() throws Throwable {
29757 tejbeer 147
 
29673 manish 148
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
149
		propertiesDetails.put("sendStockAgeingReport", "0");
150
 
151
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
152
 
24681 amit.gupta 153
		scheduledTasks.sendAgeingReport();
29757 tejbeer 154
 
29673 manish 155
		propertiesDetails.put("sendStockAgeingReport", "1");
156
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
157
 
24681 amit.gupta 158
	}
24131 govind 159
 
24890 amit.gupta 160
	@Scheduled(cron = "0 0/30 1-23 * * *")
29673 manish 161
	public void escalateTicket() throws Exception {
24653 govind 162
		log.info("escalate ticket");
29673 manish 163
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
164
		propertiesDetails.put("escalateTicket", "0");
165
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
24841 govind 166
		ticketRelatedScheduledTask.escalateTicket();
29757 tejbeer 167
 
29673 manish 168
		propertiesDetails.put("escalateTicket", "1");
169
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
170
 
24533 govind 171
	}
24841 govind 172
 
173
	@Scheduled(cron = "0 0 11 * * *")
174
	public void alertTicketToUser() throws Exception {
24653 govind 175
		log.info("alert for ticket");
29673 manish 176
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
177
		propertiesDetails.put("alertTicketToUser", "0");
178
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
179
 
24841 govind 180
		ticketRelatedScheduledTask.alertforTicket();
29673 manish 181
		propertiesDetails.put("alertTicketToUser", "1");
182
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
183
 
24653 govind 184
	}
24841 govind 185
 
26943 amit.gupta 186
	@Scheduled(cron = "0 0 12,18,23 ? * *")
25822 amit.gupta 187
	public void dailySaleNotification() throws Exception {
188
		log.info("daily send Notification");
29673 manish 189
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
190
		propertiesDetails.put("dailySaleNotification", "0");
191
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
192
 
25837 amit.gupta 193
		scheduledTasks.sendDailySalesNotificationToPartner(null);
29757 tejbeer 194
 
29673 manish 195
		propertiesDetails.put("dailySaleNotification", "1");
196
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
197
 
25822 amit.gupta 198
	}
24841 govind 199
 
29232 amit.gupta 200
	/*
201
	 * @Scheduled(cron = "0 0 6 * * *") public void dailyReconciliation() throws
202
	 * Exception { reconciliation.dailyReconciliation(); }
203
	 */
28205 tejbeer 204
 
27441 amit.gupta 205
	@Scheduled(cron = "0 0 1 * * *")
29801 manish 206
	public void selectFinServiceFollowUpDateByCurrDate() throws Exception {
207
		log.info("selectFinServiceFollowUpDateByCurrDate");
208
		scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
30049 amit.gupta 209
 
29801 manish 210
	}
30049 amit.gupta 211
 
30584 amit.gupta 212
	@Scheduled(cron = "0 0 2 * * *")
27441 amit.gupta 213
	public void processActivation() throws Exception {
29757 tejbeer 214
 
29673 manish 215
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
216
		propertiesDetails.put("processActivation", "0");
217
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
218
 
27441 amit.gupta 219
		scheduledTasks.processActivation();
29757 tejbeer 220
 
29673 manish 221
		propertiesDetails.put("processActivation", "1");
222
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
223
 
27441 amit.gupta 224
	}
25721 tejbeer 225
 
30859 tejbeer 226
	// TODO: Change it back to first of every month
227
	// @Scheduled(cron = "0 0 1 1 * *")
30788 amit.gupta 228
	@Scheduled(cron = "0 0 1 9 * *")
229
	public void rollOutUpgardedMargins() throws Exception {
230
		scheduledTasks.rollOutUpgardedMarginsNextMonth();
231
 
232
	}
233
 
26944 amit.gupta 234
	@Scheduled(cron = "0 */5 * * * *")
25300 tejbeer 235
	public void sendNotification() throws Throwable {
29757 tejbeer 236
 
29674 manish 237
		log.info("send Notification");
29673 manish 238
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
239
		propertiesDetails.put("sendNotification", "0");
240
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
241
 
25300 tejbeer 242
		scheduledTasks.sendNotification();
29693 manish 243
		propertiesDetails.put("sendNotification", "1");
29673 manish 244
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29674 manish 245
		log.info("send Notification Done");
29673 manish 246
 
25300 tejbeer 247
	}
28205 tejbeer 248
 
28377 tejbeer 249
	@Scheduled(cron = "0 */15 * * * *")
250
	public void checkRazorPayPaymentStatus() throws Throwable {
29757 tejbeer 251
 
29673 manish 252
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
253
		propertiesDetails.put("checkRazorPayPaymentStatus", "0");
254
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
255
 
28377 tejbeer 256
		scheduledTasks.checkRazorPayPaymentStatus();
29673 manish 257
		propertiesDetails.put("checkRazorPayPaymentStatus", "1");
258
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
259
 
28377 tejbeer 260
	}
261
 
30401 amit.gupta 262
	@Scheduled(fixedDelay = 30 * 60 * 1000)
30321 amit.gupta 263
	public void updateIrnsToInvoices() throws Throwable {
264
		runOnceTasks.updateIrnsToInvoices();
265
	}
266
 
27686 amit.gupta 267
	@Scheduled(cron = "0 */10 * * * *")
268
	public void attachToffeeInvoices() throws Throwable {
29757 tejbeer 269
 
29673 manish 270
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
271
		propertiesDetails.put("attachToffeeInvoices", "0");
272
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
273
 
27686 amit.gupta 274
		scheduledTasks.attachToffeeInvoices();
29757 tejbeer 275
 
29673 manish 276
		propertiesDetails.put("attachToffeeInvoices", "1");
277
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
278
 
27686 amit.gupta 279
	}
24841 govind 280
 
26283 tejbeer 281
	@Scheduled(cron = "0 0 5 * * *")
282
	public void ticketClosed() throws Throwable {
283
 
29673 manish 284
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
285
		propertiesDetails.put("ticketClosed", "0");
286
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
287
 
26283 tejbeer 288
		scheduledTasks.ticketClosed();
29757 tejbeer 289
 
29673 manish 290
		propertiesDetails.put("ticketClosed", "1");
291
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
26283 tejbeer 292
 
293
	}
294
 
29757 tejbeer 295
	@Scheduled(cron = "0 0 8 * * *")
25721 tejbeer 296
	public void checkfocusedModelInPartnerStock() throws Throwable {
297
		log.info("startTime" + LocalDateTime.now());
29757 tejbeer 298
 
29673 manish 299
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
300
		propertiesDetails.put("checkfocusedModelInPartnerStock", "0");
301
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
302
 
25721 tejbeer 303
		scheduledTasks.checkfocusedModelInPartnerStock();
29673 manish 304
		propertiesDetails.put("checkfocusedModelInPartnerStock", "1");
305
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
25721 tejbeer 306
 
307
		log.info("endTime" + LocalDateTime.now());
308
	}
28205 tejbeer 309
 
26083 amit.gupta 310
	@Scheduled(cron = "0 0 8,10,12,14,16,18,20 * * *")
25909 amit.gupta 311
	public void notifyLead() throws Throwable {
29757 tejbeer 312
 
29673 manish 313
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
314
		propertiesDetails.put("notifyLead", "0");
315
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
316
 
25909 amit.gupta 317
		scheduledTasks.notifyLead();
29757 tejbeer 318
 
29673 manish 319
		propertiesDetails.put("notifyLead", "1");
320
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
321
 
28205 tejbeer 322
		// scheduledTasks.notifyVisits();
25909 amit.gupta 323
	}
25721 tejbeer 324
 
26214 amit.gupta 325
	@Scheduled(cron = "0 0 1 * * *")
326
	public void fetchImeiActivation() throws Throwable {
29673 manish 327
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
328
		propertiesDetails.put("fetchImeiActivation", "0");
329
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
330
 
26408 amit.gupta 331
		runOnceTasks.fetchImeiActivation(0);
29757 tejbeer 332
 
29673 manish 333
		propertiesDetails.put("fetchImeiActivation", "1");
334
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
335
 
26214 amit.gupta 336
	}
26790 tejbeer 337
 
338
	@Scheduled(cron = "0 0 1 * * *")
339
	public void checkValidateReferral() throws Throwable {
340
		log.info("startTime" + LocalDateTime.now());
29673 manish 341
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
342
		propertiesDetails.put("checkValidateReferral", "0");
343
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
344
 
26790 tejbeer 345
		scheduledTasks.checkValidateReferral();
29757 tejbeer 346
 
29673 manish 347
		propertiesDetails.put("checkValidateReferral", "1");
348
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
26790 tejbeer 349
 
350
		log.info("endTime" + LocalDateTime.now());
351
	}
352
 
28921 tejbeer 353
	// @Scheduled(cron = "0 0 8 * * *")
28205 tejbeer 354
	public void partnerProblemAlert() throws Throwable {
355
		log.info("startTime" + LocalDateTime.now());
29673 manish 356
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
357
		propertiesDetails.put("partnerProblemAlert", "0");
358
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
359
 
28205 tejbeer 360
		scheduledTasks.partnerProblemAlert();
29673 manish 361
		propertiesDetails.put("partnerProblemAlert", "1");
362
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
363
 
28205 tejbeer 364
		log.info("endTime" + LocalDateTime.now());
365
	}
28921 tejbeer 366
 
28788 amit.gupta 367
	@Scheduled(cron = "0 30 10 * * MON-SAT")
28783 amit.gupta 368
	public void sendMorningAttendanceAlert() throws Throwable {
369
		log.info("startTime" + LocalDateTime.now());
29673 manish 370
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
371
		propertiesDetails.put("sendMorningAttendanceAlert", "0");
372
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
373
 
28783 amit.gupta 374
		scheduledTasks.sendAttendanceMorningAlert();
29673 manish 375
		propertiesDetails.put("sendMorningAttendanceAlert", "1");
376
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
377
 
28783 amit.gupta 378
		log.info("endTime" + LocalDateTime.now());
379
	}
28921 tejbeer 380
 
28788 amit.gupta 381
	@Scheduled(cron = "0 30 20 * * MON-SAT")
28783 amit.gupta 382
	public void sendEveningAttendanceAlert() throws Throwable {
383
		log.info("startTime" + LocalDateTime.now());
29673 manish 384
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
385
		propertiesDetails.put("sendEveningAttendanceAlert", "0");
386
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
387
 
28783 amit.gupta 388
		scheduledTasks.sendAttendanceEveningAlert();
29673 manish 389
		propertiesDetails.put("sendEveningAttendanceAlert", "1");
390
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
391
 
28783 amit.gupta 392
		log.info("endTime" + LocalDateTime.now());
393
	}
28921 tejbeer 394
 
395
	@Scheduled(cron = "0 0 7 * * *")
396
	public void onboardingEventDelays() throws Throwable {
397
		log.info("startTime" + LocalDateTime.now());
29757 tejbeer 398
 
29673 manish 399
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
400
		propertiesDetails.put("onboardingEventDelays", "0");
401
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
402
 
28921 tejbeer 403
		onBoardingRelatedSchelduleTask.onboardingEventDelays();
29757 tejbeer 404
 
29673 manish 405
		propertiesDetails.put("onboardingEventDelays", "1");
406
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
407
 
28921 tejbeer 408
		log.info("endTime" + LocalDateTime.now());
409
	}
410
 
411
	@Scheduled(cron = "0 0 8 * * *")
412
	public void brandingAlert() throws Throwable {
413
		log.info("startTime" + LocalDateTime.now());
29673 manish 414
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
415
		propertiesDetails.put("brandingAlert", "0");
416
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
417
 
28921 tejbeer 418
		onBoardingRelatedSchelduleTask.brandingAlert();
29673 manish 419
		propertiesDetails.put("brandingAlert", "1");
420
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
421
 
28921 tejbeer 422
		log.info("endTime" + LocalDateTime.now());
423
	}
424
 
425
	@Scheduled(cron = "0 0 8 * * *")
426
	public void advancePaymentPendingAlert() throws Throwable {
427
		log.info("startTime" + LocalDateTime.now());
29757 tejbeer 428
 
29673 manish 429
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
430
		propertiesDetails.put("advancePaymentPendingAlert", "0");
431
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
432
 
28921 tejbeer 433
		onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
29673 manish 434
		propertiesDetails.put("advancePaymentPendingAlert", "1");
435
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
436
 
28921 tejbeer 437
		log.info("endTime" + LocalDateTime.now());
438
	}
439
 
440
	@Scheduled(cron = "0 0 8 * * *")
441
	public void fullPaymentPendingAlert() throws Throwable {
442
		log.info("startTime" + LocalDateTime.now());
29757 tejbeer 443
 
29673 manish 444
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
445
		propertiesDetails.put("fullPaymentPendingAlert", "0");
446
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
447
 
28921 tejbeer 448
		onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
29757 tejbeer 449
 
29673 manish 450
		propertiesDetails.put("fullPaymentPendingAlert", "1");
451
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
452
 
28921 tejbeer 453
		log.info("endTime" + LocalDateTime.now());
454
	}
455
 
28963 tejbeer 456
	@Scheduled(cron = "0 0 9 * * *")
457
	public void advancePaymentPendinglegalAlert() throws Throwable {
458
		log.info("startTime" + LocalDateTime.now());
29673 manish 459
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
460
		propertiesDetails.put("advancePaymentPendinglegalAlert", "0");
461
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
462
 
28963 tejbeer 463
		onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
29757 tejbeer 464
 
29673 manish 465
		propertiesDetails.put("advancePaymentPendinglegalAlert", "1");
466
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
467
 
28963 tejbeer 468
		log.info("endTime" + LocalDateTime.now());
469
	}
470
 
29035 tejbeer 471
	@Scheduled(cron = "0 */5 * * * *")
472
	public void onBoardingCompleteEventEmail() throws Throwable {
473
		log.info("startTime" + LocalDateTime.now());
29673 manish 474
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
475
		propertiesDetails.put("onBoardingCompleteEventEmail", "0");
476
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
477
 
29035 tejbeer 478
		onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
29673 manish 479
		propertiesDetails.put("onBoardingCompleteEventEmail", "1");
480
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
481
 
29035 tejbeer 482
		log.info("endTime" + LocalDateTime.now());
483
	}
29040 tejbeer 484
 
30731 amit.gupta 485
	@Scheduled(cron = "0 */2 * * * *")
30667 amit.gupta 486
	public void updateSaholicCISTable() throws Throwable {
487
		log.info("startTime" + LocalDateTime.now());
488
		runOnceTasks.updateSaholicCISTable();
489
		log.info("endTime" + LocalDateTime.now());
490
	}
491
 
30390 amit.gupta 492
	@Scheduled(fixedDelay = 30 * 60 * 1000, initialDelay = 15 * 60 * 1000)
493
	public void fetchPartnerStat() throws Throwable {
494
		scheduledTasks.fetchParnterStats();
495
	}
496
 
29255 tejbeer 497
	@Scheduled(cron = "0 0 9 * * *")
498
	public void storeTimelinePromoterPending() throws Throwable {
499
		log.info("startTime" + LocalDateTime.now());
29757 tejbeer 500
 
29673 manish 501
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
502
		propertiesDetails.put("storeTimelinePromoterPending", "0");
503
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
504
 
29255 tejbeer 505
		onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
29673 manish 506
		propertiesDetails.put("storeTimelinePromoterPending", "1");
507
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
508
 
29255 tejbeer 509
		log.info("endTime" + LocalDateTime.now());
510
	}
29668 tejbeer 511
 
29467 amit.gupta 512
	@Scheduled(cron = "0 0 23 * * *")
29492 manish 513
	public void checkItelImeiActivation() throws Throwable {
514
		log.info("startTime" + LocalDate.now());
29673 manish 515
 
516
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
517
		propertiesDetails.put("checkItelImeiActivation", "0");
518
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29694 manish 519
		log.info("startTimecheckItelImeiActivation" + LocalDate.now());
30837 amit.gupta 520
		scheduledTasks.checkItelImeiActivation(LocalDate.now(), 90);
29757 tejbeer 521
		long secs = (new Date().getTime()) / 1000;
29694 manish 522
		log.info("endTimecheckItelImeiActivation" + LocalDate.now());
29673 manish 523
		propertiesDetails.put("checkItelImeiActivation", "1");
29757 tejbeer 524
		propertiesDetails.put("itelDate", Long.toString(secs));
29673 manish 525
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
526
 
29757 tejbeer 527
	}
29673 manish 528
 
29492 manish 529
	@Scheduled(cron = "0 0 23 * * *")
530
	public void checkTecnoImeiActivation() throws Throwable {
29757 tejbeer 531
 
29673 manish 532
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
533
		propertiesDetails.put("checkTecnoImeiActivation", "0");
534
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
535
 
29492 manish 536
		log.info("startTime" + LocalDate.now());
29694 manish 537
		log.info("startTimecheckTecnoImeiActivation" + LocalDate.now());
30837 amit.gupta 538
		scheduledTasks.checkTecnoImeiActivation(LocalDate.now(), 90);
29694 manish 539
		log.info("endTimecheckTecnoImeiActivation" + LocalDate.now());
29757 tejbeer 540
 
541
		long secs = (new Date().getTime()) / 1000;
29673 manish 542
		propertiesDetails.put("checkTecnoImeiActivation", "1");
29691 manish 543
		propertiesDetails.put("technoDate", Long.toString(secs));
29673 manish 544
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29757 tejbeer 545
 
29492 manish 546
	}
29668 tejbeer 547
 
30370 amit.gupta 548
	@Scheduled(fixedDelay = 60 * 1000)
29457 manish 549
	public void vivoImeiActivation() throws Throwable {
29694 manish 550
		log.info("startTimevivoImeiActivation" + LocalDateTime.now());
29757 tejbeer 551
 
29673 manish 552
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
553
		propertiesDetails.put("vivoImeiActivation", "0");
554
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
555
 
29457 manish 556
		scheduledTasks.checkImeiActivation();
29757 tejbeer 557
		long secs = (new Date().getTime()) / 1000;
29694 manish 558
		log.info("endTimevivoImeiActivation" + LocalDateTime.now());
29673 manish 559
		propertiesDetails.put("vivoImeiActivation", "1");
29757 tejbeer 560
 
29691 manish 561
		propertiesDetails.put("vivoDate", Long.toString(secs));
29673 manish 562
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
563
 
29457 manish 564
	}
29255 tejbeer 565
 
30421 tejbeer 566
	@Scheduled(cron = "0 0 8 * * *")
567
	public void reviewUncontactablePartner() throws Throwable {
568
		log.info("startTime" + LocalDateTime.now());
569
 
570
		scheduledTasks.reviewUncontactablePartner();
571
 
572
	}
573
 
30352 amit.gupta 574
	@Autowired
575
	private StandAlone standAlone;
576
 
30370 amit.gupta 577
	@Scheduled(fixedDelay = 60 * 1000)
30352 amit.gupta 578
	public void oppo() throws Throwable {
579
		standAlone.checkOppoImeiStatus();
580
	}
581
 
29316 tejbeer 582
	@Scheduled(cron = "0 0 * * * *")
29308 tejbeer 583
	public void markDelhiveryOrderDelivered() throws Throwable {
29673 manish 584
		LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
585
		propertiesDetails.put("markDelhiveryOrderDelivered", "0");
586
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
587
 
29308 tejbeer 588
		log.info("startTime" + LocalDateTime.now());
589
		scheduledTasks.markDelhiveryOrderDelivered();
29673 manish 590
		propertiesDetails.put("markDelhiveryOrderDelivered", "1");
591
		writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
592
 
29308 tejbeer 593
		log.info("endTime" + LocalDateTime.now());
594
	}
595
 
30637 amit.gupta 596
	@Scheduled(cron = "0 4 * * * *")
597
	public void processPriceDrop() throws Throwable {
598
		scheduledTasks.processPriceDrop();
599
	}
600
 
30859 tejbeer 601
	@Scheduled(cron = "0 0 0 * * *")
602
	public void calculateInterestAccured() throws Throwable {
603
		scheduledTasks.calculateInterestAccured();
604
	}
605
 
606
	@Scheduled(cron = "0 0 1 * * * *")
607
	public void loanSettlement() throws Throwable {
608
		scheduledTasks.loanSettlement();
609
	}
610
 
611
	@Scheduled(cron = "0 0 2 * * * *")
612
	public void dailyLoanAlert() throws Throwable {
613
		scheduledTasks.dailyLoanAlert();
614
	}
29208 tejbeer 615
	/*
616
	 * @Scheduled(cron = "0 0 9 * * *") public void onBoardingDocumentsPending()
617
	 * throws Throwable { log.info("startTime" + LocalDateTime.now());
618
	 * onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
619
	 * log.info("endTime" + LocalDateTime.now()); }
620
	 */
23756 amit.gupta 621
}