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/ThBatchCourseChapterServiceImpl.java |   72 ++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThBatchCourseChapterServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThBatchCourseChapterServiceImpl.java
new file mode 100644
index 0000000..dea9dcc
--- /dev/null
+++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThBatchCourseChapterServiceImpl.java
@@ -0,0 +1,72 @@
+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.extension.service.impl.ServiceImpl;
+import com.gkhy.exam.institutionalaccess.entity.ThBatchCourse;
+import com.gkhy.exam.institutionalaccess.entity.ThBatchCourseChapter;
+import com.gkhy.exam.institutionalaccess.entity.ThCourseChapter;
+import com.gkhy.exam.institutionalaccess.mapper.ThBatchCourseChapterMapper;
+import com.gkhy.exam.institutionalaccess.service.ThBatchCourseChapterService;
+import com.ruoyi.common.enums.coalmineEnums.DeleteStatusEnum;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Service("ThBatchCourseChapterService")
+public class ThBatchCourseChapterServiceImpl extends ServiceImpl<ThBatchCourseChapterMapper, ThBatchCourseChapter> implements ThBatchCourseChapterService {
+    @Override
+    public void deleteByBatchUuid(String batchUuid) {
+        baseMapper.deleteByBatchUuid(batchUuid);
+    }
+
+    @Override
+    public List<ThBatchCourseChapter> getByBatchUuid(String batchUuid) {
+        return baseMapper.selectList(new LambdaQueryWrapper<ThBatchCourseChapter>()
+                .eq(ThBatchCourseChapter::getBatchUuid, batchUuid)
+                .eq(ThBatchCourseChapter::getDelFlag, DeleteStatusEnum.NO.getStatus()));
+    }
+
+    @Override
+    public ThBatchCourseChapter getByUuid(String batchUuid, String courseUuid, String chapterUuid) {
+        return baseMapper.selectOne(new LambdaQueryWrapper<ThBatchCourseChapter>()
+                .eq(ThBatchCourseChapter::getBatchUuid, batchUuid)
+                .eq(ThBatchCourseChapter::getCourseUuid, courseUuid)
+                .eq(ThBatchCourseChapter::getChapterUuid, chapterUuid)
+                .eq(ThBatchCourseChapter::getDelFlag, DeleteStatusEnum.NO.getStatus()));
+    }
+
+    @Override
+    public List<ThBatchCourseChapter> getListByBatchUuids(List<String> batchUuids) {
+        List<ThBatchCourseChapter> allBatchCourseChapterList = new ArrayList<>();
+        List<List<String>> split = ListUtil.split(batchUuids, 900);
+        for (List<String> list : split) {
+            List<ThBatchCourseChapter> thBatchCourseChapterList = baseMapper.getByBatchUuids(list);
+            allBatchCourseChapterList.addAll(thBatchCourseChapterList);
+        }
+        return allBatchCourseChapterList;
+    }
+
+    @Override
+    public Integer insertBatch(List<ThBatchCourseChapter> chapterList) {
+        return baseMapper.insertBatch(chapterList);
+    }
+
+    @Override
+    public Integer updateBatch(List<ThBatchCourseChapter> chapterList) {
+        return baseMapper.updateBatch(chapterList);
+    }
+
+    @Override
+    public List<ThBatchCourseChapter> getByChapterUuids(List<String> chapterUuids) {
+        List<ThBatchCourseChapter> allBatchCourseChapterList = new ArrayList<>();
+        List<List<String>> split = ListUtil.split(chapterUuids, 900);
+        for (List<String> list : split) {
+            List<ThBatchCourseChapter> thBatchCourseChapterList = baseMapper.getByChapterUuids(list);
+            allBatchCourseChapterList.addAll(thBatchCourseChapterList);
+        }
+        return allBatchCourseChapterList;
+    }
+}

--
Gitblit v1.9.2