Subversion Repositories SmartDukaan

Rev

Rev 34669 | Rev 34725 | 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;
32832 amit.gupta 7
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
32907 amit.gupta 8
import com.smartdukaan.cron.scheduled.purchaseorder.POScheduler;
34443 vikas.jang 9
import com.spice.profitmandi.common.model.ProfitMandiConstants;
34241 tejus.loha 10
import com.spice.profitmandi.dao.service.PurSaleService;
23756 amit.gupta 11
import org.apache.logging.log4j.LogManager;
12
import org.apache.logging.log4j.Logger;
13
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.scheduling.annotation.Scheduled;
15
import org.springframework.stereotype.Component;
16
 
30049 amit.gupta 17
import java.time.LocalDate;
18
import java.time.LocalDateTime;
19
import java.util.Date;
20
import java.util.LinkedHashMap;
23756 amit.gupta 21
 
22
@Component
30887 amit.gupta 23
//@ConditionalOnProperty(name = "scheduled", havingValue = "true", matchIfMissing = true)
23756 amit.gupta 24
public class ScheduledSkeleton {
23794 govind 25
 
32048 tejbeer 26
    private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
23756 amit.gupta 27
 
32048 tejbeer 28
    @Autowired
29
    private ScheduledTasks scheduledTasks;
28205 tejbeer 30
 
32048 tejbeer 31
    @Autowired
34321 ranu 32
    private ScheduledTasksTest scheduledTasksTest;
33
 
34
    @Autowired
32048 tejbeer 35
    private LeadSyncRunner leadSyncRunner;
24841 govind 36
 
32048 tejbeer 37
    @Autowired
38
    private Reconciliation reconciliation;
25822 amit.gupta 39
 
32048 tejbeer 40
    @Autowired
41
    private RunOnceTasks runOnceTasks;
23756 amit.gupta 42
 
32048 tejbeer 43
    @Autowired
44
    NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 45
 
32048 tejbeer 46
    @Autowired
47
    private TicketRelatedScheduledTask ticketRelatedScheduledTask;
24841 govind 48
 
32048 tejbeer 49
    @Autowired
50
    private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
28921 tejbeer 51
 
32048 tejbeer 52
    @Autowired
53
    private WriteToPropertiesFile writeToPropertiesFile;
29673 manish 54
 
32048 tejbeer 55
    String nagiosCronPropertiesFile = "/var/log/services/nagios-Cron-Monitoring.properties";
29757 tejbeer 56
 
32048 tejbeer 57
    @Scheduled(cron = "0 0 2 * * *")
58
    public void processDailySchemes() throws Exception {
29757 tejbeer 59
 
32048 tejbeer 60
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
61
        propertiesDetails.put("processDailySchemes", "0");
29673 manish 62
 
32048 tejbeer 63
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
64
        int maxMinusDays = 5;
65
        int currentDayOfMonth = LocalDate.now().getDayOfMonth();
66
        int minusDays = currentDayOfMonth > maxMinusDays ? maxMinusDays : currentDayOfMonth - 1;
67
        if (minusDays > 0) {
68
            scheduledTasks.processScheme(LocalDateTime.now().minusDays(minusDays), LocalDateTime.now(), false);
69
        }
70
        propertiesDetails.put("processDailySchemes", "1");
71
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 72
 
32048 tejbeer 73
    }
24841 govind 74
 
32048 tejbeer 75
    @Scheduled(cron = "0 15 0 * * *")
76
    public void runOnceTasks() throws Exception {
29757 tejbeer 77
 
32048 tejbeer 78
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
79
        propertiesDetails.put("runOnceTasks", "0");
29673 manish 80
 
32048 tejbeer 81
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 82
 
32048 tejbeer 83
        scheduledTasks.reconcileRecharge();
29757 tejbeer 84
 
32048 tejbeer 85
        propertiesDetails.put("runOnceTasks", "1");
86
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
87
    }
25822 amit.gupta 88
 
32048 tejbeer 89
    /*
90
     * @Scheduled(cron = "0 0 8 * * *") public void mailDashboardScreenshots()
91
     * throws Exception { runOnceTasks.mailDashboardScreenshots(); }
92
     */
25721 tejbeer 93
 
32048 tejbeer 94
    @Scheduled(cron = "0 05 0 1,16 * ?")
95
    public void processRechargeCashback() throws Throwable {
29673 manish 96
 
32048 tejbeer 97
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
98
        propertiesDetails.put("processRechargeCashback", "0");
29673 manish 99
 
32048 tejbeer 100
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
101
        scheduledTasks.processRechargeCashback();
29673 manish 102
 
32048 tejbeer 103
        propertiesDetails.put("processRechargeCashback", "1");
104
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 105
 
32048 tejbeer 106
    }
23794 govind 107
 
32048 tejbeer 108
    @Scheduled(cron = "0 0 6 * * *")
109
    public void sendPartnerInvestmentDetails() throws Exception {
110
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
111
        propertiesDetails.put("sendPartnerInvestmentDetails", "0");
112
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
113
        scheduledTasks.sendPartnerInvestmentDetails();
114
        long secs = (new Date().getTime()) / 1000;
115
        log.info("sendPartnerInvestmentDetails" + LocalDateTime.now());
29757 tejbeer 116
 
32048 tejbeer 117
        propertiesDetails.put("investmentDate", Long.toString(secs));
118
        propertiesDetails.put("sendPartnerInvestmentDetails", "1");
119
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 120
 
32048 tejbeer 121
    }
28921 tejbeer 122
 
34648 ranu 123
    @Scheduled(cron = "0 45 6 * * *")
124
    public void generateBiReport() throws Exception {
125
        scheduledTasksTest.generateBiReport();
126
    }
127
 
32048 tejbeer 128
    @Scheduled(cron = "0 0 10,15,17 * * *")
129
    public void sendIndentTertiaryReport() throws Exception {
29757 tejbeer 130
 
32048 tejbeer 131
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
132
        propertiesDetails.put("sendIndentTertiaryReport", "0");
29673 manish 133
 
32048 tejbeer 134
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 135
 
32048 tejbeer 136
        scheduledTasks.sendIndentTertiary();
29757 tejbeer 137
 
32048 tejbeer 138
        propertiesDetails.put("sendIndentTertiaryReport", "1");
139
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 140
 
32048 tejbeer 141
    }
28921 tejbeer 142
 
32048 tejbeer 143
    @Scheduled(cron = "0 0 6 * * *")
144
    public void checkPartnerActiveStoreByStatus() throws Exception {
145
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
146
        propertiesDetails.put("checkPartnerActiveStoreByStatus", "0");
29673 manish 147
 
32048 tejbeer 148
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 149
 
32048 tejbeer 150
        scheduledTasks.checkPartnerActiveStore();
151
        propertiesDetails.put("checkPartnerActiveStoreByStatus", "1");
152
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 153
 
32048 tejbeer 154
    }
26790 tejbeer 155
 
32048 tejbeer 156
    // @Scheduled(cron = "0 0 8 * * *")
157
    public void sendStockAgeingReport() throws Throwable {
29757 tejbeer 158
 
32048 tejbeer 159
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
160
        propertiesDetails.put("sendStockAgeingReport", "0");
29673 manish 161
 
32048 tejbeer 162
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 163
 
32048 tejbeer 164
        scheduledTasks.sendAgeingReport();
29757 tejbeer 165
 
32048 tejbeer 166
        propertiesDetails.put("sendStockAgeingReport", "1");
167
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 168
 
32048 tejbeer 169
    }
24131 govind 170
 
32048 tejbeer 171
    @Scheduled(cron = "0 0 11 * * *")
172
    public void escalateTicket() throws Exception {
173
        log.info("escalate ticket");
174
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
175
        propertiesDetails.put("escalateTicket", "0");
176
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
177
        ticketRelatedScheduledTask.escalateTicket();
29757 tejbeer 178
 
32048 tejbeer 179
        propertiesDetails.put("escalateTicket", "1");
180
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 181
 
32048 tejbeer 182
    }
24841 govind 183
 
32048 tejbeer 184
    @Scheduled(cron = "0 0 11 * * *")
185
    public void alertTicketToUser() throws Exception {
186
        log.info("alert for ticket");
187
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
188
        propertiesDetails.put("alertTicketToUser", "0");
189
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 190
 
32048 tejbeer 191
        ticketRelatedScheduledTask.alertforTicket();
192
        propertiesDetails.put("alertTicketToUser", "1");
193
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 194
 
32048 tejbeer 195
    }
24841 govind 196
 
32048 tejbeer 197
    @Scheduled(cron = "0 0 14,18,23 ? * *")
198
    public void dailySaleNotification() throws Exception {
199
        log.info("daily send Notification");
200
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
201
        propertiesDetails.put("dailySaleNotification", "0");
202
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 203
 
32048 tejbeer 204
        scheduledTasks.sendDailySalesNotificationToPartner(null);
29757 tejbeer 205
 
32048 tejbeer 206
        propertiesDetails.put("dailySaleNotification", "1");
207
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 208
 
32048 tejbeer 209
    }
24841 govind 210
 
32048 tejbeer 211
    /*
212
     * @Scheduled(cron = "0 0 6 * * *") public void dailyReconciliation() throws
213
     * Exception { reconciliation.dailyReconciliation(); }
214
     */
28205 tejbeer 215
 
32048 tejbeer 216
    @Scheduled(cron = "0 0 1 * * *")
217
    public void selectFinServiceFollowUpDateByCurrDate() throws Exception {
218
        log.info("selectFinServiceFollowUpDateByCurrDate");
219
        scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
30049 amit.gupta 220
 
32048 tejbeer 221
    }
30049 amit.gupta 222
 
32165 amit.gupta 223
    @Scheduled(cron = "0 0 4 * * *")
32048 tejbeer 224
    public void processActivation() throws Exception {
29757 tejbeer 225
 
32048 tejbeer 226
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
227
        propertiesDetails.put("processActivation", "0");
228
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 229
 
32048 tejbeer 230
        scheduledTasks.processActivation();
29757 tejbeer 231
 
32048 tejbeer 232
        propertiesDetails.put("processActivation", "1");
233
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 234
 
32048 tejbeer 235
    }
25721 tejbeer 236
 
32048 tejbeer 237
    // TODO: Change it back to first of every month
238
    // @Scheduled(cron = "0 0 1 1 * *")
239
    @Scheduled(cron = "0 0 1 2 * *")
240
    public void rollOutUpgardedMargins() throws Exception {
241
        scheduledTasks.rollOutUpgardedMarginsNextMonth();
30788 amit.gupta 242
 
32048 tejbeer 243
    }
30788 amit.gupta 244
 
34241 tejus.loha 245
    @Scheduled(fixedDelay = 60 * 1000)
32048 tejbeer 246
    public void sendNotification() throws Throwable {
29757 tejbeer 247
 
32048 tejbeer 248
        log.info("send Notification");
249
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
250
        propertiesDetails.put("sendNotification", "0");
251
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 252
 
32048 tejbeer 253
        scheduledTasks.sendNotification();
254
        propertiesDetails.put("sendNotification", "1");
255
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
256
        log.info("send Notification Done");
29673 manish 257
 
32048 tejbeer 258
    }
28205 tejbeer 259
 
34669 amit.gupta 260
    //@Scheduled(cron = "0 */15 * * * *")
32048 tejbeer 261
    public void checkRazorPayPaymentStatus() throws Throwable {
29757 tejbeer 262
 
32048 tejbeer 263
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
264
        propertiesDetails.put("checkRazorPayPaymentStatus", "0");
265
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 266
 
32048 tejbeer 267
        scheduledTasks.checkRazorPayPaymentStatus();
268
        propertiesDetails.put("checkRazorPayPaymentStatus", "1");
269
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 270
 
32048 tejbeer 271
    }
28377 tejbeer 272
 
34241 tejus.loha 273
    @Scheduled(fixedDelay = 2 * 1000)
33426 amit.gupta 274
    //@Scheduled(cron = "0 5 23 * * *")
32048 tejbeer 275
    public void updateIrnsToInvoices() throws Throwable {
276
        runOnceTasks.updateIrnsToInvoices();
277
    }
31612 tejbeer 278
 
32048 tejbeer 279
    // No longer needed
280
    // @Scheduled(cron = "0 */10 * * * *")
281
    public void attachToffeeInvoices() throws Throwable {
29757 tejbeer 282
 
32048 tejbeer 283
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
284
        propertiesDetails.put("attachToffeeInvoices", "0");
285
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 286
 
32048 tejbeer 287
        scheduledTasks.attachToffeeInvoices();
29757 tejbeer 288
 
32048 tejbeer 289
        propertiesDetails.put("attachToffeeInvoices", "1");
290
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 291
 
32048 tejbeer 292
    }
24841 govind 293
 
32048 tejbeer 294
    @Scheduled(cron = "0 0 5 * * *")
295
    public void ticketClosed() throws Throwable {
26283 tejbeer 296
 
32048 tejbeer 297
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
298
        propertiesDetails.put("ticketClosed", "0");
299
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 300
 
32048 tejbeer 301
        scheduledTasks.ticketClosed();
29757 tejbeer 302
 
32048 tejbeer 303
        propertiesDetails.put("ticketClosed", "1");
304
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
26283 tejbeer 305
 
32048 tejbeer 306
    }
26283 tejbeer 307
 
32048 tejbeer 308
    @Scheduled(cron = "0 0 8 * * *")
309
    public void checkfocusedModelInPartnerStock() throws Throwable {
310
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 311
 
32048 tejbeer 312
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
313
        propertiesDetails.put("checkfocusedModelInPartnerStock", "0");
314
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 315
 
32048 tejbeer 316
        scheduledTasks.checkfocusedModelInPartnerStock();
317
        propertiesDetails.put("checkfocusedModelInPartnerStock", "1");
318
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
25721 tejbeer 319
 
32048 tejbeer 320
        log.info("endTime" + LocalDateTime.now());
321
    }
28205 tejbeer 322
 
32048 tejbeer 323
    @Scheduled(cron = "0 0 8,10,12,14,16,18,20 * * *")
324
    public void notifyLead() throws Throwable {
29757 tejbeer 325
 
32048 tejbeer 326
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
327
        propertiesDetails.put("notifyLead", "0");
328
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 329
 
32048 tejbeer 330
        scheduledTasks.notifyLead();
29757 tejbeer 331
 
32048 tejbeer 332
        propertiesDetails.put("notifyLead", "1");
333
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 334
 
32048 tejbeer 335
        // scheduledTasks.notifyVisits();
336
    }
25721 tejbeer 337
 
32048 tejbeer 338
    // No longer scheduled
339
    // @Scheduled(cron = "0 0 1 * * *")
340
    public void fetchImeiActivation() throws Throwable {
341
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
342
        propertiesDetails.put("fetchImeiActivation", "0");
343
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 344
 
32048 tejbeer 345
        runOnceTasks.fetchImeiActivation(0);
29757 tejbeer 346
 
32048 tejbeer 347
        propertiesDetails.put("fetchImeiActivation", "1");
348
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 349
 
32048 tejbeer 350
    }
26790 tejbeer 351
 
32411 amit.gupta 352
    @Scheduled(cron = "0 0 7 * * *")
353
    //Send all lead owners the report for scheduled followups missed
354
    public void sendUnscheduledFollowUpMail() throws Exception {
355
        scheduledTasks.sendUnscheduledFollowUpMail();
356
    }
357
 
32048 tejbeer 358
    @Scheduled(cron = "0 0 1 * * *")
359
    public void checkValidateReferral() throws Throwable {
360
        log.info("startTime" + LocalDateTime.now());
361
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
362
        propertiesDetails.put("checkValidateReferral", "0");
363
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 364
 
32048 tejbeer 365
        scheduledTasks.checkValidateReferral();
29757 tejbeer 366
 
32048 tejbeer 367
        propertiesDetails.put("checkValidateReferral", "1");
368
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
26790 tejbeer 369
 
32048 tejbeer 370
        log.info("endTime" + LocalDateTime.now());
371
    }
26790 tejbeer 372
 
32048 tejbeer 373
    // @Scheduled(cron = "0 0 8 * * *")
374
    public void partnerProblemAlert() throws Throwable {
375
        log.info("startTime" + LocalDateTime.now());
376
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
377
        propertiesDetails.put("partnerProblemAlert", "0");
378
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 379
 
32048 tejbeer 380
        scheduledTasks.partnerProblemAlert();
381
        propertiesDetails.put("partnerProblemAlert", "1");
382
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 383
 
32048 tejbeer 384
        log.info("endTime" + LocalDateTime.now());
385
    }
28921 tejbeer 386
 
32048 tejbeer 387
    /*
388
     * @Scheduled(cron = "0 30 10 * * MON-SAT") public void
389
     * sendMorningAttendanceAlert() throws Throwable { log.info("startTime" +
390
     * LocalDateTime.now()); LinkedHashMap<String, String> propertiesDetails = new
391
     * LinkedHashMap<>(); propertiesDetails.put("sendMorningAttendanceAlert", "0");
392
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
393
     * nagiosCronPropertiesFile);
32507 amit.gupta 394
     *
32048 tejbeer 395
     * scheduledTasks.sendAttendanceMorningAlert();
396
     * propertiesDetails.put("sendMorningAttendanceAlert", "1");
397
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
398
     * nagiosCronPropertiesFile);
32507 amit.gupta 399
     *
32048 tejbeer 400
     * log.info("endTime" + LocalDateTime.now()); }
32507 amit.gupta 401
     *
32048 tejbeer 402
     * @Scheduled(cron = "0 30 20 * * MON-SAT") public void
403
     * sendEveningAttendanceAlert() throws Throwable { log.info("startTime" +
404
     * LocalDateTime.now()); LinkedHashMap<String, String> propertiesDetails = new
405
     * LinkedHashMap<>(); propertiesDetails.put("sendEveningAttendanceAlert", "0");
406
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
407
     * nagiosCronPropertiesFile);
32507 amit.gupta 408
     *
32048 tejbeer 409
     * scheduledTasks.sendAttendanceEveningAlert();
410
     * propertiesDetails.put("sendEveningAttendanceAlert", "1");
411
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
412
     * nagiosCronPropertiesFile);
32507 amit.gupta 413
     *
32048 tejbeer 414
     * log.info("endTime" + LocalDateTime.now()); }
415
     */
29673 manish 416
 
32048 tejbeer 417
    @Scheduled(cron = "0 0 7 * * *")
418
    public void onboardingEventDelays() throws Throwable {
419
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 420
 
32048 tejbeer 421
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
422
        propertiesDetails.put("onboardingEventDelays", "0");
423
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 424
 
32048 tejbeer 425
        onBoardingRelatedSchelduleTask.onboardingEventDelays();
29757 tejbeer 426
 
32048 tejbeer 427
        propertiesDetails.put("onboardingEventDelays", "1");
428
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 429
 
32048 tejbeer 430
        log.info("endTime" + LocalDateTime.now());
431
    }
28921 tejbeer 432
 
32048 tejbeer 433
    @Scheduled(cron = "0 0 8 * * *")
434
    public void brandingAlert() throws Throwable {
435
        log.info("startTime" + LocalDateTime.now());
436
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
437
        propertiesDetails.put("brandingAlert", "0");
438
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 439
 
32048 tejbeer 440
        onBoardingRelatedSchelduleTask.brandingAlert();
441
        propertiesDetails.put("brandingAlert", "1");
442
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 443
 
32048 tejbeer 444
        log.info("endTime" + LocalDateTime.now());
445
    }
28921 tejbeer 446
 
33859 tejus.loha 447
//    @Scheduled(cron = "0 0 8 * * *")
448
//    public void advancePaymentPendingAlert() throws Throwable {
449
//        log.info("startTime" + LocalDateTime.now());
450
//
451
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
452
//        propertiesDetails.put("advancePaymentPendingAlert", "0");
453
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
454
//
455
//        onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
456
//        propertiesDetails.put("advancePaymentPendingAlert", "1");
457
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
458
//
459
//        log.info("endTime" + LocalDateTime.now());
460
//    }
29757 tejbeer 461
 
32048 tejbeer 462
    @Scheduled(cron = "0 0 8 * * *")
463
    public void fullPaymentPendingAlert() throws Throwable {
464
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 465
 
32048 tejbeer 466
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
467
        propertiesDetails.put("fullPaymentPendingAlert", "0");
468
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 469
 
32048 tejbeer 470
        onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
29757 tejbeer 471
 
32048 tejbeer 472
        propertiesDetails.put("fullPaymentPendingAlert", "1");
473
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 474
 
32048 tejbeer 475
        log.info("endTime" + LocalDateTime.now());
476
    }
28921 tejbeer 477
 
33859 tejus.loha 478
//    @Scheduled(cron = "0 0 9 * * *")
479
//    public void advancePaymentPendinglegalAlert() throws Throwable {
480
//        log.info("startTime" + LocalDateTime.now());
481
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
482
//        propertiesDetails.put("advancePaymentPendinglegalAlert", "0");
483
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
484
//
485
////        onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
486
//
487
//        propertiesDetails.put("advancePaymentPendinglegalAlert", "1");
488
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
489
//
490
//        log.info("endTime" + LocalDateTime.now());
491
//    }
29673 manish 492
 
32048 tejbeer 493
    @Scheduled(cron = "0 */5 * * * *")
494
    public void onBoardingCompleteEventEmail() throws Throwable {
495
        log.info("startTime" + LocalDateTime.now());
496
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
497
        propertiesDetails.put("onBoardingCompleteEventEmail", "0");
498
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 499
 
32048 tejbeer 500
        onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
501
        propertiesDetails.put("onBoardingCompleteEventEmail", "1");
502
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 503
 
32048 tejbeer 504
        log.info("endTime" + LocalDateTime.now());
505
    }
29040 tejbeer 506
 
32048 tejbeer 507
    @Scheduled(cron = "0 */5 * * * *")
508
    public void updateSaholicCISTable() throws Throwable {
509
        log.info("updateSaholicCISTable startTime" + LocalDateTime.now());
510
        runOnceTasks.updateSaholicCISTable();
511
        log.info("updateSaholicCISTable endTime" + LocalDateTime.now());
512
    }
30667 amit.gupta 513
 
34241 tejus.loha 514
    @Autowired
515
    PurSaleService purSaleService;
516
 
517
    @Scheduled(cron = "0 0 10,19 * * ?")
518
    public void send10DaysEgedStockReport() throws Throwable {
34275 tejus.loha 519
        log.info("moreThen10DaysEgedStockReport startTime" + LocalDateTime.now());
520
        scheduledTasks.send10OrMoreOlderStockReport();
521
        log.info("moreThen10DaysEgedStockReport endTime" + LocalDateTime.now());
34241 tejus.loha 522
    }
523
 
32048 tejbeer 524
    @Scheduled(fixedDelay = 30 * 60 * 1000, initialDelay = 15 * 60 * 1000)
525
    public void fetchPartnerStat() throws Throwable {
526
        scheduledTasks.fetchParnterStats();
527
    }
30390 amit.gupta 528
 
33859 tejus.loha 529
//    @Scheduled(cron = "0 0 9 * * *")
530
//    public void storeTimelinePromoterPending() throws Throwable {
531
//        log.info("startTime" + LocalDateTime.now());
532
//
533
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
534
//        propertiesDetails.put("storeTimelinePromoterPending", "0");
535
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
536
//
537
////        onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
538
//        propertiesDetails.put("storeTimelinePromoterPending", "1");
539
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
540
//
541
//        log.info("endTime" + LocalDateTime.now());
542
//    }
29757 tejbeer 543
 
34669 amit.gupta 544
    //@Scheduled(cron = "0 0 23 * * *")
32214 jai.hind 545
    public void checkItelImeiActivationNew() throws Throwable {
546
        log.info("startTime" + LocalDate.now());
547
 
548
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
549
        propertiesDetails.put("checkItelImeiActivationNew", "0");
550
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
551
        log.info("startTimecheckItelImeiActivation" + LocalDate.now());
552
        scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 90);
553
        long secs = (new Date().getTime()) / 1000;
554
        log.info("endTimecheckItelImeiActivation" + LocalDate.now());
555
        propertiesDetails.put("checkItelImeiActivationNew", "1");
556
        propertiesDetails.put("itelDate", Long.toString(secs));
557
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
558
 
559
    }
560
 
561
 
32048 tejbeer 562
    @Scheduled(fixedDelay = 60 * 1000)
563
    public void vivoImeiActivation() throws Throwable {
564
        log.info("startTimevivoImeiActivation" + LocalDateTime.now());
29757 tejbeer 565
 
32048 tejbeer 566
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
567
        propertiesDetails.put("vivoImeiActivation", "0");
568
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 569
 
32048 tejbeer 570
        scheduledTasks.checkImeiActivation();
571
        long secs = (new Date().getTime()) / 1000;
572
        log.info("endTimevivoImeiActivation" + LocalDateTime.now());
573
        propertiesDetails.put("vivoImeiActivation", "1");
29757 tejbeer 574
 
32048 tejbeer 575
        propertiesDetails.put("vivoDate", Long.toString(secs));
576
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 577
 
32048 tejbeer 578
    }
29255 tejbeer 579
 
32048 tejbeer 580
    @Scheduled(cron = "0 0 8 * * *")
581
    public void reviewUncontactablePartner() throws Throwable {
582
        log.info("startTime" + LocalDateTime.now());
30421 tejbeer 583
 
32048 tejbeer 584
        scheduledTasks.reviewUncontactablePartner();
30421 tejbeer 585
 
32048 tejbeer 586
    }
30421 tejbeer 587
 
33928 ranu 588
    @Scheduled(cron = "0 0 7 * * *")
589
    public void setMovementWiseRbmTodayTargets() throws Throwable {
34669 amit.gupta 590
        log.info("today targets startTime {}", LocalDateTime.now());
33928 ranu 591
 
592
        scheduledTasks.persistRbmTodayTargets();
593
 
594
    }
595
 
33986 ranu 596
    @Scheduled(cron = "0 0 21 * * *")
597
    public void setMovementWiseRbmTodayAchievements() throws Throwable {
34669 amit.gupta 598
        log.info("today achievement startTime {}", LocalDateTime.now());
33986 ranu 599
 
600
        scheduledTasks.persistRbmTodayAchievements();
601
 
602
    }
603
 
33078 ranu 604
    @Scheduled(cron = "0 0 8 * * *")
605
    public void reviewNonSdBuyingBrand() throws Throwable {
606
        log.info("startTime" + LocalDateTime.now());
607
 
608
        scheduledTasks.reviewNonSdBuyingBrand();
609
 
610
    }
611
 
32048 tejbeer 612
    @Autowired
613
    private StandAlone standAlone;
30352 amit.gupta 614
 
32832 amit.gupta 615
    @Autowired
616
    OrderTrackingService orderTrackingService;
617
 
32147 amit.gupta 618
    @Scheduled(fixedDelay = 60 * 1000)
32048 tejbeer 619
    public void oppo() throws Throwable {
620
        standAlone.checkOppoImeiStatus();
621
    }
30352 amit.gupta 622
 
34421 amit.gupta 623
    @Scheduled(fixedDelay = 60 * 1000)
624
    public void realme() throws Throwable {
625
        standAlone.checkRealmeImeiStatus();
626
    }
627
 
32801 amit.gupta 628
    @Scheduled(cron = "0 0 * * * *")
32048 tejbeer 629
    public void markBlueDartOrderDelivered() throws Throwable {
630
        log.info("startTime" + LocalDateTime.now());
32832 amit.gupta 631
        orderTrackingService.markBlueDartOrderDelivered();
32048 tejbeer 632
        log.info("endTime" + LocalDateTime.now());
633
    }
31117 tejbeer 634
 
32881 amit.gupta 635
    @Scheduled(cron = "0 15 * * * *")
32048 tejbeer 636
    public void markDelhiveryOrderDelivered() throws Throwable {
637
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
638
        propertiesDetails.put("markDelhiveryOrderDelivered", "0");
639
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 640
 
32048 tejbeer 641
        log.info("startTime" + LocalDateTime.now());
32832 amit.gupta 642
        orderTrackingService.markDelhiveryOrderDelivered();
32048 tejbeer 643
        propertiesDetails.put("markDelhiveryOrderDelivered", "1");
644
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 645
 
32048 tejbeer 646
        log.info("endTime" + LocalDateTime.now());
647
    }
29308 tejbeer 648
 
32048 tejbeer 649
    @Scheduled(cron = "0 0 4 * * *")
650
    public void processPriceDrop() throws Throwable {
651
        scheduledTasks.processPriceDrop();
652
    }
30637 amit.gupta 653
 
32048 tejbeer 654
    @Scheduled(cron = "0 0 0 * * *")
655
    public void calculateInterestAccured() throws Throwable {
34710 amit.gupta 656
        scheduledTasks.loanSettlement();
32048 tejbeer 657
        scheduledTasks.calculateInterestAccured();
658
    }
30859 tejbeer 659
 
32117 tejbeer 660
    //  @Scheduled(cron = "0 */5 2-22 * * *")
33181 amit.gupta 661
    @Scheduled(fixedDelay = 1 * 60 * 1000)
32531 amit.gupta 662
    //@Scheduled(cron = "0 0 23 * * *")
32048 tejbeer 663
    public void loanSettlement() throws Throwable {
664
        scheduledTasks.loanSettlement();
665
    }
30859 tejbeer 666
 
32048 tejbeer 667
    @Scheduled(cron = "0 */15 * * * *")
668
    public void ccAvenueSettlement() throws Throwable {
669
        scheduledTasks.settleCCAvePayments();
670
    }
31332 amit.gupta 671
 
32048 tejbeer 672
    @Scheduled(cron = "0 0 6 * * *")
673
    public void dailyLoanAlert() throws Throwable {
674
        scheduledTasks.dailyLoanAlert();
675
    }
30896 amit.gupta 676
 
34162 ranu 677
    @Scheduled(cron = "0 0 6 * * *")
678
    public void groupHidCatalogsByWeeks() throws Throwable {
679
        scheduledTasks.groupHidCatalogsByWeeks();
680
    }
681
 
34321 ranu 682
    @Scheduled(cron = "0 0 9 * * *")
683
    public void sendFeebackSalesAndRbm() throws Throwable {
684
        scheduledTasksTest.sendRbmFeedbackSummaryEmail();
685
        scheduledTasksTest.sendSalesFeedbackSummaryEmail();
686
    }
687
 
32165 amit.gupta 688
    //Look out for imeis that have activation pending based of sale and mark create new SIO out of them
32048 tejbeer 689
    @Scheduled(cron = "0 0 1 * * *")
690
    public void processActivatedImeisForSchemes() throws Throwable {
691
        scheduledTasks.processActivatedImeisForSchemes();
692
    }
34241 tejus.loha 693
 
33357 amit.gupta 694
    //On every fifth update deductions
33435 amit.gupta 695
    @Scheduled(cron = "0 30 6 5 * ?")
33357 amit.gupta 696
    public void processSidbiDeductions() throws Throwable {
697
        scheduledTasks.processSidbiDeductions();
698
    }
34669 amit.gupta 699
 
34374 amit.gupta 700
    //Dont reset it for now as proposed by TV
701
    //@Scheduled(cron = "0 30 6 4 * ?")
33904 amit.gupta 702
    public void resetHardLimit() throws Throwable {
703
        scheduledTasks.resetHardLimit();
704
    }
705
 
34451 ranu 706
    @Scheduled(cron = "0 0/30 * * * *")
32048 tejbeer 707
    public void updatePartnerLimit() throws Throwable {
708
        scheduledTasks.updatePartnerLimit();
709
    }
30929 tejbeer 710
 
34253 ranu 711
    @Scheduled(cron = "0 0 9,14,18 * * *")
33874 ranu 712
    public void createOpeningStockPartyWise() throws Throwable {
713
        scheduledTasks.createOpeningStockPartyWise();
714
    }
30936 tejbeer 715
 
33874 ranu 716
 
32842 amit.gupta 717
    //Loans due/overdue/default notifications sent to parnters
718
    @Scheduled(cron = "0 0 11 * * *")
32822 ranu 719
    public void sendMailWhatsAppAfterLoanDueDate() throws Throwable {
720
        scheduledTasks.sendMailWhatsAppAfterLoanDueDate();
721
    }
34241 tejus.loha 722
 
32842 amit.gupta 723
    @Scheduled(cron = "0 0 8 * * *")
724
    public void alertForDueDate() throws Throwable {
725
        scheduledTasks.alertForDueDate();
726
    }
32822 ranu 727
 
33722 ranu 728
    @Scheduled(cron = "0 10 6 * * *")
32048 tejbeer 729
    public void notifyLoanDueDateCross() throws Throwable {
730
        scheduledTasks.notifyLoanDueDateCross();
731
    }
30936 tejbeer 732
 
33722 ranu 733
    @Scheduled(cron = "0 15 6 * * *")
32048 tejbeer 734
    public void notifyDefaultLoans() throws Throwable {
735
        scheduledTasks.notifyDefaultLoans();
736
    }
30936 tejbeer 737
 
32048 tejbeer 738
    @Scheduled(cron = "0 0 23 * * *")
739
    public void hygineAlertForInternalTeam() throws Throwable {
740
        scheduledTasks.hygineAlertForInternalTeam();
31206 tejbeer 741
 
32048 tejbeer 742
    }
31206 tejbeer 743
 
32048 tejbeer 744
    @Scheduled(cron = "0 0 23 * * *")
745
    public void hygineAlertForPartner() throws Throwable {
746
        scheduledTasks.hygineAlertForPartner();
31206 tejbeer 747
 
32048 tejbeer 748
    }
31206 tejbeer 749
 
32048 tejbeer 750
    @Scheduled(cron = "0 0 0 * * MON")
751
    public void monthlyTargetForPartner() throws Throwable {
752
        scheduledTasks.monthlyTargetForPartner();
31249 tejbeer 753
 
32048 tejbeer 754
    }
31249 tejbeer 755
 
32048 tejbeer 756
    @Scheduled(cron = "0 0 0 * * MON")
757
    public void monthlyTargetForInternalTeam() throws Throwable {
758
        scheduledTasks.monthlyTargetForInternalTeam();
31249 tejbeer 759
 
32048 tejbeer 760
    }
31612 tejbeer 761
 
32048 tejbeer 762
    @Scheduled(cron = "0 0 6 * * *")
763
    public void sendSamsungRebilling() throws Throwable {
764
        scheduledTasks.sendMailForSamsungRebilling();
765
    }
31931 amit.gupta 766
 
32048 tejbeer 767
    @Scheduled(cron = "0 10 8 * * *")
768
    public void sendMailForAgeingAlert() throws Throwable {
769
        scheduledTasks.sendMailForAgeingAlert();
770
    }
771
 
772
 
773
    @Scheduled(cron = "0 0 8 * * *")
774
    public void sendFilteredRetailerPerformance() throws Throwable {
775
        scheduledTasks.sendFilteredRetailerPerformance();
776
    }
32690 amit.gupta 777
 
33444 ranu 778
    @Scheduled(cron = "0 0 0 * * MON")
779
    public void findAllLiveDemoBrandItemsByBillingDate() throws Throwable {
780
        scheduledTasks.findAllLiveDemoBrandItemsByBillingDate();
781
    }
34241 tejus.loha 782
 
33464 ranu 783
    @Scheduled(cron = "0 10 6 * * *")
784
    public void findTodayPocoBillingItems() throws Throwable {
785
        scheduledTasks.findTodayPocoBillingItems();
786
    }
32690 amit.gupta 787
 
33444 ranu 788
 
32690 amit.gupta 789
    @Scheduled(cron = "0 0 12 * * *")
790
    public void rejectPriceDropsOfApprovedImeis() throws Throwable {
791
        scheduledTasks.rejectPriceDropsOfApprovedImeis();
792
    }
32907 amit.gupta 793
 
794
    @Autowired
795
    POScheduler poScheduler;
34241 tejus.loha 796
 
32907 amit.gupta 797
    @Scheduled(cron = "0 0 1 * * *")
33643 amit.gupta 798
    public void autoClosePO() {
32907 amit.gupta 799
        poScheduler.autoClosePurchaseOrders();
800
    }
32048 tejbeer 801
    /*
802
     * @Scheduled(cron = "0 0 9 * * *") public void onBoardingDocumentsPending()
803
     * throws Throwable { log.info("startTime" + LocalDateTime.now());
804
     * onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
805
     * log.info("endTime" + LocalDateTime.now()); }
806
     */
34443 vikas.jang 807
 
34547 vikas.jang 808
    @Scheduled(cron = "0 50 23 * * *")
34443 vikas.jang 809
    public void bidConfirmation() throws Throwable {
34547 vikas.jang 810
        log.info("running bid cron at 23:50PM");
34443 vikas.jang 811
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.YESTERDAY);
812
    }
813
 
34547 vikas.jang 814
    @Scheduled(cron = "0 0 19 * * *")
34443 vikas.jang 815
    public void processLiquidationBids() throws Throwable {
34547 vikas.jang 816
        log.info("running bid cron at 07:00PM");
34443 vikas.jang 817
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
818
    }
819
 
34547 vikas.jang 820
    @Scheduled(cron = "0 30 21 * * *")
34443 vikas.jang 821
    public void bidPurchaseOrder() throws Throwable {
34547 vikas.jang 822
        log.info("running bid cron at 09:30PM");
34443 vikas.jang 823
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
824
    }
34547 vikas.jang 825
 
34669 amit.gupta 826
    /*@Scheduled(cron = "0 0 12 * * *")
827
    public void processCashDiscount() throws Throwable {
828
        scheduledTasks.processCashDiscount();
829
    }*/
830
 
831
 
34563 vikas.jang 832
    @Scheduled(cron = "0 0 9,17 * * *")
34547 vikas.jang 833
    public void bidConsolidatedMessage() throws Throwable {
834
        log.info("Running bid cron at 09:00 AM or 05:00 PM");
835
        runOnceTasks.consolidatedBiddingMessage();
34563 vikas.jang 836
    }
23756 amit.gupta 837
}