修改了综合规划成绩的需求

master
yz 3 months ago
parent e49ab08af5
commit d4fa6d15d8

@ -239,10 +239,10 @@ public class GradeController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("学生端-成绩中心-综合规划成绩展示") @ApiOperation("学生端-成绩中心-综合规划成绩展示")
@PostMapping("selectStuSynthesisPlanScoreList") @PostMapping("selectStuSynthesisPlanScoreList")
public ResultEntity<List<StuSynthesisPlanScoreDto>> selectStuSynthesisPlanScoreList(@RequestParam String userId, public ResultEntity<StuSynthesisPlanScoreAndAvgScoreDto> selectStuSynthesisPlanScoreList(@RequestParam String userId,
@RequestParam String schoolId) { @RequestParam String schoolId) {
List<StuSynthesisPlanScoreDto> list = trainingService.selectStuSynthesisPlanScoreList(userId, schoolId); StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId, schoolId);
return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-综合规划成绩展示", list); return new ResultEntity<>(HttpStatus.OK, "学生端-成绩中心-综合规划成绩展示", dto);
} }
//学生端 综合规划审核报告展示 同综合规划-规划报告-审核报告 //学生端 综合规划审核报告展示 同综合规划-规划报告-审核报告

@ -0,0 +1,17 @@
package com.sztzjy.money_management.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
@Data
@NoArgsConstructor
public class StuSynthesisPlanScoreAndAvgScoreDto {
@ApiModelProperty("平均成绩")
private BigDecimal avgScore;
List<StuSynthesisPlanScoreDto> list;
}

@ -15,10 +15,10 @@ public class StuSynthesisPlanScoreDto {
@ApiModelProperty("实训时长") @ApiModelProperty("实训时长")
private BigDecimal useTime; private BigDecimal useTime;
@ApiModelProperty("实训总分") @ApiModelProperty("实训总分/暂不用")
private BigDecimal trainingTotalScore; private BigDecimal trainingTotalScore;
@ApiModelProperty("成绩权重") @ApiModelProperty("成绩权重/暂不用")
private BigDecimal scoreWight; private BigDecimal scoreWight;
@ApiModelProperty("完成情况") @ApiModelProperty("完成情况")
@ -27,6 +27,12 @@ public class StuSynthesisPlanScoreDto {
@ApiModelProperty("实训得分") @ApiModelProperty("实训得分")
private BigDecimal trainingScore; private BigDecimal trainingScore;
@ApiModelProperty("实训满分")
private BigDecimal trainingFullScore;
@ApiModelProperty("实训成绩")
private BigDecimal stuScore;
@ApiModelProperty("caseId") @ApiModelProperty("caseId")
private String caseId; private String caseId;

@ -2,6 +2,7 @@ package com.sztzjy.money_management.service;
import com.sztzjy.money_management.entity.StudentScoreWeight; import com.sztzjy.money_management.entity.StudentScoreWeight;
import com.sztzjy.money_management.entity.dto.StuClientCaseScoreDto; import com.sztzjy.money_management.entity.dto.StuClientCaseScoreDto;
import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreAndAvgScoreDto;
import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreDto; import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreDto;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -12,7 +13,7 @@ public interface TrainingService {
List<StuClientCaseScoreDto> selectStuClientCaseScoreList(String userId, String schoolId); List<StuClientCaseScoreDto> selectStuClientCaseScoreList(String userId, String schoolId);
List<StuSynthesisPlanScoreDto> selectStuSynthesisPlanScoreList(String userId, String schoolId); StuSynthesisPlanScoreAndAvgScoreDto selectStuSynthesisPlanScoreList(String userId, String schoolId);
Map<String, BigDecimal> getClientWeight(String schoolId); Map<String, BigDecimal> getClientWeight(String schoolId);

@ -1,6 +1,7 @@
package com.sztzjy.money_management.service.impl; package com.sztzjy.money_management.service.impl;
import com.sztzjy.money_management.entity.*; import com.sztzjy.money_management.entity.*;
import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreAndAvgScoreDto;
import com.sztzjy.money_management.mapper.*; import com.sztzjy.money_management.mapper.*;
import com.sztzjy.money_management.service.ScoreRankService; import com.sztzjy.money_management.service.ScoreRankService;
import com.sztzjy.money_management.service.TrainingService; import com.sztzjy.money_management.service.TrainingService;
@ -34,6 +35,8 @@ public class ScoreRankServiceImpl implements ScoreRankService {
TotalWeightMapper totalWeightMapper; TotalWeightMapper totalWeightMapper;
@Autowired @Autowired
StuTheoryRecordMapper stuTheoryRecordMapper; StuTheoryRecordMapper stuTheoryRecordMapper;
@Autowired
TrainingReportMapper trainingReportMapper;
@Override @Override
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 0 1 * * ?")
@ -136,7 +139,16 @@ public class ScoreRankServiceImpl implements ScoreRankService {
experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight()); experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
} }
} }
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore); //计算报告分数
String chapterId = stuTraining.getChapterId();
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
BigDecimal reportScore=BigDecimal.ZERO;
if (!trainingReports.isEmpty()) {
reportScore=trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
}
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore);
if ("风险测评".equals(stuTraining.getChapterName())) { if ("风险测评".equals(stuTraining.getChapterName())) {
scoreRank.setFxcp(sum); scoreRank.setFxcp(sum);
} else if ("财务分析".equals(stuTraining.getChapterName())) { } else if ("财务分析".equals(stuTraining.getChapterName())) {
@ -186,17 +198,12 @@ public class ScoreRankServiceImpl implements ScoreRankService {
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample); long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
scoreRank.setCountCase((int) countCase); scoreRank.setCountCase((int) countCase);
BigDecimal zhghScore = synthesisPlanScoreMapper.selectTotalScoreByUserId(userId); StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
if (zhghScore==null){ if(dto==null){
scoreRank.setZhghScore(BigDecimal.ZERO); scoreRank.setZhghScore(BigDecimal.ZERO);
}else { }else {
//查询zhgh考核点数量 scoreRank.setZhghScore(dto.getAvgScore());
Integer zhghSize=synthesisPlanScoreMapper.CountScoreSizeByUserId(userId);
//考核点所有分数
BigDecimal zhghTotalScore=BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2));
scoreRank.setZhghScore(zhghScore.divide(zhghTotalScore,2,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).divide(BigDecimal.valueOf(countCase),2,BigDecimal.ROUND_HALF_UP));
} }
scoreRank.setZhghScore(zhghScore);
//设置理论考核平均分成绩 //设置理论考核平均分成绩
StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId); StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId);
@ -415,7 +422,17 @@ public class ScoreRankServiceImpl implements ScoreRankService {
experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight()); experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
} }
} }
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore); //计算报告分数
String chapterId = stuTraining.getChapterId();
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
BigDecimal reportScore=BigDecimal.ZERO;
if (!trainingReports.isEmpty()) {
reportScore=trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
}
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore);
if ("风险测评".equals(stuTraining.getChapterName())) { if ("风险测评".equals(stuTraining.getChapterName())) {
scoreRank.setFxcp(sum); scoreRank.setFxcp(sum);
} else if ("财务分析".equals(stuTraining.getChapterName())) { } else if ("财务分析".equals(stuTraining.getChapterName())) {
@ -465,18 +482,13 @@ public class ScoreRankServiceImpl implements ScoreRankService {
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample); long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
scoreRank.setCountCase((int) countCase); scoreRank.setCountCase((int) countCase);
BigDecimal zhghScore = synthesisPlanScoreMapper.selectTotalScoreByUserId(userId); StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
if (zhghScore==null){ if(dto==null){
scoreRank.setZhghScore(BigDecimal.ZERO); scoreRank.setZhghScore(BigDecimal.ZERO);
}else { }else {
//查询zhgh考核点数量 scoreRank.setZhghScore(dto.getAvgScore());
Integer zhghSize=synthesisPlanScoreMapper.CountScoreSizeByUserId(userId);
//考核点所有分数
BigDecimal zhghTotalScore=BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2));
scoreRank.setZhghScore(zhghScore.divide(zhghTotalScore,2,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).divide(BigDecimal.valueOf(countCase),2,BigDecimal.ROUND_HALF_UP));
} }
//设置理论考核平均分成绩 //设置理论考核平均分成绩
StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId); StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId);
if (stuTheoryRecord == null) { if (stuTheoryRecord == null) {

@ -2,6 +2,7 @@ package com.sztzjy.money_management.service.impl;
import com.sztzjy.money_management.entity.*; import com.sztzjy.money_management.entity.*;
import com.sztzjy.money_management.entity.dto.StuClientCaseScoreDto; import com.sztzjy.money_management.entity.dto.StuClientCaseScoreDto;
import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreAndAvgScoreDto;
import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreDto; import com.sztzjy.money_management.entity.dto.StuSynthesisPlanScoreDto;
import com.sztzjy.money_management.entity.dto.StuTrainingDto; import com.sztzjy.money_management.entity.dto.StuTrainingDto;
import com.sztzjy.money_management.mapper.*; import com.sztzjy.money_management.mapper.*;
@ -39,7 +40,7 @@ public class TrainingServiceImpl implements TrainingService {
StuTrainingExample stuTrainingExample = new StuTrainingExample(); StuTrainingExample stuTrainingExample = new StuTrainingExample();
stuTrainingExample.createCriteria().andUserIdEqualTo(userId); stuTrainingExample.createCriteria().andUserIdEqualTo(userId);
List<StuTraining> stuTrainingList = trainingMapper.selectByExample(stuTrainingExample); List<StuTraining> stuTrainingList = trainingMapper.selectByExample(stuTrainingExample);
if(stuTrainingList.isEmpty()){ if (stuTrainingList.isEmpty()) {
return null; return null;
} }
@ -47,53 +48,53 @@ public class TrainingServiceImpl implements TrainingService {
Map<String, StudentScoreWeight> studentScoreWeightMap = getStudentScoreWeightMap(schoolId); Map<String, StudentScoreWeight> studentScoreWeightMap = getStudentScoreWeightMap(schoolId);
//获取客户案例权重 //获取客户案例权重
Map<String, BigDecimal> clientWeightMap = getClientWeight(schoolId); Map<String, BigDecimal> clientWeightMap = getClientWeight(schoolId);
List<StuClientCaseScoreDto> returnList=new ArrayList<>(); List<StuClientCaseScoreDto> returnList = new ArrayList<>();
for (int i = 0; i < stuTrainingList.size(); i++) { for (int i = 0; i < stuTrainingList.size(); i++) {
StuClientCaseScoreDto stuClientCaseScoreDto = new StuClientCaseScoreDto(); StuClientCaseScoreDto stuClientCaseScoreDto = new StuClientCaseScoreDto();
StuTraining stuTraining = stuTrainingList.get(i); StuTraining stuTraining = stuTrainingList.get(i);
Integer knowledgeStatus = stuTraining.getKnowledgeSummaryCompleteStatus() == null ? 0 : stuTraining.getKnowledgeSummaryCompleteStatus(); Integer knowledgeStatus = stuTraining.getKnowledgeSummaryCompleteStatus() == null ? 0 : stuTraining.getKnowledgeSummaryCompleteStatus();
Integer resourceStatus = stuTraining.getResourceLearningCompleteStatus()== null ? 0 : stuTraining.getResourceLearningCompleteStatus(); Integer resourceStatus = stuTraining.getResourceLearningCompleteStatus() == null ? 0 : stuTraining.getResourceLearningCompleteStatus();
Integer learningEvalCompleteStatus = stuTraining.getLearningEvalCompleteStatus()== null ? 9999 : stuTraining.getLearningEvalCompleteStatus(); Integer learningEvalCompleteStatus = stuTraining.getLearningEvalCompleteStatus() == null ? 9999 : stuTraining.getLearningEvalCompleteStatus();
Integer expStatus = stuTraining.getExpTrainingCompleteStatus()==null?9999:stuTraining.getExpTrainingCompleteStatus(); Integer expStatus = stuTraining.getExpTrainingCompleteStatus() == null ? 9999 : stuTraining.getExpTrainingCompleteStatus();
StudentScoreWeight studentScoreWeight = studentScoreWeightMap.get(stuTraining.getChapterName()); StudentScoreWeight studentScoreWeight = studentScoreWeightMap.get(stuTraining.getChapterName());
if(studentScoreWeight==null){ if (studentScoreWeight == null) {
continue; continue;
} }
if(knowledgeStatus>5){ if (knowledgeStatus > 5) {
knowledgeStatus=5; knowledgeStatus = 5;
} }
if(resourceStatus>5){ if (resourceStatus > 5) {
resourceStatus=5; resourceStatus = 5;
} }
BigDecimal summaryScore = studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(knowledgeStatus)).multiply(studentScoreWeight.getSummaryOfKnowledgeWeight()); BigDecimal summaryScore = studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(knowledgeStatus)).multiply(studentScoreWeight.getSummaryOfKnowledgeWeight());
BigDecimal resourceScore = studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(resourceStatus)).multiply(studentScoreWeight.getResourceLearningWeight()); BigDecimal resourceScore = studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(resourceStatus)).multiply(studentScoreWeight.getResourceLearningWeight());
BigDecimal learningScore= BigDecimal.valueOf(0); BigDecimal learningScore = BigDecimal.valueOf(0);
BigDecimal experimentalScore= BigDecimal.valueOf(0); BigDecimal experimentalScore = BigDecimal.valueOf(0);
if(learningEvalCompleteStatus!=9999){ if (learningEvalCompleteStatus != 9999) {
if(learningEvalCompleteStatus<=10){ if (learningEvalCompleteStatus <= 10) {
learningScore = (BigDecimal.valueOf(100).subtract(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(learningEvalCompleteStatus)))).multiply(studentScoreWeight.getLearningAssessmentWeight()); learningScore = (BigDecimal.valueOf(100).subtract(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(learningEvalCompleteStatus)))).multiply(studentScoreWeight.getLearningAssessmentWeight());
} }
} }
if(expStatus!=9999){ if (expStatus != 9999) {
if(expStatus<=5){ if (expStatus <= 5) {
experimentalScore =BigDecimal.valueOf(100).subtract(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(expStatus))).multiply(studentScoreWeight.getExperimentalTrainingWeight()); experimentalScore = BigDecimal.valueOf(100).subtract(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(expStatus))).multiply(studentScoreWeight.getExperimentalTrainingWeight());
} }
//财产分配特殊处理 //财产分配特殊处理
if("11".equals(stuTraining.getChapterId())){ if ("11".equals(stuTraining.getChapterId())) {
if(stuTraining.getExpTrainingCompleteStatus().compareTo(100)>0){ if (stuTraining.getExpTrainingCompleteStatus().compareTo(100) > 0) {
stuTraining.setExpTrainingCompleteStatus(100); stuTraining.setExpTrainingCompleteStatus(100);
} }
experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight()); experimentalScore = BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
} }
} }
//设置实验报告情况及得分 //设置实验报告情况及得分
BigDecimal reportScore=BigDecimal.ZERO; BigDecimal reportScore = BigDecimal.ZERO;
TrainingReportExample trainingReportExample = new TrainingReportExample(); TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andChapterIdEqualTo(stuTraining.getChapterName()).andUserIdEqualTo(userId); trainingReportExample.createCriteria().andChapterIdEqualTo(stuTraining.getChapterName()).andUserIdEqualTo(userId);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample); List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
if(!trainingReports.isEmpty()){ if (!trainingReports.isEmpty()) {
reportScore=trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight()); reportScore = trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
} }
stuClientCaseScoreDto.setChapterName(stuTraining.getChapterName()); stuClientCaseScoreDto.setChapterName(stuTraining.getChapterName());
stuClientCaseScoreDto.setTrainingTotalScore(summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore)); stuClientCaseScoreDto.setTrainingTotalScore(summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore));
@ -108,8 +109,8 @@ public class TrainingServiceImpl implements TrainingService {
//获取学习成绩权重对象 如果没设置 则用默认方式 map("风险测评" 权重对象) //获取学习成绩权重对象 如果没设置 则用默认方式 map("风险测评" 权重对象)
@Override @Override
public Map<String,StudentScoreWeight> getStudentScoreWeightMap(String schoolId){ public Map<String, StudentScoreWeight> getStudentScoreWeightMap(String schoolId) {
Map<String,StudentScoreWeight> map=new HashMap<>(); Map<String, StudentScoreWeight> map = new HashMap<>();
List<String> chapterNameList = getChapterNameList(); List<String> chapterNameList = getChapterNameList();
StudentScoreWeight studentScoreWeight = new StudentScoreWeight(); StudentScoreWeight studentScoreWeight = new StudentScoreWeight();
//计分规则 //计分规则
@ -125,19 +126,19 @@ public class TrainingServiceImpl implements TrainingService {
studentScoreWeight.setExperimentalTrainingWeight(BigDecimal.valueOf(0.4)); studentScoreWeight.setExperimentalTrainingWeight(BigDecimal.valueOf(0.4));
studentScoreWeight.setReportWeight(BigDecimal.valueOf(0.1)); studentScoreWeight.setReportWeight(BigDecimal.valueOf(0.1));
for (int i = 0; i < chapterNameList.size(); i++) { //先将所有内置章节设置成默认章节 for (int i = 0; i < chapterNameList.size(); i++) { //先将所有内置章节设置成默认章节
map.put(chapterNameList.get(i),studentScoreWeight); map.put(chapterNameList.get(i), studentScoreWeight);
} }
//获取老师设置的权重 如果没有设置 则将map返回 如果设置了部分 则将map中设置过的章节替换成老师设置的章节 //获取老师设置的权重 如果没有设置 则将map返回 如果设置了部分 则将map中设置过的章节替换成老师设置的章节
StudentScoreWeightExample studentScoreWeightExample = new StudentScoreWeightExample(); StudentScoreWeightExample studentScoreWeightExample = new StudentScoreWeightExample();
studentScoreWeightExample.createCriteria().andSchoolIdEqualTo(schoolId); studentScoreWeightExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<StudentScoreWeight> studentScoreWeightList = studentScoreWeightMapper.selectByExample(studentScoreWeightExample); List<StudentScoreWeight> studentScoreWeightList = studentScoreWeightMapper.selectByExample(studentScoreWeightExample);
if(studentScoreWeightList.isEmpty()){ if (studentScoreWeightList.isEmpty()) {
return map; return map;
}else { } else {
for (int i = 0; i < studentScoreWeightList.size(); i++) { for (int i = 0; i < studentScoreWeightList.size(); i++) {
StudentScoreWeight teaWeight = studentScoreWeightList.get(i); StudentScoreWeight teaWeight = studentScoreWeightList.get(i);
map.put(studentScoreWeight.getChapterName(),teaWeight); map.put(studentScoreWeight.getChapterName(), teaWeight);
} }
return map; return map;
} }
@ -145,44 +146,44 @@ public class TrainingServiceImpl implements TrainingService {
//获取客户案例权重对象 map("风险测评" 权重数值) //获取客户案例权重对象 map("风险测评" 权重数值)
@Override @Override
public Map<String,BigDecimal> getClientWeight(String schoolId){ public Map<String, BigDecimal> getClientWeight(String schoolId) {
Map<String,BigDecimal> map=new HashMap<>(); Map<String, BigDecimal> map = new HashMap<>();
ClientWeight clientWeight = clientWeightMapper.selectByPrimaryKey(schoolId); ClientWeight clientWeight = clientWeightMapper.selectByPrimaryKey(schoolId);
if(clientWeight==null){ //设置默认权重 if (clientWeight == null) { //设置默认权重
map.put("风险测评",BigDecimal.valueOf(0.05)); map.put("风险测评", BigDecimal.valueOf(0.05));
map.put("财务分析",BigDecimal.valueOf(0.20)); map.put("财务分析", BigDecimal.valueOf(0.20));
map.put("现金规划",BigDecimal.valueOf(0.05)); map.put("现金规划", BigDecimal.valueOf(0.05));
map.put("教育规划",BigDecimal.valueOf(0.1)); map.put("教育规划", BigDecimal.valueOf(0.1));
map.put("消费规划",BigDecimal.valueOf(0.1)); map.put("消费规划", BigDecimal.valueOf(0.1));
map.put("创业规划",BigDecimal.valueOf(0.05)); map.put("创业规划", BigDecimal.valueOf(0.05));
map.put("退休规划",BigDecimal.valueOf(0.1)); map.put("退休规划", BigDecimal.valueOf(0.1));
map.put("保险规划",BigDecimal.valueOf(0.15)); map.put("保险规划", BigDecimal.valueOf(0.15));
map.put("投资规划",BigDecimal.valueOf(0.05)); map.put("投资规划", BigDecimal.valueOf(0.05));
map.put("税务筹划",BigDecimal.valueOf(0.05)); map.put("税务筹划", BigDecimal.valueOf(0.05));
map.put("财产分配",BigDecimal.valueOf(0.05)); map.put("财产分配", BigDecimal.valueOf(0.05));
map.put("财产传承",BigDecimal.valueOf(0.05)); map.put("财产传承", BigDecimal.valueOf(0.05));
return map; return map;
}else { } else {
map.put("风险测评",clientWeight.getFxcp()); map.put("风险测评", clientWeight.getFxcp());
map.put("财务分析",clientWeight.getCwfx()); map.put("财务分析", clientWeight.getCwfx());
map.put("现金规划",clientWeight.getXjgh()); map.put("现金规划", clientWeight.getXjgh());
map.put("教育规划",clientWeight.getJygh()); map.put("教育规划", clientWeight.getJygh());
map.put("消费规划",clientWeight.getXfgh()); map.put("消费规划", clientWeight.getXfgh());
map.put("创业规划",clientWeight.getCygh()); map.put("创业规划", clientWeight.getCygh());
map.put("退休规划",clientWeight.getTxgh()); map.put("退休规划", clientWeight.getTxgh());
map.put("保险规划",clientWeight.getBxgh()); map.put("保险规划", clientWeight.getBxgh());
map.put("投资规划",clientWeight.getTzgh()); map.put("投资规划", clientWeight.getTzgh());
map.put("税务筹划",clientWeight.getSwch()); map.put("税务筹划", clientWeight.getSwch());
map.put("财产分配",clientWeight.getCcfp()); map.put("财产分配", clientWeight.getCcfp());
map.put("财产传承",clientWeight.getCccc()); map.put("财产传承", clientWeight.getCccc());
return map; return map;
} }
} }
//设置所有的章节名称 //设置所有的章节名称
@Override @Override
public List<String> getChapterNameList(){ public List<String> getChapterNameList() {
List<String> list=new ArrayList<>(); List<String> list = new ArrayList<>();
list.add("风险测评"); list.add("风险测评");
list.add("财务分析"); list.add("财务分析");
list.add("现金规划"); list.add("现金规划");
@ -199,7 +200,6 @@ public class TrainingServiceImpl implements TrainingService {
} }
//学生端 综合规划成绩查询 //学生端 综合规划成绩查询
// 学习项目(案例名称)-》综合规划表中查询用户姓名 // 学习项目(案例名称)-》综合规划表中查询用户姓名
// 实训时长 -》综合规划表中查询 // 实训时长 -》综合规划表中查询
@ -209,44 +209,45 @@ public class TrainingServiceImpl implements TrainingService {
// 实训得分 -》总分*权重 // 实训得分 -》总分*权重
@Override @Override
public List<StuSynthesisPlanScoreDto> selectStuSynthesisPlanScoreList(String userId, String schoolId) { public StuSynthesisPlanScoreAndAvgScoreDto selectStuSynthesisPlanScoreList(String userId, String schoolId) {
SynthesisPlanClientExample clientExample = new SynthesisPlanClientExample(); SynthesisPlanClientExample clientExample = new SynthesisPlanClientExample();
clientExample.createCriteria().andUseridEqualTo(userId).andSubmitStatusEqualTo("已审核"); clientExample.createCriteria().andUseridEqualTo(userId).andSubmitStatusEqualTo("已审核");
//获取该用户所有审核通过的综合规划数据 //获取该用户所有审核通过的综合规划数据
List<SynthesisPlanClient> synthesisPlanClientList = synthesisPlanClientMapper.selectByExample(clientExample); List<SynthesisPlanClient> synthesisPlanClientList = synthesisPlanClientMapper.selectByExample(clientExample);
clientExample.setOrderByClause("get_time desc"); clientExample.setOrderByClause("get_time desc");
if(synthesisPlanClientList.isEmpty()){ if (synthesisPlanClientList.isEmpty()) {
return null; return null;
} }
//获取该学校的成绩总览权重数据 List<StuSynthesisPlanScoreDto> returnList = new ArrayList<>();
TotalWeight totalWeight = totalWeightMapper.selectByPrimaryKey(schoolId); BigDecimal fenzi = BigDecimal.ZERO;
BigDecimal zhghWeight= BigDecimal.valueOf(0.4); BigDecimal fenmu = BigDecimal.ZERO;
if(totalWeight!=null){
zhghWeight = totalWeight.getZhgh();
}
List<StuSynthesisPlanScoreDto> returnList=new ArrayList<>();
for (int i = 0; i < synthesisPlanClientList.size(); i++) { for (int i = 0; i < synthesisPlanClientList.size(); i++) {
fenmu = fenmu.add(BigDecimal.valueOf(100));
StuSynthesisPlanScoreDto returnDto = new StuSynthesisPlanScoreDto(); StuSynthesisPlanScoreDto returnDto = new StuSynthesisPlanScoreDto();
SynthesisPlanClient client = synthesisPlanClientList.get(i); SynthesisPlanClient client = synthesisPlanClientList.get(i);
returnDto.setCaseId(client.getCaseid()); returnDto.setCaseId(client.getCaseid());
returnDto.setName(client.getName()); returnDto.setName(client.getName());
returnDto.setUseTime(client.getUseTime()); returnDto.setUseTime(client.getUseTime());
//获取实训总分 returnDto.setTrainingFullScore(BigDecimal.valueOf(0));
BigDecimal trainingTotalScore=synthesisPlanScoreMapper.selectTotalScoreByUserIdAndCaseId(userId,client.getCaseid()); //获取学生实训得分
if(trainingTotalScore==null){ BigDecimal trainingScore = synthesisPlanScoreMapper.selectTotalScoreByUserIdAndCaseId(userId, client.getCaseid());
trainingTotalScore=BigDecimal.ZERO;
}else { //查询zhgh考核点数量
//查询zhgh考核点数量 Integer zhghSize = synthesisPlanScoreMapper.CountScoreSizeByUserIdAndCaseId(userId, client.getCaseid());
Integer zhghSize=synthesisPlanScoreMapper.CountScoreSizeByUserIdAndCaseId(userId,client.getCaseid()); //案例题zhgh实训满分
BigDecimal zhghTotalScore=BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2)); BigDecimal trainingFullScore = BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2));
trainingTotalScore = trainingTotalScore.divide(zhghTotalScore, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); //实训成绩
} BigDecimal stuScore = trainingScore.divide(trainingFullScore, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100));
returnDto.setTrainingTotalScore(trainingTotalScore); returnDto.setTrainingScore(trainingScore);
returnDto.setScoreWight(zhghWeight); returnDto.setTrainingFullScore(trainingFullScore);
returnDto.setStuScore(stuScore);
returnDto.setFinishStatus("已完成"); returnDto.setFinishStatus("已完成");
returnDto.setTrainingScore(trainingTotalScore.multiply(zhghWeight));
returnList.add(returnDto); returnList.add(returnDto);
fenzi = fenzi.add(stuScore);
} }
return returnList; StuSynthesisPlanScoreAndAvgScoreDto dto = new StuSynthesisPlanScoreAndAvgScoreDto();
dto.setList(returnList);
dto.setAvgScore(fenzi.divide(fenmu).setScale(4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
return dto;
} }
} }

Loading…
Cancel
Save