|
@@ -299,7 +299,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
}
|
|
|
}
|
|
|
//解析数据
|
|
|
- this.analysisData();
|
|
|
+ this.analysisData(equipmentNo);
|
|
|
} catch (Exception e) {
|
|
|
log.error("执行系统命令失败:" + e);
|
|
|
}
|
|
@@ -308,7 +308,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
/**
|
|
|
* 解析数据
|
|
|
*/
|
|
|
- public void analysisData() {
|
|
|
+ public void analysisData(String equipmentNo) {
|
|
|
String txtPath = FileUtil.getFileUploadPath() + File.separator + "txtFile" + File.separator;
|
|
|
String excelDir = FileUtil.getFileUploadPath() + File.separator + "excelFile" + File.separator;
|
|
|
File file = new File(txtPath);
|
|
@@ -326,7 +326,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
//txt转xls
|
|
|
analysisTXT(f.getPath(), excelFile);
|
|
|
//xls文件解析入库
|
|
|
- analysisExcel(new File(excelFile));
|
|
|
+ analysisExcel(new File(excelFile),equipmentNo);
|
|
|
//转换成xls文件后删除txt文件
|
|
|
f.delete();
|
|
|
//解析完成后删除xls文件
|
|
@@ -464,7 +464,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
*
|
|
|
* @param file 文件
|
|
|
*/
|
|
|
- public void analysisExcel(File file) {
|
|
|
+ public void analysisExcel(File file,String equipmentNo) {
|
|
|
String type = "rld";
|
|
|
ExcelReader reader = ExcelUtil.getReader(file, 0);
|
|
|
List<List<Object>> read = reader.read(0);
|
|
@@ -479,6 +479,11 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
reader.addHeaderAlias(object.toString(), "time");
|
|
|
continue;
|
|
|
}
|
|
|
+ //todo 通道15解析出来有问题 临时做法
|
|
|
+ Object obj = object;
|
|
|
+ if (object.toString().contains("Ch15") && object.toString().contains("0.00") && equipmentNo.equals("006180")) {
|
|
|
+ object = object.toString().replace("0.00", "10.00");
|
|
|
+ }
|
|
|
String[] keys = object.toString().split("_");
|
|
|
//TODO改成传进去Ch1_Anem_140.00m_WNW_Avg_m/s 出来的是140风速的属性
|
|
|
//a = 最大 最小 平均值 标差
|
|
@@ -498,7 +503,7 @@ public class DataRecalculationImpl implements DataRecalculationService {
|
|
|
//判断该数据是否解析过
|
|
|
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();
|
|
|
//数据筛选
|