|
@@ -450,6 +450,9 @@ public class AnalysisDataImpl {
|
|
|
StringBuilder wdHeight = new StringBuilder();
|
|
|
for (String name : names) {
|
|
|
if (name.contains("Anem") || name.contains("Vane")) {
|
|
|
+ if (name.contains("Ch15") && name.contains("0.00")) {
|
|
|
+ name = name.replace("0.00", "10.00");
|
|
|
+ }
|
|
|
String[] keys = name.split("_");
|
|
|
String b = getWsOrWd(keys[1], keys[5]);
|
|
|
//120
|
|
@@ -674,6 +677,12 @@ public class AnalysisDataImpl {
|
|
|
reader.addHeaderAlias(object.toString(), "time");
|
|
|
continue;
|
|
|
}
|
|
|
+ //todo 通道15解析出来有问题 临时做法
|
|
|
+ Object obj = object;
|
|
|
+ if (object.toString().contains("Ch15") && object.toString().contains("0.00")) {
|
|
|
+ object = object.toString().replace("0.00", "10.00");
|
|
|
+ }
|
|
|
+
|
|
|
String[] keys = object.toString().split("_");
|
|
|
//TODO改成传进去Ch1_Anem_140.00m_WNW_Avg_m/s 出来的是140风速的属性
|
|
|
//a = 最大 最小 平均值 标差
|
|
@@ -693,7 +702,7 @@ public class AnalysisDataImpl {
|
|
|
//判断该数据是否解析过
|
|
|
map.put(value, "1");
|
|
|
CheckDataRecode.map.put(value + "DeadDataStartTime", new DateTime(fileNames[1]));
|
|
|
- reader.addHeaderAlias(object.toString(), value);
|
|
|
+ reader.addHeaderAlias(obj.toString(), value);
|
|
|
}
|
|
|
List<Map<String, Object>> allData = reader.readAll();
|
|
|
//数据筛选
|
|
@@ -1014,17 +1023,19 @@ public class AnalysisDataImpl {
|
|
|
List<File> fileNameList = Arrays.asList(files1).stream().filter(f -> f.getName().contains(".elog")).collect(Collectors.toList());
|
|
|
//循环文件名
|
|
|
for (File fileNameForELog : fileNameList) {
|
|
|
-
|
|
|
String fileName = fileNameForELog.getName().substring(0, fileNameForELog.getName().indexOf(".elog"));
|
|
|
- String eqNo = fileName.substring(fileName.indexOf("ID") + 2, fileName.indexOf("_"));
|
|
|
+ //找出wnd文件
|
|
|
+ List<File> wndFile = Arrays.stream(files1).filter(f -> f.getName().contains(".wnd") && f.getName().contains(fileName)).collect(Collectors.toList());
|
|
|
+ HashMap<String, String> stringStringHashMap = this.parseWnd(wndFile.get(0));
|
|
|
+ String eqNo = stringStringHashMap.get("SiteNumber");
|
|
|
+
|
|
|
//移动原始文件
|
|
|
com.jiayue.biz.util.FileUtil.move(fileNameForELog.getPath(), eolFilePath + File.separator + eqNo);
|
|
|
//找出csv文件
|
|
|
List<File> csvFile = Arrays.stream(files1).filter(f -> f.getName().contains(".csv") && f.getName().contains(fileName)).collect(Collectors.toList());
|
|
|
- //找出wnd文件
|
|
|
- List<File> wndFile = Arrays.stream(files1).filter(f -> f.getName().contains(".wnd") && f.getName().contains(fileName)).collect(Collectors.toList());
|
|
|
+
|
|
|
if (csvFile.size() > 0 && wndFile.size() > 0) {
|
|
|
- parseEol(csvFile.get(0), wndFile.get(0), eqNo);
|
|
|
+ parseEol(csvFile.get(0), stringStringHashMap, eqNo);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1040,7 +1051,7 @@ public class AnalysisDataImpl {
|
|
|
|
|
|
|
|
|
//解析eol文件
|
|
|
- public void parseEol(File fileCsv, File wndFile, String eqNo) {
|
|
|
+ public void parseEol(File fileCsv, HashMap<String, String> stringStringHashMap, String eqNo) {
|
|
|
//todo 需要修改
|
|
|
// String s = "C:\\Users\\Administrator\\Desktop\\ID220810_20220919_180304_20230515_063537.log_20230515_063540.csv";
|
|
|
// //从文件中读取CSV数据
|
|
@@ -1085,7 +1096,6 @@ public class AnalysisDataImpl {
|
|
|
List<WindTowerInfo> collect = list.stream().filter(w -> w.getEquipmentNo().equals(eqNo)).collect(Collectors.toList());
|
|
|
if (collect.size() > 0) {
|
|
|
if (collect.get(0).getRecorderNo() == null) {
|
|
|
- HashMap<String, String> stringStringHashMap = this.parseWnd(wndFile);
|
|
|
String wsH = this.heightReverseOrder(wsHeight);
|
|
|
String wdH = this.heightReverseOrder(wdHeight);
|
|
|
WindTowerInfo windTowerInfo = new WindTowerInfo();
|
|
@@ -1126,7 +1136,7 @@ public class AnalysisDataImpl {
|
|
|
//从文件中读取CSV数据
|
|
|
File file = FileUtil.file(fileParent + File.separator + fileName);
|
|
|
file.renameTo(new File(fileParent + File.separator + xls));
|
|
|
- CsvData data = reader.read(new File(fileParent + File.separator + xls));
|
|
|
+ CsvData data = reader.read(file);
|
|
|
CsvRow row = data.getRow(1);
|
|
|
String Longitude = "";
|
|
|
String Latitude = "";
|
|
@@ -1181,7 +1191,10 @@ public class AnalysisDataImpl {
|
|
|
//层高
|
|
|
String height = "";
|
|
|
if (!s.contains("TI")) {
|
|
|
- height = CalculationUtil.getNumberFromString(s.substring(s.indexOf("WS")));
|
|
|
+ String[] strSp = wsAndType.split("_");
|
|
|
+ if (strSp.length > 0) {
|
|
|
+ height = CalculationUtil.getNumberFromString(strSp[1]);
|
|
|
+ }
|
|
|
wsHeight.add(height);
|
|
|
}
|
|
|
//ave/min/max/sta
|
|
@@ -1191,7 +1204,11 @@ public class AnalysisDataImpl {
|
|
|
} else if (s.contains("WD")) {
|
|
|
String wdAndType = s.substring(s.indexOf("WD"));
|
|
|
//层高
|
|
|
- String height = CalculationUtil.getNumberFromString(wdAndType);
|
|
|
+ String[] strSp = wdAndType.split("_");
|
|
|
+ String height = "";
|
|
|
+ if (strSp.length > 0) {
|
|
|
+ height = CalculationUtil.getNumberFromString(strSp[1]);
|
|
|
+ }
|
|
|
wdHeight.add(height);
|
|
|
//ave/min/max/sta
|
|
|
String type = this.assembleProperty(wdAndType);
|