|
@@ -8,19 +8,16 @@ import cn.hutool.core.text.csv.CsvUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import cn.hutool.poi.excel.ExcelReader;
|
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
|
-import com.jiayue.biz.domain.*;
|
|
|
-import com.jiayue.biz.service.EmailService;
|
|
|
-import com.jiayue.biz.service.EmailWindTowerInfoService;
|
|
|
+import com.jiayue.biz.domain.EmailWindTowerInfo;
|
|
|
+import com.jiayue.biz.domain.WindTowerInfo;
|
|
|
import com.jiayue.biz.util.CalculationUtil;
|
|
|
import com.jiayue.biz.util.CoordinateUtil;
|
|
|
import com.jiayue.common.utils.file.FileUtils;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.xssf.streaming.SXSSFRow;
|
|
|
import org.apache.poi.xssf.streaming.SXSSFSheet;
|
|
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
|
|
import org.joda.time.DateTime;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -32,8 +29,6 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
-import java.util.zip.ZipEntry;
|
|
|
-import java.util.zip.ZipFile;
|
|
|
|
|
|
/**
|
|
|
* 采集数据解析实现类
|
|
@@ -660,7 +655,7 @@ public class AnalysisDataImpl {
|
|
|
List<Map<String, Object>> filterData = new CheckDataRecode().checkValue(allData, type);
|
|
|
String equipmentId = file.getName().substring(0, 4);
|
|
|
String eTime = file.getName().substring(4, 12);
|
|
|
- windTowerDataParentTableService.packageData(filterData, equipmentId, eTime, type, "");
|
|
|
+ windTowerDataParentTableService.packageData(filterData, equipmentId, eTime, type, "", null);
|
|
|
reader.close();
|
|
|
|
|
|
}
|
|
@@ -716,7 +711,7 @@ public class AnalysisDataImpl {
|
|
|
List<Map<String, Object>> filterData = new CheckDataRecode().checkValue(allData, type);
|
|
|
|
|
|
String eTime = file.getName().split("_")[1];
|
|
|
- windTowerDataParentTableService.packageData(filterData, eqId, eTime, type, "");
|
|
|
+ windTowerDataParentTableService.packageData(filterData, eqId, eTime, type, "", null);
|
|
|
reader.close();
|
|
|
}
|
|
|
|
|
@@ -940,7 +935,7 @@ public class AnalysisDataImpl {
|
|
|
//过滤数据
|
|
|
List<Map<String, Object>> mapList1 = new CheckDataRecode().checkValue(mapList, "sld");
|
|
|
|
|
|
- windTowerDataParentTableService.packageData(mapList1, eqId, time1, "sld", "");
|
|
|
+ windTowerDataParentTableService.packageData(mapList1, eqId, time1, "sld", "", null);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -1086,7 +1081,7 @@ public class AnalysisDataImpl {
|
|
|
String s1 = this.assembleWind(str, wsHeight, wdHeight);
|
|
|
//修改表头
|
|
|
csvRow.set(i, s1);
|
|
|
- if(str.equals("-")){
|
|
|
+ if (str.equals("-")) {
|
|
|
str = "-0.99";
|
|
|
}
|
|
|
hashMap.put(row.get(i), str);
|
|
@@ -1098,15 +1093,15 @@ public class AnalysisDataImpl {
|
|
|
}
|
|
|
this.emailWindTowerInfoSave(eqNo);
|
|
|
List<WindTowerInfo> list = windTowerInfoService.list();
|
|
|
- List<WindTowerInfo> collect = list.stream().filter(w -> w.getEquipmentNo().equals(eqNo)).collect(Collectors.toList());
|
|
|
- if (collect.size() > 0) {
|
|
|
- if (collect.get(0).getRecorderNo() == null) {
|
|
|
+ List<WindTowerInfo> windTowerInfos = list.stream().filter(w -> w.getEquipmentNo().equals(eqNo)).collect(Collectors.toList());
|
|
|
+ if (windTowerInfos.size() > 0) {
|
|
|
+ if (windTowerInfos.get(0).getRecorderNo() == null) {
|
|
|
String wsH = this.heightReverseOrder(wsHeight);
|
|
|
String wdH = this.heightReverseOrder(wdHeight);
|
|
|
WindTowerInfo windTowerInfo = new WindTowerInfo();
|
|
|
windTowerInfo.setEquipmentNo(eqNo);
|
|
|
windTowerInfo.setName(eqNo);
|
|
|
- windTowerInfo.setId(collect.get(0).getId());
|
|
|
+ windTowerInfo.setId(windTowerInfos.get(0).getId());
|
|
|
windTowerInfo.setType("email");
|
|
|
windTowerInfo.setHeights(wsH);
|
|
|
windTowerInfo.setWdHeights(wdH);
|
|
@@ -1123,7 +1118,7 @@ public class AnalysisDataImpl {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- windTowerDataParentTableService.packageData(dataList, eqNo, "", "eol", "");
|
|
|
+ windTowerDataParentTableService.packageData(dataList, eqNo, "", "eol", "", windTowerInfos.get(0));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1200,9 +1195,9 @@ public class AnalysisDataImpl {
|
|
|
//层高
|
|
|
String height = "";
|
|
|
if (!s.contains("TI")) {
|
|
|
- if(s.contains("K620Ab")){
|
|
|
+ if (s.contains("K620Ab")) {
|
|
|
height = "160A";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
String[] strSp = wsAndType.split("_");
|
|
|
if (strSp.length > 0) {
|
|
|
height = CalculationUtil.getNumberFromString(strSp[1]);
|
|
@@ -1235,7 +1230,7 @@ public class AnalysisDataImpl {
|
|
|
} else if (s.contains("TEM")) {
|
|
|
String type = this.assembleProperty(s);
|
|
|
str = "t" + type;
|
|
|
- }else if (s.contains("RH")) {
|
|
|
+ } else if (s.contains("RH")) {
|
|
|
String type = this.assembleProperty(s);
|
|
|
str = "rh" + type;
|
|
|
}
|