upd: 编码规范
This commit is contained in:
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
public class JobRunner implements ApplicationRunner {
|
||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||
private final QuartzJobService quartzJobService;
|
||||
private final QuartzJobMapper quartzJobMapper;
|
||||
private final QuartzManage quartzManage;
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ public class JobRunner implements ApplicationRunner {
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments applicationArguments) {
|
||||
List<QuartzJob> quartzJobs = quartzJobService.listActiveJob();
|
||||
List<QuartzJob> quartzJobs = quartzJobMapper.selectActiveJob();
|
||||
quartzJobs.forEach(quartzManage::addJob);
|
||||
log.info("Timing task injection complete");
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,4 +17,7 @@ public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
|
||||
IPage<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria);
|
||||
|
||||
@Select("SELECT * FROM sys_quartz_job WHERE is_pause = 0")
|
||||
List<QuartzJob> selectActiveJob();
|
||||
}
|
||||
|
||||
@@ -109,5 +109,4 @@ public interface QuartzJobService extends IService<QuartzJob> {
|
||||
* @throws InterruptedException /
|
||||
*/
|
||||
void executionSubJob(String[] tasks) throws InterruptedException;
|
||||
List<QuartzJob> listActiveJob();
|
||||
}
|
||||
|
||||
@@ -134,11 +134,6 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzJob> listActiveJob() {
|
||||
return lambdaQuery().eq(QuartzJob::getIsPause, 0).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<QuartzJob> quartzJobs, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user