|
|
|
@ -476,7 +476,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@Async
|
|
|
|
|
public void executeTask() {
|
|
|
|
|
//获取任务
|
|
|
|
|
List<TaskModel> taskList = getTaskList();
|
|
|
|
@ -546,8 +545,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
//睡眠
|
|
|
|
|
try {
|
|
|
|
|
String parameter = taskModel.getParameter();
|
|
|
|
|
log.info("打印taskModel:");
|
|
|
|
|
log.info(taskModel.toString());
|
|
|
|
|
// 任务类型
|
|
|
|
|
if ("identify".equals(taskModel.getTaskType())) {
|
|
|
|
|
String[] parameters = parameter.split(",");
|
|
|
|
@ -559,8 +556,9 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
requestBody.put("task_id", task_id);
|
|
|
|
|
requestBody.put("img_path", image);
|
|
|
|
|
JSONObject semanticResponseJson = RestUtil.post(OcrConstant.api_test2_identify_url, requestBody);
|
|
|
|
|
//semanticResponseJson = JSONObject.parseObject("{\"医院名称\":[{\"area\":[[361,93],[623,39],[630,73],[368,127]],\"end\":6,\"ocrText\":\"黑石社区医院\",\"probability\":0.9874083762059627,\"start\":0,\"text\":\"黑石社区医院\"}],\"姓名\":[],\"时间\":[],\"科室\":[]}");
|
|
|
|
|
semanticResponseJson.put("identifyId", masterTaskId);
|
|
|
|
|
log.info("ocr识别返回数据:");
|
|
|
|
|
log.info(semanticResponseJson.toJSONString());
|
|
|
|
|
this.getSemanticInfo(semanticResponseJson);
|
|
|
|
|
//该子任务已执行,判断主任务是否残留
|
|
|
|
|
String masterTask = (String) redisUtil.get("identify_" + masterTaskId);
|
|
|
|
|