|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.sztzjy.money_management.service.impl;
|
|
|
|
|
|
|
|
|
|
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.service.ScoreRankService;
|
|
|
|
|
import com.sztzjy.money_management.service.TrainingService;
|
|
|
|
@ -34,6 +35,8 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
TotalWeightMapper totalWeightMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
StuTheoryRecordMapper stuTheoryRecordMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
TrainingReportMapper trainingReportMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Scheduled(cron = "0 0 1 * * ?")
|
|
|
|
@ -136,7 +139,16 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
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())) {
|
|
|
|
|
scoreRank.setFxcp(sum);
|
|
|
|
|
} else if ("财务分析".equals(stuTraining.getChapterName())) {
|
|
|
|
@ -186,17 +198,12 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
|
|
|
|
|
scoreRank.setCountCase((int) countCase);
|
|
|
|
|
|
|
|
|
|
BigDecimal zhghScore = synthesisPlanScoreMapper.selectTotalScoreByUserId(userId);
|
|
|
|
|
if (zhghScore==null){
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
|
|
|
|
|
if(dto==null){
|
|
|
|
|
scoreRank.setZhghScore(BigDecimal.ZERO);
|
|
|
|
|
}else {
|
|
|
|
|
//查询zhgh考核点数量
|
|
|
|
|
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(dto.getAvgScore());
|
|
|
|
|
}
|
|
|
|
|
scoreRank.setZhghScore(zhghScore);
|
|
|
|
|
|
|
|
|
|
//设置理论考核平均分成绩
|
|
|
|
|
StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId);
|
|
|
|
@ -415,7 +422,17 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
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())) {
|
|
|
|
|
scoreRank.setFxcp(sum);
|
|
|
|
|
} else if ("财务分析".equals(stuTraining.getChapterName())) {
|
|
|
|
@ -465,18 +482,13 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
|
|
|
|
|
scoreRank.setCountCase((int) countCase);
|
|
|
|
|
|
|
|
|
|
BigDecimal zhghScore = synthesisPlanScoreMapper.selectTotalScoreByUserId(userId);
|
|
|
|
|
if (zhghScore==null){
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
|
|
|
|
|
if(dto==null){
|
|
|
|
|
scoreRank.setZhghScore(BigDecimal.ZERO);
|
|
|
|
|
}else {
|
|
|
|
|
//查询zhgh考核点数量
|
|
|
|
|
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(dto.getAvgScore());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置理论考核平均分成绩
|
|
|
|
|
StuTheoryRecord stuTheoryRecord = theoryRecordMapper.selectByPrimaryKey(userId);
|
|
|
|
|
if (stuTheoryRecord == null) {
|
|
|
|
|