From 2c85fdf7388de7e28c4d675d8e0cff1cc8886a9f Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Mon, 28 Sep 2020 20:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B5=8B=E8=AF=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=88=E5=BC=80=E5=90=AF=E8=99=9A=E6=8B=9F=E4=BB=BF?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E9=AA=8C=E3=80=82=E6=95=99=E5=AD=A6=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EvaluationRecordController.java | 27 ++++++++++++++++--- .../com/msdw/tms/dao/FractionEntityDao.java | 2 ++ .../tms/service/FractionEntityService.java | 2 ++ .../impl/FractionEntityServiceImpl.java | 6 +++++ .../mapper/tms/FractionEntityDao.xml | 4 +++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index 6cf9c29..f6be33a 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -129,15 +129,34 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi @Override @GetMapping("/openExercise") public R isOpenExercise(Integer userId){ - Integer score = fractionEntityService.queryExerciseRecord(userId); - return R.ok(); + Integer id = fractionEntityService.queryScore(userId); + if (id>0){ + Integer score = fractionEntityService.queryExerciseRecord(userId); + if (score>=60){ + return R.ok("true"); + }else{ + return R.error("false"); + } + }else{ + return R.error("false"); + } + } @Override @GetMapping("/openTeaching") public R isOpenTeaching(Integer userId){ - Integer score = fractionEntityService.queryTeachingRecord(userId); - return R.ok(); + Integer id = fractionEntityService.queryScore(userId); + if (id>0){ + Integer score = fractionEntityService.queryTeachingRecord(userId); + if (score>=60){ + return R.ok("true"); + }else{ + return R.error("false"); + } + }else{ + return R.error("false"); + } } //// @Override diff --git a/src/main/java/com/msdw/tms/dao/FractionEntityDao.java b/src/main/java/com/msdw/tms/dao/FractionEntityDao.java index 639ac5d..b9214f2 100644 --- a/src/main/java/com/msdw/tms/dao/FractionEntityDao.java +++ b/src/main/java/com/msdw/tms/dao/FractionEntityDao.java @@ -11,4 +11,6 @@ public interface FractionEntityDao { Integer queryExerciseRecord(Integer userId); Integer queryTeachingRecord(Integer userId); + + Integer queryScore( Integer userId); } diff --git a/src/main/java/com/msdw/tms/service/FractionEntityService.java b/src/main/java/com/msdw/tms/service/FractionEntityService.java index cb735a4..4f18840 100644 --- a/src/main/java/com/msdw/tms/service/FractionEntityService.java +++ b/src/main/java/com/msdw/tms/service/FractionEntityService.java @@ -9,4 +9,6 @@ public interface FractionEntityService { Integer queryExerciseRecord(Integer userId); Integer queryTeachingRecord(Integer userId); + + Integer queryScore(Integer userId); } diff --git a/src/main/java/com/msdw/tms/service/impl/FractionEntityServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/FractionEntityServiceImpl.java index 077d0e1..699e3b5 100644 --- a/src/main/java/com/msdw/tms/service/impl/FractionEntityServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/FractionEntityServiceImpl.java @@ -31,4 +31,10 @@ public class FractionEntityServiceImpl implements FractionEntityService { return score; } + + @Override + public Integer queryScore(Integer userId){ + Integer id = fractionMapper.queryScore(userId); + return id; + } } diff --git a/src/main/resources/mapper/tms/FractionEntityDao.xml b/src/main/resources/mapper/tms/FractionEntityDao.xml index 7149a44..73ecdd4 100644 --- a/src/main/resources/mapper/tms/FractionEntityDao.xml +++ b/src/main/resources/mapper/tms/FractionEntityDao.xml @@ -13,4 +13,8 @@ + + \ No newline at end of file