Subversion Repositories SmartDukaan

Rev

Rev 37234 | Rev 37292 | 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;
34948 ranu 6
import com.smartdukaan.cron.scheduled.ambreports.AbmReportSender;
30049 amit.gupta 7
import com.smartdukaan.cron.scheduled.leadsync.LeadSyncRunner;
32832 amit.gupta 8
import com.smartdukaan.cron.scheduled.ordertracking.OrderTrackingService;
32907 amit.gupta 9
import com.smartdukaan.cron.scheduled.purchaseorder.POScheduler;
34443 vikas.jang 10
import com.spice.profitmandi.common.model.ProfitMandiConstants;
34241 tejus.loha 11
import com.spice.profitmandi.dao.service.PurSaleService;
23756 amit.gupta 12
import org.apache.logging.log4j.LogManager;
13
import org.apache.logging.log4j.Logger;
14
import org.springframework.beans.factory.annotation.Autowired;
15
import org.springframework.scheduling.annotation.Scheduled;
16
import org.springframework.stereotype.Component;
17
 
30049 amit.gupta 18
import java.time.LocalDate;
19
import java.time.LocalDateTime;
34756 amit.gupta 20
import java.time.LocalTime;
36993 amit 21
import java.time.YearMonth;
30049 amit.gupta 22
import java.util.Date;
23
import java.util.LinkedHashMap;
23756 amit.gupta 24
 
25
@Component
30887 amit.gupta 26
//@ConditionalOnProperty(name = "scheduled", havingValue = "true", matchIfMissing = true)
23756 amit.gupta 27
public class ScheduledSkeleton {
23794 govind 28
 
32048 tejbeer 29
    private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
23756 amit.gupta 30
 
32048 tejbeer 31
    @Autowired
32
    private ScheduledTasks scheduledTasks;
28205 tejbeer 33
 
32048 tejbeer 34
    @Autowired
36361 amit 35
    private BatchScheduledTasks batchScheduledTasks;
36
 
37
    @Autowired
34321 ranu 38
    private ScheduledTasksTest scheduledTasksTest;
39
 
40
    @Autowired
34948 ranu 41
    private AbmReportSender abmReportSender;
42
 
43
    @Autowired
32048 tejbeer 44
    private LeadSyncRunner leadSyncRunner;
24841 govind 45
 
32048 tejbeer 46
    @Autowired
47
    private Reconciliation reconciliation;
25822 amit.gupta 48
 
32048 tejbeer 49
    @Autowired
50
    private RunOnceTasks runOnceTasks;
23756 amit.gupta 51
 
32048 tejbeer 52
    @Autowired
53
    NagiosMonitorTasks nagiosMonitorTasks;
24188 govind 54
 
32048 tejbeer 55
    @Autowired
56
    private TicketRelatedScheduledTask ticketRelatedScheduledTask;
24841 govind 57
 
32048 tejbeer 58
    @Autowired
59
    private OnBoardingRelatedSchelduleTask onBoardingRelatedSchelduleTask;
28921 tejbeer 60
 
32048 tejbeer 61
    @Autowired
62
    private WriteToPropertiesFile writeToPropertiesFile;
29673 manish 63
 
32048 tejbeer 64
    String nagiosCronPropertiesFile = "/var/log/services/nagios-Cron-Monitoring.properties";
29757 tejbeer 65
 
32048 tejbeer 66
    @Scheduled(cron = "0 0 2 * * *")
67
    public void processDailySchemes() throws Exception {
29757 tejbeer 68
 
32048 tejbeer 69
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
70
        propertiesDetails.put("processDailySchemes", "0");
29673 manish 71
 
32048 tejbeer 72
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
73
        int maxMinusDays = 5;
74
        int currentDayOfMonth = LocalDate.now().getDayOfMonth();
75
        int minusDays = currentDayOfMonth > maxMinusDays ? maxMinusDays : currentDayOfMonth - 1;
76
        if (minusDays > 0) {
77
            scheduledTasks.processScheme(LocalDateTime.now().minusDays(minusDays), LocalDateTime.now(), false);
78
        }
79
        propertiesDetails.put("processDailySchemes", "1");
80
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 81
 
32048 tejbeer 82
    }
24841 govind 83
 
37258 amit 84
    /** Daily 00:20: start/expire hot-deal windows in tag_listing.hot_deals (Solr source). */
85
    @Scheduled(cron = "0 20 0 * * *")
86
    public void syncHotDealFlags() throws Exception {
87
        try {
88
            scheduledTasks.syncHotDealFlags();
89
        } catch (Exception e) {
90
            log.error("syncHotDealFlags failed", e);
91
        }
92
    }
93
 
32048 tejbeer 94
    @Scheduled(cron = "0 15 0 * * *")
95
    public void runOnceTasks() throws Exception {
29757 tejbeer 96
 
32048 tejbeer 97
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
98
        propertiesDetails.put("runOnceTasks", "0");
29673 manish 99
 
32048 tejbeer 100
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 101
 
32048 tejbeer 102
        scheduledTasks.reconcileRecharge();
29757 tejbeer 103
 
32048 tejbeer 104
        propertiesDetails.put("runOnceTasks", "1");
105
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
106
    }
25822 amit.gupta 107
 
32048 tejbeer 108
    /*
109
     * @Scheduled(cron = "0 0 8 * * *") public void mailDashboardScreenshots()
110
     * throws Exception { runOnceTasks.mailDashboardScreenshots(); }
111
     */
25721 tejbeer 112
 
32048 tejbeer 113
    @Scheduled(cron = "0 05 0 1,16 * ?")
114
    public void processRechargeCashback() throws Throwable {
29673 manish 115
 
32048 tejbeer 116
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
117
        propertiesDetails.put("processRechargeCashback", "0");
29673 manish 118
 
32048 tejbeer 119
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
120
        scheduledTasks.processRechargeCashback();
29673 manish 121
 
32048 tejbeer 122
        propertiesDetails.put("processRechargeCashback", "1");
123
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 124
 
32048 tejbeer 125
    }
23794 govind 126
 
32048 tejbeer 127
    @Scheduled(cron = "0 0 6 * * *")
128
    public void sendPartnerInvestmentDetails() throws Exception {
129
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
130
        propertiesDetails.put("sendPartnerInvestmentDetails", "0");
131
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
132
        scheduledTasks.sendPartnerInvestmentDetails();
133
        long secs = (new Date().getTime()) / 1000;
134
        log.info("sendPartnerInvestmentDetails" + LocalDateTime.now());
29757 tejbeer 135
 
32048 tejbeer 136
        propertiesDetails.put("investmentDate", Long.toString(secs));
137
        propertiesDetails.put("sendPartnerInvestmentDetails", "1");
138
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 139
 
32048 tejbeer 140
    }
28921 tejbeer 141
 
36993 amit 142
    // Monthly margins CN dry-run at 06:00 on the 1st. dryRun=true forces the harmless dev path
143
    // (no IRN, no PDF, no DB persist, no partner mail) even on prod. The real pipeline is run
144
    // manually via `--sendCreditNote --live`.
145
    @Scheduled(cron = "0 0 6 1 * ?")
146
    public void monthlyMarginsCnDryRun() throws Exception {
147
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
148
        propertiesDetails.put("monthlyMarginsCnDryRun", "0");
149
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
150
 
151
        scheduledTasks.sendCreditNote(YearMonth.now().minusMonths(1), true);
152
 
153
        propertiesDetails.put("monthlyMarginsCnDryRun", "1");
154
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
155
    }
156
 
37234 vikas 157
    @Scheduled(cron = "0 30 6 * * *")
34648 ranu 158
    public void generateBiReport() throws Exception {
159
        scheduledTasksTest.generateBiReport();
160
    }
34939 ranu 161
    @Scheduled(cron = "0 30 4 * * *")
162
    public void createFofoSmartCartSuggestion() throws Exception {
163
        scheduledTasksTest.createFofoSmartCartSuggestion();
164
    }
35980 amit 165
    /*@Scheduled(cron = "0 0 6,22 * * *")
34948 ranu 166
    public void sendAbmSmartCartReport() throws Exception {
167
        abmReportSender.sendAbmSmartCartReport();
35980 amit 168
    }*/
34648 ranu 169
 
32048 tejbeer 170
    @Scheduled(cron = "0 0 10,15,17 * * *")
171
    public void sendIndentTertiaryReport() throws Exception {
29757 tejbeer 172
 
32048 tejbeer 173
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
174
        propertiesDetails.put("sendIndentTertiaryReport", "0");
29673 manish 175
 
32048 tejbeer 176
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 177
 
32048 tejbeer 178
        scheduledTasks.sendIndentTertiary();
29757 tejbeer 179
 
32048 tejbeer 180
        propertiesDetails.put("sendIndentTertiaryReport", "1");
181
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 182
 
32048 tejbeer 183
    }
28921 tejbeer 184
 
32048 tejbeer 185
    @Scheduled(cron = "0 0 6 * * *")
186
    public void checkPartnerActiveStoreByStatus() throws Exception {
187
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
188
        propertiesDetails.put("checkPartnerActiveStoreByStatus", "0");
29673 manish 189
 
32048 tejbeer 190
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 191
 
32048 tejbeer 192
        scheduledTasks.checkPartnerActiveStore();
193
        propertiesDetails.put("checkPartnerActiveStoreByStatus", "1");
194
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 195
 
32048 tejbeer 196
    }
26790 tejbeer 197
 
37040 ranu 198
    @Scheduled(cron = "0 30 23 * * *")
199
    public void updatePartnerActivationTypeByMonthlySale() throws Exception {
200
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
201
        propertiesDetails.put("updatePartnerActivationTypeByMonthlySale", "0");
202
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
203
 
204
        scheduledTasks.updatePartnerActivationTypeByMonthlySale();
205
 
206
        propertiesDetails.put("updatePartnerActivationTypeByMonthlySale", "1");
207
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
208
    }
209
 
37172 amit 210
    // 23:45 — after updatePartnerActivationTypeByMonthlySale (23:30), so the
211
    // REVIVAL agenda mirror reads today's activation_type state.
212
    @Scheduled(cron = "0 45 23 * * *")
213
    public void updatePjpAgendaInstances() throws Exception {
214
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
215
        propertiesDetails.put("updatePjpAgendaInstances", "0");
216
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
217
 
218
        scheduledTasks.updatePjpAgendaInstances();
219
 
220
        propertiesDetails.put("updatePjpAgendaInstances", "1");
221
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
222
    }
223
 
32048 tejbeer 224
    // @Scheduled(cron = "0 0 8 * * *")
225
    public void sendStockAgeingReport() throws Throwable {
29757 tejbeer 226
 
32048 tejbeer 227
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
228
        propertiesDetails.put("sendStockAgeingReport", "0");
29673 manish 229
 
32048 tejbeer 230
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 231
 
32048 tejbeer 232
        scheduledTasks.sendAgeingReport();
29757 tejbeer 233
 
32048 tejbeer 234
        propertiesDetails.put("sendStockAgeingReport", "1");
235
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 236
 
32048 tejbeer 237
    }
24131 govind 238
 
32048 tejbeer 239
    @Scheduled(cron = "0 0 11 * * *")
240
    public void escalateTicket() throws Exception {
241
        log.info("escalate ticket");
242
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
243
        propertiesDetails.put("escalateTicket", "0");
244
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
245
        ticketRelatedScheduledTask.escalateTicket();
29757 tejbeer 246
 
32048 tejbeer 247
        propertiesDetails.put("escalateTicket", "1");
248
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 249
 
32048 tejbeer 250
    }
24841 govind 251
 
32048 tejbeer 252
    @Scheduled(cron = "0 0 11 * * *")
253
    public void alertTicketToUser() throws Exception {
254
        log.info("alert for ticket");
255
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
256
        propertiesDetails.put("alertTicketToUser", "0");
257
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 258
 
32048 tejbeer 259
        ticketRelatedScheduledTask.alertforTicket();
260
        propertiesDetails.put("alertTicketToUser", "1");
261
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 262
 
32048 tejbeer 263
    }
24841 govind 264
 
34904 ranu 265
    //@Scheduled(cron = "0 0 14,18,23 ? * *")
32048 tejbeer 266
    public void dailySaleNotification() throws Exception {
267
        log.info("daily send Notification");
268
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
269
        propertiesDetails.put("dailySaleNotification", "0");
270
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 271
 
32048 tejbeer 272
        scheduledTasks.sendDailySalesNotificationToPartner(null);
29757 tejbeer 273
 
32048 tejbeer 274
        propertiesDetails.put("dailySaleNotification", "1");
275
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 276
 
32048 tejbeer 277
    }
24841 govind 278
 
32048 tejbeer 279
    /*
280
     * @Scheduled(cron = "0 0 6 * * *") public void dailyReconciliation() throws
281
     * Exception { reconciliation.dailyReconciliation(); }
282
     */
28205 tejbeer 283
 
32048 tejbeer 284
    @Scheduled(cron = "0 0 1 * * *")
285
    public void selectFinServiceFollowUpDateByCurrDate() throws Exception {
286
        log.info("selectFinServiceFollowUpDateByCurrDate");
287
        scheduledTasks.selectFinServiceFollowUpDateByCurrDate(LocalDate.now());
30049 amit.gupta 288
 
32048 tejbeer 289
    }
30049 amit.gupta 290
 
32165 amit.gupta 291
    @Scheduled(cron = "0 0 4 * * *")
32048 tejbeer 292
    public void processActivation() throws Exception {
29757 tejbeer 293
 
32048 tejbeer 294
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
295
        propertiesDetails.put("processActivation", "0");
296
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 297
 
32048 tejbeer 298
        scheduledTasks.processActivation();
29757 tejbeer 299
 
32048 tejbeer 300
        propertiesDetails.put("processActivation", "1");
301
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 302
 
32048 tejbeer 303
    }
25721 tejbeer 304
 
32048 tejbeer 305
    // TODO: Change it back to first of every month
306
    // @Scheduled(cron = "0 0 1 1 * *")
307
    @Scheduled(cron = "0 0 1 2 * *")
308
    public void rollOutUpgardedMargins() throws Exception {
35522 amit 309
        scheduledTasks.rollOutUpgardedMarginsNextMonth(null);
30788 amit.gupta 310
 
32048 tejbeer 311
    }
30788 amit.gupta 312
 
34241 tejus.loha 313
    @Scheduled(fixedDelay = 60 * 1000)
32048 tejbeer 314
    public void sendNotification() throws Throwable {
29757 tejbeer 315
 
32048 tejbeer 316
        log.info("send Notification");
317
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
318
        propertiesDetails.put("sendNotification", "0");
319
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 320
 
32048 tejbeer 321
        scheduledTasks.sendNotification();
322
        propertiesDetails.put("sendNotification", "1");
323
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
324
        log.info("send Notification Done");
29673 manish 325
 
32048 tejbeer 326
    }
28205 tejbeer 327
 
34669 amit.gupta 328
    //@Scheduled(cron = "0 */15 * * * *")
32048 tejbeer 329
    public void checkRazorPayPaymentStatus() throws Throwable {
29757 tejbeer 330
 
32048 tejbeer 331
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
332
        propertiesDetails.put("checkRazorPayPaymentStatus", "0");
333
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 334
 
32048 tejbeer 335
        scheduledTasks.checkRazorPayPaymentStatus();
336
        propertiesDetails.put("checkRazorPayPaymentStatus", "1");
337
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 338
 
32048 tejbeer 339
    }
28377 tejbeer 340
 
36292 amit 341
    @Scheduled(fixedDelay = 5 * 1000)
33426 amit.gupta 342
    //@Scheduled(cron = "0 5 23 * * *")
32048 tejbeer 343
    public void updateIrnsToInvoices() throws Throwable {
344
        runOnceTasks.updateIrnsToInvoices();
345
    }
31612 tejbeer 346
 
32048 tejbeer 347
    // No longer needed
348
    // @Scheduled(cron = "0 */10 * * * *")
349
    public void attachToffeeInvoices() throws Throwable {
29757 tejbeer 350
 
32048 tejbeer 351
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
352
        propertiesDetails.put("attachToffeeInvoices", "0");
353
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 354
 
32048 tejbeer 355
        scheduledTasks.attachToffeeInvoices();
29757 tejbeer 356
 
32048 tejbeer 357
        propertiesDetails.put("attachToffeeInvoices", "1");
358
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 359
 
32048 tejbeer 360
    }
24841 govind 361
 
35568 amit 362
    // REMOVED: ticketClosed() scheduler - now handled by TicketRelatedScheduledTask.autoCloseResolvedTickets()
363
    // which uses 8 working days instead of 7 calendar days and runs as part of processAllTicketTasks()
26283 tejbeer 364
 
32048 tejbeer 365
    @Scheduled(cron = "0 0 8 * * *")
366
    public void checkfocusedModelInPartnerStock() throws Throwable {
367
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 368
 
32048 tejbeer 369
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
370
        propertiesDetails.put("checkfocusedModelInPartnerStock", "0");
371
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 372
 
32048 tejbeer 373
        scheduledTasks.checkfocusedModelInPartnerStock();
374
        propertiesDetails.put("checkfocusedModelInPartnerStock", "1");
375
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
25721 tejbeer 376
 
32048 tejbeer 377
        log.info("endTime" + LocalDateTime.now());
378
    }
28205 tejbeer 379
 
32048 tejbeer 380
    @Scheduled(cron = "0 0 8,10,12,14,16,18,20 * * *")
381
    public void notifyLead() throws Throwable {
29757 tejbeer 382
 
32048 tejbeer 383
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
384
        propertiesDetails.put("notifyLead", "0");
385
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 386
 
32048 tejbeer 387
        scheduledTasks.notifyLead();
29757 tejbeer 388
 
32048 tejbeer 389
        propertiesDetails.put("notifyLead", "1");
390
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 391
 
32048 tejbeer 392
        // scheduledTasks.notifyVisits();
393
    }
25721 tejbeer 394
 
32048 tejbeer 395
    // No longer scheduled
396
    // @Scheduled(cron = "0 0 1 * * *")
397
    public void fetchImeiActivation() throws Throwable {
398
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
399
        propertiesDetails.put("fetchImeiActivation", "0");
400
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 401
 
32048 tejbeer 402
        runOnceTasks.fetchImeiActivation(0);
29757 tejbeer 403
 
32048 tejbeer 404
        propertiesDetails.put("fetchImeiActivation", "1");
405
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 406
 
32048 tejbeer 407
    }
26790 tejbeer 408
 
32411 amit.gupta 409
    @Scheduled(cron = "0 0 7 * * *")
410
    //Send all lead owners the report for scheduled followups missed
411
    public void sendUnscheduledFollowUpMail() throws Exception {
412
        scheduledTasks.sendUnscheduledFollowUpMail();
413
    }
414
 
32048 tejbeer 415
    @Scheduled(cron = "0 0 1 * * *")
416
    public void checkValidateReferral() throws Throwable {
417
        log.info("startTime" + LocalDateTime.now());
418
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
419
        propertiesDetails.put("checkValidateReferral", "0");
420
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 421
 
32048 tejbeer 422
        scheduledTasks.checkValidateReferral();
29757 tejbeer 423
 
32048 tejbeer 424
        propertiesDetails.put("checkValidateReferral", "1");
425
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
26790 tejbeer 426
 
32048 tejbeer 427
        log.info("endTime" + LocalDateTime.now());
428
    }
26790 tejbeer 429
 
32048 tejbeer 430
    // @Scheduled(cron = "0 0 8 * * *")
431
    public void partnerProblemAlert() throws Throwable {
432
        log.info("startTime" + LocalDateTime.now());
433
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
434
        propertiesDetails.put("partnerProblemAlert", "0");
435
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 436
 
32048 tejbeer 437
        scheduledTasks.partnerProblemAlert();
438
        propertiesDetails.put("partnerProblemAlert", "1");
439
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 440
 
32048 tejbeer 441
        log.info("endTime" + LocalDateTime.now());
442
    }
28921 tejbeer 443
 
32048 tejbeer 444
    /*
445
     * @Scheduled(cron = "0 30 10 * * MON-SAT") public void
446
     * sendMorningAttendanceAlert() throws Throwable { log.info("startTime" +
447
     * LocalDateTime.now()); LinkedHashMap<String, String> propertiesDetails = new
448
     * LinkedHashMap<>(); propertiesDetails.put("sendMorningAttendanceAlert", "0");
449
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
450
     * nagiosCronPropertiesFile);
32507 amit.gupta 451
     *
32048 tejbeer 452
     * scheduledTasks.sendAttendanceMorningAlert();
453
     * propertiesDetails.put("sendMorningAttendanceAlert", "1");
454
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
455
     * nagiosCronPropertiesFile);
32507 amit.gupta 456
     *
32048 tejbeer 457
     * log.info("endTime" + LocalDateTime.now()); }
32507 amit.gupta 458
     *
32048 tejbeer 459
     * @Scheduled(cron = "0 30 20 * * MON-SAT") public void
460
     * sendEveningAttendanceAlert() throws Throwable { log.info("startTime" +
461
     * LocalDateTime.now()); LinkedHashMap<String, String> propertiesDetails = new
462
     * LinkedHashMap<>(); propertiesDetails.put("sendEveningAttendanceAlert", "0");
463
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
464
     * nagiosCronPropertiesFile);
32507 amit.gupta 465
     *
32048 tejbeer 466
     * scheduledTasks.sendAttendanceEveningAlert();
467
     * propertiesDetails.put("sendEveningAttendanceAlert", "1");
468
     * writeToPropertiesFile.saveParamChanges(propertiesDetails,
469
     * nagiosCronPropertiesFile);
32507 amit.gupta 470
     *
32048 tejbeer 471
     * log.info("endTime" + LocalDateTime.now()); }
472
     */
29673 manish 473
 
35109 ranu 474
    @Scheduled(cron = "0 0 10 * * *")
32048 tejbeer 475
    public void onboardingEventDelays() throws Throwable {
476
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 477
 
32048 tejbeer 478
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
479
        propertiesDetails.put("onboardingEventDelays", "0");
480
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 481
 
32048 tejbeer 482
        onBoardingRelatedSchelduleTask.onboardingEventDelays();
29757 tejbeer 483
 
32048 tejbeer 484
        propertiesDetails.put("onboardingEventDelays", "1");
485
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 486
 
32048 tejbeer 487
        log.info("endTime" + LocalDateTime.now());
488
    }
28921 tejbeer 489
 
36065 aman 490
    @Scheduled(cron = "0 30 10 * * *")
491
    public void sendStockDeliveredTrainingNotification() {
492
        log.info("sendStockDeliveredTrainingNotification startTime " + LocalDateTime.now());
493
        onBoardingRelatedSchelduleTask.sendStockDeliveredTrainingNotification();
494
        log.info("sendStockDeliveredTrainingNotification endTime " + LocalDateTime.now());
495
    }
496
 
36003 aman 497
    @Scheduled(cron = "0 0 9 * * ?")
498
    public void sendDelayAlertEmail() {
499
        log.info("sendDelayAlertEmail startTime " + LocalDateTime.now());
500
        onBoardingRelatedSchelduleTask.sendDelayAlertEmail();
501
        log.info("sendDelayAlertEmail endTime " + LocalDateTime.now());
502
    }
503
 
32048 tejbeer 504
    @Scheduled(cron = "0 0 8 * * *")
505
    public void brandingAlert() throws Throwable {
506
        log.info("startTime" + LocalDateTime.now());
507
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
508
        propertiesDetails.put("brandingAlert", "0");
509
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 510
 
32048 tejbeer 511
        onBoardingRelatedSchelduleTask.brandingAlert();
512
        propertiesDetails.put("brandingAlert", "1");
513
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 514
 
32048 tejbeer 515
        log.info("endTime" + LocalDateTime.now());
516
    }
28921 tejbeer 517
 
33859 tejus.loha 518
//    @Scheduled(cron = "0 0 8 * * *")
519
//    public void advancePaymentPendingAlert() throws Throwable {
520
//        log.info("startTime" + LocalDateTime.now());
521
//
522
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
523
//        propertiesDetails.put("advancePaymentPendingAlert", "0");
524
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
525
//
526
//        onBoardingRelatedSchelduleTask.advancePaymentPendingAlert();
527
//        propertiesDetails.put("advancePaymentPendingAlert", "1");
528
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
529
//
530
//        log.info("endTime" + LocalDateTime.now());
531
//    }
29757 tejbeer 532
 
32048 tejbeer 533
    @Scheduled(cron = "0 0 8 * * *")
534
    public void fullPaymentPendingAlert() throws Throwable {
535
        log.info("startTime" + LocalDateTime.now());
29757 tejbeer 536
 
32048 tejbeer 537
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
538
        propertiesDetails.put("fullPaymentPendingAlert", "0");
539
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 540
 
32048 tejbeer 541
        onBoardingRelatedSchelduleTask.fullPaymentPendingAlert();
29757 tejbeer 542
 
32048 tejbeer 543
        propertiesDetails.put("fullPaymentPendingAlert", "1");
544
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 545
 
32048 tejbeer 546
        log.info("endTime" + LocalDateTime.now());
547
    }
28921 tejbeer 548
 
33859 tejus.loha 549
//    @Scheduled(cron = "0 0 9 * * *")
550
//    public void advancePaymentPendinglegalAlert() throws Throwable {
551
//        log.info("startTime" + LocalDateTime.now());
552
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
553
//        propertiesDetails.put("advancePaymentPendinglegalAlert", "0");
554
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
555
//
556
////        onBoardingRelatedSchelduleTask.advancePaymentPendinglegalAlert();
557
//
558
//        propertiesDetails.put("advancePaymentPendinglegalAlert", "1");
559
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
560
//
561
//        log.info("endTime" + LocalDateTime.now());
562
//    }
29673 manish 563
 
32048 tejbeer 564
    @Scheduled(cron = "0 */5 * * * *")
565
    public void onBoardingCompleteEventEmail() throws Throwable {
566
        log.info("startTime" + LocalDateTime.now());
567
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
568
        propertiesDetails.put("onBoardingCompleteEventEmail", "0");
569
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 570
 
32048 tejbeer 571
        onBoardingRelatedSchelduleTask.onBoardingCompleteEventEmail();
572
        propertiesDetails.put("onBoardingCompleteEventEmail", "1");
573
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 574
 
32048 tejbeer 575
        log.info("endTime" + LocalDateTime.now());
576
    }
29040 tejbeer 577
 
32048 tejbeer 578
    @Scheduled(cron = "0 */5 * * * *")
579
    public void updateSaholicCISTable() throws Throwable {
580
        log.info("updateSaholicCISTable startTime" + LocalDateTime.now());
581
        runOnceTasks.updateSaholicCISTable();
582
        log.info("updateSaholicCISTable endTime" + LocalDateTime.now());
583
    }
30667 amit.gupta 584
 
34241 tejus.loha 585
    @Autowired
586
    PurSaleService purSaleService;
587
 
35133 ranu 588
    @Scheduled(cron = "0 0 6,22 * * ?")
34241 tejus.loha 589
    public void send10DaysEgedStockReport() throws Throwable {
34275 tejus.loha 590
        log.info("moreThen10DaysEgedStockReport startTime" + LocalDateTime.now());
591
        scheduledTasks.send10OrMoreOlderStockReport();
592
        log.info("moreThen10DaysEgedStockReport endTime" + LocalDateTime.now());
34241 tejus.loha 593
    }
594
 
35616 amit 595
    @Scheduled(fixedDelay = 5 * 60 * 1000)
32048 tejbeer 596
    public void fetchPartnerStat() throws Throwable {
597
        scheduledTasks.fetchParnterStats();
598
    }
30390 amit.gupta 599
 
33859 tejus.loha 600
//    @Scheduled(cron = "0 0 9 * * *")
601
//    public void storeTimelinePromoterPending() throws Throwable {
602
//        log.info("startTime" + LocalDateTime.now());
603
//
604
//        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
605
//        propertiesDetails.put("storeTimelinePromoterPending", "0");
606
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
607
//
608
////        onBoardingRelatedSchelduleTask.storeTimelinePromoterPending();
609
//        propertiesDetails.put("storeTimelinePromoterPending", "1");
610
//        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
611
//
612
//        log.info("endTime" + LocalDateTime.now());
613
//    }
29757 tejbeer 614
 
34669 amit.gupta 615
    //@Scheduled(cron = "0 0 23 * * *")
32214 jai.hind 616
    public void checkItelImeiActivationNew() throws Throwable {
617
        log.info("startTime" + LocalDate.now());
618
 
619
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
620
        propertiesDetails.put("checkItelImeiActivationNew", "0");
621
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
622
        log.info("startTimecheckItelImeiActivation" + LocalDate.now());
623
        scheduledTasks.checkItelImeiActivationNew(LocalDate.now(), 90);
624
        long secs = (new Date().getTime()) / 1000;
625
        log.info("endTimecheckItelImeiActivation" + LocalDate.now());
626
        propertiesDetails.put("checkItelImeiActivationNew", "1");
627
        propertiesDetails.put("itelDate", Long.toString(secs));
628
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
629
 
630
    }
631
 
632
 
36292 amit 633
    @Scheduled(fixedDelay = 5 * 60 * 1000)
32048 tejbeer 634
    public void vivoImeiActivation() throws Throwable {
635
        log.info("startTimevivoImeiActivation" + LocalDateTime.now());
29757 tejbeer 636
 
32048 tejbeer 637
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
638
        propertiesDetails.put("vivoImeiActivation", "0");
639
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 640
 
32048 tejbeer 641
        scheduledTasks.checkImeiActivation();
642
        long secs = (new Date().getTime()) / 1000;
643
        log.info("endTimevivoImeiActivation" + LocalDateTime.now());
644
        propertiesDetails.put("vivoImeiActivation", "1");
29757 tejbeer 645
 
32048 tejbeer 646
        propertiesDetails.put("vivoDate", Long.toString(secs));
647
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 648
 
32048 tejbeer 649
    }
29255 tejbeer 650
 
36292 amit 651
    @Scheduled(fixedDelay = 5 * 60 * 1000)
36253 amit 652
    public void vivoImeiActivationTertiary() throws Throwable {
653
        log.info("startTimevivoImeiActivationTertiary" + LocalDateTime.now());
654
 
655
        scheduledTasks.checkImeiActivationTertiary();
656
 
657
        log.info("endTimevivoImeiActivationTertiary" + LocalDateTime.now());
658
    }
659
 
32048 tejbeer 660
    @Scheduled(cron = "0 0 8 * * *")
661
    public void reviewUncontactablePartner() throws Throwable {
662
        log.info("startTime" + LocalDateTime.now());
30421 tejbeer 663
 
32048 tejbeer 664
        scheduledTasks.reviewUncontactablePartner();
30421 tejbeer 665
 
32048 tejbeer 666
    }
30421 tejbeer 667
 
33928 ranu 668
    @Scheduled(cron = "0 0 7 * * *")
669
    public void setMovementWiseRbmTodayTargets() throws Throwable {
34669 amit.gupta 670
        log.info("today targets startTime {}", LocalDateTime.now());
33928 ranu 671
 
672
        scheduledTasks.persistRbmTodayTargets();
673
 
674
    }
675
 
33986 ranu 676
    @Scheduled(cron = "0 0 21 * * *")
677
    public void setMovementWiseRbmTodayAchievements() throws Throwable {
34669 amit.gupta 678
        log.info("today achievement startTime {}", LocalDateTime.now());
33986 ranu 679
 
680
        scheduledTasks.persistRbmTodayAchievements();
681
 
682
    }
683
 
33078 ranu 684
    @Scheduled(cron = "0 0 8 * * *")
685
    public void reviewNonSdBuyingBrand() throws Throwable {
686
        log.info("startTime" + LocalDateTime.now());
687
 
688
        scheduledTasks.reviewNonSdBuyingBrand();
689
 
690
    }
691
 
32048 tejbeer 692
    @Autowired
693
    private StandAlone standAlone;
30352 amit.gupta 694
 
32832 amit.gupta 695
    @Autowired
696
    OrderTrackingService orderTrackingService;
697
 
36292 amit 698
    @Scheduled(fixedDelay = 5 * 60 * 1000)
32048 tejbeer 699
    public void oppo() throws Throwable {
700
        standAlone.checkOppoImeiStatus();
701
    }
30352 amit.gupta 702
 
36292 amit 703
    @Scheduled(fixedDelay = 5 * 60 * 1000)
36253 amit 704
    public void oppoTertiary() throws Throwable {
705
        standAlone.checkOppoImeiStatusTertiary();
706
    }
707
 
36292 amit 708
    @Scheduled(fixedDelay = 5 * 60 * 1000)
34421 amit.gupta 709
    public void realme() throws Throwable {
710
        standAlone.checkRealmeImeiStatus();
711
    }
712
 
36292 amit 713
    @Scheduled(fixedDelay = 5 * 60 * 1000)
36253 amit 714
    public void realmeTertiary() throws Throwable {
715
        standAlone.checkRealmeImeiStatusTertiary();
716
    }
717
 
32801 amit.gupta 718
    @Scheduled(cron = "0 0 * * * *")
32048 tejbeer 719
    public void markBlueDartOrderDelivered() throws Throwable {
720
        log.info("startTime" + LocalDateTime.now());
32832 amit.gupta 721
        orderTrackingService.markBlueDartOrderDelivered();
32048 tejbeer 722
        log.info("endTime" + LocalDateTime.now());
723
    }
31117 tejbeer 724
 
32881 amit.gupta 725
    @Scheduled(cron = "0 15 * * * *")
32048 tejbeer 726
    public void markDelhiveryOrderDelivered() throws Throwable {
727
        LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
728
        propertiesDetails.put("markDelhiveryOrderDelivered", "0");
729
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 730
 
32048 tejbeer 731
        log.info("startTime" + LocalDateTime.now());
32832 amit.gupta 732
        orderTrackingService.markDelhiveryOrderDelivered();
32048 tejbeer 733
        propertiesDetails.put("markDelhiveryOrderDelivered", "1");
734
        writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
29673 manish 735
 
32048 tejbeer 736
        log.info("endTime" + LocalDateTime.now());
737
    }
29308 tejbeer 738
 
32048 tejbeer 739
    @Scheduled(cron = "0 0 4 * * *")
740
    public void processPriceDrop() throws Throwable {
741
        scheduledTasks.processPriceDrop();
742
    }
30637 amit.gupta 743
 
32048 tejbeer 744
    @Scheduled(cron = "0 0 0 * * *")
745
    public void calculateInterestAccured() throws Throwable {
34710 amit.gupta 746
        scheduledTasks.loanSettlement();
32048 tejbeer 747
        scheduledTasks.calculateInterestAccured();
748
    }
30859 tejbeer 749
 
32117 tejbeer 750
    //  @Scheduled(cron = "0 */5 2-22 * * *")
33181 amit.gupta 751
    @Scheduled(fixedDelay = 1 * 60 * 1000)
32531 amit.gupta 752
    //@Scheduled(cron = "0 0 23 * * *")
32048 tejbeer 753
    public void loanSettlement() throws Throwable {
34756 amit.gupta 754
        LocalTime now = LocalTime.now();
34767 amit.gupta 755
        LocalTime start = LocalTime.of(9, 0);
34757 amit.gupta 756
        LocalTime end = LocalTime.of(23, 0);
34756 amit.gupta 757
 
758
        if (now.isBefore(start) || now.isAfter(end)) {
34762 amit.gupta 759
            System.out.println("Task skipped during restricted hours: " + now);
760
        } else {
34756 amit.gupta 761
            scheduledTasks.loanSettlement();
762
            System.out.println("Task executed at " + now);
763
        }
32048 tejbeer 764
    }
30859 tejbeer 765
 
32048 tejbeer 766
    @Scheduled(cron = "0 */15 * * * *")
767
    public void ccAvenueSettlement() throws Throwable {
768
        scheduledTasks.settleCCAvePayments();
769
    }
31332 amit.gupta 770
 
32048 tejbeer 771
    @Scheduled(cron = "0 0 6 * * *")
772
    public void dailyLoanAlert() throws Throwable {
773
        scheduledTasks.dailyLoanAlert();
774
    }
30896 amit.gupta 775
 
35106 ranu 776
    @Scheduled(cron = "0 0 11 * * *")
34162 ranu 777
    public void groupHidCatalogsByWeeks() throws Throwable {
778
        scheduledTasks.groupHidCatalogsByWeeks();
779
    }
780
 
36113 ranu 781
    @Scheduled(cron = "0 0 9 * * MON")  // Every Monday at 9:00 AM
34321 ranu 782
    public void sendFeebackSalesAndRbm() throws Throwable {
783
        scheduledTasksTest.sendRbmFeedbackSummaryEmail();
784
        scheduledTasksTest.sendSalesFeedbackSummaryEmail();
785
    }
786
 
32165 amit.gupta 787
    //Look out for imeis that have activation pending based of sale and mark create new SIO out of them
32048 tejbeer 788
    @Scheduled(cron = "0 0 1 * * *")
789
    public void processActivatedImeisForSchemes() throws Throwable {
790
        scheduledTasks.processActivatedImeisForSchemes();
791
    }
34241 tejus.loha 792
 
33357 amit.gupta 793
    //On every fifth update deductions
33435 amit.gupta 794
    @Scheduled(cron = "0 30 6 5 * ?")
33357 amit.gupta 795
    public void processSidbiDeductions() throws Throwable {
796
        scheduledTasks.processSidbiDeductions();
797
    }
34669 amit.gupta 798
 
34374 amit.gupta 799
    //Dont reset it for now as proposed by TV
800
    //@Scheduled(cron = "0 30 6 4 * ?")
33904 amit.gupta 801
    public void resetHardLimit() throws Throwable {
802
        scheduledTasks.resetHardLimit();
803
    }
804
 
34830 ranu 805
    @Scheduled(cron = "0 0/20 * * * *")
32048 tejbeer 806
    public void updatePartnerLimit() throws Throwable {
36361 amit 807
        batchScheduledTasks.updatePartnerLimitWithBatch();
32048 tejbeer 808
    }
30929 tejbeer 809
 
34253 ranu 810
    @Scheduled(cron = "0 0 9,14,18 * * *")
33874 ranu 811
    public void createOpeningStockPartyWise() throws Throwable {
812
        scheduledTasks.createOpeningStockPartyWise();
813
    }
30936 tejbeer 814
 
33874 ranu 815
 
32842 amit.gupta 816
    //Loans due/overdue/default notifications sent to parnters
817
    @Scheduled(cron = "0 0 11 * * *")
32822 ranu 818
    public void sendMailWhatsAppAfterLoanDueDate() throws Throwable {
819
        scheduledTasks.sendMailWhatsAppAfterLoanDueDate();
820
    }
34241 tejus.loha 821
 
32842 amit.gupta 822
    @Scheduled(cron = "0 0 8 * * *")
823
    public void alertForDueDate() throws Throwable {
824
        scheduledTasks.alertForDueDate();
825
    }
32822 ranu 826
 
35133 ranu 827
    @Scheduled(cron = "0 0 4,21 * * *")
32048 tejbeer 828
    public void notifyLoanDueDateCross() throws Throwable {
829
        scheduledTasks.notifyLoanDueDateCross();
830
    }
30936 tejbeer 831
 
35133 ranu 832
    @Scheduled(cron = "0 0 4,21 * * *")
32048 tejbeer 833
    public void notifyDefaultLoans() throws Throwable {
834
        scheduledTasks.notifyDefaultLoans();
835
    }
30936 tejbeer 836
 
34910 ranu 837
   // @Scheduled(cron = "0 0 23 * * *")
32048 tejbeer 838
    public void hygineAlertForInternalTeam() throws Throwable {
839
        scheduledTasks.hygineAlertForInternalTeam();
31206 tejbeer 840
 
32048 tejbeer 841
    }
31206 tejbeer 842
 
32048 tejbeer 843
    @Scheduled(cron = "0 0 23 * * *")
844
    public void hygineAlertForPartner() throws Throwable {
845
        scheduledTasks.hygineAlertForPartner();
31206 tejbeer 846
 
32048 tejbeer 847
    }
31206 tejbeer 848
 
32048 tejbeer 849
    @Scheduled(cron = "0 0 0 * * MON")
850
    public void monthlyTargetForPartner() throws Throwable {
851
        scheduledTasks.monthlyTargetForPartner();
31249 tejbeer 852
 
32048 tejbeer 853
    }
31249 tejbeer 854
 
32048 tejbeer 855
    @Scheduled(cron = "0 0 0 * * MON")
856
    public void monthlyTargetForInternalTeam() throws Throwable {
857
        scheduledTasks.monthlyTargetForInternalTeam();
31249 tejbeer 858
 
32048 tejbeer 859
    }
31612 tejbeer 860
 
32048 tejbeer 861
    @Scheduled(cron = "0 0 6 * * *")
862
    public void sendSamsungRebilling() throws Throwable {
863
        scheduledTasks.sendMailForSamsungRebilling();
864
    }
31931 amit.gupta 865
 
32048 tejbeer 866
    @Scheduled(cron = "0 10 8 * * *")
867
    public void sendMailForAgeingAlert() throws Throwable {
868
        scheduledTasks.sendMailForAgeingAlert();
869
    }
870
 
871
 
872
    @Scheduled(cron = "0 0 8 * * *")
873
    public void sendFilteredRetailerPerformance() throws Throwable {
874
        scheduledTasks.sendFilteredRetailerPerformance();
875
    }
32690 amit.gupta 876
 
33444 ranu 877
    @Scheduled(cron = "0 0 0 * * MON")
878
    public void findAllLiveDemoBrandItemsByBillingDate() throws Throwable {
879
        scheduledTasks.findAllLiveDemoBrandItemsByBillingDate();
880
    }
34241 tejus.loha 881
 
33464 ranu 882
    @Scheduled(cron = "0 10 6 * * *")
883
    public void findTodayPocoBillingItems() throws Throwable {
884
        scheduledTasks.findTodayPocoBillingItems();
885
    }
32690 amit.gupta 886
 
33444 ranu 887
 
32690 amit.gupta 888
    @Scheduled(cron = "0 0 12 * * *")
889
    public void rejectPriceDropsOfApprovedImeis() throws Throwable {
37083 amit 890
        batchScheduledTasks.reprocessPriceDropsWithBatch();
32690 amit.gupta 891
    }
32907 amit.gupta 892
 
893
    @Autowired
894
    POScheduler poScheduler;
34241 tejus.loha 895
 
32907 amit.gupta 896
    @Scheduled(cron = "0 0 1 * * *")
33643 amit.gupta 897
    public void autoClosePO() {
32907 amit.gupta 898
        poScheduler.autoClosePurchaseOrders();
899
    }
32048 tejbeer 900
    /*
901
     * @Scheduled(cron = "0 0 9 * * *") public void onBoardingDocumentsPending()
902
     * throws Throwable { log.info("startTime" + LocalDateTime.now());
903
     * onBoardingRelatedSchelduleTask.onBoardingDocumentsPending();
904
     * log.info("endTime" + LocalDateTime.now()); }
905
     */
34443 vikas.jang 906
 
34547 vikas.jang 907
    @Scheduled(cron = "0 50 23 * * *")
34443 vikas.jang 908
    public void bidConfirmation() throws Throwable {
34547 vikas.jang 909
        log.info("running bid cron at 23:50PM");
34443 vikas.jang 910
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.YESTERDAY);
911
    }
912
 
34547 vikas.jang 913
    @Scheduled(cron = "0 0 19 * * *")
34443 vikas.jang 914
    public void processLiquidationBids() throws Throwable {
34547 vikas.jang 915
        log.info("running bid cron at 07:00PM");
34443 vikas.jang 916
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
917
    }
918
 
34547 vikas.jang 919
    @Scheduled(cron = "0 30 21 * * *")
34443 vikas.jang 920
    public void bidPurchaseOrder() throws Throwable {
34547 vikas.jang 921
        log.info("running bid cron at 09:30PM");
34443 vikas.jang 922
        runOnceTasks.processBids(ProfitMandiConstants.BID_CRON_ENUM.TODAY);
923
    }
34547 vikas.jang 924
 
34669 amit.gupta 925
    /*@Scheduled(cron = "0 0 12 * * *")
926
    public void processCashDiscount() throws Throwable {
927
        scheduledTasks.processCashDiscount();
928
    }*/
929
 
930
 
34563 vikas.jang 931
    @Scheduled(cron = "0 0 9,17 * * *")
34547 vikas.jang 932
    public void bidConsolidatedMessage() throws Throwable {
933
        log.info("Running bid cron at 09:00 AM or 05:00 PM");
934
        runOnceTasks.consolidatedBiddingMessage();
34563 vikas.jang 935
    }
34770 vikas.jang 936
 
937
    @Scheduled(cron = "0 0 8 * * *")
34836 vikas 938
    public void yesterdayTrackingReport() throws Throwable {
939
        log.info("Running yesterday employee tracking cron at 08:00 AM");
940
        runOnceTasks.yesterdayTrackingReport();
34770 vikas.jang 941
    }
34836 vikas 942
 
35178 amit 943
    @Scheduled(cron = "0 10 8 * * *")
35177 amit 944
    public void partnerCreditExposureReport() throws Throwable {
945
        log.info("Running yesterday employee tracking cron at 08:00 AM");
946
        runOnceTasks.sendCreditExposureReport();
947
    }
948
 
36552 ranu 949
    @Scheduled(cron = "0 0 22,16 * * *")
34836 vikas 950
    public void dailyTrackingReport() throws Throwable {
36552 ranu 951
        log.info("Running daily employee tracking cron at 10:00 PM and 04:00 PM");
34836 vikas 952
        runOnceTasks.dailyTrackingReport();
953
    }
35105 vikas 954
 
34792 amit.gupta 955
    @Scheduled(cron = "0 0 0 1 1,4,7,10 *")
956
    public void sendUpdateMobileBrandMarketShareQuaterlyMail() throws Throwable {
34791 aman.kumar 957
        log.info("Running Marketshare update remined quaterly");
958
        scheduledTasks.sendUpdateMobileBrandMarketShareQuaterlyMail();
959
    }
35105 vikas 960
 
961
    @Scheduled(cron = "0 0 * * * *")
962
    public void checkRewardsEligibility() throws Throwable {
963
        log.info("Running Rewards Disburse daily");
964
        runOnceTasks.checkRewardsEligibility();
965
    }
35326 amit 966
 
967
    @Scheduled(cron="0 0 20 * * *")
968
    public void sendTrialExpiry() {
969
        scheduledTasks.sendTrialExpiry();
970
    }
35666 vikas 971
 
972
    @Scheduled(cron = "0 0 0 * * *")
973
    public void fetchOffersByItem() {
974
        scheduledTasks.cachePinelabsOffers();
975
    }
35788 vikas 976
 
977
    @Scheduled(cron = "0 0 0 * * *")
978
    public void syncProductsToShopify() throws Exception {
36058 ranu 979
        scheduledTasks.syncProductsToShopifyByWarehouseId(ProfitMandiConstants.WAREHOUSE_NAME_MAP.get("UP-WEST/NOIDA"));
35788 vikas 980
    }
36511 amit 981
 
37162 vikas 982
    @Scheduled(cron = "0 0 6,18 * * *")
983
    public void syncInventoryToShopify() throws Exception {
984
        scheduledTasks.syncInventoryToShopifyByWarehouseId(ProfitMandiConstants.WAREHOUSE_NAME_MAP.get("UP-WEST/NOIDA"));
985
    }
986
 
36511 amit 987
    @Autowired
988
    private WarehouseStockReconciliation warehouseStockReconciliation;
989
 
990
    @Scheduled(cron = "0 30 5 * * *")
991
    public void reconcileInventorySnapshot() throws Exception {
992
        log.info("reconcileInventorySnapshot");
993
        warehouseStockReconciliation.reconcile();
994
    }
37159 amit 995
 
996
    @Autowired
997
    private PartnerIdentityIntegrityMonitor partnerIdentityIntegrityMonitor;
998
 
999
    @Scheduled(cron = "0 0 7 * * *")
1000
    public void partnerIdentityIntegrityMonitor() throws Exception {
1001
        log.info("partnerIdentityIntegrityMonitor");
1002
        partnerIdentityIntegrityMonitor.monitor();
1003
    }
23756 amit.gupta 1004
}