add:加载载具图片页面

This commit is contained in:
zhangzq
2025-09-19 10:13:12 +08:00
parent 6c10720ea8
commit dd2263626b
2 changed files with 68 additions and 0 deletions

View File

@@ -91,6 +91,8 @@ public class BsrealStorattrController {
public ResponseEntity<Object> getFile(@PathVariable String filename) {
try {
String imagePath = HikvisionSnapshotUtil.path+ DateUtil.thisYear();
//文件名称后缀是jpg具体以实际为准。文件路径是path+当前年份,在存储时也是一样
//文件会存储两份:一个是载具编号.jpg一个是载具编号_任务号.jpg载具编号的图片会进行替换为最新的
Path file = Paths.get(imagePath).resolve(filename+".jpg");
org.springframework.core.io.Resource resource = new UrlResource(file.toUri());
if (resource.exists() && resource.isReadable()) {