From 03f6700b0df19e10f453e9e0efdd0406e814a5dc Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 8 Dec 2023 17:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ExpScoreController.java | 68 ++++++++++++------- .../controller/ScoreStaController.java | 38 +++++++++++ .../topic/controller/TopicController.java | 27 +++++--- 3 files changed, 97 insertions(+), 36 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java index f2dc8d4d..2124ed14 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java @@ -106,34 +106,52 @@ public class ExpScoreController extends JeecgController listeslist = expScoreService.list(queryWrapperlist); if(listeslist.size()==0){ - for (int i = 0 ; i < listeg.size();i++){ - AnnComGroTopP annComGroTopP = new AnnComGroTopP(); - QueryWrapper queryWrapperacgtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); - queryWrapperacgtp.eq("ann_com_gro_topid",xmtmid); - List listacftp = annComGroTopPService.list(queryWrapperacgtp); - ExpScore expScore1 = new ExpScore(); - expScore1.setAnnid(annComGroTop.getAnnid()); - expScore1.setAnnComP(annComGroTop.getAnnComP()); - expScore1.setAnnalComp(annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId()); - expScore1.setTopid(annComGroTop.getTopid()); - expScore1.setBmcode(listacftp.get(0).getBmcode()); + AnnComGroTopP annComGroTopP = new AnnComGroTopP(); + QueryWrapper queryWrapperacgtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); + queryWrapperacgtp.eq("ann_com_gro_topid",xmtmid); + List listacftp = annComGroTopPService.list(queryWrapperacgtp); + if(listacftp.size()==0){ + return Result.error("题目未绑定报名编号,请联系组委会"); + } + for(int l = 0 ; l < listacftp.size() ; l++){ UpfilePersion upfilePersion = new UpfilePersion(); QueryWrapper queryWrapperup = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap()); - queryWrapperup.eq("apply_code",listacftp.get(0).getBmcode()); + queryWrapperup.eq("apply_code",listacftp.get(l).getBmcode()); List listup = upfilePersionService.list(queryWrapperup); - expScore1.setUpfilePersionId(listup.get(0).getId().toString()); - ScoreSta scoreSta = new ScoreSta(); - QueryWrapper queryWrapperss = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap()); - queryWrapperss.eq("annual_id",annComGroTop.getAnnid()); - queryWrapperss.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId()); - queryWrapperss.eq("annual_compid",annComGroTop.getAnnComP()); - queryWrapperss.eq("topicid",annComGroTop.getTopid()); - List listss = scoreStaService.list(queryWrapperss); - expScore1.setScoreStaid(listss.get(0).getId()); - expScore1.setScore(0); - expScore1.setUserid(expertService.getById(listeg.get(i).getGrouid()).getUserId()); - expScore1.setIspf("0"); - expScoreService.save(expScore1); + if(listup.size()==0){ + return Result.error("报名编号为:"+listacftp.get(l).getBmcode()+"未上传作品,请联系组委会"); + } + } + ScoreSta scoreSta = new ScoreSta(); + QueryWrapper queryWrapperss = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap()); + queryWrapperss.eq("annual_id",annComGroTop.getAnnid()); + queryWrapperss.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId()); + queryWrapperss.eq("annual_compid",annComGroTop.getAnnComP()); + queryWrapperss.eq("topicid",annComGroTop.getTopid()); + List listss = scoreStaService.list(queryWrapperss); + if(listss.size()==0){ + return Result.error("未设置评分标准,请联系组委会"); + } + for (int i = 0 ; i < listeg.size();i++){ + for(int l = 0 ; l < listacftp.size() ; l++){ + UpfilePersion upfilePersion = new UpfilePersion(); + QueryWrapper queryWrapperup = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap()); + queryWrapperup.eq("apply_code",listacftp.get(l).getBmcode()); + List listup = upfilePersionService.list(queryWrapperup); + ExpScore expScore1 = new ExpScore(); + expScore1.setAnnid(annComGroTop.getAnnid()); + expScore1.setAnnComP(annComGroTop.getAnnComP()); + expScore1.setAnnalComp(annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId()); + expScore1.setTopid(annComGroTop.getTopid()); + expScore1.setBmcode(listacftp.get(l).getBmcode()); + expScore1.setUpfilePersionId(listup.get(0).getId().toString()); + expScore1.setScoreStaid(listss.get(0).getId()); + expScore1.setScore(0); + expScore1.setUserid(expertService.getById(listeg.get(i).getGrouid()).getUserId()); + expScore1.setIspf("0"); + expScoreService.save(expScore1); + } + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java index 9dc72f05..0534484d 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java @@ -9,9 +9,19 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; +import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; +import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; +import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; +import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup; +import org.jeecg.modules.demo.comp.entity.Comp; +import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.scoresta.entity.ScoreSta; import org.jeecg.modules.demo.scoresta.service.IScoreStaService; @@ -50,6 +60,12 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class ScoreStaController extends JeecgController { @Autowired private IScoreStaService scoreStaService; + @Autowired + private ICompService compService; + @Autowired + private IAnnualCompService annualCompService; + @Autowired + private IAnnualCompPointService annualCompPointService; /** * 分页列表查询 @@ -67,7 +83,29 @@ public class ScoreStaController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); + queryWrappercomp.like("comp_admin",user.getUsername()); + List list = compService.list(queryWrappercomp); + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap()); + queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); + + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in(acpIds.size()!=0,"annual_compid",acpIds); + + Page page = new Page(pageNo, pageSize); IPage pageList = scoreStaService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java index 59b1cb1f..2d4ea113 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java @@ -102,18 +102,23 @@ public class TopicController extends JeecgController { queryWrapper.eq("annual_compid",annualCompGroup.getAnnCompP()); queryWrapper.eq("status",2); queryWrapper.eq("isopen","Y"); - AnnComGroTop annComGroTop = new AnnComGroTop(); - QueryWrapper queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); - queryWrapper1.eq("ann_com_p_g",ndbsxzid); - List listagt = annComGroTopService.list(queryWrapper1); - String str = ""; - for(int i = 0 ; i queryWrapper1 = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap()); + queryWrapper1.eq("ann_com_p_g",ndbsxzid); + List listagt = annComGroTopService.list(queryWrapper1); + String str = ""; + for(int i = 0 ; i page = new Page(pageNo, pageSize); + IPage pageList = topicService.page(page, queryWrapper); + return Result.OK(pageList); } - Page page = new Page(pageNo, pageSize); - IPage pageList = topicService.page(page, queryWrapper); - return Result.OK(pageList); + } /**