diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index 6970b6e..c38c7ab 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -71,7 +71,7 @@ public class ClassTeachingController implements ClassTeachingApi { */ @Override @GetMapping("/checkInvitationCode") - public R check(@RequestParam Integer userId,@RequestParam Integer projectId){ + public R check(@RequestParam Integer userId,@RequestParam("id") Integer projectId){ List o = experimentalStudentService.queryIsCode(userId,projectId); if (o.size()>0){ return R.ok(); @@ -91,6 +91,7 @@ public class ClassTeachingController implements ClassTeachingApi { public R joinPractice(@RequestBody ExperimentalTeachingEntity entity1){ //获取参数 Integer projectId = entity1.getProjectId(); + Integer id = entity1.getId(); Integer invitationCode = entity1.getInvitationCode(); Integer userId = entity1.getUserId(); //用于接受参数 @@ -100,11 +101,12 @@ public class ClassTeachingController implements ClassTeachingApi { //if (isCode==0) if (invitationCode!=null){ - entity.setProjectId(projectId); + entity.setId(id); +// entity.setProjectId(projectId); ExperimentalTeachingEntity result= classTeachingService.queryInvitationcode(entity);//邀请码唯一 Integer code = result.getInvitationCode(); if (invitationCode.equals(code)==true){ - ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(projectId); + ExperimentalStudentEntity student = studentEntity.setUserId(userId).setProjectId(id); experimentalStudentService.saveCode(student); return R.ok(); }else{ diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java index c0283c5..6c697e5 100644 --- a/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java @@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -318,6 +319,7 @@ public class EvaluationRecordServiceImpl extends ServiceImpl - SELECT userId FROM tms_experimental_student WHERE userId = #{userId} AND projectId = #{projectId} + SELECT userId FROM tms_experimental_student WHERE userId = #{userId} AND id = #{projectId} - INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{projectId},#{userId}) + INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{id},#{userId}) \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index 2f8a991..7a7f05a 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -49,8 +49,8 @@ schoolId = #{schoolId}, - phone #{phone} - > + phone = #{phone} + WHERE userId = #{userId};