Compare commits
2 Commits
ae9a607da1
...
e4d6de61ae
| Author | SHA1 | Date | |
|---|---|---|---|
| e4d6de61ae | |||
| 73c1bc9d01 |
@@ -156,4 +156,4 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -55,4 +55,10 @@ public interface MaterialInfoService extends BaseService<MaterialInfoResp, Mater
|
|||||||
* 照片批量上传处理
|
* 照片批量上传处理
|
||||||
* */
|
* */
|
||||||
void uploadMaterialPhotos(MultipartFile file);
|
void uploadMaterialPhotos(MultipartFile file);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 称重时照片抓取
|
||||||
|
* */
|
||||||
|
String catchPhoto(MultipartFile file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -413,4 +413,13 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
|
|||||||
.forEach(code -> log.warn("物料编码 [{}] 不存在,照片更新失败", code));
|
.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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,4 +82,10 @@ public class MaterialInfoController extends BaseController<MaterialInfoService,
|
|||||||
baseService.uploadMaterialPhotos(zipFile);
|
baseService.uploadMaterialPhotos(zipFile);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
@Operation(summary = "照片抓取", description = "照片抓取")
|
||||||
|
@PostMapping("/import/catch")
|
||||||
|
public String catchPhoto(@RequestParam("file")MultipartFile file) {
|
||||||
|
CheckUtils.throwIfEmpty(file,"照片抓取失败,请重新抓取");
|
||||||
|
return baseService.catchPhoto(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user