|
|
@ -131,16 +131,25 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward |
|
|
|
Comp comp = new Comp(); |
|
|
|
Comp comp = new Comp(); |
|
|
|
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); |
|
|
|
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); |
|
|
|
queryWrappercomp.eq("comp_admin",user.getUsername()); |
|
|
|
queryWrappercomp.eq("comp_admin",user.getUsername()); |
|
|
|
|
|
|
|
if(awardPersion.getComType()!=null){ |
|
|
|
|
|
|
|
queryWrappercomp.eq("comp_type_id",awardPersion.getComType()); |
|
|
|
|
|
|
|
} |
|
|
|
List<Comp> list = compService.list(queryWrappercomp); |
|
|
|
List<Comp> list = compService.list(queryWrappercomp); |
|
|
|
if(list.size()==0){ |
|
|
|
if(list.size()==0){ |
|
|
|
return Result.error("未绑定比赛"); |
|
|
|
return Result.OK(null); |
|
|
|
|
|
|
|
/* if(awardPersion.getComType()==null){ |
|
|
|
|
|
|
|
return Result.error("未绑定比赛"); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
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()); |
|
|
|
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); |
|
|
|
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); |
|
|
|
queryWrapperAnnual.in("compid",ids); |
|
|
|
queryWrapperAnnual.in("compid",ids); |
|
|
|
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); |
|
|
|
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); |
|
|
|
if(listAnnual.size()==0){ |
|
|
|
if(listAnnual.size()==0){ |
|
|
|
return Result.error("未创建年度比赛"); |
|
|
|
/*return Result.error("未创建年度比赛");*/ |
|
|
|
|
|
|
|
return Result.OK(null); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); |
|
|
|
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); |
|
|
|
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); |
|
|
|
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); |
|
|
@ -150,9 +159,17 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward |
|
|
|
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); |
|
|
|
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); |
|
|
|
queryWrapperacp.in("annual_comp_id",annualIds); |
|
|
|
queryWrapperacp.in("annual_comp_id",annualIds); |
|
|
|
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
|
|
|
|
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
|
|
|
|
|
|
|
|
if(awardPersion.getObjLevel()!=null){ |
|
|
|
|
|
|
|
queryWrapperacp.eq("obj_level",awardPersion.getObjLevel()); |
|
|
|
|
|
|
|
} |
|
|
|
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); |
|
|
|
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); |
|
|
|
if(listacp.size()==0){ |
|
|
|
if(listacp.size()==0){ |
|
|
|
return Result.error("未创建年度比赛项目"); |
|
|
|
/*if(awardPersion.getObjLevel()==null){ |
|
|
|
|
|
|
|
return Result.error("未创建年度比赛项目"); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
return Result.error("未创建该项目层次的年度比赛项目"); |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
return Result.OK(null); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); |
|
|
|
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); |
|
|
|
queryWrapper.in("annual_comp_p",acpIds); |
|
|
|
queryWrapper.in("annual_comp_p",acpIds); |
|
|
@ -171,6 +188,33 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward |
|
|
|
//学校和超级管理员(全部都可以)(查全部数据)
|
|
|
|
//学校和超级管理员(全部都可以)(查全部数据)
|
|
|
|
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize); |
|
|
|
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize); |
|
|
|
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); |
|
|
|
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); |
|
|
|
|
|
|
|
if(awardPersion.getComType()!=null){ |
|
|
|
|
|
|
|
QueryWrapper<Comp> queryWrappercomp = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrappercomp.eq("comp_type_id",awardPersion.getComType()); |
|
|
|
|
|
|
|
List<Comp> list = compService.list(queryWrappercomp); |
|
|
|
|
|
|
|
if(list.size()==0){ |
|
|
|
|
|
|
|
return Result.OK(null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapperAnnual.in("compid",ids); |
|
|
|
|
|
|
|
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); |
|
|
|
|
|
|
|
if(listAnnual.size()==0){ |
|
|
|
|
|
|
|
return Result.OK(null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
queryWrapper.in("annal_comp",annualIds); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(awardPersion.getObjLevel()!=null){ |
|
|
|
|
|
|
|
QueryWrapper<AnnualCompPoint> queryWrapperacp = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapperacp.eq("obj_level",awardPersion.getObjLevel()); |
|
|
|
|
|
|
|
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); |
|
|
|
|
|
|
|
if(listacp.size()==0){ |
|
|
|
|
|
|
|
return Result.OK(null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
queryWrapper.in("annual_comp_p",acpIds); |
|
|
|
|
|
|
|
} |
|
|
|
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper); |
|
|
|
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper); |
|
|
|
return Result.OK(pageList); |
|
|
|
return Result.OK(pageList); |
|
|
|
} |
|
|
|
} |
|
|
|