|
|
|
@ -22,6 +22,8 @@ import com.docus.server.infrastructure.dao.IZdAssortDao;
|
|
|
|
|
import com.docus.server.service.*;
|
|
|
|
|
import com.docus.server.vo.segmentation.ocrconfignew.OcrConfigNewVO;
|
|
|
|
|
import com.docus.server.vo.segmentation.ocrfileinfo.OcrFileInfoVO;
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -37,6 +39,8 @@ import java.util.stream.Collectors;
|
|
|
|
|
* @author AutoGenerator
|
|
|
|
|
* @since 2023-08-29
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
|
public class OcrFileInfoServiceImpl implements IOcrFileInfoService {
|
|
|
|
|
@Resource
|
|
|
|
@ -125,9 +129,9 @@ public class OcrFileInfoServiceImpl implements IOcrFileInfoService {
|
|
|
|
|
List<OcrFileInfo> uploadInfo = v;
|
|
|
|
|
OcrBasic ocrBasic = iOcrBasicDao.findOneBy("patientId", patientId);
|
|
|
|
|
|
|
|
|
|
List<FileDTO> fileDTOList = new ArrayList<>(uploadInfo.size());
|
|
|
|
|
List<File> files = new ArrayList<>(uploadInfo.size());
|
|
|
|
|
for (OcrFileInfo item:uploadInfo) {
|
|
|
|
|
List<FileDTO> fileDTOList = new ArrayList<>(uploadInfo.size());
|
|
|
|
|
List<File> files = new ArrayList<>(uploadInfo.size());
|
|
|
|
|
File file = new File(item.getPicUrl());
|
|
|
|
|
files.add(file);
|
|
|
|
|
|
|
|
|
@ -141,18 +145,18 @@ public class OcrFileInfoServiceImpl implements IOcrFileInfoService {
|
|
|
|
|
|
|
|
|
|
fileDTOList.add(fileDTO);
|
|
|
|
|
|
|
|
|
|
//数据上传到3.0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UploadBatchFileRequest request = new UploadBatchFileRequest();
|
|
|
|
|
request.setCollectorId("-1");
|
|
|
|
|
request.setInpatientNo(ocrBasic.getInpatientNo());
|
|
|
|
|
request.setTestData(0);
|
|
|
|
|
request.setPatientId(patientId);
|
|
|
|
|
request.setName(ocrBasic.getName());
|
|
|
|
|
request.setFileInfo(JSONUtil.toJsonStr(fileDTOList));
|
|
|
|
|
//数据上传到3.0
|
|
|
|
|
|
|
|
|
|
platformService.uploadPlatform(files, request);
|
|
|
|
|
}
|
|
|
|
|
UploadBatchFileRequest request = new UploadBatchFileRequest();
|
|
|
|
|
request.setCollectorId("-1");
|
|
|
|
|
request.setInpatientNo(ocrBasic.getInpatientNo());
|
|
|
|
|
request.setTestData(0);
|
|
|
|
|
request.setPatientId(patientId);
|
|
|
|
|
request.setName(ocrBasic.getName());
|
|
|
|
|
request.setFileInfo(JSONUtil.toJsonStr(fileDTOList));
|
|
|
|
|
platformService.uploadPlatform(files, request);
|
|
|
|
|
|
|
|
|
|
ocrBasic.setFailNum(0);
|
|
|
|
|
ocrBasic.setSuccessNum(uploadInfo.size());
|
|
|
|
@ -379,6 +383,8 @@ public class OcrFileInfoServiceImpl implements IOcrFileInfoService {
|
|
|
|
|
Map<String, List<OcrFileInfo>> collect = new HashMap<>();
|
|
|
|
|
collect.put(ocrFileInfo.getPatientId(),ocrFileInfoList);
|
|
|
|
|
|
|
|
|
|
log.info("上传参数内容:"+new Gson().toJson(collect));
|
|
|
|
|
|
|
|
|
|
this.uploadPlatform(null,collect);
|
|
|
|
|
}
|
|
|
|
|
iOcrBasicDao.updateById(ocrBasic);
|
|
|
|
|