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/ThStudentServiceImpl.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+), 0 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudentServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudentServiceImpl.java new file mode 100644 index 0000000..4ac5864 --- /dev/null +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudentServiceImpl.java @@ -0,0 +1,59 @@ +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.ThStudent; +import com.gkhy.exam.institutionalaccess.entity.ThStudentBatch; +import com.gkhy.exam.institutionalaccess.mapper.ThStudentMapper; +import com.gkhy.exam.institutionalaccess.model.vo.ThStatisticStudentVO; +import com.gkhy.exam.institutionalaccess.service.ThStudentService; +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; + +@Service("ThStudentService") +public class ThStudentServiceImpl extends ServiceImpl<ThStudentMapper, ThStudent> implements ThStudentService { + @Autowired + private ThStudentMapper studentMapper; + + @Override + public ThStudent getByIdcard(String idcard) { + + return studentMapper.selectOne(new LambdaQueryWrapper<ThStudent>().eq(ThStudent::getIdcard, idcard) + .eq(ThStudent::getDelFlag, DeleteStatusEnum.NO.getStatus())); + } + + @Override + public List<ThStudent> getByIdcards(List<String> idcards) { + List<ThStudent> allStudentList = new ArrayList<>(); + List<List<String>> split = ListUtil.split(idcards, 900); + for (List<String> list : split) { + List<ThStudent> studentList = studentMapper.getByIdCards(list); + allStudentList.addAll(studentList); + } + return allStudentList; + } + + @Override + public Integer updateBatch(List<ThStudent> updateStudentList) { + return studentMapper.updateBatch(updateStudentList); + } + + @Override + public Integer insertBatch(List<ThStudent> saveSudentList) { + return studentMapper.insertBatch(saveSudentList); + } + + @Override + public List<ThStudent> getNameByIdcards(List<String> idcards) { + + return studentMapper.getNameByIdcards(idcards); + } + + +} -- Gitblit v1.9.2