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

master
yz
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.*;
@ -199,7 +200,6 @@ public class TrainingServiceImpl implements TrainingService {
} }
//学生端 综合规划成绩查询 //学生端 综合规划成绩查询
// 学习项目(案例名称)-》综合规划表中查询用户姓名 // 学习项目(案例名称)-》综合规划表中查询用户姓名
// 实训时长 -》综合规划表中查询 // 实训时长 -》综合规划表中查询
@ -209,7 +209,7 @@ 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("已审核");
//获取该用户所有审核通过的综合规划数据 //获取该用户所有审核通过的综合规划数据
@ -218,35 +218,36 @@ public class TrainingServiceImpl implements TrainingService {
if (synthesisPlanClientList.isEmpty()) { if (synthesisPlanClientList.isEmpty()) {
return null; 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++) { 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());
BigDecimal zhghTotalScore=BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2)); //案例题zhgh实训满分
trainingTotalScore = trainingTotalScore.divide(zhghTotalScore, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); BigDecimal trainingFullScore = BigDecimal.valueOf(zhghSize).multiply(BigDecimal.valueOf(2));
} //实训成绩
returnDto.setTrainingTotalScore(trainingTotalScore); BigDecimal stuScore = trainingScore.divide(trainingFullScore, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100));
returnDto.setScoreWight(zhghWeight); returnDto.setTrainingScore(trainingScore);
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