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