From 790c2ba4a0b46edf191e3bac84931f796bd42b8f Mon Sep 17 00:00:00 2001 From: zhangf <1603559716@qq.com> Date: 星期三, 24 七月 2024 09:02:49 +0800 Subject: [PATCH] 三方对接接口优化 --- exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThCourseChapterServiceImpl.java | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThCourseChapterServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThCourseChapterServiceImpl.java index f6038b2..6413a7f 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThCourseChapterServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThCourseChapterServiceImpl.java @@ -1,16 +1,20 @@ package com.gkhy.exam.institutionalaccess.service.serviceImpl; +import cn.hutool.core.collection.ListUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gkhy.exam.institutionalaccess.entity.ThCourse; import com.gkhy.exam.institutionalaccess.entity.ThCourseChapter; import com.gkhy.exam.institutionalaccess.mapper.ThCourseChapterMapper; import com.gkhy.exam.institutionalaccess.model.vo.ThCourseChapterVO; +import com.gkhy.exam.institutionalaccess.model.vo.ThStatisticStudentVO; import com.gkhy.exam.institutionalaccess.service.ThCourseChapterService; import com.ruoyi.common.enums.coalmineEnums.DeleteStatusEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -38,4 +42,33 @@ public ThCourseChapter getByUuid(String batchUuid) { return courseChapterMapper.selectOne(new LambdaQueryWrapper<ThCourseChapter>().eq(ThCourseChapter::getUuid, batchUuid).eq(ThCourseChapter::getDelFlag, DeleteStatusEnum.NO.getStatus())); } + + @Override + public List<ThCourseChapter> getByUuids(List<String> chapterUuids) { + List<ThCourseChapter> allList = new ArrayList<>(); + //分批量查询 + List<List<String>> list = ListUtil.split(chapterUuids, 900); + for (List<String> uuids : list) { + List<ThCourseChapter> courseListList = courseChapterMapper.getByUuids(uuids); + allList.addAll(courseListList); + } + return allList; + } + + @Override + public Integer insertBatch(List<ThCourseChapter> courseChapterList) { + return courseChapterMapper.insertBatch(courseChapterList); + } + + @Override + public Integer updateBatch(List<ThCourseChapter> courseChapterList) { + return courseChapterMapper.updateBatch(courseChapterList); + } + + @Override + public List<ThCourseChapter> getChapterNameByUuids(List<String> chapterUuids) { + return courseChapterMapper.getChapterNameByUuids(chapterUuids); + } + + } -- Gitblit v1.9.2