master
周文涛 2 years ago
parent f5d0781aa8
commit 568b57684b

@ -0,0 +1,57 @@
package org.jeecg.modules.ocr.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description
* @Author ZhouWenTao
* @Date 2023/7/19 11:03
*/
@RequestMapping(value = "/ocrApi")
@RestController
@Slf4j
public class OcrApiController {
/**
* 1. id[]
* 2. java
* id
*
*
* {
* "医院名称":[
* {
* "ocrText":"从北京到广东医科大学附属医院",
* "text": "广东医科大学附属医院",
* "area": []
* },{},{}
* ],
* "科室": [{}],
* "时间": [{}]
* "姓名": [{}]
* }
* )
* message: "成功"
* 0 1
*/
/**
* task_id: "11",
* img_path: "/usr/ssss/img.jpg"
* semantic_result:
* {
* "医院名称":[
* {
* "ocrText":"从北京到广东医科大学附属医院",
* "text": "广东医科大学附属医院",
* "area": []
* },
* ],
* "科室": [{}],
* "时间": [{}]
* "姓名": [{}]
* }
* message: "成功"
*/
}

@ -40,12 +40,14 @@ public class OcrTaskTypeServiceImpl extends ServiceImpl<OcrTaskTypeMapper, OcrTa
AssertUtils.notTrue(super.count(countQueryWrapper)>0,String.format("[%s]-已存在",ocrTaskType.getTypeName()));
}
//判断重复类型名
if (ocrTaskTypes.size()>0) {
Map<String, Long> countMap = ocrTaskTypes.stream().map(o->o.getTypeName()).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
if (countMap.keySet().size()>0) {
//有重复的类型名
String typeName = countMap.keySet().stream().filter(key -> countMap.get(key) > 1).distinct().collect(Collectors.joining(","));
AssertUtils.isEmpty(typeName,String.format("[%s]-重复了",typeName));
}
}
return true;
}

Loading…
Cancel
Save