From 48b2309ee87ea98091989c15d14853d276bcebf6 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 5 Dec 2023 17:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E6=9C=BA=E8=A1=A8=EF=BC=8C=E5=AE=8C=E6=88=90=E6=8A=95=E8=B5=84?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InvestmentReportController.java | 8 ++++---- .../controller/tea/ClassScoreController.java | 4 ++-- .../serviceImpl/InvestmentReportServiceImpl.java | 8 ++++---- .../serviceImpl/tea/ClassScoreServiceImpl.java | 12 +++++++++--- .../service/tea/ClassScoreService.java | 2 +- src/main/resources/application-dev.yml | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) 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