郭超 4 years ago
parent
commit
171010e076

+ 3 - 3
src/main/java/edu/nju/service/NginxFileService.java

@@ -122,11 +122,11 @@ public class NginxFileService implements FileService {
     private List<BugDetail> saveBugDetail(MultipartFile sourceZipFile, MultipartFile sourceJsonFile, String originalCaseId,String cpSerialNum){
     private List<BugDetail> saveBugDetail(MultipartFile sourceZipFile, MultipartFile sourceJsonFile, String originalCaseId,String cpSerialNum){
         try {
         try {
             //读取文件流并保存在本地
             //读取文件流并保存在本地
-            String zipFilePath = savePath+ folderName + inputName + "/imageZip/"+originalCaseId+"/"+cpSerialNum+"/"+originalCaseId+".zip";
+            String zipFilePath = savePath + folderName + inputName + "/imageZip/"+originalCaseId+"/"+cpSerialNum+"/"+originalCaseId+".zip";
             File zipFile=new File(zipFilePath);
             File zipFile=new File(zipFilePath);
             if(!zipFile.getParentFile().exists()) { zipFile.getParentFile().mkdirs(); }
             if(!zipFile.getParentFile().exists()) { zipFile.getParentFile().mkdirs(); }
             if(!sourceZipFile.isEmpty()) { sourceZipFile.transferTo(zipFile); }
             if(!sourceZipFile.isEmpty()) { sourceZipFile.transferTo(zipFile); }
-            String jsonFilePath = savePath+ folderName + inputName + "/"+originalCaseId+"/"+cpSerialNum+"/"+originalCaseId+".json";
+            String jsonFilePath = savePath + folderName + inputName + "/"+originalCaseId+"/"+cpSerialNum+"/"+originalCaseId+".json";
             File jsonFile=new File(jsonFilePath);
             File jsonFile=new File(jsonFilePath);
             if(!jsonFile.getParentFile().exists()) { jsonFile.getParentFile().mkdirs(); }
             if(!jsonFile.getParentFile().exists()) { jsonFile.getParentFile().mkdirs(); }
             if(!sourceJsonFile.isEmpty()) { sourceJsonFile.transferTo(jsonFile); }
             if(!sourceJsonFile.isEmpty()) { sourceJsonFile.transferTo(jsonFile); }
@@ -160,7 +160,7 @@ public class NginxFileService implements FileService {
                 bugDetailDao.save(bugDetail);
                 bugDetailDao.save(bugDetail);
             }
             }
             //解压图片文件,保存至本地
             //解压图片文件,保存至本地
-            String destPath = savePath+ folderName + inputName + "/imageUnzip/"+originalCaseId+"/"+cpSerialNum;
+            String destPath = savePath + folderName + inputName + "/imageUnzip/"+originalCaseId+"/"+cpSerialNum;
             File unzipFile=new File(destPath);
             File unzipFile=new File(destPath);
             if(!unzipFile.getParentFile().exists()) { unzipFile.getParentFile().mkdirs(); }
             if(!unzipFile.getParentFile().exists()) { unzipFile.getParentFile().mkdirs(); }
             unZip(zipFile,destPath,originalCaseId,cpSerialNum);
             unZip(zipFile,destPath,originalCaseId,cpSerialNum);

+ 1 - 14
src/main/java/edu/nju/service/OssFileService.java

@@ -473,24 +473,11 @@ public class OssFileService implements FileService {
 		String jsonObjectName = folderName.substring(1) + outputName + "/"+caseId+"/"+cpSerialNum+"/" + jsonFile.getName();
 		String jsonObjectName = folderName.substring(1) + outputName + "/"+caseId+"/"+cpSerialNum+"/" + jsonFile.getName();
 		uploadToOss(csvObjectName,csvFile);
 		uploadToOss(csvObjectName,csvFile);
 		uploadToOss(jsonObjectName,jsonFile);
 		uploadToOss(jsonObjectName,jsonFile);
-		//导出图片zip包
-//		String sourceFile = savePath + folderName + "/" + UploadType.IMAGE + caseId;
-//		try {
-//			File dest = new File(savePath + folderName + outputName + "/imageZip/" + caseId + ".zip");
-//			if (!dest.getParentFile().exists()) {
-//				dest.getParentFile().mkdirs();
-//			}
-//			FileOutputStream fileOutputStream = new FileOutputStream(dest);
-//			toZip(sourceFile, fileOutputStream, false);
-//			uploadToOss(jsonObjectName,jsonFile);
-//		} catch (FileNotFoundException e) {
-//			e.printStackTrace();
-//		}
 	}
 	}
 
 
 	private File exportJson(List<BugDetail> bugDetailList, String caseId) {
 	private File exportJson(List<BugDetail> bugDetailList, String caseId) {
 		try {
 		try {
-			File file = new File(savePath+ folderName + outputName + "/" + caseId + "/" + caseId + ".json");
+			File file = new File(savePath + folderName + outputName + "/" + caseId + "/" + caseId + ".json");
 			if(!file.getParentFile().exists()) { file.getParentFile().mkdirs(); }
 			if(!file.getParentFile().exists()) { file.getParentFile().mkdirs(); }
 			JSONArray jsonArray = new JSONArray(bugDetailList);
 			JSONArray jsonArray = new JSONArray(bugDetailList);
 			Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);
 			Writer write = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);