From ee86ae6a32b9bd78cec8cd6227ef1b7acc4826f8 Mon Sep 17 00:00:00 2001 From: Gitea Date: Sun, 28 Jul 2024 16:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E6=B1=87=E6=80=BB=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualCompPointController.java | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 8ba7429c..75de9765 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -337,12 +337,11 @@ public class AnnualCompPointController extends JeecgController cjhz(@RequestParam(name = "id", required = true) String id,HttpServletRequest req) { AnnualCompPoint annualCompPoint = annualCompPointService.getById(id); - ExpScore expScore = new ExpScore(); - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("bmcode,SUM(score) as score"); queryWrapper.eq("ann_com_p",id); - queryWrapper.having("sum(score)"); - queryWrapper.groupBy("bmcode"); queryWrapper.eq("ispf","1"); + queryWrapper.groupBy("bmcode"); List list = expScoreService.list(queryWrapper); for (int i = 0 ; i < list.size() ; i++){ AnnComGroTopP annComGroTopP = new AnnComGroTopP(); @@ -354,15 +353,17 @@ public class AnnualCompPointController extends JeecgController queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.eq("bmcode",list.get(i).getBmcode()); + List list1 = expScoreService.list(queryWrapper1); + scorePersion.setAnnualid(list1.get(0).getAnnid()); + scorePersion.setAnnualCompid(list1.get(0).getAnnalComp()); + scorePersion.setAnnualCompP(list1.get(0).getAnnComP()); scorePersion.setEnrollCode(list.get(i).getBmcode()); scorePersion.setScore(dfstr); scorePersionService.save(scorePersion); } - ScorePersion scorePersion = new ScorePersion(); - QueryWrapper queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); + QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); queryWrappersp.eq("annual_comp_p",id); @@ -408,12 +409,11 @@ public class AnnualCompPointController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("bmcode,SUM(score) as score"); queryWrapper.eq("ann_com_p",scorePersiontem.getAnnualCompP()); - queryWrapper.having("sum(score)"); - queryWrapper.groupBy("bmcode"); queryWrapper.eq("ispf","1"); + queryWrapper.groupBy("bmcode"); List list = expScoreService.list(queryWrapper); for (int i = 0 ; i < list.size() ; i++){ AnnComGroTopP annComGroTopP = new AnnComGroTopP(); @@ -425,19 +425,21 @@ public class AnnualCompPointController extends JeecgController queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.eq("bmcode",list.get(i).getBmcode()); + List list1 = expScoreService.list(queryWrapper1); + scorePersion.setAnnualid(list1.get(0).getAnnid()); + scorePersion.setAnnualCompid(list1.get(0).getAnnalComp()); + scorePersion.setAnnualCompP(list1.get(0).getAnnComP()); scorePersion.setEnrollCode(list.get(i).getBmcode()); scorePersion.setScore(dfstr); scorePersionService.save(scorePersion); } - ScorePersion scorePersion = new ScorePersion(); - QueryWrapper queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); + QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); queryWrappersp.eq("annual_comp_p",scorePersiontem.getAnnualCompP()); - queryWrappersp.orderByDesc("score"); + queryWrappersp.orderByDesc("score+0"); List listsp = scorePersionService.list(queryWrappersp); for (int k = 0 ; k < listsp.size() ;k++){ if(k==0){ @@ -487,6 +489,7 @@ public class AnnualCompPointController extends JeecgController list = expScoreService.list(queryWrapper); ExpScore expScore1 = list.get(0); expScore1.setIspf("0"); + expScoreService.updateById(expScore1); } } @@ -510,8 +513,7 @@ public class AnnualCompPointController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); queryWrapper.eq("annucompid",id); List list = annualCompAwardService.list(queryWrapper); - ScorePersion scorePersion = new ScorePersion(); - QueryWrapper queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); + QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); queryWrappersp.eq("annual_comp_p",id); @@ -670,8 +672,7 @@ public class AnnualCompPointController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); List list = annualCompAwardService.list(queryWrapper); - ScorePersion scorePersion = new ScorePersion(); - QueryWrapper queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); + QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); queryWrappersp.eq("annual_comp_p",awardPersion.getAnnualCompP());