成绩汇总报错

main
Gitea 4 months ago
parent 227b2ee93d
commit ee86ae6a32
  1. 47
      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<AnnualCompPoint,
@GetMapping(value = "/cjhz")
public Result<String> cjhz(@RequestParam(name = "id", required = true) String id,HttpServletRequest req) {
AnnualCompPoint annualCompPoint = annualCompPointService.getById(id);
ExpScore expScore = new ExpScore();
QueryWrapper<ExpScore> queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap());
QueryWrapper<ExpScore> 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<ExpScore> 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<AnnualCompPoint,
DecimalFormat decimalFormat = new DecimalFormat("0.00");
String dfstr = decimalFormat.format(df);
ScorePersion scorePersion = new ScorePersion();
scorePersion.setAnnualid(list.get(i).getAnnid());
scorePersion.setAnnualCompid(list.get(i).getAnnalComp());
scorePersion.setAnnualCompP(list.get(i).getAnnComP());
QueryWrapper<ExpScore> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("bmcode",list.get(i).getBmcode());
List<ExpScore> 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<ScorePersion> queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap());
QueryWrapper<ScorePersion> 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<AnnualCompPoint,
}
}
AnnualCompPoint annualCompPoint = annualCompPointService.getById(scorePersiontem.getAnnualCompP());
ExpScore expScore = new ExpScore();
QueryWrapper<ExpScore> queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap());
QueryWrapper<ExpScore> 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<ExpScore> 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<AnnualCompPoint,
DecimalFormat decimalFormat = new DecimalFormat("0.00");
String dfstr = decimalFormat.format(df);
ScorePersion scorePersion = new ScorePersion();
scorePersion.setAnnualid(list.get(i).getAnnid());
scorePersion.setAnnualCompid(list.get(i).getAnnalComp());
scorePersion.setAnnualCompP(list.get(i).getAnnComP());
QueryWrapper<ExpScore> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("bmcode",list.get(i).getBmcode());
List<ExpScore> 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<ScorePersion> queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap());
QueryWrapper<ScorePersion> 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<ScorePersion> listsp = scorePersionService.list(queryWrappersp);
for (int k = 0 ; k < listsp.size() ;k++){
if(k==0){
@ -487,6 +489,7 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
List<ExpScore> list = expScoreService.list(queryWrapper);
ExpScore expScore1 = list.get(0);
expScore1.setIspf("0");
expScoreService.updateById(expScore1);
}
}
@ -510,8 +513,7 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
QueryWrapper<AnnualCompAward> queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap());
queryWrapper.eq("annucompid",id);
List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper);
ScorePersion scorePersion = new ScorePersion();
QueryWrapper<ScorePersion> queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap());
QueryWrapper<ScorePersion> 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<AnnualCompPoint,
QueryWrapper<AnnualCompAward> queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap());
queryWrapper.eq("annucompid",awardPersion.getAnnualCompP());
List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper);
ScorePersion scorePersion = new ScorePersion();
QueryWrapper<ScorePersion> queryWrappersp = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap());
QueryWrapper<ScorePersion> queryWrappersp = new QueryWrapper<>();
queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid());
queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId());
queryWrappersp.eq("annual_comp_p",awardPersion.getAnnualCompP());

Loading…
Cancel
Save