|
|
|
@ -2,9 +2,13 @@ package com.docus.server.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.docus.server.dto.segmentation.UploadBatchFileRequest;
|
|
|
|
|
import com.docus.server.dto.segmentation.ocrbasic.AddOcrBasicDTO;
|
|
|
|
|
import com.docus.server.dto.segmentation.ocrbasictest.AddOcrBasicTestDTO;
|
|
|
|
|
import com.docus.server.dto.segmentation.ocrfileinfo.AddOcrFileInfoDTO;
|
|
|
|
|
import com.docus.server.dto.segmentation.ocrfileinfotest.AddOcrFileInfoTestDTO;
|
|
|
|
|
import com.docus.server.service.IOcrBasicService;
|
|
|
|
|
import com.docus.server.service.IOcrBasicTestService;
|
|
|
|
|
import com.docus.server.service.IOcrFileInfoService;
|
|
|
|
|
import com.docus.server.service.IOcrFileInfoTestService;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectorversionfile.UploadFileVO;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -21,36 +25,71 @@ public class CommonService {
|
|
|
|
|
@Resource
|
|
|
|
|
private IOcrFileInfoService iOcrFileInfoService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private IOcrBasicTestService iOcrBasicTestService;
|
|
|
|
|
@Resource
|
|
|
|
|
private IOcrFileInfoTestService iOcrFileInfoTestService;
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void add(List<UploadFileVO> segmentation, UploadBatchFileRequest request) {
|
|
|
|
|
//test
|
|
|
|
|
if (request.getTestData() == 1) {
|
|
|
|
|
AddOcrBasicTestDTO addOcrBasicDTO = new AddOcrBasicTestDTO();
|
|
|
|
|
|
|
|
|
|
AddOcrBasicDTO addOcrBasicDTO = new AddOcrBasicDTO();
|
|
|
|
|
addOcrBasicDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrBasicDTO.setInpatientNo(request.getInpatientNo());
|
|
|
|
|
addOcrBasicDTO.setName(request.getName());
|
|
|
|
|
|
|
|
|
|
addOcrBasicDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrBasicDTO.setInpatientNo(request.getInpatientNo());
|
|
|
|
|
addOcrBasicDTO.setName(request.getName());
|
|
|
|
|
|
|
|
|
|
iOcrBasicTestService.add(addOcrBasicDTO);
|
|
|
|
|
|
|
|
|
|
iOcrBasicService.add(addOcrBasicDTO);
|
|
|
|
|
|
|
|
|
|
AddOcrFileInfoTestDTO addOcrFileInfoDTO = new AddOcrFileInfoTestDTO();
|
|
|
|
|
|
|
|
|
|
AddOcrFileInfoDTO addOcrFileInfoDTO = new AddOcrFileInfoDTO();
|
|
|
|
|
List<AddOcrFileInfoTestDTO> files = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<AddOcrFileInfoDTO> files = new ArrayList<>();
|
|
|
|
|
for (UploadFileVO uploadFileVO : segmentation) {
|
|
|
|
|
addOcrFileInfoDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrFileInfoDTO.setFileTitle(uploadFileVO.getFileTitle());
|
|
|
|
|
addOcrFileInfoDTO.setPicName(uploadFileVO.getFileName());
|
|
|
|
|
addOcrFileInfoDTO.setFileType(2);
|
|
|
|
|
addOcrFileInfoDTO.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
addOcrFileInfoDTO.setPicUrl(uploadFileVO.getSaveFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
addOcrFileInfoDTO.setPicCutUrl(uploadFileVO.getSaveCutFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
files.add(addOcrFileInfoDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (UploadFileVO uploadFileVO : segmentation) {
|
|
|
|
|
addOcrFileInfoDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrFileInfoDTO.setFileTitle(uploadFileVO.getFileTitle());
|
|
|
|
|
addOcrFileInfoDTO.setPicName(uploadFileVO.getFileName());
|
|
|
|
|
addOcrFileInfoDTO.setFileType(2);
|
|
|
|
|
addOcrFileInfoDTO.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
addOcrFileInfoDTO.setPicUrl(uploadFileVO.getSaveFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
addOcrFileInfoDTO.setPicCutUrl(uploadFileVO.getSaveCutFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
files.add(addOcrFileInfoDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iOcrFileInfoTestService.addBatch(files);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
AddOcrBasicDTO addOcrBasicDTO = new AddOcrBasicDTO();
|
|
|
|
|
|
|
|
|
|
addOcrBasicDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrBasicDTO.setInpatientNo(request.getInpatientNo());
|
|
|
|
|
addOcrBasicDTO.setName(request.getName());
|
|
|
|
|
|
|
|
|
|
iOcrBasicService.add(addOcrBasicDTO);
|
|
|
|
|
|
|
|
|
|
AddOcrFileInfoDTO addOcrFileInfoDTO = new AddOcrFileInfoDTO();
|
|
|
|
|
|
|
|
|
|
List<AddOcrFileInfoDTO> files = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (UploadFileVO uploadFileVO : segmentation) {
|
|
|
|
|
addOcrFileInfoDTO.setPatientId(request.getPatientId());
|
|
|
|
|
addOcrFileInfoDTO.setFileTitle(uploadFileVO.getFileTitle());
|
|
|
|
|
addOcrFileInfoDTO.setPicName(uploadFileVO.getFileName());
|
|
|
|
|
addOcrFileInfoDTO.setFileType(2);
|
|
|
|
|
addOcrFileInfoDTO.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
addOcrFileInfoDTO.setPicUrl(uploadFileVO.getSaveFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
addOcrFileInfoDTO.setPicCutUrl(uploadFileVO.getSaveCutFilePath() + uploadFileVO.getFilePath());
|
|
|
|
|
files.add(addOcrFileInfoDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iOcrFileInfoService.addBatch(files);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iOcrFileInfoService.addBatch(files);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|