fix: 解决没有开启获取hash值问题

fix/localPictureUrlIsNotNull
shuliYao 1 year ago
parent 294463c6a1
commit cb3c46e5a3

@ -22,7 +22,7 @@ public class TaskRunner implements CommandLineRunner {
TaskThreadPool taskThreadPool = new TaskThreadPool();
taskThreadPool.startPictureDisposePull();
taskThreadPool.startPictureImgToLocalPull();
// ImageDownloadMonitoring imageDownloadMonitoring = new ImageDownloadMonitoring();
// imageDownloadMonitoring.startImageDownloadMonitoring(localImagePath);
ImageDownloadMonitoring imageDownloadMonitoring = new ImageDownloadMonitoring();
imageDownloadMonitoring.startImageDownloadMonitoring(localImagePath);
}
}

@ -64,26 +64,26 @@ public class PictureImgToLocalTask implements Runnable {
if (ObjectUtil.isNotEmpty(picture)) {
picture.setLocalpictrueurl(pictureImgToLocal.getLocalPath());
picture.setIsdownload(1);
// try {
// picture.setLocalThumbnailUrl(ImageUtils.generateThumbnail(pictureImgToLocal.getLocalPath(),182));
// picture.setServerThumbnailUrl(ocrPictureService.getServerUrl()+ImageUtils.getFileName(picture.getLocalThumbnailUrl()));
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// Map<String, String> ocrPictureClassifyAndHash = ocrPictureService.getOcrPictureClassifyAndHash(picture.getLocalpictrueurl());
// if(ocrPictureClassifyAndHash!=null){
// picture.setImgHash(ocrPictureClassifyAndHash.get("hash"));
// picture.setClassificationid(ocrPictureClassifyAndHash.get("classId"));
// }
try {
picture.setLocalThumbnailUrl(ImageUtils.generateThumbnail(pictureImgToLocal.getLocalPath(),182));
picture.setServerThumbnailUrl(ocrPictureService.getServerUrl()+ImageUtils.getFileName(picture.getLocalThumbnailUrl()));
} catch (IOException e) {
throw new RuntimeException(e);
}
Map<String, String> ocrPictureClassifyAndHash = ocrPictureService.getOcrPictureClassifyAndHash(picture.getLocalpictrueurl());
if(ocrPictureClassifyAndHash!=null){
picture.setImgHash(ocrPictureClassifyAndHash.get("hash"));
picture.setClassificationid(ocrPictureClassifyAndHash.get("classId"));
}
// 获取拍照时间
// Long timestamp = ocrPictureService.getPhotoDateTime(picture);
// if(timestamp != 0L){
// picture.setPhotoDateTimestamp(timestamp);
// }
// ocrPictureService.updateById(picture);
ocrPictureService.updateById(picture);
logger.info("图片本地化,回写数据完成!");
logger.info("开启获取图片信息操作!");
// ocrPictureService.savePicturesInfo(picture);
ocrPictureService.savePicturesInfo(picture);
logger.info("获取图片信息操作,结束!");
}
}else{

Loading…
Cancel
Save