diff --git a/src/main/java/com/sztzjy/money_management/controller/GradeController.java b/src/main/java/com/sztzjy/money_management/controller/GradeController.java index 25e6123..3082e3a 100644 --- a/src/main/java/com/sztzjy/money_management/controller/GradeController.java +++ b/src/main/java/com/sztzjy/money_management/controller/GradeController.java @@ -1,8 +1,6 @@ package com.sztzjy.money_management.controller; import cn.hutool.core.util.IdUtil; -import cn.hutool.json.JSONObject; -import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.nimbusds.jose.shaded.gson.Gson; @@ -19,9 +17,7 @@ import com.sztzjy.money_management.util.excel.FilePortUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import io.swagger.models.auth.In; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.formula.functions.T; import org.python.core.AstList; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -102,14 +98,14 @@ public class GradeController { @ApiOperation("实训演练-学习成绩得分情况展示") @PostMapping("getScoreInfo") public ResultEntity getScoreInfo(@RequestParam String userId, - @RequestParam String chapterId, - @RequestParam String schoolId) { - StudentScoreWeight studentScoreWeight=new StudentScoreWeight(); + @RequestParam String chapterId, + @RequestParam String schoolId) { + StudentScoreWeight studentScoreWeight = new StudentScoreWeight(); //先根据schoolID和chapterId查出学习成绩权重表数据 StudentScoreWeightExample studentScoreWeightExample = new StudentScoreWeightExample(); studentScoreWeightExample.createCriteria().andSchoolIdEqualTo(schoolId).andChapterIdEqualTo(chapterId); List studentScoreWeights = studentScoreWeightMapper.selectByExample(studentScoreWeightExample); - if(studentScoreWeights.isEmpty()){ //设置默认权重与计分规则 + if (studentScoreWeights.isEmpty()) { //设置默认权重与计分规则 //计分规则 studentScoreWeight.setSummaryOfKnowledgeScore(BigDecimal.valueOf(20)); studentScoreWeight.setResourceLearningScore(BigDecimal.valueOf(2)); @@ -122,15 +118,15 @@ public class GradeController { studentScoreWeight.setLearningAssessmentWeight(BigDecimal.valueOf(0.2)); studentScoreWeight.setExperimentalTrainingWeight(BigDecimal.valueOf(0.2)); studentScoreWeight.setReportWeight(BigDecimal.valueOf(0.2)); - }else { + } else { studentScoreWeight = studentScoreWeights.get(0); } //再根据userid和chapterId查出学生实训表中的数据 StuTrainingExample stuTrainingExample = new StuTrainingExample(); stuTrainingExample.createCriteria().andUserIdEqualTo(userId).andChapterIdEqualTo(chapterId); List stuTrainings = trainingMapper.selectByExample(stuTrainingExample); - StuTraining stuTraining=new StuTraining(); - if(!stuTrainings.isEmpty()){ + StuTraining stuTraining = new StuTraining(); + if (!stuTrainings.isEmpty()) { stuTraining = stuTrainings.get(0); } //进行整合 @@ -147,40 +143,40 @@ public class GradeController { stuTrainingDto.setExpTrainingWeight(studentScoreWeight.getExperimentalTrainingWeight()); stuTrainingDto.setReportWeight(studentScoreWeight.getReportWeight()); //设置返回对象完成情况 - stuTrainingDto.setKnowledgeSummaryCompleteStatus(stuTraining.getKnowledgeSummaryCompleteStatus()==null?0:stuTraining.getKnowledgeSummaryCompleteStatus()); - stuTrainingDto.setResourceLearningCompleteStatus(stuTraining.getResourceLearningCompleteStatus()==null?0:stuTraining.getResourceLearningCompleteStatus()); - stuTrainingDto.setLearningEvalCompleteStatus(stuTraining.getLearningEvalCompleteStatus()==null?0:stuTraining.getLearningEvalCompleteStatus()); - stuTrainingDto.setExpTrainingCompleteStatus(stuTraining.getExpTrainingCompleteStatus()==null?0:stuTraining.getExpTrainingCompleteStatus()); + stuTrainingDto.setKnowledgeSummaryCompleteStatus(stuTraining.getKnowledgeSummaryCompleteStatus() == null ? 0 : stuTraining.getKnowledgeSummaryCompleteStatus()); + stuTrainingDto.setResourceLearningCompleteStatus(stuTraining.getResourceLearningCompleteStatus() == null ? 0 : stuTraining.getResourceLearningCompleteStatus()); + stuTrainingDto.setLearningEvalCompleteStatus(stuTraining.getLearningEvalCompleteStatus() == null ? 0 : stuTraining.getLearningEvalCompleteStatus()); + stuTrainingDto.setExpTrainingCompleteStatus(stuTraining.getExpTrainingCompleteStatus() == null ? 0 : stuTraining.getExpTrainingCompleteStatus()); TrainingReportExample trainingReportExample = new TrainingReportExample(); trainingReportExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId); //设置返回对象得分 根据学生实训表完成情况 设置得分 - stuTrainingDto.setKnowledgeSummaryScore(studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(stuTraining.getKnowledgeSummaryCompleteStatus()==null?0:stuTraining.getKnowledgeSummaryCompleteStatus()))); - stuTrainingDto.setResourceLearningScore(studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(stuTraining.getResourceLearningCompleteStatus()==null?0:stuTraining.getResourceLearningCompleteStatus()))); - stuTrainingDto.setLearningEvalScore(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(stuTraining.getLearningEvalCompleteStatus()==null?0:stuTraining.getLearningEvalCompleteStatus()))); - stuTrainingDto.setCaseStuScore(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()==null?0:stuTraining.getExpTrainingCompleteStatus()))); - if(stuTrainingDto.getKnowledgeSummaryScore().compareTo(BigDecimal.valueOf(100))>0){ + stuTrainingDto.setKnowledgeSummaryScore(studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(stuTraining.getKnowledgeSummaryCompleteStatus() == null ? 0 : stuTraining.getKnowledgeSummaryCompleteStatus()))); + stuTrainingDto.setResourceLearningScore(studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(stuTraining.getResourceLearningCompleteStatus() == null ? 0 : stuTraining.getResourceLearningCompleteStatus()))); + stuTrainingDto.setLearningEvalScore(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(stuTraining.getLearningEvalCompleteStatus() == null ? 0 : stuTraining.getLearningEvalCompleteStatus()))); + stuTrainingDto.setCaseStuScore(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus() == null ? 0 : stuTraining.getExpTrainingCompleteStatus()))); + if (stuTrainingDto.getKnowledgeSummaryScore().compareTo(BigDecimal.valueOf(100)) > 0) { stuTrainingDto.setKnowledgeSummaryScore(BigDecimal.valueOf(100)); } - if(stuTrainingDto.getResourceLearningScore().compareTo(BigDecimal.valueOf(100))>0){ + if (stuTrainingDto.getResourceLearningScore().compareTo(BigDecimal.valueOf(100)) > 0) { stuTrainingDto.setResourceLearningScore(BigDecimal.valueOf(100)); } - if(stuTrainingDto.getLearningEvalScore().compareTo(BigDecimal.valueOf(100))>0){ + if (stuTrainingDto.getLearningEvalScore().compareTo(BigDecimal.valueOf(100)) > 0) { stuTrainingDto.setLearningEvalScore(BigDecimal.valueOf(100)); } - if(stuTrainingDto.getCaseStuScore().compareTo(BigDecimal.valueOf(100))>0){ + if (stuTrainingDto.getCaseStuScore().compareTo(BigDecimal.valueOf(100)) > 0) { stuTrainingDto.setCaseStuScore(BigDecimal.valueOf(100)); } //设置实验报告情况及得分 List trainingReports = trainingReportMapper.selectByExample(trainingReportExample); - if(trainingReports.isEmpty()){ + if (trainingReports.isEmpty()) { stuTrainingDto.setReportCompleteStatus("未提交"); stuTrainingDto.setReportScore(BigDecimal.valueOf(0)); - }else { + } else { stuTrainingDto.setReportCompleteStatus("已提交"); stuTrainingDto.setReportScore(trainingReports.get(0).getTeacherScore()); } - return new ResultEntity<>(HttpStatus.OK, "得分情况展示",stuTrainingDto); + return new ResultEntity<>(HttpStatus.OK, "得分情况展示", stuTrainingDto); } @@ -206,15 +202,14 @@ public class GradeController { } - //学生端 客户案例成绩展示 @AnonymousAccess @ApiOperation("学生端-成绩中心-客户案例成绩展示") @PostMapping("selectStuClientCaseScoreList") public ResultEntity> selectStuClientCaseScoreList(@RequestParam String userId, - @RequestParam String schoolId) { - List list=trainingService.selectStuClientCaseScoreList(userId,schoolId); - return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-客户案例成绩展示",list); + @RequestParam String schoolId) { + List list = trainingService.selectStuClientCaseScoreList(userId, schoolId); + return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-客户案例成绩展示", list); } //学生端 综合规划成绩 @@ -223,8 +218,8 @@ public class GradeController { @PostMapping("selectStuSynthesisPlanScoreList") public ResultEntity> selectStuSynthesisPlanScoreList(@RequestParam String userId, @RequestParam String schoolId) { - List list=trainingService.selectStuSynthesisPlanScoreList(userId,schoolId); - return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-综合规划成绩展示",list); + List list = trainingService.selectStuSynthesisPlanScoreList(userId, schoolId); + return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-综合规划成绩展示", list); } //学生端 综合规划审核报告展示 同综合规划-规划报告-审核报告 @@ -233,10 +228,10 @@ public class GradeController { @AnonymousAccess @ApiOperation("学生端-成绩中心-理论考核成绩展示") @PostMapping("selectStuTheoryScore") - public ResultEntity selectStuTheoryRecord(@RequestParam String userId,@RequestParam String schoolId) { + public ResultEntity selectStuTheoryRecord(@RequestParam String userId, @RequestParam String schoolId) { StuTheoryRecord stuTheoryRecord = stuTheoryRecordMapper.selectByPrimaryKey(userId); - if(stuTheoryRecord==null){ - return new ResultEntity<>(HttpStatus.OK, "暂无数据",null); + if (stuTheoryRecord == null) { + return new ResultEntity<>(HttpStatus.OK, "暂无数据", null); } StuTheoryRecordDto stuTheoryRecordDto = new StuTheoryRecordDto(); stuTheoryRecordDto.setExamCount(stuTheoryRecord.getExamCount()); @@ -246,12 +241,12 @@ public class GradeController { //设置权重 TotalWeight totalWeight = totalWeightMapper.selectByPrimaryKey(schoolId); - if(totalWeight==null){ + if (totalWeight == null) { stuTheoryRecordDto.setWeight(BigDecimal.valueOf(0.2)); - }else { + } else { stuTheoryRecordDto.setWeight(totalWeight.getLlkh()); } - return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-理论考核成绩展示",stuTheoryRecordDto); + return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-理论考核成绩展示", stuTheoryRecordDto); } @@ -260,34 +255,34 @@ public class GradeController { @ApiOperation("学生端-成绩中心-成绩总览展示") @PostMapping("selectStuTotalScore") public ResultEntity> selectStuTotalScore(@RequestParam String userId, @RequestParam String schoolId) { - List returnDtoList=new ArrayList<>(); + List returnDtoList = new ArrayList<>(); //客户案例数据 StuTotalScoreDto clientCaseReturnDto = new StuTotalScoreDto(); - List clientCaseList=trainingService.selectStuClientCaseScoreList(userId,schoolId); + List clientCaseList = trainingService.selectStuClientCaseScoreList(userId, schoolId); clientCaseReturnDto.setModelName("客户案例成绩"); - BigDecimal clientCaseTrainingTime=BigDecimal.ZERO; - BigDecimal clientCaseTotalTrainingScore=BigDecimal.ZERO; + BigDecimal clientCaseTrainingTime = BigDecimal.ZERO; + BigDecimal clientCaseTotalTrainingScore = BigDecimal.ZERO; clientCaseReturnDto.setTrainingScore(BigDecimal.ZERO); clientCaseReturnDto.setTrainingTotalScore(BigDecimal.ZERO); clientCaseReturnDto.setUseTime(BigDecimal.ZERO); //根据学校iD获取成绩总览权重 TotalWeight totalWeight = totalWeightMapper.selectByPrimaryKey(schoolId); - if(totalWeight==null){ - totalWeight=new TotalWeight(); + if (totalWeight == null) { + totalWeight = new TotalWeight(); totalWeight.setKhan(BigDecimal.valueOf(0.4)); totalWeight.setZhgh(BigDecimal.valueOf(0.4)); totalWeight.setLlkh(BigDecimal.valueOf(0.2)); } clientCaseReturnDto.setScoreWight(totalWeight.getKhan()); - if(clientCaseList.isEmpty()){ + if (clientCaseList.isEmpty()) { returnDtoList.add(clientCaseReturnDto); - }else { + } else { for (int i = 0; i < clientCaseList.size(); i++) { StuClientCaseScoreDto clientCase = clientCaseList.get(i); - BigDecimal trainingTime = clientCase.getTrainingTime()==null?BigDecimal.ZERO:clientCase.getTrainingTime(); + BigDecimal trainingTime = clientCase.getTrainingTime() == null ? BigDecimal.ZERO : clientCase.getTrainingTime(); BigDecimal totalScore = clientCase.getTrainingTotalScore() == null ? BigDecimal.ZERO : clientCase.getTrainingTotalScore(); - clientCaseTrainingTime=clientCaseTrainingTime.add(trainingTime); - clientCaseTotalTrainingScore=clientCaseTotalTrainingScore.add(totalScore); + clientCaseTrainingTime = clientCaseTrainingTime.add(trainingTime); + clientCaseTotalTrainingScore = clientCaseTotalTrainingScore.add(totalScore); } clientCaseReturnDto.setTrainingTotalScore(clientCaseTotalTrainingScore); clientCaseReturnDto.setUseTime(clientCaseTrainingTime); @@ -301,13 +296,13 @@ public class GradeController { ScoreRankExample scoreRankExample = new ScoreRankExample(); scoreRankExample.createCriteria().andUseridEqualTo(userId).andUpdateDateEqualTo(scoreRankService.getNowDate()); List scoreRankList = scoreRankMapper.selectByExample(scoreRankExample); - if(scoreRankList.isEmpty()){ + if (scoreRankList.isEmpty()) { synthesisPlanReturnDto.setTrainingScore(BigDecimal.ZERO); synthesisPlanReturnDto.setUseTime(BigDecimal.ZERO); synthesisPlanReturnDto.setTrainingTotalScore(BigDecimal.ZERO); - }else { + } else { ScoreRank scoreRank = scoreRankList.get(0); - Integer totalUseTime=synthesisPlanClientMapper.getTotalUseTime(userId); + Integer totalUseTime = synthesisPlanClientMapper.getTotalUseTime(userId); synthesisPlanReturnDto.setUseTime(BigDecimal.valueOf(totalUseTime)); synthesisPlanReturnDto.setTrainingScore(scoreRank.getZhghScore().multiply(totalWeight.getZhgh())); synthesisPlanReturnDto.setTrainingTotalScore(scoreRank.getZhghScore()); @@ -318,17 +313,17 @@ public class GradeController { //理论考试成绩 StuTotalScoreDto theoryReturnDto = new StuTotalScoreDto(); theoryReturnDto.setModelName("理论考试成绩"); - if(scoreRankList.isEmpty()){ + if (scoreRankList.isEmpty()) { theoryReturnDto.setTrainingScore(BigDecimal.ZERO); theoryReturnDto.setUseTime(BigDecimal.ZERO); theoryReturnDto.setTrainingTotalScore(BigDecimal.ZERO); - }else { + } else { StuTheoryRecord stuTheoryRecord = stuTheoryRecordMapper.selectByPrimaryKey(userId); - if(stuTheoryRecord==null){ + if (stuTheoryRecord == null) { theoryReturnDto.setTrainingScore(BigDecimal.ZERO); theoryReturnDto.setUseTime(BigDecimal.ZERO); theoryReturnDto.setTrainingTotalScore(BigDecimal.ZERO); - }else { + } else { theoryReturnDto.setUseTime(stuTheoryRecord.getTotalDuration()); theoryReturnDto.setTrainingTotalScore(stuTheoryRecord.getAverageScore()); theoryReturnDto.setTrainingTotalScore(stuTheoryRecord.getAverageScore().multiply(totalWeight.getLlkh())); @@ -336,7 +331,7 @@ public class GradeController { } theoryReturnDto.setScoreWight(totalWeight.getLlkh()); returnDtoList.add(theoryReturnDto); - return new ResultEntity<>(HttpStatus.OK,"学生端-成绩中心-成绩总览展示成功" ,returnDtoList); + return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-成绩总览展示成功", returnDtoList); } @@ -344,29 +339,29 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-成绩总览展示") @PostMapping("selectTeaSummaryOfResults") - public ResultEntity> selectTeaSummaryOfResults(@RequestParam String schoolId,@RequestParam Integer index,@RequestParam Integer size, - @RequestParam(required = false) String name, - @RequestParam(required = false) String studentId, - @RequestParam(required = false) String classId){ + public ResultEntity> selectTeaSummaryOfResults(@RequestParam String schoolId, @RequestParam Integer index, @RequestParam Integer size, + @RequestParam(required = false) String name, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String classId) { PageHelper.startPage(index, size); ScoreRankExample scoreRankExample = new ScoreRankExample(); ScoreRankExample.Criteria criteria = scoreRankExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId).andUpdateDateEqualTo(scoreRankService.getNowDate()); - if(StringUtils.isNotBlank(name)){ + if (StringUtils.isNotBlank(name)) { criteria.andNameEqualTo(name); } - if(StringUtils.isNotBlank(studentId)){ + if (StringUtils.isNotBlank(studentId)) { criteria.andSchoolIdEqualTo(studentId); } - if(StringUtils.isNotBlank(classId)){ + if (StringUtils.isNotBlank(classId)) { criteria.andClassIdEqualTo(classId); } scoreRankExample.setOrderByClause("khal_score+zhgh_score+llkh_score desc"); List scoreRankList = scoreRankMapper.selectByExample(scoreRankExample); //查询成绩总览权重 TotalWeight totalWeight = totalWeightMapper.selectByPrimaryKey(schoolId); - if(totalWeight==null){ - totalWeight=new TotalWeight(); + if (totalWeight == null) { + totalWeight = new TotalWeight(); totalWeight.setKhan(BigDecimal.valueOf(0.4)); totalWeight.setZhgh(BigDecimal.valueOf(0.4)); totalWeight.setLlkh(BigDecimal.valueOf(0.2)); @@ -385,10 +380,10 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-成绩总览权重查询") @PostMapping("seleteTotalWeight") - public ResultEntity seleteTotalWeight(@RequestBody String schoolId){ + public ResultEntity seleteTotalWeight(@RequestBody String schoolId) { TotalWeight totalWeight = totalWeightMapper.selectByPrimaryKey(schoolId); - if(totalWeight==null){ - totalWeight=new TotalWeight(); + if (totalWeight == null) { + totalWeight = new TotalWeight(); totalWeight.setSchoolId(schoolId); totalWeight.setKhan(BigDecimal.valueOf(0.4)); totalWeight.setZhgh(BigDecimal.valueOf(0.4)); @@ -400,33 +395,32 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-成绩总览权重设置") @PostMapping("setTotalWeight") - public Boolean setTotalWeight(@RequestBody TotalWeight totalWeight){ + public Boolean setTotalWeight(@RequestBody TotalWeight totalWeight) { TotalWeight totalWeight1 = totalWeightMapper.selectByPrimaryKey(totalWeight.getSchoolId()); - if(totalWeight1==null){ + if (totalWeight1 == null) { int insert = totalWeightMapper.insert(totalWeight); - return insert==1; - }else { + return insert == 1; + } else { int i = totalWeightMapper.updateByPrimaryKey(totalWeight); - return i==1; + return i == 1; } } - //教师端 成绩总览导出 @AnonymousAccess @GetMapping("/exportSummaryOfResults") @ApiOperation("教师端--成绩总览导出页面导出") public void exportSummaryOfResults(HttpServletResponse response, - @RequestParam String schoolId) { - List scoreRankList=scoreRankService.selectExportScoreRankList(schoolId); + @RequestParam String schoolId) { + List scoreRankList = scoreRankService.selectExportScoreRankList(schoolId); //导出的表名 String title = "成绩总览"; //表中第一行表头字段 String[] headers = {"排名", "姓名", "学号", "总成绩", "班级", "客户案例成绩", "综合规划成绩", "理论考核成绩"}; //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 - List listColumn = Arrays.asList("rankId", "name", "studentId", "totalScore", "className", "khalScore", "zhghScore","llkhScore"); + List listColumn = Arrays.asList("rankId", "name", "studentId", "totalScore", "className", "khalScore", "zhghScore", "llkhScore"); try { FilePortUtil.exportExcel(response, title, headers, scoreRankList, listColumn); } catch (Exception e) { @@ -439,21 +433,21 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-客户案例展示") @PostMapping("selectTeaClientCaseScoreList") - public ResultEntity> selectTeaClientCaseScoreList(@RequestParam String schoolId,@RequestParam Integer index,@RequestParam Integer size, - @RequestParam(required = false) String name, - @RequestParam(required = false) String studentId, - @RequestParam(required = false) String classId){ + public ResultEntity> selectTeaClientCaseScoreList(@RequestParam String schoolId, @RequestParam Integer index, @RequestParam Integer size, + @RequestParam(required = false) String name, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String classId) { PageHelper.startPage(index, size); ScoreRankExample scoreRankExample = new ScoreRankExample(); ScoreRankExample.Criteria criteria = scoreRankExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId).andUpdateDateEqualTo(scoreRankService.getNowDate()); - if(StringUtils.isNotBlank(name)){ + if (StringUtils.isNotBlank(name)) { criteria.andNameEqualTo(name); } - if(StringUtils.isNotBlank(studentId)){ + if (StringUtils.isNotBlank(studentId)) { criteria.andSchoolIdEqualTo(studentId); } - if(StringUtils.isNotBlank(classId)){ + if (StringUtils.isNotBlank(classId)) { criteria.andClassIdEqualTo(classId); } scoreRankExample.setOrderByClause("khal_score desc"); @@ -473,14 +467,14 @@ public class GradeController { @GetMapping("/exportClientCase") @ApiOperation("教师端--客户案例导出页面导出") public void exportClientCase(HttpServletResponse response, - @RequestParam String schoolId) { - List scoreRankList=scoreRankService.selectExportScoreRankList(schoolId); + @RequestParam String schoolId) { + List scoreRankList = scoreRankService.selectExportScoreRankList(schoolId); //导出的表名 String title = IdUtil.simpleUUID(); //表中第一行表头字段 - String[] headers = {"排名", "姓名", "学号","班级","总成绩", "风险测评分数", "财务分析分数", "现金规划分数","教育规划分数","消费规划分数","创业规划分数","退休规划分数","保险规划分数","投资规划分数","税务筹划分数","财产分配分数","财产传承分数"}; + String[] headers = {"排名", "姓名", "学号", "班级", "总成绩", "风险测评分数", "财务分析分数", "现金规划分数", "教育规划分数", "消费规划分数", "创业规划分数", "退休规划分数", "保险规划分数", "投资规划分数", "税务筹划分数", "财产分配分数", "财产传承分数"}; //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 - List listColumn = Arrays.asList("rankId", "name", "studentId","className","khalScore", "fxcp", "cwfx","xjgh","jygh","xfgh","cygh","txgh","bxgh","tzgh","swch","ccfp","cccc"); + List listColumn = Arrays.asList("rankId", "name", "studentId", "className", "khalScore", "fxcp", "cwfx", "xjgh", "jygh", "xfgh", "cygh", "txgh", "bxgh", "tzgh", "swch", "ccfp", "cccc"); try { FilePortUtil.exportExcel(response, title, headers, scoreRankList, listColumn); } catch (Exception e) { @@ -493,10 +487,10 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-客户案例权重查询") @PostMapping("seleteClientWeight") - public ResultEntity seleteClientWeight(@RequestBody String schoolId){ + public ResultEntity seleteClientWeight(@RequestBody String schoolId) { ClientWeight clientWeight = clientWeightMapper.selectByPrimaryKey(schoolId); - if(clientWeight==null){ - clientWeight=new ClientWeight(); + if (clientWeight == null) { + clientWeight = new ClientWeight(); clientWeight.setFxcp(BigDecimal.valueOf(0.05)); clientWeight.setCwfx(BigDecimal.valueOf(0.20)); clientWeight.setXjgh(BigDecimal.valueOf(0.05)); @@ -517,14 +511,14 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-客户案例权重设置") @PostMapping("setClientWeight") - public Boolean setClientWeight(@RequestBody ClientWeight clientWeight){ + public Boolean setClientWeight(@RequestBody ClientWeight clientWeight) { ClientWeight clientWeight1 = clientWeightMapper.selectByPrimaryKey(clientWeight.getSchoolId()); - if(clientWeight1==null){ + if (clientWeight1 == null) { int insert = clientWeightMapper.insert(clientWeight); - return insert==1; - }else { + return insert == 1; + } else { int i = clientWeightMapper.updateByPrimaryKey(clientWeight); - return i==1; + return i == 1; } } @@ -533,9 +527,9 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-客户案例章节成绩详情") @PostMapping("selectTeaClientChapter") - public ResultEntityselectTeaClientChapter(@RequestParam String userId, - @RequestParam String chapterName, - @RequestParam String schoolId){ + public ResultEntity selectTeaClientChapter(@RequestParam String userId, + @RequestParam String chapterName, + @RequestParam String schoolId) { ChapterExample chapterExample = new ChapterExample(); chapterExample.createCriteria().andChapterNameEqualTo(chapterName); List chapters = chapterMapper.selectByExample(chapterExample); @@ -618,21 +612,21 @@ public class GradeController { @AnonymousAccess @ApiOperation("教师端-成绩中心-综合规划成绩展示") @PostMapping("selectTeaSynthesisPlanScoreList") - public ResultEntity> selectTeaSynthesisPlanScoreList(@RequestParam String schoolId,@RequestParam Integer index,@RequestParam Integer size, - @RequestParam(required = false) String name, - @RequestParam(required = false) String studentId, - @RequestParam(required = false) String classId){ + public ResultEntity> selectTeaSynthesisPlanScoreList(@RequestParam String schoolId, @RequestParam Integer index, @RequestParam Integer size, + @RequestParam(required = false) String name, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String classId) { PageHelper.startPage(index, size); ScoreRankExample scoreRankExample = new ScoreRankExample(); ScoreRankExample.Criteria criteria = scoreRankExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId).andUpdateDateEqualTo(scoreRankService.getNowDate()); - if(StringUtils.isNotBlank(name)){ + if (StringUtils.isNotBlank(name)) { criteria.andNameEqualTo(name); } - if(StringUtils.isNotBlank(studentId)){ + if (StringUtils.isNotBlank(studentId)) { criteria.andSchoolIdEqualTo(studentId); } - if(StringUtils.isNotBlank(classId)){ + if (StringUtils.isNotBlank(classId)) { criteria.andClassIdEqualTo(classId); } scoreRankExample.setOrderByClause("zhgh_score"); @@ -652,7 +646,7 @@ public class GradeController { @GetMapping("/exportSynthesisPlanScore") @ApiOperation("教师端--综合规划页面导出") public void exportSynthesisPlanScore(HttpServletResponse response, - @RequestParam String schoolId) { + @RequestParam String schoolId) { ScoreRankExample scoreRankExample = new ScoreRankExample(); ScoreRankExample.Criteria criteria = scoreRankExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId).andUpdateDateEqualTo(scoreRankService.getNowDate()); @@ -662,9 +656,9 @@ public class GradeController { //导出的表名 String title = IdUtil.simpleUUID(); //表中第一行表头字段 - String[] headers = {"排名", "姓名", "学号","班级","总成绩", "完成案例个数"}; + String[] headers = {"排名", "姓名", "学号", "班级", "总成绩", "完成案例个数"}; //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 - List listColumn = Arrays.asList("classId", "name", "studentId","className", "zhghScore", "countCase"); + List listColumn = Arrays.asList("classId", "name", "studentId", "className", "zhghScore", "countCase"); try { FilePortUtil.exportExcel(response, title, headers, scoreRankList, listColumn); } catch (Exception e) { @@ -675,148 +669,148 @@ public class GradeController { @GetMapping("/getSubmitStatusCaseListByUserId") @ApiOperation("教师端-成绩中心-综合规划-案例列表展示") @AnonymousAccess - public ResultEntity> getSubmitStatusCaseListByUserId(String userId){ + public ResultEntity> getSubmitStatusCaseListByUserId(String userId) { SynthesisPlanClientExample synthesisPlanClientExample = new SynthesisPlanClientExample(); - List submitStatusList=new ArrayList<>(); + List submitStatusList = new ArrayList<>(); submitStatusList.add("未审核"); submitStatusList.add("已审核"); synthesisPlanClientExample.createCriteria().andUseridEqualTo(userId).andSubmitStatusIn(submitStatusList); List synthesisPlanClientList = synthesisPlanClientMapper.selectByExample(synthesisPlanClientExample); - return new ResultEntity<>(HttpStatus.OK, "案例列表展示成功",synthesisPlanClientList); + return new ResultEntity<>(HttpStatus.OK, "案例列表展示成功", synthesisPlanClientList); } //***** map有误 必须根据caseId获取案例题所有type @GetMapping("/getObjCaseScore") @ApiOperation("教师端-成绩中心-综合规划-查看详情、评分 客观题标准分、学生得分情况") @AnonymousAccess - public ResultEntity> getObjCaseScore(String userId,String caseId){ + public ResultEntity> getObjCaseScore(String userId, String caseId) { SynthesisPlanScoreExample synthesisPlanScoreExample = new SynthesisPlanScoreExample(); synthesisPlanScoreExample.createCriteria().andCaseidEqualTo(caseId).andUseridEqualTo(userId); List synthesisPlanScores = synthesisPlanScoreMapper.selectByExample(synthesisPlanScoreExample); - if(!synthesisPlanScores.isEmpty()){ - Map map=new HashMap<>(); + if (!synthesisPlanScores.isEmpty()) { + Map map = new HashMap<>(); for (int i = 0; i < synthesisPlanScores.size(); i++) { SynthesisPlanScore synthesisPlanScore = synthesisPlanScores.get(i); - if(map.containsKey(synthesisPlanScore.getManageMoneyMattersType())){ + if (map.containsKey(synthesisPlanScore.getManageMoneyMattersType())) { ObjCaseScoreVo objCaseScoreVo = map.get(synthesisPlanScore.getManageMoneyMattersType()); objCaseScoreVo.setStandardScore(objCaseScoreVo.getStandardScore().add(BigDecimal.valueOf(2))); - if("答对".equals(synthesisPlanScore.getStatus())){ + if ("答对".equals(synthesisPlanScore.getStatus())) { objCaseScoreVo.setStuScore(objCaseScoreVo.getStuScore().add(BigDecimal.valueOf(2))); } - }else { + } else { ObjCaseScoreVo objCaseScoreVo = new ObjCaseScoreVo(); objCaseScoreVo.setStandardScore(BigDecimal.valueOf(2)); - if("答对".equals(synthesisPlanScore.getStatus())){ + if ("答对".equals(synthesisPlanScore.getStatus())) { objCaseScoreVo.setStuScore(BigDecimal.valueOf(2)); - }else { + } else { objCaseScoreVo.setStuScore(BigDecimal.ZERO); } - map.put(synthesisPlanScore.getManageMoneyMattersType(),objCaseScoreVo); + map.put(synthesisPlanScore.getManageMoneyMattersType(), objCaseScoreVo); } } Set keySet = map.keySet(); - for(Object key : keySet ){ + for (Object key : keySet) { ObjCaseScoreVo objCaseScoreVo = map.get(key); - if("财务分析-财务比例分析".equals(key)){ + if ("财务分析-财务比例分析".equals(key)) { CaseFinancialRatiosExample example = new CaseFinancialRatiosExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List caseFinancialRatios = caseFinancialRatiosMapper.selectByExampleWithBLOBs(example); - if (!caseFinancialRatios.isEmpty()){ + if (!caseFinancialRatios.isEmpty()) { objCaseScoreVo.setAnswerOne(caseFinancialRatios.get(0).getAnalysis()); } } - if("现金规划".equals(key)){ + if ("现金规划".equals(key)) { CaseCashPlanExample example = new CaseCashPlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseCashPlanMapper.selectByExampleWithBLOBs(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(teaObj.get(0).getAnalysis()); } } - if("生涯规划-教育规划".equals(key)){ + if ("生涯规划-教育规划".equals(key)) { CaseLifeEducationPlanExample example = new CaseLifeEducationPlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseLifeEducationPlanMapper.selectByExampleWithBLOBs(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getReturnOnInvestment())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getAnalysis()); } } - if("生涯规划-消费规划".equals(key)){ + if ("生涯规划-消费规划".equals(key)) { CaseConsumptionPlanExample example = new CaseConsumptionPlanExample(); example.createCriteria().andCaseIdEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseConsumptionPlanMapper.selectByExampleWithBLOBs(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getReturnOnInvestment())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getAnalysis()); } } - if("生涯规划-创业规划".equals(key)){ + if ("生涯规划-创业规划".equals(key)) { CaseStartAnUndertakingPlanExample example = new CaseStartAnUndertakingPlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseStartAnUndertakingPlanMapper.selectByExample(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getReturnOnInvestmentRate())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getAnalysis()); } } - if("生涯规划-退休规划".equals(key)){ + if ("生涯规划-退休规划".equals(key)) { CaseRetirementPlanExample example = new CaseRetirementPlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseRetirementPlanMapper.selectByExample(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getReturnOnInvestmentRate())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getAnalysis()); } } - if("生涯规划-保险规划".equals(key)){ + if ("生涯规划-保险规划".equals(key)) { CaseInsurancePlanExample example = new CaseInsurancePlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseInsurancePlanMapper.selectByExample(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(teaObj.get(0).getAnalysis()); } } - if("投资规划".equals(key)){ + if ("投资规划".equals(key)) { CaseInvestmentPlanExample example = new CaseInvestmentPlanExample(); example.createCriteria().andCaseIdEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseInvestmentPlanMapper.selectByExample(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(teaObj.get(0).getAnalysis()); } } - if("税务筹划".equals(key)){ + if ("税务筹划".equals(key)) { CaseTaxPlanExample example = new CaseTaxPlanExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseTaxPlanMapper.selectByExample(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(teaObj.get(0).getAnalysis()); } } - if("财产分配".equals(key)){ + if ("财产分配".equals(key)) { CaseDistributionOfPropertyExample example = new CaseDistributionOfPropertyExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getSituationAnalysis())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getPlanAnalysis()); } } - if("财产传承".equals(key)){ + if ("财产传承".equals(key)) { CaseHeritageExample example = new CaseHeritageExample(); example.createCriteria().andCaseidEqualTo(caseId).andIsAnswerEqualTo("题目答案"); List teaObj = caseHeritageMapper.selectByExampleWithBLOBs(example); - if (!teaObj.isEmpty()){ + if (!teaObj.isEmpty()) { objCaseScoreVo.setAnswerOne(String.valueOf(teaObj.get(0).getFinanceAnalysis())); objCaseScoreVo.setAnswerTwo(teaObj.get(0).getPlanAnalysis()); } } } - return new ResultEntity<>(HttpStatus.OK, "学生得分情况返回成功",map); - }else { - return new ResultEntity<>(HttpStatus.OK, "未查询到数据"); + return new ResultEntity<>(HttpStatus.OK, "学生得分情况返回成功", map); + } else { + return new ResultEntity<>(HttpStatus.OK, "未查询到数据"); } } @@ -836,21 +830,22 @@ public class GradeController { @ApiOperation("教师端 综合规划老师评分") @AnonymousAccess private ResultEntity updateSynthesisPlanMark(@ApiParam("map type为更新的表名,json为预览展示单个表中的对象") @RequestBody Map updateMap, - @RequestParam String userId,@RequestParam String caseId) { + @RequestParam String userId, @RequestParam String caseId) { System.out.println(); - for(String type:updateMap.keySet()){ + for (String type : updateMap.keySet()) { // String json = updateMap.get(type); LinkedHashMap map = (LinkedHashMap) updateMap.get(type); String json = new Gson().toJson(map); Gson gson = new Gson(); - caseService.addCorrelationTable(type,json,gson,"1"); + caseService.addCorrelationTable(type, json, gson, "1"); } //修改审核状态 SynthesisPlanClientExample synthesisPlanClientExample = new SynthesisPlanClientExample(); synthesisPlanClientExample.createCriteria().andUseridEqualTo(userId).andCaseidEqualTo(caseId); List synthesisPlanClients = synthesisPlanClientMapper.selectByExample(synthesisPlanClientExample); - synthesisPlanClients.get(0).setSubmitStatus("已审核"); - + SynthesisPlanClient synthesisPlanClient = synthesisPlanClients.get(0); + synthesisPlanClient.setSubmitStatus("已审核"); + synthesisPlanClientMapper.updateByPrimaryKeySelective(synthesisPlanClient); //设置综合规划成绩表 ***** return new ResultEntity<>(HttpStatus.OK, "更新评分成功"); @@ -860,11 +855,11 @@ public class GradeController { @GetMapping("/OneClickScoring") @ApiOperation("教师端-综合规划一键评分") @AnonymousAccess - private ResultEntity OneClickScoring(String schoolId){ + private ResultEntity OneClickScoring(String schoolId) { //先在synthesis_plan_client表中查询schoolID 并且submitStatus状态为未审核的数据 循环获取caseId和userId SynthesisPlanClientExample synthesisPlanClientExample = new SynthesisPlanClientExample(); synthesisPlanClientExample.createCriteria().andSchoolIdEqualTo(schoolId).andSubmitStatusEqualTo("未审核"); - List planClientList= synthesisPlanClientMapper.selectByExample(synthesisPlanClientExample); + List planClientList = synthesisPlanClientMapper.selectByExample(synthesisPlanClientExample); for (int i = 0; i < planClientList.size(); i++) { SynthesisPlanClient client = planClientList.get(0); @@ -872,8 +867,8 @@ public class GradeController { String userid = client.getUserid(); //根据caseId 查询caseInfo表中的manage_money_matters_type字段 如果等于综合规划 则查询com_case表 获取理财类型TypeList 如果不等于综合规划 则获取caseInfo中的manage_money_matters_type作为理财类型Type CaseInfo caseInfo = caseInfoMapper.selectByPrimaryKey(caseid); - List typeList=new ArrayList<>(); - if("综合规划".equals(caseInfo.getManageMoneyMattersType())){ + List typeList = new ArrayList<>(); + if ("综合规划".equals(caseInfo.getManageMoneyMattersType())) { ComCaseExample comCaseExample = new ComCaseExample(); comCaseExample.createCriteria().andCaseidEqualTo(caseid); List comCaseList = comCaseMapper.selectByExample(comCaseExample); @@ -881,33 +876,33 @@ public class GradeController { String manageMoneyMattersType = comCaseList.get(j).getManageMoneyMattersType(); typeList.add(manageMoneyMattersType); } - }else { + } else { typeList.add(caseInfo.getManageMoneyMattersType()); } for (int j = 0; j < typeList.size(); j++) { String type = typeList.get(j); - if("财务分析-财务比例分析".equals(type)){ + if ("财务分析-财务比例分析".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseFinancialRatiosExample example = new CaseFinancialRatiosExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseFinancialRatiosMapper.selectByExampleWithBLOBs(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseFinancialRatiosWithBLOBs caseFinancialRatiosWithBLOBs = list.get(0); String analysis = caseFinancialRatiosWithBLOBs.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis)){ + BigDecimal teacherScore = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis)) { caseFinancialRatiosWithBLOBs.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { caseFinancialRatiosWithBLOBs.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); caseFinancialRatiosWithBLOBs.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); caseFinancialRatiosWithBLOBs.setAnalysisTeacherScore(teacherScore); } } @@ -919,27 +914,27 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore = scoreList.get(0); synthesisPlanScore.setScore(teacherScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore); - }else if("现金规划".equals(type)){ + } else if ("现金规划".equals(type)) { CaseCashPlanExample example = new CaseCashPlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseCashPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseCashPlan caseCashPlan = list.get(0); String analysis = caseCashPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis)){ + BigDecimal teacherScore = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis)) { caseCashPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { caseCashPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); caseCashPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); caseCashPlan.setAnalysisTeacherScore(teacherScore); } } @@ -951,28 +946,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore = scoreList.get(0); synthesisPlanScore.setScore(teacherScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore); - }else if("生涯规划-教育规划".equals(type)){ + } else if ("生涯规划-教育规划".equals(type)) { CaseLifeEducationPlanExample example = new CaseLifeEducationPlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseLifeEducationPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseLifeEducationPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; + BigDecimal teacherScore = BigDecimal.ZERO; //设置分析分数 - if(StringUtils.isBlank(analysis)){ + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -986,12 +981,12 @@ public class GradeController { BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n - BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment,disposableInput,monthlyInvestment,regularYear); - BigDecimal teacherFinancialPlanningScore=BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 - if(stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney)>=0){ - teacherFinancialPlanningScore=BigDecimal.valueOf(2); + BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear); + BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 + if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { + teacherFinancialPlanningScore = BigDecimal.valueOf(2); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); - }else { + } else { stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); } @@ -1012,28 +1007,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherFinancialPlanningScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else if("生涯规划-消费规划".equals(type)){ + } else if ("生涯规划-消费规划".equals(type)) { CaseConsumptionPlanExample example = new CaseConsumptionPlanExample(); example.createCriteria().andCaseIdEqualTo(caseid).andUserIdEqualTo(userid); List list = caseConsumptionPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseConsumptionPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; + BigDecimal teacherScore = BigDecimal.ZERO; //设置分析分数 - if(StringUtils.isBlank(analysis)){ + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -1047,12 +1042,12 @@ public class GradeController { BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n - BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment,disposableInput,monthlyInvestment,regularYear); - BigDecimal teacherFinancialPlanningScore=BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 - if(stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney)>=0){ - teacherFinancialPlanningScore=BigDecimal.valueOf(2); + BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear); + BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 + if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { + teacherFinancialPlanningScore = BigDecimal.valueOf(2); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); - }else { + } else { stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); } @@ -1073,28 +1068,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherFinancialPlanningScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else if("生涯规划-创业规划".equals(type)){ + } else if ("生涯规划-创业规划".equals(type)) { CaseStartAnUndertakingPlanExample example = new CaseStartAnUndertakingPlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseStartAnUndertakingPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseStartAnUndertakingPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; + BigDecimal teacherScore = BigDecimal.ZERO; //设置分析分数 - if(StringUtils.isBlank(analysis)){ + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -1108,12 +1103,12 @@ public class GradeController { BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n - BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment,disposableInput,monthlyInvestment,regularYear); - BigDecimal teacherFinancialPlanningScore=BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 - if(stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney)>=0){ - teacherFinancialPlanningScore=BigDecimal.valueOf(2); + BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear); + BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 + if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { + teacherFinancialPlanningScore = BigDecimal.valueOf(2); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); - }else { + } else { stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); } @@ -1134,28 +1129,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherFinancialPlanningScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else if("生涯规划-退休规划".equals(type)){ + } else if ("生涯规划-退休规划".equals(type)) { CaseRetirementPlanExample example = new CaseRetirementPlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseRetirementPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseRetirementPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; + BigDecimal teacherScore = BigDecimal.ZERO; //设置分析分数 - if(StringUtils.isBlank(analysis)){ + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -1169,12 +1164,12 @@ public class GradeController { BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n - BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment,disposableInput,monthlyInvestment,regularYear); - BigDecimal teacherFinancialPlanningScore=BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 - if(stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney)>=0){ - teacherFinancialPlanningScore=BigDecimal.valueOf(2); + BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear); + BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 + if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { + teacherFinancialPlanningScore = BigDecimal.valueOf(2); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); - }else { + } else { stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); } @@ -1195,35 +1190,35 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherFinancialPlanningScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else if("生涯规划-保险规划".equals(type)){ + } else if ("生涯规划-保险规划".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseInsurancePlanExample example = new CaseInsurancePlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseInsurancePlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseInsurancePlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis)){ + BigDecimal teacherScore = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } caseInsurancePlanMapper.updateByPrimaryKey(stuPlan); //并设置综合规划成绩表 修改分数 SynthesisPlanScoreExample scoreExample = new SynthesisPlanScoreExample(); - List testCenterList=new ArrayList<>(); + List testCenterList = new ArrayList<>(); testCenterList.add("寿险需求测算方法选择-遗属需求法-保险规划分析"); testCenterList.add("寿险需求测算方法选择-生命价值法-保险规划分析"); scoreExample.createCriteria().andCaseidEqualTo(caseid).andUseridEqualTo(userid).andManageMoneyMattersTypeEqualTo("生涯规划-保险规划").andTestCenterIn(testCenterList); @@ -1231,28 +1226,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore = scoreList.get(0); synthesisPlanScore.setScore(teacherScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore); - }else if("投资规划".equals(type)){ + } else if ("投资规划".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseInvestmentPlanExample example = new CaseInvestmentPlanExample(); example.createCriteria().andCaseIdEqualTo(caseid).andUserIdEqualTo(userid); List list = caseInvestmentPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseInvestmentPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis)){ + BigDecimal teacherScore = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -1264,28 +1259,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore = scoreList.get(0); synthesisPlanScore.setScore(teacherScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore); - }else if("税务筹划".equals(type)){ + } else if ("税务筹划".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseTaxPlanExample example = new CaseTaxPlanExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseTaxPlanMapper.selectByExample(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseTaxPlan stuPlan = list.get(0); String analysis = stuPlan.getAnalysis(); - BigDecimal teacherScore=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis)){ + BigDecimal teacherScore = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis)) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - if(analysis.length()<20){ + } else { + if (analysis.length() < 20) { stuPlan.setAnalysisTeacherScore(teacherScore); - }else if(analysis.length()>=50){ - teacherScore=BigDecimal.valueOf(2); + } else if (analysis.length() >= 50) { + teacherScore = BigDecimal.valueOf(2); stuPlan.setAnalysisTeacherScore(teacherScore); - }else { - teacherScore=BigDecimal.valueOf(1); + } else { + teacherScore = BigDecimal.valueOf(1); stuPlan.setAnalysisTeacherScore(teacherScore); } } @@ -1297,43 +1292,43 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore = scoreList.get(0); synthesisPlanScore.setScore(teacherScore); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore); - }else if("财产分配".equals(type)){ + } else if ("财产分配".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseDistributionOfPropertyExample example = new CaseDistributionOfPropertyExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseDistributionOfPropertyWithBLOBs stuPlan = list.get(0); String analysis1 = stuPlan.getSituationAnalysis(); - BigDecimal teacherScore1=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis1)){ + BigDecimal teacherScore1 = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis1)) { stuPlan.setSituationanalysisTeacherScore(teacherScore1); - }else { - if(analysis1.length()<20){ + } else { + if (analysis1.length() < 20) { stuPlan.setSituationanalysisTeacherScore(teacherScore1); - }else if(analysis1.length()>=50){ - teacherScore1=BigDecimal.valueOf(2); + } else if (analysis1.length() >= 50) { + teacherScore1 = BigDecimal.valueOf(2); stuPlan.setSituationanalysisTeacherScore(teacherScore1); - }else { - teacherScore1=BigDecimal.valueOf(1); + } else { + teacherScore1 = BigDecimal.valueOf(1); stuPlan.setSituationanalysisTeacherScore(teacherScore1); } } String analysis2 = stuPlan.getPlanAnalysis(); - BigDecimal teacherScore2=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis2)){ + BigDecimal teacherScore2 = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis2)) { stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else { - if(analysis2.length()<20){ + } else { + if (analysis2.length() < 20) { stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else if(analysis2.length()>=50){ - teacherScore2=BigDecimal.valueOf(2); + } else if (analysis2.length() >= 50) { + teacherScore2 = BigDecimal.valueOf(2); stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else { - teacherScore2=BigDecimal.valueOf(1); + } else { + teacherScore2 = BigDecimal.valueOf(1); stuPlan.setPlananalysisTeacherScore(teacherScore2); } } @@ -1351,28 +1346,28 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherScore2); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else if("财产传承".equals(type)){ + } else if ("财产传承".equals(type)) { //根据caseid和userId查询case_Financial_Ratios表 CaseHeritageExample example = new CaseHeritageExample(); example.createCriteria().andCaseidEqualTo(caseid).andUserIdEqualTo(userid); List list = caseHeritageMapper.selectByExampleWithBLOBs(example); //如果不存在 则跳过 - if(list.isEmpty()){ + if (list.isEmpty()) { continue; } CaseHeritageWithBLOBs stuPlan = list.get(0); String analysis2 = stuPlan.getPlanAnalysis(); - BigDecimal teacherScore2=BigDecimal.ZERO; - if(StringUtils.isBlank(analysis2)){ + BigDecimal teacherScore2 = BigDecimal.ZERO; + if (StringUtils.isBlank(analysis2)) { stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else { - if(analysis2.length()<20){ + } else { + if (analysis2.length() < 20) { stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else if(analysis2.length()>=50){ - teacherScore2=BigDecimal.valueOf(2); + } else if (analysis2.length() >= 50) { + teacherScore2 = BigDecimal.valueOf(2); stuPlan.setPlananalysisTeacherScore(teacherScore2); - }else { - teacherScore2=BigDecimal.valueOf(1); + } else { + teacherScore2 = BigDecimal.valueOf(1); stuPlan.setPlananalysisTeacherScore(teacherScore2); } } @@ -1384,7 +1379,7 @@ public class GradeController { SynthesisPlanScore synthesisPlanScore2 = scoreList2.get(0); synthesisPlanScore2.setScore(teacherScore2); synthesisPlanScoreMapper.updateByPrimaryKey(synthesisPlanScore2); - }else { + } else { continue; } } @@ -1393,48 +1388,46 @@ public class GradeController { } //计算理财方案 - public BigDecimal getFinancialPlanningMoney(BigDecimal returnOnInvestment,BigDecimal disposableInput,BigDecimal monthlyInvestment,Integer regularYear){ + public BigDecimal getFinancialPlanningMoney(BigDecimal returnOnInvestment, BigDecimal disposableInput, BigDecimal monthlyInvestment, Integer regularYear) { // returnOnInvestment 预计投资收益率 r // disposableInput 一次性投入金额 pv // monthlyInvestment 每月定期投资金额 pmt // regularYear 定期定额投资年份 - Integer regularMonth = regularYear*12; //定期定额投资月份 n + Integer regularMonth = regularYear * 12; //定期定额投资月份 n //单笔投资的终值 FV=PV*(1+r)^n FV终值 PV一次性投入金额 r预计投资收益率 n定期定额投资月份 BigDecimal dbFV = disposableInput.multiply((BigDecimal.ONE.add(returnOnInvestment)).pow(regularMonth)); //普通年金的终值 FV=PMT*(((1+r)^n)-1)/r PMT 每月定期投资金额 r预计投资收益率 n定期定额投资月份 - BigDecimal ptFV=monthlyInvestment.divide(((((BigDecimal.ONE.add(returnOnInvestment)).pow(regularMonth)).subtract(BigDecimal.ONE)).divide(returnOnInvestment))); - BigDecimal answer=dbFV.add(ptFV); + BigDecimal ptFV = monthlyInvestment.divide(((((BigDecimal.ONE.add(returnOnInvestment)).pow(regularMonth)).subtract(BigDecimal.ONE)).divide(returnOnInvestment))); + BigDecimal answer = dbFV.add(ptFV); return answer; } - - //教师端 理论考核查询 @AnonymousAccess @ApiOperation("教师端-成绩中心-理论考核查询") @PostMapping("selectTeaTheoryScore") - public ResultEntity> selectTeaTheoryScore( @RequestParam String schoolId,@RequestParam Integer index,@RequestParam Integer size, - @RequestParam(required = false) String name, - @RequestParam(required = false) String studentId, - @RequestParam(required = false) String classId - ) { + public ResultEntity> selectTeaTheoryScore(@RequestParam String schoolId, @RequestParam Integer index, @RequestParam Integer size, + @RequestParam(required = false) String name, + @RequestParam(required = false) String studentId, + @RequestParam(required = false) String classId + ) { PageHelper.startPage(index, size); StuTheoryRecordExample theoryRecordExample = new StuTheoryRecordExample(); StuTheoryRecordExample.Criteria criteria = theoryRecordExample.createCriteria(); criteria.andSchoolIdEqualTo(schoolId); - if(StringUtils.isNotBlank(name)){ + if (StringUtils.isNotBlank(name)) { criteria.andNameEqualTo(name); } - if(StringUtils.isNotBlank(studentId)){ + if (StringUtils.isNotBlank(studentId)) { criteria.andSchoolIdEqualTo(studentId); } - if(StringUtils.isNotBlank(classId)){ + if (StringUtils.isNotBlank(classId)) { criteria.andClassIdEqualTo(classId); } theoryRecordExample.setOrderByClause("average_score desc"); List stuTheoryRecords = stuTheoryRecordMapper.selectByExample(theoryRecordExample); - if(stuTheoryRecords.isEmpty()){ + if (stuTheoryRecords.isEmpty()) { return null; } PageInfo pageInfo = new PageInfo(stuTheoryRecords); @@ -1446,14 +1439,14 @@ public class GradeController { @GetMapping("/exportTheoryScore") @ApiOperation("教师端--理论考核页面导出") public void exportTheoryScore(HttpServletResponse response, - @RequestParam String schoolId) { - List stuTheoryRecordList =scoreRankService.selectExportTheoryScoreRankList(schoolId); + @RequestParam String schoolId) { + List stuTheoryRecordList = scoreRankService.selectExportTheoryScoreRankList(schoolId); //导出的表名 String title = IdUtil.simpleUUID(); //表中第一行表头字段 - String[] headers = {"排名", "姓名", "学号", "平均成绩", "班级", "考试次数", "考试最高分","考试最低分","考试合计时长"}; + String[] headers = {"排名", "姓名", "学号", "平均成绩", "班级", "考试次数", "考试最高分", "考试最低分", "考试合计时长"}; //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 - List listColumn = Arrays.asList("classId", "name", "studentId", "averageScore", "className", "examCount","highestScore","lowestScore","totalDuration"); + List listColumn = Arrays.asList("classId", "name", "studentId", "averageScore", "className", "examCount", "highestScore", "lowestScore", "totalDuration"); try { FilePortUtil.exportExcel(response, title, headers, stuTheoryRecordList, listColumn); } catch (Exception e) {