|
@@ -1,7 +1,6 @@
|
|
package com.qmth.paper.library.business.service.impl;
|
|
package com.qmth.paper.library.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.qmth.paper.library.business.bean.vo.PathSequenceVo;
|
|
import com.qmth.paper.library.business.bean.vo.PathSequenceVo;
|
|
import com.qmth.paper.library.business.bean.vo.RecognitionResultVo;
|
|
import com.qmth.paper.library.business.bean.vo.RecognitionResultVo;
|
|
import com.qmth.paper.library.business.entity.PaperLibrary;
|
|
import com.qmth.paper.library.business.entity.PaperLibrary;
|
|
@@ -12,12 +11,14 @@ import com.qmth.paper.library.common.contant.SystemConstant;
|
|
import com.qmth.paper.library.common.entity.BasicFileType;
|
|
import com.qmth.paper.library.common.entity.BasicFileType;
|
|
import com.qmth.paper.library.common.entity.ExamStudent;
|
|
import com.qmth.paper.library.common.entity.ExamStudent;
|
|
import com.qmth.paper.library.common.entity.SysPrivilege;
|
|
import com.qmth.paper.library.common.entity.SysPrivilege;
|
|
|
|
+import com.qmth.paper.library.common.entity.SysUser;
|
|
import com.qmth.paper.library.common.enums.ExceptionResultEnum;
|
|
import com.qmth.paper.library.common.enums.ExceptionResultEnum;
|
|
import com.qmth.paper.library.common.enums.UploadFileEnum;
|
|
import com.qmth.paper.library.common.enums.UploadFileEnum;
|
|
import com.qmth.paper.library.common.lock.LockService;
|
|
import com.qmth.paper.library.common.lock.LockService;
|
|
import com.qmth.paper.library.common.lock.LockType;
|
|
import com.qmth.paper.library.common.lock.LockType;
|
|
import com.qmth.paper.library.common.service.BasicBatchNumberService;
|
|
import com.qmth.paper.library.common.service.BasicBatchNumberService;
|
|
import com.qmth.paper.library.common.service.SysPrivilegeService;
|
|
import com.qmth.paper.library.common.service.SysPrivilegeService;
|
|
|
|
+import com.qmth.paper.library.common.service.SysUserService;
|
|
import com.qmth.paper.library.common.util.ServletUtil;
|
|
import com.qmth.paper.library.common.util.ServletUtil;
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
@@ -43,6 +44,8 @@ public class ClientServiceImpl implements ClientService {
|
|
@Resource
|
|
@Resource
|
|
private SysPrivilegeService sysPrivilegeService;
|
|
private SysPrivilegeService sysPrivilegeService;
|
|
@Resource
|
|
@Resource
|
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
+ @Resource
|
|
private PaperLibraryService paperLibraryService;
|
|
private PaperLibraryService paperLibraryService;
|
|
@Resource
|
|
@Resource
|
|
private PaperLibraryOtherService paperLibraryOtherService;
|
|
private PaperLibraryOtherService paperLibraryOtherService;
|
|
@@ -80,7 +83,7 @@ public class ClientServiceImpl implements ClientService {
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public Long pictureUpload(Long paperScanTaskId, String studentCode, Integer x, Integer y, Integer width, Integer height, Integer rotate,
|
|
public Long pictureUpload(Long paperScanTaskId, String studentCode, Integer x, Integer y, Integer width, Integer height, Integer rotate,
|
|
- MultipartFile frontFile, String frontMd5, MultipartFile versoFile, String versoMd5, Long scanUserId, String batchNo, Integer studentPaperNo) {
|
|
|
|
|
|
+ MultipartFile frontFile, String frontMd5, MultipartFile versoFile, String versoMd5, Long scanUserId, String batchNo, Integer studentPaperNo) {
|
|
|
|
|
|
if (Objects.isNull(frontFile) || frontFile.getSize() == 0) {
|
|
if (Objects.isNull(frontFile) || frontFile.getSize() == 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("frontFile(正面图片)为空");
|
|
throw ExceptionResultEnum.ERROR.exception("frontFile(正面图片)为空");
|
|
@@ -163,8 +166,9 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean otherUpload(Long paperScanTaskId, MultipartFile frontFile, String frontMd5, MultipartFile versoFile, String versoMd5, Long fileTypeId, String classRoomName) {
|
|
|
|
|
|
+ public boolean otherUpload(Long paperScanTaskId, MultipartFile frontFile, String frontMd5, MultipartFile versoFile, String versoMd5, Long fileTypeId, String classRoomName, String batchNo, Integer studentPaperNo) {
|
|
Long userId = Long.valueOf(ServletUtil.getRequestHeaderUserId().toString());
|
|
Long userId = Long.valueOf(ServletUtil.getRequestHeaderUserId().toString());
|
|
|
|
+ SysUser sysUser = sysUserService.getById(userId);
|
|
if (Objects.isNull(frontFile) || frontFile.getSize() == 0) {
|
|
if (Objects.isNull(frontFile) || frontFile.getSize() == 0) {
|
|
throw ExceptionResultEnum.ERROR.exception("frontFile(正面图片)为空");
|
|
throw ExceptionResultEnum.ERROR.exception("frontFile(正面图片)为空");
|
|
}
|
|
}
|
|
@@ -189,6 +193,7 @@ public class ClientServiceImpl implements ClientService {
|
|
PaperLibraryOther paperLibraryOther = new PaperLibraryOther();
|
|
PaperLibraryOther paperLibraryOther = new PaperLibraryOther();
|
|
paperLibraryOther.setId(SystemConstant.getDbUuid());
|
|
paperLibraryOther.setId(SystemConstant.getDbUuid());
|
|
paperLibraryOther.setPaperScanTaskId(paperScanTaskId);
|
|
paperLibraryOther.setPaperScanTaskId(paperScanTaskId);
|
|
|
|
+ paperLibraryOther.setBatchNo(batchNo);
|
|
paperLibraryOther.setCreateId(userId);
|
|
paperLibraryOther.setCreateId(userId);
|
|
paperLibraryOther.setCreateTime(System.currentTimeMillis());
|
|
paperLibraryOther.setCreateTime(System.currentTimeMillis());
|
|
|
|
|
|
@@ -198,10 +203,10 @@ public class ClientServiceImpl implements ClientService {
|
|
}
|
|
}
|
|
paperLibraryOther.setFileTypeId(fileTypeId);
|
|
paperLibraryOther.setFileTypeId(fileTypeId);
|
|
|
|
|
|
- int maxSequence = paperLibraryOtherService.getMaxSequence(paperScanTaskId, fileTypeId);
|
|
|
|
- paperLibraryOther.setSequence(maxSequence);
|
|
|
|
|
|
+ int maxSequence = paperLibraryOtherService.getMaxSequence(paperScanTaskId, fileTypeId, userId, batchNo);
|
|
|
|
+ paperLibraryOther.setSequence(maxSequence + studentPaperNo);
|
|
// 保存图片,生成路径
|
|
// 保存图片,生成路径
|
|
- PathSequenceVo pathSequenceVo = paperLibraryCommonService.saveLibraryOtherFile(paperScanTask, UploadFileEnum.IMAGE, basicFileType.getName() + maxSequence, classRoomName, frontFile, versoFile);
|
|
|
|
|
|
+ PathSequenceVo pathSequenceVo = paperLibraryCommonService.saveLibraryOtherFile(paperScanTask, UploadFileEnum.IMAGE, basicFileType.getName() + "-" + sysUser.getLoginName() + "-" + paperLibraryOther.getSequence(), classRoomName, frontFile, versoFile);
|
|
paperLibraryOther.setPath(pathSequenceVo.getPath());
|
|
paperLibraryOther.setPath(pathSequenceVo.getPath());
|
|
|
|
|
|
return paperLibraryOtherService.save(paperLibraryOther);
|
|
return paperLibraryOtherService.save(paperLibraryOther);
|