From 7cd85b1af56842dc6220029ea6060e07f93b2922 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Thu, 21 Dec 2023 15:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=20=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=A6=E7=94=9F=E6=8F=90=E9=97=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TopicController.java | 1 - .../controller/tea/ClassScoreController.java | 6 +- .../tea/TeaTopicManageController.java | 31 +++- .../entity/QuestionAnswerExample.java | 47 ++----- .../entity/dto/QuestionAnswerDto.java | 3 + .../fund_investment/mapper/UserMapper.java | 5 +- .../PerformanceScoreServiceImpl.java | 16 ++- .../tea/ClassScoreServiceImpl.java | 133 ++++++++++++------ .../tea/TeaTopicManageServiceImpl.java | 6 +- .../service/tea/TeaTopicManageService.java | 4 +- 10 files changed, 148 insertions(+), 104 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java b/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java index 9afb801..8a9fea3 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/TopicController.java @@ -15,7 +15,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java index 55b0948..1d68cbc 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java @@ -167,9 +167,9 @@ public class ClassScoreController { @AnonymousAccess @GetMapping("/getClassNameBySchoolId") @ApiOperation("成绩管理&互动答疑/班级下拉框") - public ResultEntity> getClassNameBySchoolId(@RequestParam String schoolId) { - List className = userMapper.selectClassNameBySchoolId(schoolId); - return new ResultEntity<>(className); + public ResultEntity>> getClassNameBySchoolId(@RequestParam String schoolId) { + List> nameAndId = userMapper.selectClassNameBySchoolId(schoolId); + return new ResultEntity<>(nameAndId); } diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java index a4a744f..57fb0d0 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java @@ -1,5 +1,6 @@ package com.sztzjy.fund_investment.controller.tea; +import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.annotation.AnonymousAccess; 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.web.bind.annotation.*; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + /** * @Author xcj * @Date 2023/12/1 @@ -48,10 +53,10 @@ public class TeaTopicManageController { @GetMapping("/getTopicsBySchoolId") @ApiOperation("试题管理/页面搜索展示") public ResultEntity> getTopicsBySchoolId(@RequestParam Integer index, - @RequestParam Integer size, - @RequestParam String schoolId, - @ApiParam("module值同导入功能模块") @RequestParam String module, - @ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) { + @RequestParam Integer size, + @RequestParam String schoolId, + @ApiParam("module值同导入功能模块") @RequestParam String module, + @ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) { return new ResultEntity>(teaTopicManageService.getTopicsBySchoolId(index, size, schoolId, module, topicContent)); } @@ -97,16 +102,30 @@ public class TeaTopicManageController { return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入回复内容!"); } questionAnswerWithBLOBs.setReplyContent(content); - questionAnswerMapper.updateByPrimaryKey(questionAnswerWithBLOBs); + questionAnswerMapper.updateByPrimaryKeyWithBLOBs(questionAnswerWithBLOBs); return new ResultEntity(HttpStatus.OK, "回复成功!"); } @AnonymousAccess @GetMapping("/getQuestionById") - @ApiOperation("互动答疑/获取单挑互动数据") + @ApiOperation("互动答疑/获取单条互动数据") public ResultEntity getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) { return new ResultEntity(questionAnswerMapper.selectByPrimaryKey(questionId)); } + @AnonymousAccess + @PostMapping("/addQuestion") + @ApiOperation("互动答疑/学生提问") + public ResultEntity 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,"提问成功!"); + } + } diff --git a/src/main/java/com/sztzjy/fund_investment/entity/QuestionAnswerExample.java b/src/main/java/com/sztzjy/fund_investment/entity/QuestionAnswerExample.java index b916eff..9f55be3 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/QuestionAnswerExample.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/QuestionAnswerExample.java @@ -2,7 +2,6 @@ package com.sztzjy.fund_investment.entity; import java.util.ArrayList; import java.util.Date; -import java.util.Iterator; import java.util.List; public class QuestionAnswerExample { @@ -106,32 +105,6 @@ public class QuestionAnswerExample { 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 values, String property) { - if (values == null || values.size() == 0) { - throw new RuntimeException("Value list for " + property + " cannot be null or empty"); - } - List dateList = new ArrayList<>(); - Iterator 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() { addCriterion("id is null"); return (Criteria) this; @@ -353,52 +326,52 @@ public class QuestionAnswerExample { } public Criteria andQuestionTimeEqualTo(Date value) { - addCriterionForJDBCDate("question_time =", value, "questionTime"); + addCriterion("question_time =", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeNotEqualTo(Date value) { - addCriterionForJDBCDate("question_time <>", value, "questionTime"); + addCriterion("question_time <>", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeGreaterThan(Date value) { - addCriterionForJDBCDate("question_time >", value, "questionTime"); + addCriterion("question_time >", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeGreaterThanOrEqualTo(Date value) { - addCriterionForJDBCDate("question_time >=", value, "questionTime"); + addCriterion("question_time >=", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeLessThan(Date value) { - addCriterionForJDBCDate("question_time <", value, "questionTime"); + addCriterion("question_time <", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeLessThanOrEqualTo(Date value) { - addCriterionForJDBCDate("question_time <=", value, "questionTime"); + addCriterion("question_time <=", value, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeIn(List values) { - addCriterionForJDBCDate("question_time in", values, "questionTime"); + addCriterion("question_time in", values, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeNotIn(List values) { - addCriterionForJDBCDate("question_time not in", values, "questionTime"); + addCriterion("question_time not in", values, "questionTime"); return (Criteria) this; } public Criteria andQuestionTimeBetween(Date value1, Date value2) { - addCriterionForJDBCDate("question_time between", value1, value2, "questionTime"); + addCriterion("question_time between", value1, value2, "questionTime"); return (Criteria) this; } 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; } } diff --git a/src/main/java/com/sztzjy/fund_investment/entity/dto/QuestionAnswerDto.java b/src/main/java/com/sztzjy/fund_investment/entity/dto/QuestionAnswerDto.java index fa5cee9..00b74ce 100644 --- a/src/main/java/com/sztzjy/fund_investment/entity/dto/QuestionAnswerDto.java +++ b/src/main/java/com/sztzjy/fund_investment/entity/dto/QuestionAnswerDto.java @@ -1,7 +1,9 @@ package com.sztzjy.fund_investment.entity.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -20,6 +22,7 @@ public class QuestionAnswerDto { @ApiModelProperty("学校ID") private String schoolid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @ApiModelProperty("提问时间") private Date questionTime; diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java index 8ca1e67..6715793 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java @@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.mapper; import com.sztzjy.fund_investment.entity.User; import com.sztzjy.fund_investment.entity.UserExample; import java.util.List; +import java.util.Map; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -32,6 +33,6 @@ public interface UserMapper { int updateByPrimaryKey(User record); - @Select("select class_name from wx_user where school_id = #{schoolId} group by class_name") - List selectClassNameBySchoolId(@Param("schoolId") String schoolId); + @Select("select distinct(class_id),class_name from wx_user where school_id = #{schoolId}") + List> selectClassNameBySchoolId(@Param("schoolId") String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/PerformanceScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/PerformanceScoreServiceImpl.java index 5ddc592..1c2bca2 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/PerformanceScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/PerformanceScoreServiceImpl.java @@ -28,9 +28,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService { public void calculateScoreByModule(String methodName, Integer score, String flowId) { PerformanceScore performanceScore = getByFlowId(flowId); Object o = performanceScore.get(methodName); - if (o==null){ + if (o == null) { 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); } } @@ -39,13 +43,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService { public void calculateScoreByModule2(String methodName, Integer score, String flowId) { PerformanceScore performanceScore = getByFlowId(flowId); Object o = performanceScore.get(methodName); - if(o==null){ + if (o == null) { performanceScore.set(methodName, BigDecimal.valueOf(score)); performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score))); performanceScoreMapper.updateByPrimaryKey(performanceScore); - }else { - BigDecimal bigDecimal=(BigDecimal) performanceScore.get(methodName); - if(bigDecimal.compareTo(BigDecimal.valueOf(score))<0){ + } else { + BigDecimal bigDecimal = (BigDecimal) performanceScore.get(methodName); + if (bigDecimal.compareTo(BigDecimal.valueOf(score)) < 0) { performanceScore.set(methodName, BigDecimal.valueOf(score)); performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)).subtract(bigDecimal)); performanceScoreMapper.updateByPrimaryKey(performanceScore); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 522968e..3726cbd 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -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,11 +178,12 @@ public class ClassScoreServiceImpl implements ClassScoreService { List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); if (!performanceScores.isEmpty()) { PerformanceScore performanceScore = performanceScores.get(0); - if (!trainingReports.isEmpty()) { - for (TrainingReport trainingReport : trainingReports) { - userDto.setReportId(trainingReport.getId()); - userDto.setReportName(trainingReport.getReportName()); - } + if (trainingReports.isEmpty()) { + continue; + } + for (TrainingReport trainingReport : trainingReports) { + userDto.setReportId(trainingReport.getId()); + userDto.setReportName(trainingReport.getReportName()); } userDto.setFlowId(flowId); userDto.setScore(performanceScore.getTotalScore()); @@ -253,16 +260,45 @@ public class ClassScoreServiceImpl implements ClassScoreService { PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId); List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); + List 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,38 +338,46 @@ 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 trainingReports = trainingReportMapper.selectByExample(trainingReportExample); - if (!trainingReports.isEmpty()) { - 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 (experience.length() < 100) { - performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 1, flowId); //todo 需要修改 - trainingReport.setExperienceScore(BigDecimal.ONE); - } - if (experience.length() >= 100 && experience.length() < 300) { - performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowId);//todo 需要修改 - trainingReport.setExperienceScore(BigDecimal.valueOf(2)); - } - if (experience.length() >= 300) { - performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowId);//todo 需要修改 - trainingReport.setExperienceScore(BigDecimal.valueOf(3)); - } - - //实验报告,未上传 0 分 上传得两分 - if (!(url.isEmpty()) && !(reportName.isEmpty())) { - performanceScoreService.calculateScoreByModule("investmentReportScore", 2, flowId);//todo 需要修改 - trainingReport.setReportScore(BigDecimal.valueOf(2)); - } - trainingReportMapper.updateByPrimaryKey(trainingReport); + if (trainingReports.isEmpty()) { + continue; + } + String experience = ""; + TrainingReport trainingReport = trainingReports.get(0); + 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, flowIdByList); + trainingReport.setExperienceScore(BigDecimal.ONE); + } + if (experience.length() >= 100 && experience.length() < 300) { + performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowIdByList); + trainingReport.setExperienceScore(BigDecimal.valueOf(2)); + } + if (experience.length() >= 300) { + performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowIdByList); + trainingReport.setExperienceScore(BigDecimal.valueOf(3)); + } + + //实验报告,未上传 0 分 上传得两分 + 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); } @@ -439,7 +480,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { } -// 实训成绩 + // 实训成绩 @Override public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) { PerformanceScoreExample example = new PerformanceScoreExample(); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java index 81c99d6..ccae9f1 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/TeaTopicManageServiceImpl.java @@ -1,5 +1,6 @@ package com.sztzjy.fund_investment.service.serviceImpl.tea; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; @@ -83,8 +84,9 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService { */ @Override public PageInfo getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent) { + PageHelper.startPage(index, size); List topics = topicsMapper.getTopicsByCondition(schoolId, module, topicContent); - PageInfo pageInfo = PageUtil.pageHelper(topics, index, size); + PageInfo pageInfo = new PageInfo<>(topics); return pageInfo; } @@ -99,7 +101,7 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService { public PageInfo getQuestionAnswer(Integer index, Integer size, String schoolId, String className, String keyWord) { QuestionAnswerExample questionAnswerExample = new QuestionAnswerExample(); questionAnswerExample.createCriteria().andSchoolidEqualTo(schoolId); - List questionAnswers = questionAnswerMapper.selectByExample(questionAnswerExample); + List questionAnswers = questionAnswerMapper.selectByExampleWithBLOBs(questionAnswerExample); UserExample userTableExample = new UserExample(); UserExample.Criteria criteria = userTableExample.createCriteria(); UserExample.Criteria or = userTableExample.createCriteria(); diff --git a/src/main/java/com/sztzjy/fund_investment/service/tea/TeaTopicManageService.java b/src/main/java/com/sztzjy/fund_investment/service/tea/TeaTopicManageService.java index 9c834d9..94aa25d 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/tea/TeaTopicManageService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/tea/TeaTopicManageService.java @@ -5,6 +5,8 @@ import com.sztzjy.fund_investment.entity.TopicsWithBLOBs; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; import com.sztzjy.fund_investment.util.ResultEntity; +import java.util.List; + /** * @Author xcj * @Date 2023/12/1 @@ -12,7 +14,7 @@ import com.sztzjy.fund_investment.util.ResultEntity; public interface TeaTopicManageService { ResultEntity insertTopics(TopicsWithBLOBs topics); - PageInfo getTopicsBySchoolId(Integer index, Integer size,String schoolId, String module,String topicContent); + PageInfo getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent); PageInfo getQuestionAnswer(Integer index, Integer size,String schoolId, String className, String keyWord);