|
@@ -1,5 +1,6 @@
|
|
|
package com.hcloud.microserver.h5.task;
|
|
|
|
|
|
+import com.hcloud.microserver.commoncore.util.reflect.DateUtils;
|
|
|
import com.hcloud.microserver.h5.service.CustomerCarbonValService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -7,6 +8,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
@EnableScheduling
|
|
|
@Component
|
|
|
@Slf4j
|
|
@@ -14,10 +17,10 @@ public class AutoTask {
|
|
|
|
|
|
@Autowired
|
|
|
private CustomerCarbonValService customerCarbonValService;
|
|
|
-
|
|
|
- @Scheduled(cron="*/15 * * * * ?")
|
|
|
+ //每年的1月1号0时1分0秒执行
|
|
|
+ @Scheduled(cron="0 1 0 1 1 ?")
|
|
|
public void process(){
|
|
|
- log.info("autoTask ");
|
|
|
+ log.info("执行碳汇量贡献自动生成任务 : "+ DateUtils.getDateInfo());
|
|
|
customerCarbonValService.contribution();
|
|
|
}
|
|
|
}
|