|
|
@ -5,10 +5,12 @@ import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
@Component
|
|
|
|
@Component
|
|
|
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
|
|
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
|
|
@ -21,6 +23,7 @@ public class OrgCommissionTask {
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 15 0 1 * ?")
|
|
|
|
@Scheduled(cron = "0 15 0 1 * ?")
|
|
|
|
public void generateOrgCommission() {
|
|
|
|
public void generateOrgCommission() {
|
|
|
|
|
|
|
|
synchronizedScheduler.executeProcess("manage_task:cityPartnerPrize", 120_000, () -> {
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
Calendar monthCal = Calendar.getInstance();
|
|
|
|
monthCal.setTime(new Date());
|
|
|
|
monthCal.setTime(new Date());
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
|
int year = monthCal.get(Calendar.YEAR);
|
|
|
@ -31,6 +34,7 @@ public class OrgCommissionTask {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String monthStr = year + "-" + month;
|
|
|
|
String monthStr = year + "-" + month;
|
|
|
|
cityPartnerPrizeService.generate(monthStr);
|
|
|
|
cityPartnerPrizeService.generate(monthStr);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|