Subversion Repositories SmartDukaan

Rev

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