| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.jjt.task;
- import com.jjt.common.utils.StringUtils;
- import com.jjt.hl.service.IHlScoreService;
- import org.springframework.stereotype.Component;
- import javax.annotation.Resource;
- import java.time.LocalDate;
- import java.time.ZoneId;
- import java.util.Date;
- /**
- * 定时任务调度测试
- *
- * @author jjt
- */
- @Component("hlTask")
- public class HlTask {
- @Resource
- private IHlScoreService scoreService;
- public void score() {
- scoreService.score();
- }
- public void day() {
- LocalDate time = LocalDate.now().minusDays(8);
- for (int j = 0; j < 7; j++) {
- time = time.plusDays(1);
- Date date = Date.from(time.atStartOfDay(ZoneId.systemDefault()).toInstant());
- scoreService.day(date);
- }
- }
- public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
- System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
- }
- public void ryParams(String params) {
- System.out.println("执行有参方法:" + params);
- }
- public void ryNoParams() {
- System.out.println("执行无参方法");
- }
- }
|