修改计分规则

master
yz 4 months ago
parent ef7df4d9fc
commit 1c8db29b6d

@ -108,7 +108,7 @@ public class GradeController {
if (studentScoreWeights.isEmpty()) { //设置默认权重与计分规则 if (studentScoreWeights.isEmpty()) { //设置默认权重与计分规则
//计分规则 //计分规则
studentScoreWeight.setSummaryOfKnowledgeScore(BigDecimal.valueOf(20)); studentScoreWeight.setSummaryOfKnowledgeScore(BigDecimal.valueOf(20));
studentScoreWeight.setResourceLearningScore(BigDecimal.valueOf(2)); studentScoreWeight.setResourceLearningScore(BigDecimal.valueOf(20));
studentScoreWeight.setLearningAssessmentScore(BigDecimal.valueOf(10)); studentScoreWeight.setLearningAssessmentScore(BigDecimal.valueOf(10));
studentScoreWeight.setExperimentalTrainingScore(BigDecimal.valueOf(10)); studentScoreWeight.setExperimentalTrainingScore(BigDecimal.valueOf(10));
@ -291,7 +291,7 @@ public class GradeController {
for (int i = 0; i < clientCaseList.size(); i++) { for (int i = 0; i < clientCaseList.size(); i++) {
StuClientCaseScoreDto clientCase = clientCaseList.get(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(); BigDecimal totalScore = clientCase.getTrainingTotalScore() == null ? BigDecimal.ZERO : clientCase.getTrainingScore();
clientCaseTrainingTime = clientCaseTrainingTime.add(trainingTime); clientCaseTrainingTime = clientCaseTrainingTime.add(trainingTime);
clientCaseTotalTrainingScore = clientCaseTotalTrainingScore.add(totalScore); clientCaseTotalTrainingScore = clientCaseTotalTrainingScore.add(totalScore);
} }
@ -993,25 +993,32 @@ public class GradeController {
} }
} }
//设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分 //设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分
CaseLifeEducationPlanExample teaExample = new CaseLifeEducationPlanExample(); BigDecimal teaFinancialPlanningMoney = new BigDecimal(0);
teaExample.createCriteria().andCaseidEqualTo(caseid).andIsAnswerEqualTo("题目答案"); String financialPlan = stuPlan.getFinancialPlan();
List<CaseLifeEducationPlan> teaCasePlanList = caseLifeEducationPlanMapper.selectByExample(teaExample); try {
CaseLifeEducationPlan teaPlan = teaCasePlanList.get(0); if (financialPlan != null) {
BigDecimal teaFinancialPlanningMoney = new BigDecimal(teaPlan.getFinancialPlan()); teaFinancialPlanningMoney = new BigDecimal(financialPlan);
}
} catch (Exception e) {
// 可以选择设置一个默认值或者进行其他错误处理
teaFinancialPlanningMoney = new BigDecimal("0"); // 或者其他适当的默认值
}
BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestment(); BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestment();
BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal disposableInput = stuPlan.getDisposableInput();
BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment();
Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n
BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中
if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { try {
teacherFinancialPlanningScore = BigDecimal.valueOf(2); BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) {
} else { teacherFinancialPlanningScore = BigDecimal.valueOf(2);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
} } else {
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
}
} catch (Exception e) {
}
caseLifeEducationPlanMapper.updateByPrimaryKey(stuPlan); caseLifeEducationPlanMapper.updateByPrimaryKey(stuPlan);
//并设置综合规划成绩表 修改老师评分分数 //并设置综合规划成绩表 修改老师评分分数
SynthesisPlanScoreExample scoreExample = new SynthesisPlanScoreExample(); SynthesisPlanScoreExample scoreExample = new SynthesisPlanScoreExample();
@ -1064,25 +1071,32 @@ public class GradeController {
} }
} }
//设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分 //设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分
CaseConsumptionPlanExample teaExample = new CaseConsumptionPlanExample(); BigDecimal teaFinancialPlanningMoney = new BigDecimal(0);
teaExample.createCriteria().andCaseIdEqualTo(caseid).andIsAnswerEqualTo("题目答案"); String financialPlan = stuPlan.getFinancialPlan();
List<CaseConsumptionPlan> teaCasePlanList = caseConsumptionPlanMapper.selectByExample(teaExample); try {
CaseConsumptionPlan teaPlan = teaCasePlanList.get(0); if (financialPlan != null) {
BigDecimal teaFinancialPlanningMoney = new BigDecimal(teaPlan.getFinancialPlan()); teaFinancialPlanningMoney = new BigDecimal(financialPlan);
}
} catch (Exception e) {
// 可以选择设置一个默认值或者进行其他错误处理
teaFinancialPlanningMoney = new BigDecimal("0"); // 或者其他适当的默认值
}
BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestment(); BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestment();
BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal disposableInput = stuPlan.getDisposableInput();
BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment();
Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n
BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中
if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { try {
teacherFinancialPlanningScore = BigDecimal.valueOf(2); BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) {
} else { teacherFinancialPlanningScore = BigDecimal.valueOf(2);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
} } else {
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
}
} catch (Exception e) {
}
caseConsumptionPlanMapper.updateByPrimaryKey(stuPlan); caseConsumptionPlanMapper.updateByPrimaryKey(stuPlan);
//并设置综合规划成绩表 修改老师评分分数 //并设置综合规划成绩表 修改老师评分分数
SynthesisPlanScoreExample scoreExample = new SynthesisPlanScoreExample(); SynthesisPlanScoreExample scoreExample = new SynthesisPlanScoreExample();
@ -1135,22 +1149,31 @@ public class GradeController {
} }
} }
//设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分 //设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分
CaseStartAnUndertakingPlanExample teaExample = new CaseStartAnUndertakingPlanExample(); BigDecimal teaFinancialPlanningMoney = new BigDecimal(0);
teaExample.createCriteria().andCaseidEqualTo(caseid).andIsAnswerEqualTo("题目答案"); String financialPlan = stuPlan.getFinancialPlan();
List<CaseStartAnUndertakingPlan> teaCasePlanList = caseStartAnUndertakingPlanMapper.selectByExample(teaExample); try {
CaseStartAnUndertakingPlan teaPlan = teaCasePlanList.get(0); if (financialPlan != null) {
BigDecimal teaFinancialPlanningMoney = new BigDecimal(teaPlan.getFinancialPlan()); teaFinancialPlanningMoney = new BigDecimal(financialPlan);
}
} catch (Exception e) {
// 可以选择设置一个默认值或者进行其他错误处理
teaFinancialPlanningMoney = new BigDecimal("0"); // 或者其他适当的默认值
}
BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestmentRate(); BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestmentRate();
BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal disposableInput = stuPlan.getDisposableInput();
BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment();
Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n
BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中
if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { try {
teacherFinancialPlanningScore = BigDecimal.valueOf(2); BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) {
} else { teacherFinancialPlanningScore = BigDecimal.valueOf(2);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
} else {
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
}
} catch (Exception e) {
} }
@ -1206,24 +1229,32 @@ public class GradeController {
} }
} }
//设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分 //设置理财方案分数 先获取案例题答案的分数 再获取学生理财方案的四个对象 按照公式对比大小 如果大于老师的答案 则给两分 低于给0分
CaseRetirementPlanExample teaExample = new CaseRetirementPlanExample(); BigDecimal teaFinancialPlanningMoney = new BigDecimal(0);
teaExample.createCriteria().andCaseidEqualTo(caseid).andIsAnswerEqualTo("题目答案"); String financialPlan = stuPlan.getFinancialPlan();
List<CaseRetirementPlan> teaCasePlanList = caseRetirementPlanMapper.selectByExample(teaExample); try {
CaseRetirementPlan teaPlan = teaCasePlanList.get(0); if (financialPlan != null) {
BigDecimal teaFinancialPlanningMoney = new BigDecimal(teaPlan.getFinancialPlan()); teaFinancialPlanningMoney = new BigDecimal(financialPlan);
}
} catch (Exception e) {
// 可以选择设置一个默认值或者进行其他错误处理
teaFinancialPlanningMoney = new BigDecimal("0"); // 或者其他适当的默认值
}
BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestmentRate(); BigDecimal returnOnInvestment = stuPlan.getReturnOnInvestmentRate();
BigDecimal disposableInput = stuPlan.getDisposableInput(); BigDecimal disposableInput = stuPlan.getDisposableInput();
BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment(); BigDecimal monthlyInvestment = stuPlan.getMonthlyInvestment();
Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n Integer regularYear = stuPlan.getRegularYear(); //定期定额投资年限 n
BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中 BigDecimal teacherFinancialPlanningScore = BigDecimal.ZERO; //老师理财分数 用于保存到综合规划成绩表中
if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) { try {
teacherFinancialPlanningScore = BigDecimal.valueOf(2); BigDecimal stuFinancialPlanningMoney = getFinancialPlanningMoney(returnOnInvestment, disposableInput, monthlyInvestment, regularYear);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); if (stuFinancialPlanningMoney.compareTo(teaFinancialPlanningMoney) >= 0) {
} else { teacherFinancialPlanningScore = BigDecimal.valueOf(2);
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore); stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
} } else {
stuPlan.setCaseTeacherScore(teacherFinancialPlanningScore);
}
} catch (Exception e) {
}
caseRetirementPlanMapper.updateByPrimaryKey(stuPlan); caseRetirementPlanMapper.updateByPrimaryKey(stuPlan);
//并设置综合规划成绩表 修改老师评分分数 //并设置综合规划成绩表 修改老师评分分数

@ -19,4 +19,5 @@ public interface TrainingService {
List<String> getChapterNameList(); List<String> getChapterNameList();
Map<String, StudentScoreWeight> getStudentScoreWeightMap(String schoolId); Map<String, StudentScoreWeight> getStudentScoreWeightMap(String schoolId);
} }

@ -131,6 +131,7 @@ public class TrainingServiceImpl implements TrainingService {
} }
//获取客户案例权重对象 map("风险测评" 权重数值) //获取客户案例权重对象 map("风险测评" 权重数值)
@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);

Loading…
Cancel
Save