diff --git a/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java index 179d5cc..b608f08 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/InvestmentReportController.java @@ -50,7 +50,7 @@ public class InvestmentReportController { // 基金收益/投资金额=投资收益率 BigDecimal bigDecimal = fundEarnings.divide(investmentAmount,6,RoundingMode.HALF_UP); - map.put(profitManagement.getMarketTime(), bigDecimal); + map.put(profitManagement.getMarketTime(), bigDecimal);// todo 时间格式是年月日 } } return new ResultEntity>(map); @@ -68,14 +68,14 @@ public class InvestmentReportController { @AnonymousAccess @PostMapping("commitExperience") @ApiOperation("提交心得") - public ResultEntity commitExperience(@ApiParam("传三个ID、experience、uploadTime") @RequestBody TrainingReport trainingReport) { + public ResultEntity commitExperience(@ApiParam("传三个ID、experience") @RequestBody TrainingReport trainingReport) { return investmentReportService.commitExperience(trainingReport); } @AnonymousAccess - @PostMapping("getExperience") + @GetMapping("getExperience") @ApiOperation("心得回显") - public ResultEntity getExperience(@RequestBody String flowId) { + public ResultEntity getExperience(@RequestParam String flowId) { List trainingReports = investmentReportService.getTrainingReports(flowId); if (trainingReports.isEmpty()) { return null; 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 d5c8569..834c5d1 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 @@ -100,8 +100,8 @@ public class ClassScoreController { @AnonymousAccess @GetMapping("/getStuTrainingScore") @ApiOperation("成绩详情&投资报告/实训成绩展示") - public ResultEntity getStuTrainingScore(@ApiParam("页面返回的得分ID") @RequestParam String performanceScoreId) { - return new ResultEntity<>(classScoreService.getStuTrainingScore(performanceScoreId)); + public ResultEntity getStuTrainingScore(@RequestParam String flowId) { + return new ResultEntity<>(classScoreService.getStuTrainingScore(flowId)); } @AnonymousAccess diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java index ec95c81..c600ab3 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InvestmentReportServiceImpl.java @@ -1,5 +1,6 @@ package com.sztzjy.fund_investment.service.serviceImpl; +import com.sztzjy.fund_investment.config.Constant; import com.sztzjy.fund_investment.entity.TrainingReport; import com.sztzjy.fund_investment.entity.TrainingReportExample; import com.sztzjy.fund_investment.mapper.TrainingReportMapper; @@ -7,7 +8,6 @@ import com.sztzjy.fund_investment.service.InvestmentReportService; import com.sztzjy.fund_investment.util.ResultEntity; import com.sztzjy.fund_investment.util.file.IFileUtil; import org.apache.commons.lang3.StringUtils; -import org.apache.xmlbeans.impl.xb.xsdschema.Public; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -52,7 +52,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { trainingReport.setUrl(filePath); trainingReport.setReportName(fileName); trainingReport.setUploadtime(new Date()); - trainingReport.setStep("投资报告"); + trainingReport.setStep(Constant.TZBG); trainingReportMapper.updateByPrimaryKey(trainingReport); return new ResultEntity<>(HttpStatus.OK, "报告上传成功!"); } @@ -64,7 +64,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { trainingReport.setUrl(filePath); trainingReport.setReportName(fileName); trainingReport.setUploadtime(new Date()); - trainingReport.setStep("投资报告"); + trainingReport.setStep(Constant.TZBG); trainingReportMapper.insert(trainingReport); return new ResultEntity<>(HttpStatus.OK, "报告上传成功!"); } @@ -75,7 +75,7 @@ public class InvestmentReportServiceImpl implements InvestmentReportService { public List getTrainingReports(String flowId) { TrainingReportExample trainingReportExample = new TrainingReportExample(); trainingReportExample.createCriteria().andFlowIdEqualTo(flowId); - return trainingReportMapper.selectByExample(trainingReportExample); + return trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample); } 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 133c702..f5004f8 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 @@ -144,7 +144,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid()); String flowId = flow.getFlowId(); TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andFlowIdEqualTo(flowId); //todo 查询时看需不需要加上模块 + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); List trainingReports = reportMapper.selectByExample(trainingReportExample); PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId); @@ -423,8 +423,14 @@ public class ClassScoreServiceImpl implements ClassScoreService { * @Date 2023/11/29 */ @Override - public PerformanceTrainingScoreDto getStuTrainingScore(String performanceScoreId) { - PerformanceScore performanceScore = performanceScoreMapper.selectByPrimaryKey(performanceScoreId); + public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) { + PerformanceScoreExample example =new PerformanceScoreExample(); + example.createCriteria().andFlowIdEqualTo(flowId); + List performanceScores = performanceScoreMapper.selectByExample(example); + if (performanceScores.isEmpty()){ + return null; + } + PerformanceScore performanceScore = performanceScores.get(0); PerformanceTrainingScoreDto performanceTrainingScoreDto = new PerformanceTrainingScoreDto(); performanceTrainingScoreDto.setFlowId(performanceScore.getFlowId()); performanceTrainingScoreDto.setPracticalCognitionScore(performanceScore.getPracticalCognitionScore()); diff --git a/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java b/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java index 02514e2..4f0ac8d 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java @@ -29,7 +29,7 @@ public interface ClassScoreService { PerformanceScoreDto getPerformanceScoreDto(String flowId); - PerformanceTrainingScoreDto getStuTrainingScore(String performanceScoreId); + PerformanceTrainingScoreDto getStuTrainingScore(String flowId); FoundProjectDto getReportStringByFlowId(String flowId); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 26d8fdf..f5c8bf5 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -11,7 +11,7 @@ spring: # 文件存储 file: type: local - path: C:/Users/86132/Desktop/fsdownload + path: D:/home timer: enable: false \ No newline at end of file