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/ThStudyAuthServiceImpl.java |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyAuthServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyAuthServiceImpl.java
index f221f5c..001a11c 100644
--- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyAuthServiceImpl.java
+++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyAuthServiceImpl.java
@@ -1,5 +1,6 @@
 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.ThStudyAuth;
@@ -9,6 +10,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -23,7 +25,21 @@
     }
 
     @Override
-    public List<ThStudyAuth> getListByStudyDetaiIds(List<String> detailUuids) {
-        return thStudyAuthMapper.selectList(new LambdaQueryWrapper<ThStudyAuth>().in(ThStudyAuth::getStudyDetailUuid, detailUuids));
+    public List<ThStudyAuth> getByStudyDetaiUuids(List<String> studyUuids) {
+        List<ThStudyAuth> allAuthList = new ArrayList<>();
+        List<List<String>> split = ListUtil.split(studyUuids, 900);
+        for (List<String> list : split) {
+            List<ThStudyAuth> authList = thStudyAuthMapper.getByStudyDetaiUuids(list);
+            allAuthList.addAll(authList);
+        }
+
+        return allAuthList;
     }
+
+    @Override
+    public Integer insetBatch(List<ThStudyAuth> thStudyAuthList) {
+        return baseMapper.insertBatch(thStudyAuthList);
+    }
+
+
 }

--
Gitblit v1.9.2