新创建的用户可以看到所有的年度比赛项目

main
王家东 4 months ago
parent a3c16d44ed
commit ba013f5ac2
  1. 13
      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<AnnualCompPoint,
// 获取负责的比赛id // 获取负责的比赛id
LambdaQueryWrapper<Comp> queryWrapperComp = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Comp> queryWrapperComp = new LambdaQueryWrapper<>();
// id位数相同,可用like模糊 // id位数相同,可用like模糊
queryWrapperComp.like(Comp::getCompAdmin, userId); queryWrapperComp.eq(Comp::getCompAdmin, userId);
List<Comp> list = compService.list(queryWrapperComp); List<Comp> list = compService.list(queryWrapperComp);
if(list.isEmpty()){
return Result.error("未绑定比赛");
}
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList()); List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
// 获取负责的年度比赛id // 获取负责的年度比赛id
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in(ids.size()!=0,"compid",ids); /*queryWrapperAnnual.in(ids.size()!=0,"compid",ids);*/
queryWrapperAnnual.in("compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if(listAnnual.isEmpty()){
return Result.error("未创建年度比赛");
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AnnualCompPoint> queryWrapper = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); QueryWrapper<AnnualCompPoint> 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"); // 比赛必须是开启的 queryWrapper.eq("annual_comp_switch","Y"); // 比赛必须是开启的
Page<AnnualCompPoint> page = new Page<AnnualCompPoint>(pageNo, pageSize); Page<AnnualCompPoint> page = new Page<AnnualCompPoint>(pageNo, pageSize);
IPage<AnnualCompPoint> pageList = annualCompPointService.page(page, queryWrapper); IPage<AnnualCompPoint> pageList = annualCompPointService.page(page, queryWrapper);

Loading…
Cancel
Save