用户测评更新(开启虚拟仿真实验。教学实验)

hehai
mzh820631607 4 years ago
parent 9cc6d9fa95
commit 2c85fdf738
  1. 27
      src/main/java/com/msdw/tms/controller/EvaluationRecordController.java
  2. 2
      src/main/java/com/msdw/tms/dao/FractionEntityDao.java
  3. 2
      src/main/java/com/msdw/tms/service/FractionEntityService.java
  4. 6
      src/main/java/com/msdw/tms/service/impl/FractionEntityServiceImpl.java
  5. 4
      src/main/resources/mapper/tms/FractionEntityDao.xml

@ -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

@ -11,4 +11,6 @@ public interface FractionEntityDao {
Integer queryExerciseRecord(Integer userId);
Integer queryTeachingRecord(Integer userId);
Integer queryScore( Integer userId);
}

@ -9,4 +9,6 @@ public interface FractionEntityService {
Integer queryExerciseRecord(Integer userId);
Integer queryTeachingRecord(Integer userId);
Integer queryScore(Integer userId);
}

@ -31,4 +31,10 @@ public class FractionEntityServiceImpl implements FractionEntityService {
return score;
}
@Override
public Integer queryScore(Integer userId){
Integer id = fractionMapper.queryScore(userId);
return id;
}
}

@ -13,4 +13,8 @@
<select id="queryTeachingRecord" resultType="int">
SELECT MAX(fraction) FROM tms_evaluation_fraction WHERE userId = #{userId} AND types = 3
</select>
<select id="queryScore" resultType="int">
SELECT count(userId) FROM tms_evaluation_fraction WHERE userId = #{userId}
</select>
</mapper>
Loading…
Cancel
Save