add synchronizedScheduler citypartner prize

master
luoyang 5 years ago
parent 8ee542babd
commit e330a51b25

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>2.2.9</version>
<version>2.2.10</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

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

Loading…
Cancel
Save