Subversion Repositories SmartDukaan

Rev

Rev 37154 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37154 Rev 37172
Line 96... Line 96...
96
import com.spice.profitmandi.service.integrations.pinelabs.dto.*;
96
import com.spice.profitmandi.service.integrations.pinelabs.dto.*;
97
import com.spice.profitmandi.service.integrations.psismart.PsiSmartService;
97
import com.spice.profitmandi.service.integrations.psismart.PsiSmartService;
98
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
98
import com.spice.profitmandi.service.integrations.smartping.SmartPingService;
99
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
99
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
100
import com.spice.profitmandi.service.inventory.*;
100
import com.spice.profitmandi.service.inventory.*;
-
 
101
import com.spice.profitmandi.service.AgendaSyncResult;
101
import com.spice.profitmandi.service.mail.MailOutboxService;
102
import com.spice.profitmandi.service.mail.MailOutboxService;
102
import com.spice.profitmandi.service.offers.OfferService;
103
import com.spice.profitmandi.service.offers.OfferService;
103
import com.spice.profitmandi.service.order.OrderService;
104
import com.spice.profitmandi.service.order.OrderService;
104
import com.spice.profitmandi.service.pricecircular.PriceCircularService;
105
import com.spice.profitmandi.service.pricecircular.PriceCircularService;
105
import com.spice.profitmandi.service.pricing.PriceDropService;
106
import com.spice.profitmandi.service.pricing.PriceDropService;
Line 181... Line 182...
181
 
182
 
182
    @Autowired
183
    @Autowired
183
    private BeatMissDetectorRunner beatMissDetectorRunner;
184
    private BeatMissDetectorRunner beatMissDetectorRunner;
184
 
185
 
185
    @Autowired
186
    @Autowired
-
 
187
    private com.spice.profitmandi.service.AgendaAutoRuleService agendaAutoRuleService;
-
 
188
 
-
 
189
    @Autowired
186
    SmartPingService smartPingService;
190
    SmartPingService smartPingService;
187
 
191
 
188
    @Autowired
192
    @Autowired
189
    private ASTRepository astRepository;
193
    private ASTRepository astRepository;
190
 
194
 
Line 4098... Line 4102...
4098
        } catch (Exception e) {
4102
        } catch (Exception e) {
4099
            LOGGER.error("detectMissedBeats failed", e);
4103
            LOGGER.error("detectMissedBeats failed", e);
4100
        }
4104
        }
4101
    }
4105
    }
4102
 
4106
 
-
 
4107
    // Nightly PJP agenda sync: evaluate the 5 AUTO agenda rules per partner and
-
 
4108
    // open/close user.agenda_instance rows. Scheduled from ScheduledSkeleton at
-
 
4109
    // 23:45 — after the 23:30 activation-type cron, so the REVIVAL mirror sees
-
 
4110
    // today's state.
-
 
4111
    public void updatePjpAgendaInstances() {
-
 
4112
        AgendaSyncResult result = agendaAutoRuleService.syncAllPartners();
-
 
4113
        LOGGER.info("updatePjpAgendaInstances: {}", result);
-
 
4114
        if (result.getErrors() > 0) {
-
 
4115
            String body = "PJP agenda sync finished with errors.\n\n" + result + "\n\n"
-
 
4116
                    + String.join("\n", result.getErrorDetails());
-
 
4117
            mailOutboxService.queueMailViaGoogle(
-
 
4118
                    "amit.gupta@smartdukaan.com",
-
 
4119
                    new String[]{"tarun.verma@smartdukaan.com"},
-
 
4120
                    "PJP agenda sync: " + result.getErrors() + " errors",
-
 
4121
                    body,
-
 
4122
                    "ScheduledTasks.updatePjpAgendaInstances");
-
 
4123
        }
-
 
4124
    }
-
 
4125
 
4103
    @Scheduled(cron = "0 0 1 * * *")
4126
    @Scheduled(cron = "0 0 1 * * *")
4104
    public void convertExpiredFlagshipCredits() {
4127
    public void convertExpiredFlagshipCredits() {
4105
        synchronized (SD_CREDIT_LOCK) {
4128
        synchronized (SD_CREDIT_LOCK) {
4106
            try {
4129
            try {
4107
                sdCreditService.convertExpiredFlagshipCredits();
4130
                sdCreditService.convertExpiredFlagshipCredits();