|
@@ -11,7 +11,6 @@ import java.util.Set;
|
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.uas.search.console.core.util.FastjsonUtils;
|
|
|
|
|
import com.uas.search.console.model.ComponentSimpleInfo;
|
|
import com.uas.search.console.model.ComponentSimpleInfo;
|
|
|
import com.uas.search.console.model.PropertyValue;
|
|
import com.uas.search.console.model.PropertyValue;
|
|
|
|
|
|
|
@@ -73,7 +72,7 @@ public class MergeComponentData {
|
|
|
try {
|
|
try {
|
|
|
componentReader = new BufferedReader(new FileReader(DATA_DIR + "\\Component.txt"));
|
|
componentReader = new BufferedReader(new FileReader(DATA_DIR + "\\Component.txt"));
|
|
|
propertyValueReader = new BufferedReader(new FileReader(DATA_DIR + "\\PropertyValue.txt"));
|
|
propertyValueReader = new BufferedReader(new FileReader(DATA_DIR + "\\PropertyValue.txt"));
|
|
|
- printWriter = new PrintWriter(DATA_DIR + "\\merged\\ComponentWithProperty_" + fileIndex + ".txt");
|
|
|
|
|
|
|
+ printWriter = new PrintWriter(DATA_DIR + "\\components\\ComponentWithProperty_" + fileIndex + ".txt");
|
|
|
// 第一行内容为列名,不做解析
|
|
// 第一行内容为列名,不做解析
|
|
|
componentReader.readLine();
|
|
componentReader.readLine();
|
|
|
propertyValueReader.readLine();
|
|
propertyValueReader.readLine();
|
|
@@ -91,7 +90,8 @@ public class MergeComponentData {
|
|
|
printWriter.flush();
|
|
printWriter.flush();
|
|
|
printWriter.close();
|
|
printWriter.close();
|
|
|
fileIndex++;
|
|
fileIndex++;
|
|
|
- printWriter = new PrintWriter(DATA_DIR + "\\merged\\ComponentWithProperty_" + fileIndex + ".txt");
|
|
|
|
|
|
|
+ printWriter = new PrintWriter(
|
|
|
|
|
+ DATA_DIR + "\\components\\ComponentWithProperty_" + fileIndex + ".txt");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ComponentSimpleInfo component = parseComponent(componentLine);
|
|
ComponentSimpleInfo component = parseComponent(componentLine);
|
|
@@ -110,7 +110,7 @@ public class MergeComponentData {
|
|
|
}
|
|
}
|
|
|
component.setProperties(properties);
|
|
component.setProperties(properties);
|
|
|
System.out.println(component);
|
|
System.out.println(component);
|
|
|
- printWriter.println(FastjsonUtils.toJson(component));
|
|
|
|
|
|
|
+ printWriter.println(JSONObject.toJSONString(component));
|
|
|
}
|
|
}
|
|
|
printWriter.flush();
|
|
printWriter.flush();
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
@@ -135,7 +135,7 @@ public class MergeComponentData {
|
|
|
private static void readData() {
|
|
private static void readData() {
|
|
|
BufferedReader br = null;
|
|
BufferedReader br = null;
|
|
|
try {
|
|
try {
|
|
|
- br = new BufferedReader(new FileReader(DATA_DIR + "\\merged\\ComponentWithProperty_1.txt"));
|
|
|
|
|
|
|
+ br = new BufferedReader(new FileReader(DATA_DIR + "\\components\\ComponentWithProperty_1.txt"));
|
|
|
String line = br.readLine();
|
|
String line = br.readLine();
|
|
|
System.out.println(JSONObject.parseObject(line, ComponentSimpleInfo.class));
|
|
System.out.println(JSONObject.parseObject(line, ComponentSimpleInfo.class));
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|