|
@@ -28,10 +28,7 @@ import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.io.FileInputStream;
|
|
|
|
-import java.io.FileOutputStream;
|
|
|
|
-import java.io.ObjectInputStream;
|
|
|
|
-import java.io.ObjectOutputStream;
|
|
|
|
|
|
+import java.io.*;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -68,8 +65,6 @@ public class ExportProjectService {
|
|
|
|
|
|
this.writeProjectToFile(projectId, url);
|
|
this.writeProjectToFile(projectId, url);
|
|
this.getPatentsFromEs(projectId,url);
|
|
this.getPatentsFromEs(projectId,url);
|
|
- List<CustomField> customFields = this.getCustomFiled(projectId, url);
|
|
|
|
- this.getCustomFiledLabel(customFields, url);
|
|
|
|
String outUrl = FileUtils.getStaticPath("");
|
|
String outUrl = FileUtils.getStaticPath("");
|
|
String trueOutUrl = outUrl + "\\" + directoryName + ".zip";
|
|
String trueOutUrl = outUrl + "\\" + directoryName + ".zip";
|
|
ZipUtil.zip(url, trueOutUrl);
|
|
ZipUtil.zip(url, trueOutUrl);
|
|
@@ -82,8 +77,7 @@ public class ExportProjectService {
|
|
try {
|
|
try {
|
|
PatentProjectVO patentProjectVO=patentProjectService.getPatentProjectVOById(projectId);
|
|
PatentProjectVO patentProjectVO=patentProjectService.getPatentProjectVOById(projectId);
|
|
String projectUrl = url + "\\project.json";
|
|
String projectUrl = url + "\\project.json";
|
|
- ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(projectUrl));
|
|
|
|
- oos.writeObject(patentProjectVO);
|
|
|
|
|
|
+ FileUtils.writeJson(projectUrl,patentProjectVO);
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -136,12 +130,20 @@ public class ExportProjectService {
|
|
queryRequests.add(queryRequest1);
|
|
queryRequests.add(queryRequest1);
|
|
|
|
|
|
}
|
|
}
|
|
- String customFiledUrl = url + "\\patent" + index + ".json";
|
|
|
|
- try {
|
|
|
|
- ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(customFiledUrl));
|
|
|
|
- oos.writeObject(patents);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
|
+ for(PatentColumnDTO patent:patents){
|
|
|
|
+ String appNo =patent.getAppNo();
|
|
|
|
+ String patentDirectoryName =url+"\\"+appNo;
|
|
|
|
+ File patentDirectory =new File(patentDirectoryName);
|
|
|
|
+ if(!patentDirectory.exists())
|
|
|
|
+ {
|
|
|
|
+ patentDirectory.mkdir();
|
|
|
|
+ }
|
|
|
|
+ String patentName ="patentCategory.json";
|
|
|
|
+ String patentCategoryUrl =patentDirectoryName+"\\"+patentName;
|
|
|
|
+
|
|
|
|
+ FileUtils.writeJson(patentCategoryUrl,patent);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|