|
|
|
@ -95,7 +95,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
int schoolGeneralCount = 0;
|
|
|
|
|
int schoolFailCount = 0;
|
|
|
|
|
BigDecimal maxScoreBySchoolId = BigDecimal.ZERO;
|
|
|
|
|
BigDecimal minScoreBySchoolId = null;
|
|
|
|
|
BigDecimal minScoreBySchoolId = BigDecimal.ZERO;
|
|
|
|
|
BigDecimal avgScoreBySchoolId = BigDecimal.ZERO;
|
|
|
|
|
for (TeaClassScore teaClassScore : teaClassScores) {
|
|
|
|
|
schoolExcellentCount = schoolExcellentCount + teaClassScore.getExcellentCount();
|
|
|
|
@ -104,13 +104,19 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
schoolFailCount = schoolFailCount + teaClassScore.getFailCount();
|
|
|
|
|
|
|
|
|
|
BigDecimal maxScore = teaClassScore.getClassMaxScore();
|
|
|
|
|
if (maxScore == null) {
|
|
|
|
|
maxScore = BigDecimal.ZERO;
|
|
|
|
|
}
|
|
|
|
|
BigDecimal minScore = teaClassScore.getClassMinScore();
|
|
|
|
|
if (minScore == null) {
|
|
|
|
|
minScore = BigDecimal.ZERO;
|
|
|
|
|
}
|
|
|
|
|
// 计算最高分
|
|
|
|
|
if (maxScore.compareTo(maxScoreBySchoolId) >= 0) {
|
|
|
|
|
maxScoreBySchoolId = maxScore;
|
|
|
|
|
}
|
|
|
|
|
// 计算最低分
|
|
|
|
|
if (minScoreBySchoolId == null || minScore.compareTo(minScoreBySchoolId) <= 0) {
|
|
|
|
|
if (minScoreBySchoolId.compareTo(BigDecimal.ZERO) == 0 || minScore.compareTo(minScoreBySchoolId) <= 0) {
|
|
|
|
|
minScoreBySchoolId = minScore;
|
|
|
|
|
}
|
|
|
|
|
//所有班级平均分累加
|
|
|
|
@ -172,12 +178,13 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
if (!performanceScores.isEmpty()) {
|
|
|
|
|
PerformanceScore performanceScore = performanceScores.get(0);
|
|
|
|
|
if (!trainingReports.isEmpty()) {
|
|
|
|
|
if (trainingReports.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (TrainingReport trainingReport : trainingReports) {
|
|
|
|
|
userDto.setReportId(trainingReport.getId());
|
|
|
|
|
userDto.setReportName(trainingReport.getReportName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userDto.setFlowId(flowId);
|
|
|
|
|
userDto.setScore(performanceScore.getTotalScore());
|
|
|
|
|
userDto.setPerformanceScoreId(performanceScore.getId());
|
|
|
|
@ -253,16 +260,45 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
List<String> list = new ArrayList();
|
|
|
|
|
if (!performanceScores.isEmpty()) {
|
|
|
|
|
for (PerformanceScore performanceScore : performanceScores) {
|
|
|
|
|
String flowId = performanceScore.getFlowId();
|
|
|
|
|
list.add(flowId);
|
|
|
|
|
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
|
|
|
|
|
String foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
|
|
|
|
|
String serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
|
|
|
|
|
String financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
|
|
|
|
|
String projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
|
|
|
|
|
String projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
|
|
|
|
|
|
|
|
|
|
if (foundProject == null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String serviceDueDiligence = "";
|
|
|
|
|
String financialDueDiligence = "";
|
|
|
|
|
String projectValuationRelative = "";
|
|
|
|
|
String projectValuationAbsolute = "";
|
|
|
|
|
String foundProjectConclusion = "";
|
|
|
|
|
if (foundProject.getFoundProjectConclusion() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectSearchReportScore", 0, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
|
|
|
|
|
}
|
|
|
|
|
if (foundProject.getServiceDueDiligence() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 0, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
|
|
|
|
|
}
|
|
|
|
|
if (foundProject.getFinancialDueDiligence() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 0, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
|
|
|
|
|
}
|
|
|
|
|
if (foundProject.getProjectValuationRelative() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 0, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
|
|
|
|
|
}
|
|
|
|
|
if (foundProject.getProjectValuationAbsolute() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationAbsoluteScore", 0, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
|
|
|
|
|
}
|
|
|
|
|
foundProjectConclusion = foundProjectConclusion.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
serviceDueDiligence = serviceDueDiligence.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
financialDueDiligence = financialDueDiligence.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
@ -278,21 +314,18 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
//未超过30,结论报告是必填项,到这里就给1分没有0
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectSearchReportScore", 1, flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 业务尽调结论
|
|
|
|
|
if (serviceDueDiligence.length() >= 30) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 2, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 1, flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务尽调结论
|
|
|
|
|
if (financialDueDiligence.length() >= 30) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 2, flowId);
|
|
|
|
|
} else {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 1, flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//项目相对估值结论
|
|
|
|
|
if (projectValuationRelative.length() >= 30) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowId);
|
|
|
|
@ -305,39 +338,47 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
} else {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationAbsoluteScore", 1, flowId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (String flowIdByList : list) {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowId);
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
if (!trainingReports.isEmpty()) {
|
|
|
|
|
if (trainingReports.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String experience = "";
|
|
|
|
|
TrainingReport trainingReport = trainingReports.get(0);
|
|
|
|
|
String experience = trainingReport.getExperience();
|
|
|
|
|
String url = trainingReport.getUrl();
|
|
|
|
|
String reportName = trainingReport.getReportName();
|
|
|
|
|
experience = experience.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
url = url.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
reportName = reportName.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
if (trainingReport.getExperience() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 0, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
experience = trainingReport.getExperience();
|
|
|
|
|
}
|
|
|
|
|
//实训心得
|
|
|
|
|
if (experience.length() < 100) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 1, flowId); //todo 需要修改
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 1, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.ONE);
|
|
|
|
|
}
|
|
|
|
|
if (experience.length() >= 100 && experience.length() < 300) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowId);//todo 需要修改
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.valueOf(2));
|
|
|
|
|
}
|
|
|
|
|
if (experience.length() >= 300) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowId);//todo 需要修改
|
|
|
|
|
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.valueOf(3));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//实验报告,未上传 0 分 上传得两分
|
|
|
|
|
if (!(url.isEmpty()) && !(reportName.isEmpty())) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("investmentReportScore", 2, flowId);//todo 需要修改
|
|
|
|
|
if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("investmentReportScore", 0, flowIdByList);//todo 需要修改
|
|
|
|
|
trainingReport.setReportScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
if (!(trainingReport.getUrl().isEmpty()) && !(trainingReport.getReportName().isEmpty())) {
|
|
|
|
|
performanceScoreService.calculateScoreByModule("investmentReportScore", 2, flowIdByList);//todo 需要修改
|
|
|
|
|
trainingReport.setReportScore(BigDecimal.valueOf(2));
|
|
|
|
|
}
|
|
|
|
|
trainingReportMapper.updateByPrimaryKey(trainingReport);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(HttpStatus.NOT_FOUND);
|
|
|
|
@ -439,7 +480,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 实训成绩
|
|
|
|
|
// 实训成绩
|
|
|
|
|
@Override
|
|
|
|
|
public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) {
|
|
|
|
|
PerformanceScoreExample example = new PerformanceScoreExample();
|
|
|
|
|