|
@@ -1229,6 +1229,26 @@ public class AnalysisDataImpl {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public boolean windTowerInfoType(String id) {
|
|
|
+ List<WindTowerInfo> equipmentNo = windTowerInfoService.getByEquipmentNo(id);
|
|
|
+ List<EmailWindTowerInfo> emailWindTowerInfos = emailWindTowerInfoService.lambdaQuery().eq(EmailWindTowerInfo::getEquipmentNo, id).list();
|
|
|
+ if (equipmentNo.size() != 0 && emailWindTowerInfos.size() != 0) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ if (emailWindTowerInfos.size() == 0) {
|
|
|
+ //如果测风塔里面没有这个塔并且邮件测风塔里也没有这个塔 则添加到邮箱读取的测风塔表中
|
|
|
+ EmailWindTowerInfo emailWindTowerInfo = new EmailWindTowerInfo();
|
|
|
+ emailWindTowerInfo.setEquipmentNo(id);
|
|
|
+ emailWindTowerInfoService.save(emailWindTowerInfo);
|
|
|
+ log.info(id + " 测风塔信息里没有这个的塔 并且邮件测风塔里也没有这个塔");
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* dat文件解析
|
|
|
*/
|
|
@@ -1256,28 +1276,31 @@ public class AnalysisDataImpl {
|
|
|
rowsOne.set(i, wsOrWdOrTOrRhOrPa);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
List<WindTowerInfo> equipmentNo = windTowerInfoService.getByEquipmentNo(windTowerInfo.getEquipmentNo());
|
|
|
+ if (windTowerInfoType(windTowerInfo.getEquipmentNo())) {
|
|
|
+ if (equipmentNo.size() == 0) {
|
|
|
+ windTowerInfo.setHeights(height.toString());
|
|
|
+ windTowerInfo.setWdHeights(height.toString());
|
|
|
+ windTowerInfoService.saveOrUpdate(windTowerInfo);
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> mapList = parseByHead(rows, rowsOne);
|
|
|
+ List<Map<String, Object>> mapList1 = new CheckDataRecode().checkValue(mapList, "dat");
|
|
|
+ windTowerDataParentTableService.packageData(mapList1, windTowerInfo.getEquipmentNo(), "dat", "");
|
|
|
+ //将后缀名修改回来
|
|
|
+ String newFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".dat";
|
|
|
+ File file1 = new File(dec + newFileName);
|
|
|
+ newFile.renameTo(file1);
|
|
|
+ try {
|
|
|
+ com.jiayue.biz.util.FileUtil.move(file1.getPath(), eolFilePath + File.separator + windTowerInfo.getEquipmentNo());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("dat文件转移失败");
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- if (equipmentNo.size() == 0) {
|
|
|
- windTowerInfo.setHeights(height.toString());
|
|
|
- windTowerInfo.setWdHeights(height.toString());
|
|
|
- windTowerInfoService.saveOrUpdate(windTowerInfo);
|
|
|
- }
|
|
|
- List<Map<String, Object>> mapList = parseByHead(rows, rowsOne);
|
|
|
- List<Map<String, Object>> mapList1 = new CheckDataRecode().checkValue(mapList, "dat");
|
|
|
- windTowerDataParentTableService.packageData(mapList1, windTowerInfo.getEquipmentNo(), "dat", "");
|
|
|
- //将后缀名修改回来
|
|
|
- String newFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".dat";
|
|
|
- File file1 = new File(dec + newFileName);
|
|
|
- newFile.renameTo(file1);
|
|
|
- try {
|
|
|
- com.jiayue.biz.util.FileUtil.move(file1.getPath(), eolFilePath + File.separator + windTowerInfo.getEquipmentNo());
|
|
|
- } catch (Exception e) {
|
|
|
- log.info("dat文件转移失败");
|
|
|
- throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> parseByHead(List<CsvRow> rows, CsvRow rowsOne) {
|