ljy121 1 éve
szülő
commit
ed5b5b43d1

+ 1 - 0
zjugis-business/src/main/java/com/zjugis/business/constants/ResponseStatusEnum.java

@@ -14,6 +14,7 @@ public enum ResponseStatusEnum {
     PROJECT_MILESTONE_FINISHED(2110,"项目里程碑已完成,请勿重复操作"),
     PROJECT_CONTRACT_RELATED(2120,"项目已存在关联合同"),
 
+    PROJECT_NOT_EXIST(2132,"项目不存在"),
     CONTRACT_NOT_EXIST(2131,"合同不存在"),
 
     CONTRACT_SUB_SUB_EXIST(2150,"存在进行中的分包签订流程"),

+ 4 - 1
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectServiceImpl.java

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

+ 0 - 2
zjugis-business/src/main/resources/application-dev.yaml

@@ -98,5 +98,3 @@ contract:
 
 file:
   client: 11
-file:
-  client: 11

+ 0 - 2
zjugis-business/src/main/resources/application-prod.yaml

@@ -97,5 +97,3 @@ contract:
 
 file:
   client: 11
-file:
-  client: 11