master
周文涛 2 years ago
parent 727f25379f
commit 134a86233a

@ -205,7 +205,7 @@ public class ApiController {
@Async
public Result restartTask() throws InterruptedException {
//获取未执行完的任务
List<OcrIdentify> list = ocrIdentifyService.list(new LambdaQueryWrapper<OcrIdentify>().eq(OcrIdentify::getStatus, "0"));
List<OcrIdentify> list = ocrIdentifyService.list(new LambdaQueryWrapper<OcrIdentify>().in(OcrIdentify::getStatus, "0","2"));
List<String> identifyIdList = list.stream().map(l -> l.getId()).collect(Collectors.toList());
if (identifyIdList.size()>0) {
ocrIdentifyDetailService.remove(new LambdaQueryWrapper<OcrIdentifyDetail>().in(OcrIdentifyDetail::getIdentifyId,identifyIdList));

@ -110,7 +110,6 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
List<OcrIdentifyDetail> ocrIdentifyDetailList = null;
if (idList.size()>0) {
ocrIdentifyDetailList = ocrIdentifyDetailService.list(new LambdaQueryWrapper<OcrIdentifyDetail>().in(OcrIdentifyDetail::getIdentifyId, idList));
}
List<OcrIdentifyDetail> identifyDetailList = new ArrayList<>();
@ -202,7 +201,7 @@ public class OcrIdentifyController extends JeecgController<OcrIdentify, IOcrIden
public Result<String> edit(@RequestBody OcrIdentify ocrIdentify) {
AssertUtils.notEmpty(ocrIdentify.getId(), "[id]不可为空");
OcrIdentify identify = ocrIdentifyService.getById(ocrIdentify.getId());
if ("0".equals(identify.getStatus()) || "1".equals(identify.getStatus())) {
if (Arrays.asList("0","1","2").contains(identify.getStatus())) {
throw new JeecgBootException("当前状态不可编辑");
}
ocrIdentifyService.updateById(ocrIdentify);

@ -149,7 +149,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
probability = ocrItem.getDouble("probability");//置信度
log.info("ocrItem:");
log.info(ocrItem.toJSONString());
if (StringUtils.isBlank(text)) {
//ocr识别参数为空不通过
rMessage.append(value.getFieldName() + "参数未获取到结果<br>");
@ -178,8 +177,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
}
} else {
rMessage.append(value.getFieldName() + "_未查到ocr结果<br>");
ocrResultAdd(ocrResultList, field, inputText, null, 0d, imgPath, "ocr结果未获取", false);
rMessage.append(value.getFieldName() + "参数未获取到结果<br>");
ocrResultAdd(ocrResultList, field, inputText, null, 0d, imgPath, "参数未获取到结果", false);
fieldRightMap.put(field, false);
}
}
@ -489,6 +488,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
public void updateMasterTaskStartTime(String id) {
LambdaUpdateWrapper<OcrIdentify> updateWrapper=new LambdaUpdateWrapper<>();
updateWrapper.set(OcrIdentify::getStartTime,new Date());
updateWrapper.set(OcrIdentify::getStatus,"2");
updateWrapper.isNull(OcrIdentify::getStartTime);
updateWrapper.eq(OcrIdentify::getId,id);
super.update(updateWrapper);

Loading…
Cancel
Save