提交 d4880dc4 作者: 925993793@qq.com

【自定义专题】统计接口特殊处理,后续优化

上级 9def98f0
......@@ -142,6 +142,9 @@ public class SubjectManageController {
@Value("${infoSource.commonLabel:}")
private String commonSourceLabels;
@Value("${scheduling.yjzxEnable:false}")
Boolean yjzxEnable;
/**
* 专题列表-资讯转换时使用
*
......@@ -264,15 +267,17 @@ public class SubjectManageController {
*/
@GetMapping(value = "/statisticInfo")
private Result<?> statisticInfo(@RequestParam List<String> subjectIds) {
//List<SubjectStatisticInfo> statisticInfoList = subjectService.statisticInfo(subjectIds);
////异步更新专题统计信息表的数据
//CompletableFuture.runAsync(() -> {
// if (CollectionUtils.isNotEmpty(statisticInfoList)) {
// subjectStatisticInfoService.batchModify(statisticInfoList);
// }
//});
//return Result.OK(statisticInfoList);
return Result.OK(new ArrayList<>());
if(yjzxEnable){
return Result.OK(new ArrayList<>());
}
List<SubjectStatisticInfo> statisticInfoList = subjectService.statisticInfo(subjectIds);
//异步更新专题统计信息表的数据
CompletableFuture.runAsync(() -> {
if (CollectionUtils.isNotEmpty(statisticInfoList)) {
subjectStatisticInfoService.batchModify(statisticInfoList);
}
});
return Result.OK(statisticInfoList);
}
/**
......
......@@ -32,8 +32,14 @@ public class SubjectStatisticTask {
@Autowired
private SubjectStatisticInfoService subjectStatisticInfoService;
//@Scheduled(cron = "0 30 0 * * ?")
@Value("${scheduling.yjzxEnable:false}")
Boolean yjzxEnable;
@Scheduled(cron = "0 30 0 * * ?")
public void statistic() {
if(yjzxEnable){
return;
}
LambdaQueryWrapper<Subject> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.select(Subject::getId).eq(Subject::getSubjectType, 1);
List<Subject> list = subjectService.list(queryWrapper);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论