|
|
|
@ -91,6 +91,12 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getTaskName())) {
|
|
|
|
|
ocrIdentify.setTaskName("*"+ocrIdentify.getTaskName()+"*");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getIdentifyUrl())) {
|
|
|
|
|
ocrIdentify.setIdentifyUrl("*"+ocrIdentify.getIdentifyUrl()+"*");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getCreateBy())) {
|
|
|
|
|
ocrIdentify.setCreateBy("*"+ocrIdentify.getCreateBy()+"*");
|
|
|
|
|
}
|
|
|
|
|
Date startTime=ocrIdentify.getStartTime();
|
|
|
|
|
Date endTime=ocrIdentify.getEndTime();
|
|
|
|
|
if (startTime!=null&&endTime!=null) {
|
|
|
|
@ -102,33 +108,13 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
|
queryWrapper.between("startTime",startTime,endTime);
|
|
|
|
|
queryWrapper.between("endTime",startTime,endTime);
|
|
|
|
|
}
|
|
|
|
|
Page<OcrIdentify> page = new Page<OcrIdentify>(pageNo, pageSize);
|
|
|
|
|
Page<OcrIdentify> page = new Page<>(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) {
|
|
|
|
|
List<String> idList = pageList.getRecords().stream().map(p -> p.getId()).collect(Collectors.toList());
|
|
|
|
|
List<OcrIdentifyDetail> ocrIdentifyDetailList = null;
|
|
|
|
|
if (idList.size()>0) {
|
|
|
|
|
ocrIdentifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().in(OcrIdentifyDetail::getIdentifyId, idList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<OcrIdentifyDetail> identifyDetailList = new ArrayList<>();
|
|
|
|
|
for (OcrIdentify record : pageList.getRecords()) {
|
|
|
|
|
if ("1".equals(record.getStatus()) &&ocrIdentifyDetailList!=null&&ocrIdentifyDetailList.size()>0) {
|
|
|
|
|
//判断明细是否识别成功
|
|
|
|
|
identifyDetailList = ocrIdentifyDetailList.stream().filter(o -> o.getIdentifyId().equals(record.getId())).collect(Collectors.toList());
|
|
|
|
|
if (identifyDetailList.size()>0) {
|
|
|
|
|
long errorCount = identifyDetailList.stream().filter(i -> i.getStatus().equals("1")).count();
|
|
|
|
|
//errorCount>0,说明有失败的明细
|
|
|
|
|
record.setTaskResult(errorCount>0?"0":"1");
|
|
|
|
|
}else{
|
|
|
|
|
//失败
|
|
|
|
|
record.setTaskResult("0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
OcrRuleCheckVo ocrRuleCheckVo = ocrRuleCheckMap.get(record.getRuleCheck());
|
|
|
|
|
if (ocrRuleCheckVo!=null && StringUtils.isNotBlank(ocrRuleCheckVo.getMetadataConfigId())) {
|
|
|
|
|
record.setMetadataConfigId(ocrRuleCheckVo.getMetadataConfigId());
|
|
|
|
@ -337,9 +323,6 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
|
|
|
|
|
for (OcrIdentify ocrIdentify : ocrIdentifyList) {
|
|
|
|
|
AssertUtils.isTrue("1".equals(ocrIdentify.getStatus()),String.format("[任务名称]-%s 当前正在识别中,不可进行通知回调",ocrIdentify.getTaskName()));
|
|
|
|
|
}
|
|
|
|
|
for (OcrIdentify ocrIdentify : ocrIdentifyList) {
|
|
|
|
|
ocrIdentify.setNoticeStatus("1");
|
|
|
|
|
}
|
|
|
|
|
for (String identifyId : Arrays.asList(ids.split(","))) {
|
|
|
|
|
ocrIdentifyService.callbackWly(identifyId);
|
|
|
|
|
}
|
|
|
|
|