Subversion Repositories SmartDukaan

Rev

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