|
|
@ -1,16 +1,18 @@
|
|
|
|
package com.docus.server.controller;
|
|
|
|
package com.docus.server.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.docus.server.api.ocr.OcrApi;
|
|
|
|
import com.docus.server.common.event.FlowEvent;
|
|
|
|
import com.docus.server.common.event.FlowEvent;
|
|
|
|
import com.docus.server.common.service.IFileUploadService;
|
|
|
|
import com.docus.server.common.service.IFileUploadService;
|
|
|
|
import com.docus.server.dto.segmentation.UploadBatchFileRequest;
|
|
|
|
import com.docus.server.dto.segmentation.UploadBatchFileRequest;
|
|
|
|
import com.docus.server.entity.segmentation.OcrFileInfoTest;
|
|
|
|
import com.docus.server.entity.segmentation.OcrFileInfoTest;
|
|
|
|
import com.docus.server.entity.segmentation.OcrVersion;
|
|
|
|
import com.docus.server.service.IOcrCutConfigService;
|
|
|
|
import com.docus.server.service.*;
|
|
|
|
import com.docus.server.service.IOcrCutConfigTestService;
|
|
|
|
|
|
|
|
import com.docus.server.service.IOcrFileInfoTestService;
|
|
|
|
|
|
|
|
import com.docus.server.service.IOcrVersionService;
|
|
|
|
|
|
|
|
import com.docus.server.service.IPublishEventService;
|
|
|
|
import com.docus.server.service.impl.CommonService;
|
|
|
|
import com.docus.server.service.impl.CommonService;
|
|
|
|
import com.docus.server.service.impl.PlatformServiceImpl;
|
|
|
|
import com.docus.server.service.impl.PlatformServiceImpl;
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectorversionfile.UploadFileVO;
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectorversionfile.UploadFileVO;
|
|
|
|
import com.docus.server.vo.segmentation.ocrcutconfig.OcrCutConfigVO;
|
|
|
|
|
|
|
|
import com.docus.server.vo.segmentation.ocrcutconfigtest.OcrCutConfigTestVO;
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
@ -34,7 +36,7 @@ import java.util.List;
|
|
|
|
* @author AutoGenerator
|
|
|
|
* @author AutoGenerator
|
|
|
|
* @since 2023-07-15
|
|
|
|
* @since 2023-07-15
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Api(value = "通用文件上传下载接口", tags = "通用文件上传下载接口")
|
|
|
|
@Api(value = "通用接口", tags = "通用接口")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/ocr/file")
|
|
|
|
@RequestMapping("/ocr/file")
|
|
|
|
public class FileController {
|
|
|
|
public class FileController {
|
|
|
@ -54,6 +56,14 @@ public class FileController {
|
|
|
|
private IOcrFileInfoTestService iOcrFileInfoTestService;
|
|
|
|
private IOcrFileInfoTestService iOcrFileInfoTestService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IOcrVersionService iOcrVersionService;
|
|
|
|
private IOcrVersionService iOcrVersionService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private OcrApi ocrApi;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("ocr测试")
|
|
|
|
|
|
|
|
@GetMapping("/orc-test")
|
|
|
|
|
|
|
|
public List<String> ocrTest(String path, String ocrHttpUrl) throws Exception {
|
|
|
|
|
|
|
|
return ocrApi.getText(path, ocrHttpUrl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("文件下载")
|
|
|
|
@ApiOperation("文件下载")
|
|
|
|
@GetMapping("/download")
|
|
|
|
@GetMapping("/download")
|
|
|
@ -75,9 +85,9 @@ public class FileController {
|
|
|
|
public Object uploadFile(@RequestPart("files") MultipartFile[] files, @Validated UploadBatchFileRequest request) throws Exception {
|
|
|
|
public Object uploadFile(@RequestPart("files") MultipartFile[] files, @Validated UploadBatchFileRequest request) throws Exception {
|
|
|
|
|
|
|
|
|
|
|
|
int testData = request.getTestData();
|
|
|
|
int testData = request.getTestData();
|
|
|
|
Double height = null ;
|
|
|
|
Double height = null;
|
|
|
|
Double widthStart = null ;
|
|
|
|
Double widthStart = null;
|
|
|
|
Double widthEnd = null ;
|
|
|
|
Double widthEnd = null;
|
|
|
|
|
|
|
|
|
|
|
|
// if (testData == 1) {
|
|
|
|
// if (testData == 1) {
|
|
|
|
// OcrCutConfigTestVO ocrCutConfigTestVO = iOcrCutConfigTestService.findAll().get(0);
|
|
|
|
// OcrCutConfigTestVO ocrCutConfigTestVO = iOcrCutConfigTestService.findAll().get(0);
|
|
|
@ -99,7 +109,7 @@ public class FileController {
|
|
|
|
|
|
|
|
|
|
|
|
if (testData == 1) {
|
|
|
|
if (testData == 1) {
|
|
|
|
iPublishEventService.publishEvent(request.getPatientId(), FlowEvent.FlowTypeEnum.START_SEGMENT_TEST);
|
|
|
|
iPublishEventService.publishEvent(request.getPatientId(), FlowEvent.FlowTypeEnum.START_SEGMENT_TEST);
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
iPublishEventService.publishEvent(request.getPatientId(), FlowEvent.FlowTypeEnum.START_SEGMENT);
|
|
|
|
iPublishEventService.publishEvent(request.getPatientId(), FlowEvent.FlowTypeEnum.START_SEGMENT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -114,9 +124,9 @@ public class FileController {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
public OcrFileInfoTest singleUpload(@RequestPart("files") MultipartFile[] files, @Validated UploadBatchFileRequest request) throws Exception {
|
|
|
|
public OcrFileInfoTest singleUpload(@RequestPart("files") MultipartFile[] files, @Validated UploadBatchFileRequest request) throws Exception {
|
|
|
|
int testData = request.getTestData();
|
|
|
|
int testData = request.getTestData();
|
|
|
|
Double height = null ;
|
|
|
|
Double height = null;
|
|
|
|
Double widthStart= null;
|
|
|
|
Double widthStart = null;
|
|
|
|
Double widthEnd= null;
|
|
|
|
Double widthEnd = null;
|
|
|
|
|
|
|
|
|
|
|
|
// if (testData == 1) {
|
|
|
|
// if (testData == 1) {
|
|
|
|
// OcrCutConfigTestVO ocrCutConfigTestVO = iOcrCutConfigTestService.findAll().get(0);
|
|
|
|
// OcrCutConfigTestVO ocrCutConfigTestVO = iOcrCutConfigTestService.findAll().get(0);
|
|
|
|