parent
743662719f
commit
974d1e09ea
@ -0,0 +1,35 @@
|
|||||||
|
package au.com.royalpay.payment.manage.task;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by yishuqian on 12/03/2017.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||||
|
public class CustomerImpressionTask {
|
||||||
|
@Resource
|
||||||
|
private ClientMapper clientMapper;
|
||||||
|
@Resource
|
||||||
|
private CustomerImpressionService customerImpressionService;
|
||||||
|
|
||||||
|
// @Scheduled(cron = "0 0 9 * * ?")
|
||||||
|
// TODO: 10/01/2018 kira 启动执行
|
||||||
|
public void generate() {
|
||||||
|
List<JSONObject> clients = clientMapper.listValidClient();
|
||||||
|
clients.forEach(p -> {
|
||||||
|
customerImpressionService.generate(p.getIntValue("client_id"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue