master
周文涛 2 years ago
parent 2d97e7342c
commit 183384e84a

@ -114,7 +114,11 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
Map<String, String> taskNameMap = ocrTaskTypeService.listNameToMap(null);
IPage<OcrIdentify> pageList = ocrIdentifyService.page(page, queryWrapper);
if (pageList != null && pageList.getRecords() != null) {
List<String> identifyIdList = pageList.getRecords().stream().map(p -> p.getId()).collect(Collectors.toList());
List<OcrIdentifyDetail> identifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().in(OcrIdentifyDetail::getIdentifyId));
for (OcrIdentify record : pageList.getRecords()) {
long count = identifyDetailList.stream().filter(i -> i.getIdentifyId().equals(record.getId())).count();
record.setImgNum(count);
if (StringUtils.isNotBlank(record.getTaskResultInfo())) {
List<OcrResult2> ocrResult2s = JSONObject.parseArray(record.getTaskResultInfo()).toJavaList(OcrResult2.class);
int tagNum = ocrResult2s.size();

@ -151,5 +151,8 @@ public class OcrIdentify implements Serializable {
private Integer tagSuccessNum=0;
@TableField(exist = false)
private String successRate="0";
@TableField(exist = false)
private Long imgNum;//图片数量
//================================================================
}

@ -291,7 +291,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
updateWrapper.set(OcrIdentify::getErrorMsg, errorMsg);
updateWrapper.set(OcrIdentify::getTaskResult, 0);
fieldMapFor: for (String s : fieldMap.keySet()) {
if (successFields.contains(s)) {
updateWrapper.set(OcrIdentify::getTaskResult, 1);
@ -301,6 +300,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
}
String taskResultInfo = JSONArray.toJSONString(ocrResults);
updateWrapper.set(OcrIdentify::getStatus,"1");
updateWrapper.set(OcrIdentify::getEndTime,new Date());
updateWrapper.set(OcrIdentify::getTaskResultInfo,taskResultInfo);
}
}

Loading…
Cancel
Save