diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 1c33d0e2..24053d0d 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -148,17 +148,24 @@ public class AnnualCompPointController extends JeecgController queryWrapperComp = new LambdaQueryWrapper<>(); // id位数相同,可用like模糊 - queryWrapperComp.like(Comp::getCompAdmin, userId); + queryWrapperComp.eq(Comp::getCompAdmin, userId); List list = compService.list(queryWrapperComp); + if(list.isEmpty()){ + return Result.error("未绑定比赛"); + } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); // 获取负责的年度比赛id QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); - queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + /*queryWrapperAnnual.in(ids.size()!=0,"compid",ids);*/ + queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.isEmpty()){ + return Result.error("未创建年度比赛"); + } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapper.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapper.in("annual_comp_id",annualIds); queryWrapper.eq("annual_comp_switch","Y"); // 比赛必须是开启的 Page page = new Page(pageNo, pageSize); IPage pageList = annualCompPointService.page(page, queryWrapper);