|
@@ -2,13 +2,17 @@ package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.qmth.distributed.print.business.bean.marking.Marker;
|
|
|
import com.qmth.distributed.print.business.entity.ExamPaperGroupMarker;
|
|
|
import com.qmth.distributed.print.business.mapper.ExamPaperGroupMarkerMapper;
|
|
|
import com.qmth.distributed.print.business.service.ExamPaperGroupMarkerService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* @Description: 评卷员-分组关系服务实现类
|
|
@@ -18,11 +22,23 @@ import java.util.Set;
|
|
|
@Service
|
|
|
public class ExamPaperGroupMarkerServiceImpl extends ServiceImpl<ExamPaperGroupMarkerMapper,ExamPaperGroupMarker> implements ExamPaperGroupMarkerService {
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void saveExamPaperGroupMarkerByGroupId(Long examPaperGroupId, List<Marker> markerList) {
|
|
|
+ Set<ExamPaperGroupMarker> examPaperGroupMarkerSet = markerList.stream().flatMap(e -> {
|
|
|
+ ExamPaperGroupMarker marker = new ExamPaperGroupMarker();
|
|
|
+ marker.setGroupId(examPaperGroupId);
|
|
|
+ marker.setMarkerId(e.getId());
|
|
|
+ return Stream.of(marker);
|
|
|
+ }).collect(Collectors.toSet());
|
|
|
+ this.saveBatch(examPaperGroupMarkerSet);
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void deleteExamPaperGroupMarkerService(Set<Long> groupIdSet) {
|
|
|
- if (groupIdSet.size() > 0){
|
|
|
- this.remove(new QueryWrapper<ExamPaperGroupMarker>().lambda().in(ExamPaperGroupMarker::getGroupId,groupIdSet));
|
|
|
+ if (groupIdSet.size() > 0) {
|
|
|
+ this.remove(new QueryWrapper<ExamPaperGroupMarker>().lambda().in(ExamPaperGroupMarker::getGroupId, groupIdSet));
|
|
|
}
|
|
|
}
|
|
|
}
|