Compare commits
4 Commits
47fb031221
...
8c3da0878e
Author | SHA1 | Date |
---|---|---|
|
8c3da0878e | |
|
ffbf766cee | |
|
b818eec318 | |
|
0a446e5f66 |
|
@ -141,10 +141,13 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
if (StrUtil.isEmpty(imageSource) || Objects.isNull(ImageSourceEnum.getByCode(imageSource))) {
|
||||
throw new ServiceException(Message.IMAGE_SOURCE_IS_NOT_EXIST);
|
||||
}
|
||||
PartResp partResp = partService.detail(partId);
|
||||
if(null == files || files.length == 0){
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
PartResp partResp = partService.detail(partId);
|
||||
if (Objects.isNull(partResp)) {
|
||||
throw new ServiceException(Message.PART_ID_IS_NOT_EXIST);
|
||||
}
|
||||
List<ImageReq> list = new ArrayList<>(files.length);
|
||||
File temCategory = new File(FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix());
|
||||
if (!temCategory.exists()) {
|
||||
|
|
|
@ -99,7 +99,7 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, PartEntity> impleme
|
|||
if(StrUtil.isNotEmpty(turbine.getProjectId())){
|
||||
ProjectEntity project = projectService.getById(turbine.getProjectId());
|
||||
if(null != project){
|
||||
resp.setProjectId(resp.getProjectId());
|
||||
resp.setProjectId(project.getProjectId());
|
||||
resp.setProjectName(project.getProjectName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,11 +61,16 @@ public class ImageController {
|
|||
return Result.ok(imageService.uploadProjectBatch(projectId, imageSource, collectReq, files));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "手动批量上传文件夹图像到项目(单张)", httpMethod = "POST")
|
||||
@PostMapping("/{projectId}/{imageSource}/upload")
|
||||
public Result<ImageReq> uploadProject(@PathVariable String projectId, @PathVariable String imageSource, ImageCollectReq collectReq, @RequestParam("file") MultipartFile file) {
|
||||
return Result.ok(imageService.uploadProjectBatch(projectId, imageSource, collectReq, new MultipartFile[]{file}).get(0));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "上传图像", httpMethod = "POST")
|
||||
@PostMapping("/{imageSource}/upload/{partId}")
|
||||
public Result<ImageReq> uploadOutWork(@PathVariable String imageSource, @PathVariable String partId, ImageCollectReq collectReq, @RequestParam("file") MultipartFile file) {
|
||||
MultipartFile[] files = {file};
|
||||
return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, files).get(0));
|
||||
return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, new MultipartFile[]{file}).get(0));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设置信息", httpMethod = "POST")
|
||||
|
|
Loading…
Reference in New Issue