教育训练处考试制证系统后端
zhangf
2024-07-24 790c2ba4a0b46edf191e3bac84931f796bd42b8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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.ThStudentBatch;
import com.gkhy.exam.institutionalaccess.mapper.ThStudentBatchMapper;
 
import com.gkhy.exam.institutionalaccess.model.vo.ThStatisticStudentVO;
import com.gkhy.exam.institutionalaccess.model.vo.ThStudentBatchCourseVO;
import com.gkhy.exam.institutionalaccess.model.vo.ThStudentBatchVO;
import com.gkhy.exam.institutionalaccess.model.vo.ThStudentCourseVO;
import com.gkhy.exam.institutionalaccess.service.ThStudentBatchService;
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("ThStudentBatchService")
public class ThStudentBatchServiceImpl extends ServiceImpl<ThStudentBatchMapper, ThStudentBatch> implements ThStudentBatchService {
   @Autowired
   private ThStudentBatchMapper studentBatchMapper;
    @Override
    public List<ThStudentBatch> getByIdCards(List<String> idcards) {
        List<ThStudentBatch> allStudentBatchList = new ArrayList<>();
        List<List<String>> split = ListUtil.split(idcards, 900);
        for (List<String> list : split) {
            List<ThStudentBatch> studentBatchList = studentBatchMapper.getByIdCards(list);
            allStudentBatchList.addAll(studentBatchList);
        }
 
        return allStudentBatchList;
    }
 
    @Override
    public List<ThStatisticStudentVO> statisticByBatchUuid() {
        return studentBatchMapper.statisticByBatchUuid();
    }
 
 
    @Override
    public List<ThStudentBatch> listByInstitutionId(Long institutionId) {
        return studentBatchMapper.selectList(new LambdaQueryWrapper<ThStudentBatch>().eq(ThStudentBatch::getInstitutionId, institutionId)
                .eq(ThStudentBatch::getDelFlag,DeleteStatusEnum.NO.getStatus()));
    }
 
    @Override
    public List<ThStatisticStudentVO> statisticByCourseUuid() {
        return studentBatchMapper.statisticByCourseUuid();
    }
 
    @Override
    public List<ThStudentBatchCourseVO> getStudentBatchCourseVOByBatchUuid(String batchUuid) {
        return studentBatchMapper.getStudentBatchCourseVOByBatchUuid(batchUuid);
    }
 
    @Override
    public void updateByBatchUuid(String batchUuid) {
        studentBatchMapper.updateByBatchUuid(batchUuid);
    }
 
    @Override
    public ThStudentBatch getByIdcardAndBatchUuid(String idcard, String batchUuid) {
        ThStudentBatch thStudentCourse = studentBatchMapper.selectOne(new LambdaQueryWrapper<ThStudentBatch>().eq(ThStudentBatch::getIdcard, idcard)
                .eq(ThStudentBatch::getBatchUuid, batchUuid).eq(ThStudentBatch::getDelFlag, DeleteStatusEnum.NO.getStatus()));
    return thStudentCourse;
    }
 
    @Override
    public List<ThStudentBatch> getByBatchUuid(String batchUuid) {
        List<ThStudentBatch> thStudentCourse = studentBatchMapper.selectList(new LambdaQueryWrapper<ThStudentBatch>()
                .eq(ThStudentBatch::getBatchUuid, batchUuid).eq(ThStudentBatch::getDelFlag, DeleteStatusEnum.NO.getStatus()));
        return thStudentCourse;
    }
 
    @Override
    public void updateFinishStatusByBatchUuid(String batchUuid) {
        studentBatchMapper.updateFinishStatusByBatchUuid(batchUuid);
    }
 
    @Override
    public Integer insertBatch(List<ThStudentBatch> saveThStudentBatchList) {
        return studentBatchMapper.insertBatch(saveThStudentBatchList);
    }
 
    @Override
    public Integer updateBatch(List<ThStudentBatch> updateThStudentBatchList) {
        return studentBatchMapper.updateBatch(updateThStudentBatchList);
    }
 
    @Override
    public List<ThStudentBatchVO> getStudentBatchVOByBatchUuid(String batchUuid) {
        return studentBatchMapper.getStudentBatchVOByBatchUuid(batchUuid);
    }
 
    @Override
    public List<ThStudentBatchVO> getStudentBatchVOByCourseUuid(String courseUuid) {
        return studentBatchMapper.getStudentBatchVOByCourseUuid(courseUuid);
    }
}