修改bug ,新增学生提问接口

master
xiaoCJ 1 year ago
parent 975f204150
commit 7cd85b1af5

@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;

@ -167,9 +167,9 @@ public class ClassScoreController {
@AnonymousAccess @AnonymousAccess
@GetMapping("/getClassNameBySchoolId") @GetMapping("/getClassNameBySchoolId")
@ApiOperation("成绩管理&互动答疑/班级下拉框") @ApiOperation("成绩管理&互动答疑/班级下拉框")
public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) { public ResultEntity<List<Map<String,String>>> getClassNameBySchoolId(@RequestParam String schoolId) {
List<String> className = userMapper.selectClassNameBySchoolId(schoolId); List<Map<String,String>> nameAndId = userMapper.selectClassNameBySchoolId(schoolId);
return new ResultEntity<>(className); return new ResultEntity<>(nameAndId);
} }

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.controller.tea; package com.sztzjy.fund_investment.controller.tea;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.annotation.AnonymousAccess; import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs; import com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs;
@ -17,6 +18,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/** /**
* @Author xcj * @Author xcj
* @Date 2023/12/1 * @Date 2023/12/1
@ -48,10 +53,10 @@ public class TeaTopicManageController {
@GetMapping("/getTopicsBySchoolId") @GetMapping("/getTopicsBySchoolId")
@ApiOperation("试题管理/页面搜索展示") @ApiOperation("试题管理/页面搜索展示")
public ResultEntity<PageInfo<TopicsWithBLOBs>> getTopicsBySchoolId(@RequestParam Integer index, public ResultEntity<PageInfo<TopicsWithBLOBs>> getTopicsBySchoolId(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam String schoolId, @RequestParam String schoolId,
@ApiParam("module值同导入功能模块") @RequestParam String module, @ApiParam("module值同导入功能模块") @RequestParam String module,
@ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) { @ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) {
return new ResultEntity<PageInfo<TopicsWithBLOBs>>(teaTopicManageService.getTopicsBySchoolId(index, size, schoolId, module, topicContent)); return new ResultEntity<PageInfo<TopicsWithBLOBs>>(teaTopicManageService.getTopicsBySchoolId(index, size, schoolId, module, topicContent));
} }
@ -97,16 +102,30 @@ public class TeaTopicManageController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入回复内容!"); return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入回复内容!");
} }
questionAnswerWithBLOBs.setReplyContent(content); questionAnswerWithBLOBs.setReplyContent(content);
questionAnswerMapper.updateByPrimaryKey(questionAnswerWithBLOBs); questionAnswerMapper.updateByPrimaryKeyWithBLOBs(questionAnswerWithBLOBs);
return new ResultEntity(HttpStatus.OK, "回复成功!"); return new ResultEntity(HttpStatus.OK, "回复成功!");
} }
@AnonymousAccess @AnonymousAccess
@GetMapping("/getQuestionById") @GetMapping("/getQuestionById")
@ApiOperation("互动答疑/获取单互动数据") @ApiOperation("互动答疑/获取单互动数据")
public ResultEntity<QuestionAnswerWithBLOBs> getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) { public ResultEntity<QuestionAnswerWithBLOBs> getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) {
return new ResultEntity<QuestionAnswerWithBLOBs>(questionAnswerMapper.selectByPrimaryKey(questionId)); return new ResultEntity<QuestionAnswerWithBLOBs>(questionAnswerMapper.selectByPrimaryKey(questionId));
} }
@AnonymousAccess
@PostMapping("/addQuestion")
@ApiOperation("互动答疑/学生提问")
public ResultEntity<String> getQuestionById(@ApiParam("传flowId,提问内容,学校ID") @RequestBody QuestionAnswerWithBLOBs questionAnswerWithBLOBs) {
questionAnswerWithBLOBs.setId(IdUtil.simpleUUID());
questionAnswerWithBLOBs.setQuestionTime(new Date());
try {
questionAnswerMapper.insert(questionAnswerWithBLOBs);
}catch (Exception e){
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"提问失败,数据缺失!");
}
return new ResultEntity<>(HttpStatus.OK,"提问成功!");
}
} }

@ -2,7 +2,6 @@ package com.sztzjy.fund_investment.entity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator;
import java.util.List; import java.util.List;
public class QuestionAnswerExample { public class QuestionAnswerExample {
@ -106,32 +105,6 @@ public class QuestionAnswerExample {
criteria.add(new Criterion(condition, value1, value2)); criteria.add(new Criterion(condition, value1, value2));
} }
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() { public Criteria andIdIsNull() {
addCriterion("id is null"); addCriterion("id is null");
return (Criteria) this; return (Criteria) this;
@ -353,52 +326,52 @@ public class QuestionAnswerExample {
} }
public Criteria andQuestionTimeEqualTo(Date value) { public Criteria andQuestionTimeEqualTo(Date value) {
addCriterionForJDBCDate("question_time =", value, "questionTime"); addCriterion("question_time =", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeNotEqualTo(Date value) { public Criteria andQuestionTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("question_time <>", value, "questionTime"); addCriterion("question_time <>", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeGreaterThan(Date value) { public Criteria andQuestionTimeGreaterThan(Date value) {
addCriterionForJDBCDate("question_time >", value, "questionTime"); addCriterion("question_time >", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeGreaterThanOrEqualTo(Date value) { public Criteria andQuestionTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("question_time >=", value, "questionTime"); addCriterion("question_time >=", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeLessThan(Date value) { public Criteria andQuestionTimeLessThan(Date value) {
addCriterionForJDBCDate("question_time <", value, "questionTime"); addCriterion("question_time <", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeLessThanOrEqualTo(Date value) { public Criteria andQuestionTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("question_time <=", value, "questionTime"); addCriterion("question_time <=", value, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeIn(List<Date> values) { public Criteria andQuestionTimeIn(List<Date> values) {
addCriterionForJDBCDate("question_time in", values, "questionTime"); addCriterion("question_time in", values, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeNotIn(List<Date> values) { public Criteria andQuestionTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("question_time not in", values, "questionTime"); addCriterion("question_time not in", values, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeBetween(Date value1, Date value2) { public Criteria andQuestionTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("question_time between", value1, value2, "questionTime"); addCriterion("question_time between", value1, value2, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andQuestionTimeNotBetween(Date value1, Date value2) { public Criteria andQuestionTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("question_time not between", value1, value2, "questionTime"); addCriterion("question_time not between", value1, value2, "questionTime");
return (Criteria) this; return (Criteria) this;
} }
} }

@ -1,7 +1,9 @@
package com.sztzjy.fund_investment.entity.dto; package com.sztzjy.fund_investment.entity.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@ -20,6 +22,7 @@ public class QuestionAnswerDto {
@ApiModelProperty("学校ID") @ApiModelProperty("学校ID")
private String schoolid; private String schoolid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty("提问时间") @ApiModelProperty("提问时间")
private Date questionTime; private Date questionTime;

@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.User; import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.UserExample; import com.sztzjy.fund_investment.entity.UserExample;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -32,6 +33,6 @@ public interface UserMapper {
int updateByPrimaryKey(User record); int updateByPrimaryKey(User record);
@Select("select class_name from wx_user where school_id = #{schoolId} group by class_name") @Select("select distinct(class_id),class_name from wx_user where school_id = #{schoolId}")
List<String> selectClassNameBySchoolId(@Param("schoolId") String schoolId); List<Map<String,String>> selectClassNameBySchoolId(@Param("schoolId") String schoolId);
} }

@ -28,9 +28,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
public void calculateScoreByModule(String methodName, Integer score, String flowId) { public void calculateScoreByModule(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId); PerformanceScore performanceScore = getByFlowId(flowId);
Object o = performanceScore.get(methodName); Object o = performanceScore.get(methodName);
if (o==null){ if (o == null) {
performanceScore.set(methodName, BigDecimal.valueOf(score)); performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score))); if (performanceScore.getTotalScore()== null) {
performanceScore.setTotalScore(BigDecimal.valueOf(score));
} else {
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
}
performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreMapper.updateByPrimaryKey(performanceScore);
} }
} }
@ -39,13 +43,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
public void calculateScoreByModule2(String methodName, Integer score, String flowId) { public void calculateScoreByModule2(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId); PerformanceScore performanceScore = getByFlowId(flowId);
Object o = performanceScore.get(methodName); Object o = performanceScore.get(methodName);
if(o==null){ if (o == null) {
performanceScore.set(methodName, BigDecimal.valueOf(score)); performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score))); performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreMapper.updateByPrimaryKey(performanceScore);
}else { } else {
BigDecimal bigDecimal=(BigDecimal) performanceScore.get(methodName); BigDecimal bigDecimal = (BigDecimal) performanceScore.get(methodName);
if(bigDecimal.compareTo(BigDecimal.valueOf(score))<0){ if (bigDecimal.compareTo(BigDecimal.valueOf(score)) < 0) {
performanceScore.set(methodName, BigDecimal.valueOf(score)); performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)).subtract(bigDecimal)); performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)).subtract(bigDecimal));
performanceScoreMapper.updateByPrimaryKey(performanceScore); performanceScoreMapper.updateByPrimaryKey(performanceScore);

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

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.service.serviceImpl.tea; package com.sztzjy.fund_investment.service.serviceImpl.tea;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
@ -83,8 +84,9 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
*/ */
@Override @Override
public PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent) { public PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent) {
PageHelper.startPage(index, size);
List<TopicsWithBLOBs> topics = topicsMapper.getTopicsByCondition(schoolId, module, topicContent); List<TopicsWithBLOBs> topics = topicsMapper.getTopicsByCondition(schoolId, module, topicContent);
PageInfo pageInfo = PageUtil.pageHelper(topics, index, size); PageInfo<TopicsWithBLOBs> pageInfo = new PageInfo<>(topics);
return pageInfo; return pageInfo;
} }
@ -99,7 +101,7 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
public PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size, String schoolId, String className, String keyWord) { public PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size, String schoolId, String className, String keyWord) {
QuestionAnswerExample questionAnswerExample = new QuestionAnswerExample(); QuestionAnswerExample questionAnswerExample = new QuestionAnswerExample();
questionAnswerExample.createCriteria().andSchoolidEqualTo(schoolId); questionAnswerExample.createCriteria().andSchoolidEqualTo(schoolId);
List<QuestionAnswer> questionAnswers = questionAnswerMapper.selectByExample(questionAnswerExample); List<QuestionAnswerWithBLOBs> questionAnswers = questionAnswerMapper.selectByExampleWithBLOBs(questionAnswerExample);
UserExample userTableExample = new UserExample(); UserExample userTableExample = new UserExample();
UserExample.Criteria criteria = userTableExample.createCriteria(); UserExample.Criteria criteria = userTableExample.createCriteria();
UserExample.Criteria or = userTableExample.createCriteria(); UserExample.Criteria or = userTableExample.createCriteria();

@ -5,6 +5,8 @@ import com.sztzjy.fund_investment.entity.TopicsWithBLOBs;
import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
import com.sztzjy.fund_investment.util.ResultEntity; import com.sztzjy.fund_investment.util.ResultEntity;
import java.util.List;
/** /**
* @Author xcj * @Author xcj
* @Date 2023/12/1 * @Date 2023/12/1
@ -12,7 +14,7 @@ import com.sztzjy.fund_investment.util.ResultEntity;
public interface TeaTopicManageService { public interface TeaTopicManageService {
ResultEntity<String> insertTopics(TopicsWithBLOBs topics); ResultEntity<String> insertTopics(TopicsWithBLOBs topics);
PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size,String schoolId, String module,String topicContent); PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent);
PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size,String schoolId, String className, String keyWord); PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size,String schoolId, String className, String keyWord);

Loading…
Cancel
Save