进度识别

This commit is contained in:
lcj
2025-12-02 16:12:07 +08:00
parent 40559d4d73
commit 4e3faa7a23

View File

@ -1220,7 +1220,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
@Override
public CompletableFuture<Boolean> recognizeAsync(Long bigPictureId, String fileUrl, String tifUrl, List<Long> projectIds) {
// 调用识别算法
RecognizeVo recognizeVo = null;
RecognizeVo recognizeVo;
try {
recognizeVo = recognizerManager.recognize(fileUrl);
} catch (Exception e) {
@ -1278,18 +1278,20 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
}
// 将识别数据同步到图片上
Long recognizePic = null;
try {
RecognizeImageStreamResult drawnImage = RecognizerManager.drawImageToStream(fileUrl, targets);
InputStream inputStream = drawnImage.getInputStream();
String contentType = drawnImage.getContentType();
long length = drawnImage.getLength();
SysOssVo drawnVo = ossService.upload(inputStream, fileName, contentType, length);
if (drawnVo != null) {
recognizePic = drawnVo.getOssId();
if (CollUtil.isNotEmpty(recognizerVoList)) {
try {
RecognizeImageStreamResult drawnImage = RecognizerManager.drawImageToStream(fileUrl, targets);
InputStream inputStream = drawnImage.getInputStream();
String contentType = drawnImage.getContentType();
long length = drawnImage.getLength();
SysOssVo drawnVo = ossService.upload(inputStream, fileName, contentType, length);
if (drawnVo != null) {
recognizePic = drawnVo.getOssId();
}
} catch (IOException | URISyntaxException e) {
log.error("将识别数据同步到图片上失败", e);
return CompletableFuture.completedFuture(false);
}
} catch (IOException | URISyntaxException e) {
log.error("将识别数据同步到图片上失败", e);
return CompletableFuture.completedFuture(false);
}
String recognizerStr = JSONUtil.toJsonStr(recognizerVoList);
// 更新数据和状态
@ -1299,10 +1301,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl<PgsProgressPla
.set(DroDroneBigPicture::getRecognizePic, recognizePic)
.set(DroDroneBigPicture::getRecognizeResult, recognizerStr)
.update();
if (!update) {
return CompletableFuture.completedFuture(false);
}
return CompletableFuture.completedFuture(true);
return CompletableFuture.completedFuture(update);
}
/**