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 b23edd3a..eaeacdca 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 @@ -459,8 +459,184 @@ public class AwardPersionController extends JeecgController sysRoleList = sysUserRoleService.getUserRoleByUserId(user.getId()); + if(sysRoleList.get(0).getId().equals("1724327596426760194")){ + //学生(上传证书和查询)(根据学号查询筛选) + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, request.getParameterMap()); + queryWrapper.eq("studentcode",sysUserService.getById(user.getId()).getWorkNo()); + // 过滤选中数据 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id",selectionList); + } + // Step.2 获取导出数据 + List exportList = awardPersionService.list(queryWrapper); + + // Step.3 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.FILE_NAME, "获奖管理"); + mv.addObject(NormalExcelConstants.CLASS, AwardPersion.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams=new ExportParams("获奖管理" + "报表", "导出人:" + user.getRealname(), "获奖管理"); + exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS,exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); + return mv; + }else if(sysRoleList.get(0).getId().equals("1693451972151386114")){ + //组委会(全部都可以)(根据比赛负责人查询比赛id筛选) + Comp comp = new Comp(); + QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, request.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 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 null; + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, request.getParameterMap()); + queryWrapper.in("annal_comp",annualIds); + + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, request.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){ + /*if(awardPersion.getObjLevel()==null){ + return Result.error("未创建年度比赛项目"); + }else { + return Result.error("未创建该项目层次的年度比赛项目"); + }*/ + return null; + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in("annual_comp_p",acpIds); + + // 过滤选中数据 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id",selectionList); + } + // Step.2 获取导出数据 + List exportList = awardPersionService.list(queryWrapper); + + // Step.3 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.FILE_NAME, "获奖管理"); + mv.addObject(NormalExcelConstants.CLASS, AwardPersion.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams=new ExportParams("获奖管理" + "报表", "导出人:" + user.getRealname(), "获奖管理"); + exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS,exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); + return mv; + }else if(sysRoleList.get(0).getId().equals("1693452352310517762")){ + //学院(上传和查询)(根据部门查询数据,该学院下所有学生的获奖信息) + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, request.getParameterMap()); + queryWrapper.eq("studentorg",sysDepartService.queryDepartsByUsername(user.getUsername()).get(0).getId()); + + // 过滤选中数据 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id",selectionList); + } + // Step.2 获取导出数据 + List exportList = awardPersionService.list(queryWrapper); + + // Step.3 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.FILE_NAME, "获奖管理"); + mv.addObject(NormalExcelConstants.CLASS, AwardPersion.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams=new ExportParams("获奖管理" + "报表", "导出人:" + user.getRealname(), "获奖管理"); + exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS,exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); + return mv; + }else { + //学校和超级管理员(全部都可以)(查全部数据) + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, request.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 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 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 null; + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in("annual_comp_p", acpIds); + } + // 过滤选中数据 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id", selectionList); + } + // Step.2 获取导出数据 + List exportList = awardPersionService.list(queryWrapper); + + // Step.3 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.FILE_NAME, "获奖管理"); + mv.addObject(NormalExcelConstants.CLASS, AwardPersion.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams = new ExportParams("获奖管理" + "报表", "导出人:" + user.getRealname(), "获奖管理"); + exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS, exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); + return mv; + } + + } /** * 奖项推荐导出excel 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 b16e7b15..74eece40 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 @@ -118,7 +118,7 @@ public class AwardPersion implements Serializable { private String sczs; /**推荐*/ - @Excel(name = "是否推荐", width = 15, dicCode = "yn") + //@Excel(name = "是否推荐", width = 15, dicCode = "yn") @Dict(dicCode = "yn") @ApiModelProperty(value = "推荐") private String tj; diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java index 5fea5817..be3f920e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java @@ -77,14 +77,14 @@ public class TeamSeqController extends JeecgController * @param teamSeq * @return */ - @AutoLog(value = "团队赛队员积分计算配置-添加") - @ApiOperation(value = "团队赛队员积分计算配置-添加", notes = "团队赛队员积分计算配置-添加") -// @RequiresPermissions("teamseq:team_seq:add") - @PostMapping(value = "/add") - public Result add(@RequestBody TeamSeq teamSeq) { - teamSeqService.save(teamSeq); - return Result.OK("添加成功!"); - } +// @AutoLog(value = "团队赛队员积分计算配置-添加") +// @ApiOperation(value = "团队赛队员积分计算配置-添加", notes = "团队赛队员积分计算配置-添加") +//// @RequiresPermissions("teamseq:team_seq:add") +// @PostMapping(value = "/add") +// public Result add(@RequestBody TeamSeq teamSeq) { +// teamSeqService.save(teamSeq); +// return Result.OK("添加成功!"); +// } @AutoLog(value = "团队赛队员积分计算配置-添加") @ApiOperation(value = "团队赛队员积分计算配置-添加", notes = "团队赛队员积分计算配置-添加") diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java index 7a5c6575..db3de9bb 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/service/impl/TeamSeqServiceImpl.java @@ -28,7 +28,7 @@ public class TeamSeqServiceImpl extends ServiceImpl impl } String pointId = list.get(0).getPointId(); if (StrUtil.isEmpty(pointId)) { - throw new JeecgBootException("比赛项目不能为空!"); + throw new JeecgBootException("比赛项目未创建完成,请在编辑操作中配置!"); } this.remove(new LambdaQueryWrapper().eq(TeamSeq::getPointId, pointId)); diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/controller/SysConfigurationController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/controller/SysConfigurationController.java index 4ab3ac42..2f7841c4 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/controller/SysConfigurationController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/controller/SysConfigurationController.java @@ -173,4 +173,12 @@ public class SysConfigurationController extends JeecgController findconfig(){ + SysConfiguration sysConfiguration = sysConfigurationService.findconfig(); + return Result.ok(sysConfiguration); + } } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/mapper/SysConfigurationMapper.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/mapper/SysConfigurationMapper.java index 73da150d..d838c68d 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/mapper/SysConfigurationMapper.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/mapper/SysConfigurationMapper.java @@ -3,6 +3,7 @@ package org.jeecg.modules.sysconfiguration.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.sysconfiguration.entity.SysConfiguration; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -14,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface SysConfigurationMapper extends BaseMapper { + @Select("select * from sys_configuration ") + SysConfiguration findconfig(); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/ISysConfigurationService.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/ISysConfigurationService.java index c75bbdc0..def53628 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/ISysConfigurationService.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/ISysConfigurationService.java @@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ISysConfigurationService extends IService { + SysConfiguration findconfig(); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/impl/SysConfigurationServiceImpl.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/impl/SysConfigurationServiceImpl.java index a4f82b1e..2b7c1a0c 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/impl/SysConfigurationServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/sysconfiguration/service/impl/SysConfigurationServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.modules.sysconfiguration.service.impl; import org.jeecg.modules.sysconfiguration.entity.SysConfiguration; import org.jeecg.modules.sysconfiguration.mapper.SysConfigurationMapper; import org.jeecg.modules.sysconfiguration.service.ISysConfigurationService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,4 +17,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class SysConfigurationServiceImpl extends ServiceImpl implements ISysConfigurationService { + @Autowired + private SysConfigurationMapper sysConfigurationMapper; + + @Override + public SysConfiguration findconfig() { + return sysConfigurationMapper.findconfig(); + } } diff --git a/jeecgboot-vue3-master/index.html b/jeecgboot-vue3-master/index.html index 79df3dd2..ee7e9e31 100644 --- a/jeecgboot-vue3-master/index.html +++ b/jeecgboot-vue3-master/index.html @@ -10,7 +10,7 @@ /> <%= title %> - +