From 287e31c2330e1155c45b97ced18d718bf881c6ab Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 26 Nov 2024 15:31:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=9F=E6=88=90=E8=A7=84?= =?UTF-8?q?=E5=88=92=E6=8A=A5=E5=91=8A=E6=97=B6=E9=97=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CaseController.java | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/sztzjy/money_management/controller/CaseController.java b/src/main/java/com/sztzjy/money_management/controller/CaseController.java index 3a35cf8..701d415 100644 --- a/src/main/java/com/sztzjy/money_management/controller/CaseController.java +++ b/src/main/java/com/sztzjy/money_management/controller/CaseController.java @@ -19,6 +19,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; +import java.util.Date; import java.util.List; import java.util.Map; @@ -325,9 +326,9 @@ public class CaseController { public void countLearnTime(@RequestParam String trainingId, @ApiParam("时间,单位分钟") BigDecimal minuter) { StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(trainingId); - if (stuTrainingWithBLOBs.getTrainingTime()==null){ + if (stuTrainingWithBLOBs.getTrainingTime() == null) { stuTrainingWithBLOBs.setTrainingTime(minuter); - }else { + } else { stuTrainingWithBLOBs.setTrainingTime(stuTrainingWithBLOBs.getTrainingTime().add(minuter)); } stuTrainingMapper.updateByPrimaryKeyWithBLOBs(stuTrainingWithBLOBs); @@ -337,18 +338,34 @@ public class CaseController { @ApiOperation("统计综合规划编辑建议书时间") @AnonymousAccess public void countCaseTime(@RequestParam String stuClientId, - @ApiParam("时间,单位分钟") BigDecimal minuter) { + @ApiParam("时间,单位分钟") BigDecimal minuter) { SynthesisPlanClient synthesisPlanClient = synthesisPlanClientMapper.selectByPrimaryKey(stuClientId); - if (synthesisPlanClient.getSubmitStatus().equals("已审核")||synthesisPlanClient.getSubmitStatus().equals("未审核")){ + if (synthesisPlanClient.getSubmitStatus().equals("已审核") || synthesisPlanClient.getSubmitStatus().equals("未审核")) { return; - }else { - if (synthesisPlanClient.getUseTime()==null){ + } else { + if (synthesisPlanClient.getUseTime() == null) { synthesisPlanClient.setUseTime(minuter); - }else { + } else { synthesisPlanClient.setUseTime(synthesisPlanClient.getUseTime().add(minuter)); } } synthesisPlanClientMapper.updateByPrimaryKey(synthesisPlanClient); } + + @PostMapping("getPlanReportTime") + @ApiOperation("生成规划报告时间") + @AnonymousAccess + public void countCaseTime(@RequestParam String caseId, + @RequestParam String userId) { + SynthesisPlanClientExample example =new SynthesisPlanClientExample(); + example.createCriteria().andCaseidEqualTo(caseId).andUseridEqualTo(userId); + List synthesisPlanClients = synthesisPlanClientMapper.selectByExample(example); + if (!synthesisPlanClients.isEmpty()) { + SynthesisPlanClient synthesisPlanClient = synthesisPlanClients.get(0); + synthesisPlanClient.setCreateTime(new Date()); + synthesisPlanClientMapper.updateByPrimaryKey(synthesisPlanClient); + } + } } +