称重抓取

This commit is contained in:
2026-03-06 17:58:55 +08:00
parent 32f88b1443
commit 73c1bc9d01
4 changed files with 22 additions and 1 deletions

View File

@@ -55,4 +55,10 @@ public interface MaterialInfoService extends BaseService<MaterialInfoResp, Mater
* 照片批量上传处理
* */
void uploadMaterialPhotos(MultipartFile file);
/*
* 称重时照片抓取
* */
String catchPhoto(MultipartFile file);
}

View File

@@ -413,4 +413,13 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
.forEach(code -> log.warn("物料编码 [{}] 不存在,照片更新失败", code));
}
@Override
public String catchPhoto(MultipartFile file){
String photoStoragePath = "catch" + DateUtil.today() + "/";
FileInfo fileInfo = fileService.upload(file, photoStoragePath, null, true, true);
CheckUtils.throwIfEmpty(fileInfo.getUrl(),"上传失败,请重新上传");
return fileInfo.getUrl();
}
}