奖项管理增加项目层次和比赛类型查询条件

main
Gitea 4 months ago
parent f96eb1c8be
commit 212119ee51
  1. 50
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 8
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java
  3. 12
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue

@ -131,16 +131,25 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.eq("comp_admin",user.getUsername());
if(awardPersion.getComType()!=null){
queryWrappercomp.eq("comp_type_id",awardPersion.getComType());
}
List<Comp> 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<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.error("未创建年度比赛");
/*return Result.error("未创建年度比赛");*/
return Result.OK(null);
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
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());
queryWrapperacp.in("annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
if(awardPersion.getObjLevel()!=null){
queryWrapperacp.eq("obj_level",awardPersion.getObjLevel());
}
List<AnnualCompPoint> 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<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
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);
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);
return Result.OK(pageList);
}

@ -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;
}

@ -39,6 +39,18 @@
dictCode="sys_depart,depart_name,id" />
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="比赛类型" name="comType">
<j-dict-select-tag placeholder="请选择比赛类型" v-model:value="queryParam.comType"
dictCode="comp_type,type_name,id" />
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="项目层次" name="objLevel">
<j-dict-select-tag placeholder="请选择项目层次" v-model:value="queryParam.objLevel"
dictCode="projectlevel,name,id" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">

Loading…
Cancel
Save