Subversion Repositories SmartDukaan

Rev

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