|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.paper.library.business.bean.dto.excel.ScannerBindingDto;
|
|
|
import com.qmth.paper.library.business.bean.params.PaperScanTaskParam;
|
|
|
+import com.qmth.paper.library.business.bean.result.PaperScanTaskDetailResult;
|
|
|
import com.qmth.paper.library.business.bean.result.PaperScanTaskResult;
|
|
|
import com.qmth.paper.library.business.entity.PaperLibrary;
|
|
|
import com.qmth.paper.library.business.entity.PaperScanTask;
|
|
@@ -170,6 +171,44 @@ public class PaperScanTaskServiceImpl extends ServiceImpl<PaperScanTaskMapper, P
|
|
|
ExcelUtil.excelExport("绑定扫描员导入模板", ScannerBindingDto.class, scannerBindingDtoList, ServletUtil.getResponse());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public IPage<PaperScanTaskDetailResult> findPaperScanTaskDetailPageByTaskId(Long paperScanTaskId, int pageNumber, int pageSize, SysUser requestUser) {
|
|
|
+ Long schoolId = requestUser.getSchoolId();
|
|
|
+ return this.baseMapper.findPaperScanTaskDetailPageByTaskId(new Page<>(pageNumber, pageSize), paperScanTaskId, schoolId, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void clearScanData(Long paperScanTaskId, SysUser requestUser) {
|
|
|
+ Long schoolId = requestUser.getSchoolId();
|
|
|
+
|
|
|
+ // 扫描任务校验
|
|
|
+ PaperScanTask paperScanTask = this.getById(paperScanTaskId);
|
|
|
+ if (Objects.isNull(paperScanTask)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("扫描任务不存在");
|
|
|
+ }
|
|
|
+ // 要删除的图片数据集合
|
|
|
+ List<PaperLibrary> willDeletePaperLibraryList = paperLibraryService.list(new QueryWrapper<PaperLibrary>()
|
|
|
+ .lambda()
|
|
|
+ .eq(PaperLibrary::getSchoolId, schoolId)
|
|
|
+ .eq(PaperLibrary::getPaperScanTaskId, paperScanTaskId));
|
|
|
+
|
|
|
+ if (willDeletePaperLibraryList.size() > 0) {
|
|
|
+ // 已绑定的扫描任务校验
|
|
|
+ List<PaperLibrary> cantDeleteList = willDeletePaperLibraryList
|
|
|
+ .stream()
|
|
|
+ .filter(e -> SystemConstant.longNotNull(e.getPaperScanTaskDetailId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (cantDeleteList.size() > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("所选的扫描任务已经进行了数据检验,不能删除");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 删除该任务扫描的的数据
|
|
|
+ paperLibraryService.removeByIds(willDeletePaperLibraryList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<PaperScanTask> listByPaperArchivesId(Long paperArchivesId) {
|
|
|
QueryWrapper<PaperScanTask> queryWrapper = new QueryWrapper<>();
|