Compare commits

..

No commits in common. "8c3da0878e2b505ce060c2a56debc44dce1207b9" and "47fb03122189a6148effc04f90fb790846e35ce2" have entirely different histories.

3 changed files with 4 additions and 12 deletions

View File

@ -141,13 +141,10 @@ 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()) {

View File

@ -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(project.getProjectId());
resp.setProjectId(resp.getProjectId());
resp.setProjectName(project.getProjectName());
}
}

View File

@ -61,16 +61,11 @@ 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) {
return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, new MultipartFile[]{file}).get(0));
MultipartFile[] files = {file};
return Result.ok(imageService.batchUploadDefectImage(partId, imageSource, collectReq, files).get(0));
}
@ApiOperation(value = "设置信息", httpMethod = "POST")