|
|
|
@ -9,7 +9,6 @@ import com.sztzjy.fund_investment.entity.dto.*;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.*;
|
|
|
|
|
import com.sztzjy.fund_investment.service.PerformanceScoreService;
|
|
|
|
|
import com.sztzjy.fund_investment.service.tea.ClassScoreService;
|
|
|
|
|
import com.sztzjy.fund_investment.util.PageUtil;
|
|
|
|
|
import com.sztzjy.fund_investment.util.ResultEntity;
|
|
|
|
|
import com.sztzjy.fund_investment.util.excel.FilePortUtil;
|
|
|
|
|
import com.sztzjy.fund_investment.util.file.IFileUtil;
|
|
|
|
@ -24,8 +23,6 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author xcj
|
|
|
|
@ -218,18 +215,13 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
|
|
|
|
|
PageHelper.startPage(index,size);
|
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
|
List<UserDto> studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName);
|
|
|
|
|
PageInfo <UserDto>pageInfo =new PageInfo(studentScoreDetails);
|
|
|
|
|
PageInfo<UserDto> pageInfo = new PageInfo(studentScoreDetails);
|
|
|
|
|
return pageInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 成绩详情导出功能
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/27
|
|
|
|
@ -281,6 +273,156 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /* 智能评分
|
|
|
|
|
// * @author xcj
|
|
|
|
|
// * @Date 2023/11/28
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public ResultEntity<HttpStatus> autoScore(String schoolId) {
|
|
|
|
|
// //根据flowId查出所有页面的结论报告
|
|
|
|
|
// 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);
|
|
|
|
|
// if (foundProject == null) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// String serviceDueDiligence = "";
|
|
|
|
|
// String financialDueDiligence = "";
|
|
|
|
|
// String projectValuationRelative = "";
|
|
|
|
|
// String projectValuationAbsolute = "";
|
|
|
|
|
// String foundProjectConclusion = "";
|
|
|
|
|
// if (StringUtils.isBlank(foundProject.getFoundProjectConclusion())) {
|
|
|
|
|
// performanceScoreService.updateScore("projectSearchReportScore", 0, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isBlank(foundProject.getServiceDueDiligence())) {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 0, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isBlank(foundProject.getFinancialDueDiligence())) {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 0, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationRelativeScore", 0, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isBlank(foundProject.getProjectValuationAbsolute())) {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationAbsoluteScore", 0, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
|
|
|
|
|
// }
|
|
|
|
|
// foundProjectConclusion = foundProjectConclusion.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|
// serviceDueDiligence = serviceDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|
// financialDueDiligence = financialDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|
// projectValuationRelative = projectValuationRelative.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|
// projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|
// PerformanceScoreExample performanceScoreExample2 = new PerformanceScoreExample();
|
|
|
|
|
// performanceScoreExample2.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowId);
|
|
|
|
|
//
|
|
|
|
|
// // 寻找项目结论
|
|
|
|
|
// if (performanceScore.getProjectSearchReportScore() == null) {
|
|
|
|
|
// if (foundProjectConclusion.length() >= 30) {
|
|
|
|
|
// // 字符串长度超过30
|
|
|
|
|
// performanceScoreService.updateScore("projectSearchReportScore", 2, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// //未超过30,结论报告是必填项,到这里就给1分没有0
|
|
|
|
|
// performanceScoreService.updateScore("projectSearchReportScore", 1, flowId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // 业务尽调结论
|
|
|
|
|
// if (performanceScore.getProjectDueDiligenceBusinessReportScore() == null) {
|
|
|
|
|
//
|
|
|
|
|
// if (serviceDueDiligence.length() >= 30) {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 2, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceBusinessReportScore", 1, flowId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //财务尽调结论
|
|
|
|
|
// if (performanceScore.getProjectDueDiligenceFinanceReportScore() == null) {
|
|
|
|
|
//
|
|
|
|
|
// if (financialDueDiligence.length() >= 30) {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 2, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// performanceScoreService.updateScore("projectDueDiligenceFinanceReportScore", 1, flowId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //项目相对估值结论
|
|
|
|
|
// if (performanceScore.getProjectValuationRelativeScore() == null) {
|
|
|
|
|
//
|
|
|
|
|
// if (projectValuationRelative.length() >= 30) {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationRelativeScore", 2, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationRelativeScore", 1, flowId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //项目绝对估值结论
|
|
|
|
|
// if (performanceScore.getProjectValuationAbsoluteScore() == null) {
|
|
|
|
|
//
|
|
|
|
|
// if (projectValuationAbsolute.length() >= 30) {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationAbsoluteScore", 2, flowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// performanceScoreService.updateScore("projectValuationAbsoluteScore", 1, flowId);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (String flowIdByList : list) {
|
|
|
|
|
// TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
// trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告");
|
|
|
|
|
// PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
|
|
|
|
|
// List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
// if (trainingReports.isEmpty()) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// TrainingReport trainingReport = trainingReports.get(0);
|
|
|
|
|
// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
|
|
|
|
|
// performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
|
|
|
|
|
// trainingReport.setExperienceScore(BigDecimal.ZERO);
|
|
|
|
|
// }
|
|
|
|
|
// //实训心得
|
|
|
|
|
// if (scoreByFlowId.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) {
|
|
|
|
|
// String experience = trainingReport.getExperience();
|
|
|
|
|
// if (experience.length() < 100) {
|
|
|
|
|
// performanceScoreService.updateScore("experienceScore", 1, flowIdByList);
|
|
|
|
|
// trainingReport.setExperienceScore(BigDecimal.ONE);
|
|
|
|
|
// } else if (experience.length() < 300) {
|
|
|
|
|
// performanceScoreService.updateScore("experienceScore", 2, flowIdByList);
|
|
|
|
|
// trainingReport.setExperienceScore(BigDecimal.valueOf(2));
|
|
|
|
|
// } else {
|
|
|
|
|
// performanceScoreService.updateScore("experienceScore", 3, flowIdByList);
|
|
|
|
|
// trainingReport.setExperienceScore(BigDecimal.valueOf(3));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //实验报告,未上传 0 分 上传得两分
|
|
|
|
|
// if (scoreByFlowId.getInvestmentReportScore() == null) {
|
|
|
|
|
// if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) {
|
|
|
|
|
// performanceScoreService.updateScore("investmentReportScore", 0, flowIdByList);//todo 需要修改
|
|
|
|
|
// trainingReport.setReportScore(BigDecimal.ZERO);
|
|
|
|
|
// } else if (!(trainingReport.getUrl().isEmpty()) && !(trainingReport.getReportName().isEmpty())) {
|
|
|
|
|
// performanceScoreService.updateScore("investmentReportScore", 2, flowIdByList);//todo 需要修改
|
|
|
|
|
// trainingReport.setReportScore(BigDecimal.valueOf(2));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// trainingReportMapper.updateByPrimaryKey(trainingReport);
|
|
|
|
|
// }
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
// }
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.NOT_FOUND);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 智能评分
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/28
|
|
|
|
@ -291,12 +433,26 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
|
|
|
|
|
List<String> list = new ArrayList();
|
|
|
|
|
for (PerformanceScore performanceScore : performanceScores) {
|
|
|
|
|
String flowId = performanceScore.getFlowId();
|
|
|
|
|
list.add(flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FoundProjectExample example = new FoundProjectExample();
|
|
|
|
|
example.createCriteria().andFlowIdIn(list);
|
|
|
|
|
List<FoundProject> foundProjects = foundProjectMapper.selectByExample(example);
|
|
|
|
|
|
|
|
|
|
Map<String, FoundProject> map = new HashMap<>();
|
|
|
|
|
for (FoundProject foundProject : foundProjects) {
|
|
|
|
|
map.put(foundProject.getFlowId(), foundProject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!performanceScores.isEmpty()) {
|
|
|
|
|
for (PerformanceScore performanceScore : performanceScores) {
|
|
|
|
|
String flowId = performanceScore.getFlowId();
|
|
|
|
|
list.add(flowId);
|
|
|
|
|
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
|
|
|
|
|
FoundProject foundProject = map.get(flowId);
|
|
|
|
|
if (foundProject == null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
@ -385,15 +541,31 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 一次性从数据库中查询所有符合条件的 TrainingReport
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdIn(list).andStepEqualTo("投资报告");
|
|
|
|
|
List<TrainingReport> allTrainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
|
|
|
|
|
// 构建一个以 flowId 为 key 的 TrainingReport 的 Map,方便后续根据 flowId 查找对应的 TrainingReport
|
|
|
|
|
Map<String, TrainingReport> trainingReportMap = new HashMap<>();
|
|
|
|
|
for (TrainingReport trainingReport : allTrainingReports) {
|
|
|
|
|
trainingReportMap.put(trainingReport.getFlowId(), trainingReport);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, PerformanceScore> performanceScoreMap = new HashMap<>();
|
|
|
|
|
// 循环外执行一次查询并存储结果
|
|
|
|
|
for (String flowIdByList : list) {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告");
|
|
|
|
|
PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
if (trainingReports.isEmpty()) {
|
|
|
|
|
performanceScoreMap.put(flowIdByList, scoreByFlowId);
|
|
|
|
|
}
|
|
|
|
|
// 遍历 list,根据内存中的数据处理流程
|
|
|
|
|
for (String flowIdByList : list) {
|
|
|
|
|
TrainingReport trainingReport = trainingReportMap.get(flowIdByList);
|
|
|
|
|
if (trainingReport == null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
TrainingReport trainingReport = trainingReports.get(0);
|
|
|
|
|
PerformanceScore scoreByFlowId = performanceScoreMap.get(flowIdByList);
|
|
|
|
|
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
|
|
|
|
|
performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.ZERO);
|
|
|
|
@ -429,6 +601,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
return new ResultEntity<>(HttpStatus.NOT_FOUND);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
String projectValuationAbsolute = "12312,./,/@#$好好好好好好好好好好好好好好好好AFGGGS好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好";
|
|
|
|
|
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
|
|
|
|
|