|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.sztzjy.fund_investment.service.serviceImpl.tea;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.sztzjy.fund_investment.config.Constant;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.*;
|
|
|
|
@ -23,6 +24,8 @@ 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
|
|
|
|
@ -152,62 +155,81 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /* 成绩详情页面
|
|
|
|
|
// * @author xcj
|
|
|
|
|
// * @Date 2023/11/27
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
|
|
|
|
|
// UserExample userTableExample = new UserExample();
|
|
|
|
|
// UserExample.Criteria criteria = userTableExample.createCriteria();
|
|
|
|
|
// UserExample.Criteria orCriteria = userTableExample.createCriteria();
|
|
|
|
|
// criteria.andRoleIdEqualTo(4);
|
|
|
|
|
// if (StringUtils.isNotBlank(classId)) {
|
|
|
|
|
// criteria.andClassIdEqualTo(classId);
|
|
|
|
|
// } else {
|
|
|
|
|
// criteria.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(studentIdOrName)) {
|
|
|
|
|
// criteria.andNameEqualTo(studentIdOrName);
|
|
|
|
|
// orCriteria.andStudentIdEqualTo(studentIdOrName);
|
|
|
|
|
// }
|
|
|
|
|
// userTableExample.or(orCriteria);
|
|
|
|
|
// List<User> userTables = userMapper.selectByExample(userTableExample);
|
|
|
|
|
//
|
|
|
|
|
// List<UserDto> userDtoList = new ArrayList<>();
|
|
|
|
|
// for (User userTable : userTables) {
|
|
|
|
|
// UserDto userDto = new UserDto();
|
|
|
|
|
// BeanUtils.copyProperties(userTable, userDto);
|
|
|
|
|
// Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
|
|
|
|
|
// String flowId = flow.getFlowId();
|
|
|
|
|
// TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
// trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
|
|
|
|
|
// List<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
// PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
// performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
|
|
|
|
|
// List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
// if (!performanceScores.isEmpty()) {
|
|
|
|
|
// PerformanceScore performanceScore = performanceScores.get(0);
|
|
|
|
|
// 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());
|
|
|
|
|
// userDtoList.add(userDto);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (userDtoList.size() <= 0) {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序
|
|
|
|
|
// return PageUtil.pageHelper(userDtoList, index, size); //分页
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 成绩详情页面
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/27
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
|
|
|
|
|
UserExample userTableExample = new UserExample();
|
|
|
|
|
UserExample.Criteria criteria = userTableExample.createCriteria();
|
|
|
|
|
UserExample.Criteria orCriteria = userTableExample.createCriteria();
|
|
|
|
|
criteria.andRoleIdEqualTo(4);
|
|
|
|
|
if (StringUtils.isNotBlank(classId)) {
|
|
|
|
|
criteria.andClassIdEqualTo(classId);
|
|
|
|
|
} else {
|
|
|
|
|
criteria.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(studentIdOrName)) {
|
|
|
|
|
criteria.andNameEqualTo(studentIdOrName);
|
|
|
|
|
orCriteria.andStudentIdEqualTo(studentIdOrName);
|
|
|
|
|
}
|
|
|
|
|
userTableExample.or(orCriteria);
|
|
|
|
|
List<User> userTables = userMapper.selectByExample(userTableExample);
|
|
|
|
|
List<UserDto> userDtoList = new ArrayList<>();
|
|
|
|
|
for (User userTable : userTables) {
|
|
|
|
|
UserDto userDto = new UserDto();
|
|
|
|
|
BeanUtils.copyProperties(userTable, userDto);
|
|
|
|
|
Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
|
|
|
|
|
String flowId = flow.getFlowId();
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
|
|
|
|
|
List<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
if (!performanceScores.isEmpty()) {
|
|
|
|
|
PerformanceScore performanceScore = performanceScores.get(0);
|
|
|
|
|
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());
|
|
|
|
|
userDtoList.add(userDto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (userDtoList.size() <= 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序
|
|
|
|
|
return PageUtil.pageHelper(userDtoList, index, size); //分页
|
|
|
|
|
PageHelper.startPage(index,size);
|
|
|
|
|
List<UserDto> studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName);
|
|
|
|
|
PageInfo <UserDto>pageInfo =new PageInfo(studentScoreDetails);
|
|
|
|
|
return pageInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 成绩详情导出功能
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/27
|
|
|
|
@ -308,11 +330,11 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
} 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]", "");
|
|
|
|
|
projectValuationRelative = projectValuationRelative.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^a-zA-Z0-9]", "");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
@ -365,22 +387,20 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
for (String flowIdByList : list) {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList);
|
|
|
|
|
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告");
|
|
|
|
|
PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
|
|
|
|
|
if (trainingReports.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String experience = "";
|
|
|
|
|
TrainingReport trainingReport = trainingReports.get(0);
|
|
|
|
|
if (trainingReport.getExperience() == null) {
|
|
|
|
|
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
|
|
|
|
|
performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
|
|
|
|
|
trainingReport.setExperienceScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
experience = trainingReport.getExperience();
|
|
|
|
|
}
|
|
|
|
|
//实训心得
|
|
|
|
|
if (scoreByFlowId.getExperienceScore() == null) {
|
|
|
|
|
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);
|
|
|
|
@ -409,6 +429,15 @@ 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]", "");
|
|
|
|
|
System.out.println(projectValuationAbsolute);
|
|
|
|
|
int length = projectValuationAbsolute.length();
|
|
|
|
|
System.out.println(length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 用户成绩详情展示
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/29
|
|
|
|
|