|
|
|
@ -52,7 +52,10 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
String schoolId = schoolIdList.get(i);
|
|
|
|
|
//根据学校ID 获取所有学生userId
|
|
|
|
|
UserInfoExample userInfoExample = new UserInfoExample();
|
|
|
|
|
userInfoExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4);
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
calendar.add(Calendar.YEAR, -1);
|
|
|
|
|
Date oneYearAgo = calendar.getTime();
|
|
|
|
|
userInfoExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4).andLoginTimeBetween(oneYearAgo, new Date()).andLoginTimeIsNotNull();
|
|
|
|
|
List<UserInfo> userList = userInfoMapper.selectByExample(userInfoExample);
|
|
|
|
|
//查询学习成绩权重表
|
|
|
|
|
Map<String, BigDecimal> clientWeight = trainingService.getClientWeight(schoolId); //客户案例权重
|
|
|
|
@ -111,32 +114,32 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
Integer resourceStatus = stuTraining.getResourceLearningCompleteStatus() == null ? 0 : stuTraining.getResourceLearningCompleteStatus();
|
|
|
|
|
Integer learningEvalCompleteStatus = stuTraining.getLearningEvalCompleteStatus() == null ? 9999 : stuTraining.getLearningEvalCompleteStatus();
|
|
|
|
|
Integer expStatus = stuTraining.getExpTrainingCompleteStatus() == null ? 9999 : stuTraining.getExpTrainingCompleteStatus();
|
|
|
|
|
if(knowledgeStatus>5){
|
|
|
|
|
knowledgeStatus=5;
|
|
|
|
|
if (knowledgeStatus > 5) {
|
|
|
|
|
knowledgeStatus = 5;
|
|
|
|
|
}
|
|
|
|
|
if(resourceStatus>5){
|
|
|
|
|
resourceStatus=5;
|
|
|
|
|
if (resourceStatus > 5) {
|
|
|
|
|
resourceStatus = 5;
|
|
|
|
|
}
|
|
|
|
|
StudentScoreWeight studentScoreWeight = studentScoreWeightMap.get(stuTraining.getChapterName());
|
|
|
|
|
BigDecimal summaryScore = studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(knowledgeStatus)).multiply(studentScoreWeight.getSummaryOfKnowledgeWeight());
|
|
|
|
|
BigDecimal resourceScore = studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(resourceStatus)).multiply(studentScoreWeight.getResourceLearningWeight());
|
|
|
|
|
BigDecimal learningScore= BigDecimal.valueOf(0);
|
|
|
|
|
BigDecimal experimentalScore= BigDecimal.valueOf(0);
|
|
|
|
|
if(learningEvalCompleteStatus!=9999){
|
|
|
|
|
if(learningEvalCompleteStatus<=10){
|
|
|
|
|
BigDecimal learningScore = BigDecimal.valueOf(0);
|
|
|
|
|
BigDecimal experimentalScore = BigDecimal.valueOf(0);
|
|
|
|
|
if (learningEvalCompleteStatus != 9999) {
|
|
|
|
|
if (learningEvalCompleteStatus <= 10) {
|
|
|
|
|
learningScore = BigDecimal.valueOf(100).subtract(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(learningEvalCompleteStatus))).multiply(studentScoreWeight.getLearningAssessmentWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(expStatus!=9999){
|
|
|
|
|
if(expStatus<=5){
|
|
|
|
|
if (expStatus != 9999) {
|
|
|
|
|
if (expStatus <= 5) {
|
|
|
|
|
experimentalScore = BigDecimal.valueOf(100).subtract(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(expStatus))).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
}
|
|
|
|
|
//财产分配特殊处理
|
|
|
|
|
if("11".equals(stuTraining.getChapterId())){
|
|
|
|
|
if(stuTraining.getExpTrainingCompleteStatus().compareTo(100)>0){
|
|
|
|
|
if ("11".equals(stuTraining.getChapterId())) {
|
|
|
|
|
if (stuTraining.getExpTrainingCompleteStatus().compareTo(100) > 0) {
|
|
|
|
|
stuTraining.setExpTrainingCompleteStatus(100);
|
|
|
|
|
}
|
|
|
|
|
experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
experimentalScore = BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//计算报告分数
|
|
|
|
@ -144,9 +147,11 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
BigDecimal reportScore=BigDecimal.ZERO;
|
|
|
|
|
BigDecimal reportScore = BigDecimal.ZERO;
|
|
|
|
|
if (!trainingReports.isEmpty()) {
|
|
|
|
|
reportScore=trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
|
|
|
|
|
if (trainingReports.get(0).getTeacherScore() != null) {
|
|
|
|
|
reportScore = trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore);
|
|
|
|
|
if ("风险测评".equals(stuTraining.getChapterName())) {
|
|
|
|
@ -198,10 +203,10 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
|
|
|
|
|
scoreRank.setCountCase((int) countCase);
|
|
|
|
|
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
|
|
|
|
|
if(dto==null){
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId, schoolId);
|
|
|
|
|
if (dto == null) {
|
|
|
|
|
scoreRank.setZhghScore(BigDecimal.ZERO);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
scoreRank.setZhghScore(dto.getAvgScore());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -335,7 +340,10 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
List<ScoreRank> scoreRankList = new ArrayList<>();
|
|
|
|
|
//根据学校ID 获取所有学生userId
|
|
|
|
|
UserInfoExample userInfoExample = new UserInfoExample();
|
|
|
|
|
userInfoExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4);
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
calendar.add(Calendar.YEAR, -1);
|
|
|
|
|
Date oneYearAgo = calendar.getTime();
|
|
|
|
|
userInfoExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4).andLoginTimeBetween(oneYearAgo, new Date()).andLoginTimeIsNotNull();
|
|
|
|
|
List<UserInfo> userList = userInfoMapper.selectByExample(userInfoExample);
|
|
|
|
|
//查询学习成绩权重表
|
|
|
|
|
Map<String, BigDecimal> clientWeight = trainingService.getClientWeight(schoolId); //客户案例权重
|
|
|
|
@ -394,32 +402,32 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
Integer resourceStatus = stuTraining.getResourceLearningCompleteStatus() == null ? 0 : stuTraining.getResourceLearningCompleteStatus();
|
|
|
|
|
Integer learningEvalCompleteStatus = stuTraining.getLearningEvalCompleteStatus() == null ? 9999 : stuTraining.getLearningEvalCompleteStatus();
|
|
|
|
|
Integer expStatus = stuTraining.getExpTrainingCompleteStatus() == null ? 9999 : stuTraining.getExpTrainingCompleteStatus();
|
|
|
|
|
if(knowledgeStatus>5){
|
|
|
|
|
knowledgeStatus=5;
|
|
|
|
|
if (knowledgeStatus > 5) {
|
|
|
|
|
knowledgeStatus = 5;
|
|
|
|
|
}
|
|
|
|
|
if(resourceStatus>5){
|
|
|
|
|
resourceStatus=5;
|
|
|
|
|
if (resourceStatus > 5) {
|
|
|
|
|
resourceStatus = 5;
|
|
|
|
|
}
|
|
|
|
|
StudentScoreWeight studentScoreWeight = studentScoreWeightMap.get(stuTraining.getChapterName());
|
|
|
|
|
BigDecimal summaryScore = studentScoreWeight.getSummaryOfKnowledgeScore().multiply(BigDecimal.valueOf(knowledgeStatus)).multiply(studentScoreWeight.getSummaryOfKnowledgeWeight());
|
|
|
|
|
BigDecimal resourceScore = studentScoreWeight.getResourceLearningScore().multiply(BigDecimal.valueOf(resourceStatus)).multiply(studentScoreWeight.getResourceLearningWeight());
|
|
|
|
|
BigDecimal learningScore= BigDecimal.valueOf(0);
|
|
|
|
|
BigDecimal experimentalScore= BigDecimal.valueOf(0);
|
|
|
|
|
if(learningEvalCompleteStatus!=9999){
|
|
|
|
|
if(learningEvalCompleteStatus<=10){
|
|
|
|
|
BigDecimal learningScore = BigDecimal.valueOf(0);
|
|
|
|
|
BigDecimal experimentalScore = BigDecimal.valueOf(0);
|
|
|
|
|
if (learningEvalCompleteStatus != 9999) {
|
|
|
|
|
if (learningEvalCompleteStatus <= 10) {
|
|
|
|
|
learningScore = BigDecimal.valueOf(100).subtract(studentScoreWeight.getLearningAssessmentScore().multiply(BigDecimal.valueOf(learningEvalCompleteStatus))).multiply(studentScoreWeight.getLearningAssessmentWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(expStatus!=9999){
|
|
|
|
|
if(expStatus<=5){
|
|
|
|
|
if (expStatus != 9999) {
|
|
|
|
|
if (expStatus <= 5) {
|
|
|
|
|
experimentalScore = BigDecimal.valueOf(100).subtract(studentScoreWeight.getExperimentalTrainingScore().multiply(BigDecimal.valueOf(expStatus))).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
}
|
|
|
|
|
//财产分配特殊处理
|
|
|
|
|
if("11".equals(stuTraining.getChapterId())){
|
|
|
|
|
if(stuTraining.getExpTrainingCompleteStatus().compareTo(100)>0){
|
|
|
|
|
if ("11".equals(stuTraining.getChapterId())) {
|
|
|
|
|
if (stuTraining.getExpTrainingCompleteStatus().compareTo(100) > 0) {
|
|
|
|
|
stuTraining.setExpTrainingCompleteStatus(100);
|
|
|
|
|
}
|
|
|
|
|
experimentalScore= BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
experimentalScore = BigDecimal.valueOf(stuTraining.getExpTrainingCompleteStatus()).multiply(studentScoreWeight.getExperimentalTrainingWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//计算报告分数
|
|
|
|
@ -427,9 +435,11 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdEqualTo(userId);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
BigDecimal reportScore=BigDecimal.ZERO;
|
|
|
|
|
BigDecimal reportScore = BigDecimal.ZERO;
|
|
|
|
|
if (!trainingReports.isEmpty()) {
|
|
|
|
|
reportScore=trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
|
|
|
|
|
if (trainingReports.get(0).getTeacherScore() != null) {
|
|
|
|
|
reportScore = trainingReports.get(0).getTeacherScore().multiply(studentScoreWeight.getReportWeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigDecimal sum = summaryScore.add(resourceScore).add(learningScore).add(experimentalScore).add(reportScore);
|
|
|
|
@ -482,10 +492,10 @@ public class ScoreRankServiceImpl implements ScoreRankService {
|
|
|
|
|
long countCase = synthesisPlanClientMapper.countByExample(synthesisPlanClientExample);
|
|
|
|
|
scoreRank.setCountCase((int) countCase);
|
|
|
|
|
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId,schoolId);
|
|
|
|
|
if(dto==null){
|
|
|
|
|
StuSynthesisPlanScoreAndAvgScoreDto dto = trainingService.selectStuSynthesisPlanScoreList(userId, schoolId);
|
|
|
|
|
if (dto == null) {
|
|
|
|
|
scoreRank.setZhghScore(BigDecimal.ZERO);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
scoreRank.setZhghScore(dto.getAvgScore());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|