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