|
@@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
+import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@Slf4j
|
|
@@ -70,9 +71,11 @@ public class UploadController extends BaseController {
|
|
|
if(!uploadToOssUtil.existKey(ossKey)){
|
|
|
throw new BusinessException(ResultCode.UPLOAD_BIM_ERROR);
|
|
|
}
|
|
|
- ProjectBim bim = projectBimService.getByProjectId(projectId);
|
|
|
- if(bim != null && !bim.getBimStatus().equals(BusinessStatus.ERROR.getInfo())){
|
|
|
- throw new BusinessException(ResultCode.UPLOAD_BIM_EXIST);
|
|
|
+ List<ProjectBim> bims = projectBimService.getByProjectId(projectId);
|
|
|
+ for (ProjectBim bim : bims) {
|
|
|
+ if(bim.getBimStatus().equals(BusinessStatus.DONE.getInfo())){
|
|
|
+ throw new BusinessException(ResultCode.UPLOAD_BIM_EXIST);
|
|
|
+ }
|
|
|
}
|
|
|
ProjectBim projectBim = new ProjectBim();
|
|
|
projectBim.setBimName(Objects.requireNonNull(file.getOriginalFilename()).split("\\.")[0]);
|