Compare commits

...

4 Commits

Author SHA1 Message Date
cuizhibin 8c3da0878e 合并问题 2025-08-05 20:27:44 +08:00
cuizhibin ffbf766cee 1.手动批量上传文件夹图像到项目(单张) 2025-08-05 20:24:55 +08:00
cuizhibin b818eec318 1.批量上传图像校验部件id是否存在 2025-08-05 20:24:55 +08:00
gaoxiong 0a446e5f66 招投标 2025-08-05 20:24:45 +08:00
3 changed files with 12 additions and 4 deletions

View File

@ -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()) {

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

View File

@ -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")