Browse Source

小程序:理论考试

dev
wangzijian 1 year ago
parent
commit
34be8f12dd

+ 3
- 3
src/main/java/com/cirle/scientific/controller/miniapp/CourseStudyController.java View File

@@ -323,7 +323,7 @@ public class CourseStudyController {
323 323
         if (CollectionUtil.isNotEmpty(courseList)) {
324 324
             int finishSize = 0;
325 325
             List<Long> ids = courseList.stream().map(CourseAppListDTO::getId).collect(Collectors.toList());
326
-            List<QkjStudyRecordApp> recordApps = qkjStudyRecordAppDao.findByObjIdsAndType(ids, 2);
326
+            List<QkjStudyRecordApp> recordApps = qkjStudyRecordAppDao.findByMemCardAndObjIdsAndType(memCard, ids, 2);
327 327
             if (CollectionUtil.isNotEmpty(recordApps)) {
328 328
                 for (QkjStudyRecordApp qkjStudyRecordApp : recordApps) {
329 329
                     if (Objects.equals(qkjStudyRecordApp.getStudyAccomplish(), 1)) {
@@ -332,7 +332,7 @@ public class CourseStudyController {
332 332
                 }
333 333
             }
334 334
             log.info("joinTheoryExamination courseList:{} finishSize:{}", courseList.size(), finishSize);
335
-            finishCourse = courseList.size() == finishSize;
335
+            finishCourse = finishSize == courseList.size();
336 336
         }
337 337
         QkjExamineRecordApp recordApp = qkjExamineRecordAppDao.getByMemCard(memCard, 2);
338 338
         JoinExaminationDTO build = JoinExaminationDTO.builder()
@@ -355,7 +355,7 @@ public class CourseStudyController {
355 355
         if (CollectionUtil.isNotEmpty(courseList)) {
356 356
             int finishSize = 0;
357 357
             List<Long> ids = courseList.stream().map(CourseAppListDTO::getId).collect(Collectors.toList());
358
-            List<QkjStudyRecordApp> recordApps = qkjStudyRecordAppDao.findByObjIdsAndType(ids, 2);
358
+            List<QkjStudyRecordApp> recordApps = qkjStudyRecordAppDao.findByMemCardAndObjIdsAndType(memCard, ids, 2);
359 359
             if (CollectionUtil.isNotEmpty(recordApps)) {
360 360
                 for (QkjStudyRecordApp qkjStudyRecordApp : recordApps) {
361 361
                     if (Objects.equals(qkjStudyRecordApp.getStudyAccomplish(), 1)) {

+ 2
- 2
src/main/java/com/cirle/scientific/dao/QkjStudyRecordAppDao.java View File

@@ -23,8 +23,8 @@ public interface QkjStudyRecordAppDao extends PagingAndSortingRepository<QkjStud
23 23
     @Query(value = "SELECT * FROM qkj_study_record_app WHERE mem_card = ?1 and obj_type = ?2 and obj_id = ?3", nativeQuery = true)
24 24
     QkjStudyRecordApp findByMemCardAndTypeAndObjId(String memCard, Integer objType, Long objId);
25 25
 
26
-    @Query(value = "SELECT * FROM qkj_study_record_app WHERE obj_id in ?1 and obj_type = ?2", nativeQuery = true)
27
-    List<QkjStudyRecordApp> findByObjIdsAndType(List<Long> ids, Integer objType);
26
+    @Query(value = "SELECT * FROM qkj_study_record_app WHERE mem_card = ?1 and  obj_id in ?2 and obj_type = ?3", nativeQuery = true)
27
+    List<QkjStudyRecordApp> findByMemCardAndObjIdsAndType(String memCard , List<Long> ids, Integer objType);
28 28
 
29 29
 
30 30
 }

Loading…
Cancel
Save