|
@@ -516,6 +516,9 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
@Override
|
|
|
public IFlowMaterialsFile materialUpload(ProjectMaterialRequest projectMaterial) {
|
|
|
Project project = selectDOById(projectMaterial.getProjectId());
|
|
|
+ if(project == null) {
|
|
|
+ throw new ServiceException(ResponseStatusEnum.PROJECT_NOT_EXIST.getCode(),ResponseStatusEnum.PROJECT_NOT_EXIST.getMessage());
|
|
|
+ }
|
|
|
FileRequest fileRequest = new FileRequest();
|
|
|
MultipartFile file = projectMaterial.getFile();
|
|
|
fileRequest.setFile(file);
|
|
@@ -526,7 +529,7 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
String path = "workFlow" + flowInstance.getFlowMark() + "/"
|
|
|
+ flowInstance.getCode() + "/"
|
|
|
+ new SimpleDateFormat("yyyy-MM-dd").format(new Date())
|
|
|
- + projectMaterial.getPrePath();
|
|
|
+ + projectMaterial.getPrePath() + "/" + file.getOriginalFilename();
|
|
|
fileRequest.setPath(path);
|
|
|
CommonResult<FileResponse> res = fileClient.uploadFile(fileRequest);
|
|
|
FileResponse fileResponse = res.getCheckedData();
|