Subversion Repositories SmartDukaan

Rev

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