master
周文涛 2 years ago
parent ffd6e0aadd
commit bf6a486208

@ -80,6 +80,7 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
Page<OcrIdentify> page = new Page<OcrIdentify>(pageNo, pageSize);
Map<String, OcrRuleCheckVo> ocrRuleCheckMap = ocrRuleCheckService.listToMap(null);
Map<String, OcrMetadataConfigVo> metadataConfigMap = ocrMetadataConfigService.listToMap(null);
Map<String, String> taskNameMap = ocrTaskTypeService.listNameToMap(null);
IPage<OcrIdentify> pageList = ocrIdentifyService.page(page, queryWrapper);
if (pageList != null && pageList.getRecords() != null) {
for (OcrIdentify record : pageList.getRecords()) {
@ -87,7 +88,10 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
record.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
OcrMetadataConfigVo ocrMetadataConfigVo = metadataConfigMap.get(ocrRuleCheckVo.getMetadataConfigId());
record.setTaskType_dictText(ocrMetadataConfigVo!=null?ocrMetadataConfigVo.getTaskType_dictText():null);
if (ocrMetadataConfigVo!=null) {
record.setTaskType(ocrMetadataConfigVo.getTaskType());
record.setTaskType_dictText(taskNameMap.get(ocrMetadataConfigVo.getTaskType()));
}
}
}
}
@ -235,4 +239,16 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
return super.importExcel(request, response, OcrIdentify.class);
}
@RequestMapping(value = "/pushNotice")
public Result<?> pushNotice(@RequestParam(name = "ids", required = true) String ids){
List<OcrIdentify> ocrIdentifyList = ocrIdentifyService.listByIds(Arrays.asList(ids.split(",")));
if (ocrIdentifyList==null|| ocrIdentifyList.size()==0) {
return Result.error("未获取到任务");
}
for (OcrIdentify ocrIdentify : ocrIdentifyList) {
AssertUtils.isTrue("1".equals(ocrIdentify.getStatus()),String.format("[任务名称]-%s 当前正在识别中,不可进行通知回调",ocrIdentify.getTaskName()));
}
return Result.OK("操作成功");
}
}

@ -113,7 +113,9 @@ public class OcrIdentify implements Serializable {
@ApiModelProperty(value = "请求id")
public String requestId;
/**通知状态 0待通知,1已通知*/
@ApiModelProperty(value = "通知状态 0待通知,1已通知")
public String noticeStatus;
//======================非数据库映射
/**任务类型_字段中文*/

@ -83,7 +83,7 @@ public class OcrTaskTypeServiceImpl extends ServiceImpl<OcrTaskTypeMapper, OcrTa
if (list==null || list.size()==0) {
return new HashMap<>();
}
Map<String, String> map = list.stream().collect(Collectors.toMap(OcrTaskType::getId, OcrTaskType::getTypeName));
Map<String, String> map = list.stream().filter(o->StringUtils.isNotBlank(o.getTypeName())).collect(Collectors.toMap(OcrTaskType::getId, OcrTaskType::getTypeName));
return map;
}
}

Loading…
Cancel
Save