From 212119ee5175fa4bbce3c9faa77cf5eb79bf18dd Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 5 Aug 2024 17:33:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=96=E9=A1=B9=E7=AE=A1=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=B1=82=E6=AC=A1=E5=92=8C=E6=AF=94?= =?UTF-8?q?=E8=B5=9B=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AwardPersionController.java | 50 +++++++++++++++++-- .../awardpersion/entity/AwardPersion.java | 8 +++ .../views/awardpersion/AwardPersionList.vue | 12 +++++ 3 files changed, 67 insertions(+), 3 deletions(-) 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" /> + + + + + + + + + +