diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java index 2cb7b065..b23edd3a 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java @@ -131,16 +131,25 @@ public class AwardPersionController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); queryWrappercomp.eq("comp_admin",user.getUsername()); + if(awardPersion.getComType()!=null){ + queryWrappercomp.eq("comp_type_id",awardPersion.getComType()); + } List list = compService.list(queryWrappercomp); if(list.size()==0){ - return Result.error("未绑定比赛"); + return Result.OK(null); +/* if(awardPersion.getComType()==null){ + return Result.error("未绑定比赛"); + }else { + return Result.error("未绑定该比赛类型的比赛"); + }*/ } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); if(listAnnual.size()==0){ - return Result.error("未创建年度比赛"); + /*return Result.error("未创建年度比赛");*/ + return Result.OK(null); } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); @@ -150,9 +159,17 @@ public class AwardPersionController extends JeecgController queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); queryWrapperacp.in("annual_comp_id",annualIds); queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 + if(awardPersion.getObjLevel()!=null){ + queryWrapperacp.eq("obj_level",awardPersion.getObjLevel()); + } List listacp = annualCompPointService.list(queryWrapperacp); if(listacp.size()==0){ - return Result.error("未创建年度比赛项目"); + /*if(awardPersion.getObjLevel()==null){ + return Result.error("未创建年度比赛项目"); + }else { + return Result.error("未创建该项目层次的年度比赛项目"); + }*/ + return Result.OK(null); } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); queryWrapper.in("annual_comp_p",acpIds); @@ -171,6 +188,33 @@ public class AwardPersionController extends JeecgController page = new Page(pageNo, pageSize); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); + if(awardPersion.getComType()!=null){ + QueryWrapper queryWrappercomp = new QueryWrapper<>(); + queryWrappercomp.eq("comp_type_id",awardPersion.getComType()); + List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.OK(null); + } + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in("compid",ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return Result.OK(null); + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + queryWrapper.in("annal_comp",annualIds); + } + if(awardPersion.getObjLevel()!=null){ + QueryWrapper queryWrapperacp = new QueryWrapper<>(); + queryWrapperacp.eq("obj_level",awardPersion.getObjLevel()); + List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.OK(null); + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in("annual_comp_p",acpIds); + } IPage pageList = awardPersionService.page(page, queryWrapper); return Result.OK(pageList); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java index 6c9d1a4d..b16e7b15 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java @@ -123,4 +123,12 @@ public class AwardPersion implements Serializable { @ApiModelProperty(value = "推荐") private String tj; + @TableField(exist = false) + @ApiModelProperty(value = "比赛类型") + private String comType; + + @TableField(exist = false) + @ApiModelProperty(value = "项目层次") + private String objLevel; + } diff --git a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue index 6063b520..869c9ce4 100644 --- a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue +++ b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue @@ -39,6 +39,18 @@ dictCode="sys_depart,depart_name,id" /> + + + + + + + + + +