From 3dfef503c7f5151859839c3199e7f4b63ff50c0c Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期二, 24 十二月 2024 13:05:11 +0800 Subject: [PATCH] 修改 --- ruoyi-system/src/main/resources/mapper/system/SysUserInstitutionMapper.xml | 2 +- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 2 +- exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java | 30 +++++++++++++++--------------- exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml | 2 +- exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java | 1 + ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserInstitutionMapper.java | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java index 2cd842a..a7b3560 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java @@ -79,6 +79,7 @@ List<String> idcards = thStudyDetailVOS.stream().map(ThStudyDetailVO::getIdcard).collect(Collectors.toList()); List<ThStudent> studentList = studentService.getNameByIdcards(idcards); for(ThStudyDetailVO thStudyDetailVO : thStudyDetailVOS){ + //计算自然时间差 Duration between = Duration.between(thStudyDetailVO.getStartTime(), thStudyDetailVO.getFinishTime()); thStudyDetailVO.setDifference(between.getSeconds()); thStudyDetailVO.setDifferenceDesc(ConvertTimeUtils.convertTimeToString(thStudyDetailVO.getDifference())); diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java index 4778334..fef48da 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java @@ -437,22 +437,22 @@ } //数据插入 //课程插入 - List<List<ThCourse>> splitSaveCourseList = ListUtil.split(saveCourseList, 500); + List<List<ThCourse>> splitSaveCourseList = ListUtil.split(saveCourseList, 200); for(List<ThCourse> courseList : splitSaveCourseList){ courseService.insertBatch(courseList); } //修改课程 - List<List<ThCourse>> splitUpdateCourseList = ListUtil.split(updateCourseList, 500); + List<List<ThCourse>> splitUpdateCourseList = ListUtil.split(updateCourseList, 200); for(List<ThCourse> courseList : splitUpdateCourseList){ courseService.updateBatch(courseList); } //插入章节 - List<List<ThCourseChapter>> splitSaveChapterList = ListUtil.split(saveCourseChapterList, 500); + List<List<ThCourseChapter>> splitSaveChapterList = ListUtil.split(saveCourseChapterList, 200); for(List<ThCourseChapter> chapterList : splitSaveChapterList){ courseChapterService.insertBatch(chapterList); } //修改章节 - List<List<ThCourseChapter>> splitUpdateChapterList = ListUtil.split(updateCourseChapterList, 500); + List<List<ThCourseChapter>> splitUpdateChapterList = ListUtil.split(updateCourseChapterList, 200); for(List<ThCourseChapter> chapterList : splitUpdateChapterList){ courseChapterService.updateBatch(chapterList); } @@ -618,23 +618,23 @@ } } //学生表新增 - List<List<ThStudent>> splitSaveStudentList = ListUtil.split(saveSudentList, 500); + List<List<ThStudent>> splitSaveStudentList = ListUtil.split(saveSudentList, 200); for (List<ThStudent> studentList : splitSaveStudentList) { studentService.insertBatch(studentList); } //学生表更新 - List<List<ThStudent>> splitUpdateStudentList = ListUtil.split(updateStudentList, 500); + List<List<ThStudent>> splitUpdateStudentList = ListUtil.split(updateStudentList, 200); for (List<ThStudent> studentList : splitUpdateStudentList) { studentService.updateBatch(studentList); } //学生关联班级表 - List<List<ThStudentBatch>> splitSaveThStudentBatchList = ListUtil.split(saveThStudentBatchList, 500); + List<List<ThStudentBatch>> splitSaveThStudentBatchList = ListUtil.split(saveThStudentBatchList, 200); for (List<ThStudentBatch> studentBatcheList : splitSaveThStudentBatchList) { studentBatchService.insertBatch(studentBatcheList); } //学生关联班级表修改 - List<List<ThStudentBatch>> splitUpdateThStudentBatchList = ListUtil.split(updateThStudentBatchList, 500); + List<List<ThStudentBatch>> splitUpdateThStudentBatchList = ListUtil.split(updateThStudentBatchList, 200); for (List<ThStudentBatch> studentBatcheList : splitUpdateThStudentBatchList) { studentBatchService.updateBatch(studentBatcheList); } @@ -1241,12 +1241,12 @@ } //插入章节 - List<List<ThBatchCourseChapter>> splitSaveBatchCourseChapterList = ListUtil.split(saveBatchCourseChapterList, 500); + List<List<ThBatchCourseChapter>> splitSaveBatchCourseChapterList = ListUtil.split(saveBatchCourseChapterList, 200); for (List<ThBatchCourseChapter> chapterList : splitSaveBatchCourseChapterList) { batchCourseChapterService.insertBatch(chapterList); } //修改章节 - List<List<ThBatchCourseChapter>> splitUpdateBatchCourseChapterList = ListUtil.split(updateBatchCourseChapterList, 500); + List<List<ThBatchCourseChapter>> splitUpdateBatchCourseChapterList = ListUtil.split(updateBatchCourseChapterList, 200); for (List<ThBatchCourseChapter> chapterList : splitUpdateBatchCourseChapterList) { batchCourseChapterService.updateBatch(chapterList); } @@ -1531,27 +1531,27 @@ } } //插入学习记录 - List<List<ThStudyDetail>> splitSaveDetailList = ListUtil.split(saveStudyDetailList, 500); + List<List<ThStudyDetail>> splitSaveDetailList = ListUtil.split(saveStudyDetailList, 200); for (List<ThStudyDetail> thStudyDetails : splitSaveDetailList) { studyDetailService.insertBatch(thStudyDetails); } //修改学习记录 - List<List<ThStudyDetail>> splitUpdateDetailList = ListUtil.split(updateStudyDetailList, 500); + List<List<ThStudyDetail>> splitUpdateDetailList = ListUtil.split(updateStudyDetailList, 200); for (List<ThStudyDetail> thStudyDetails : splitUpdateDetailList) { studyDetailService.updateBatch(thStudyDetails); } //插入认证记录 - List<List<ThStudyAuth>> splitSaveAuthList = ListUtil.split(saveStudyAuthList, 500); + List<List<ThStudyAuth>> splitSaveAuthList = ListUtil.split(saveStudyAuthList, 200); for (List<ThStudyAuth> thStudyAuths : splitSaveAuthList) { studyAuthService.insetBatch(thStudyAuths); } //插入学习轨迹 - List<List<ThStudyTrack>> splitSaveTrackList = ListUtil.split(saveStudyTrackList, 500); + List<List<ThStudyTrack>> splitSaveTrackList = ListUtil.split(saveStudyTrackList, 200); for (List<ThStudyTrack> thStudyTracks : splitSaveTrackList) { studyTrackService.insertBatch(thStudyTracks); } //修改学生完成状态 - List<List<ThStudentBatch>> splitUpdateThStudentBatchList = ListUtil.split(updateStudentBatchList, 500); + List<List<ThStudentBatch>> splitUpdateThStudentBatchList = ListUtil.split(updateStudentBatchList, 200); for (List<ThStudentBatch> studentBatcheList : splitUpdateThStudentBatchList) { studentBatchService.updateBatch(studentBatcheList); } diff --git a/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml b/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml index 742be6c..c373aa4 100644 --- a/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml +++ b/exam-system/src/main/resources/mapper/institutionaccess/ThExamRecordMapper.xml @@ -49,7 +49,7 @@ <select id="getStatistic" resultType="com.gkhy.exam.institutionalaccess.model.vo.ThTrainVO"> SELECT e.institution_id, - count( e.institution_id ) passCount + count(DISTINCT e.idcard) passCount FROM th_exam_record e LEFT JOIN th_batch b ON e.batch_uuid = b.uuid diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserInstitutionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserInstitutionMapper.java index acd5199..fdd4943 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserInstitutionMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserInstitutionMapper.java @@ -22,7 +22,7 @@ * @param userIds 需要删除的数据ID * @return 结果 */ - public int deleteUserInstitution(Long[] userIds); + public int deleteUserInstitutions(Long[] userIds); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 7351376..c2dedfa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -498,7 +498,7 @@ // 删除用户与岗位关联 //userPostMapper.deleteUserPost(userIds); //删除机构 - institutionMapper.deleteUserInstitution(userIds); + institutionMapper.deleteUserInstitutions(userIds); return userMapper.deleteUserByIds(userIds); } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserInstitutionMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserInstitutionMapper.xml index f63b685..af30ec7 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserInstitutionMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserInstitutionMapper.xml @@ -13,7 +13,7 @@ delete from sys_user_institution where user_id=#{userId} </delete> - <delete id="deleteUserInstitution" parameterType="Long"> + <delete id="deleteUserInstitutions" parameterType="Long"> delete from sys_user_institution where user_id in <foreach collection="array" item="userId" open="(" separator="," close=")"> #{userId} -- Gitblit v1.9.2