فهرست منبع

修改查询基础数据逻辑 页面表单重置增加层高 测风塔数据修改同步mongo

hxf 2 سال پیش
والد
کامیت
13f304e208

+ 1 - 0
neim-biz/src/main/java/com/jiayue/biz/controller/WindTowerInfoController.java

@@ -178,6 +178,7 @@ public class WindTowerInfoController extends BaseController {
     @Log(title = "测风塔信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody WindTowerInfo windTowerInfo) {
+        windTowerInfoService.updateWindTowerInfo(windTowerInfo);
         return toAjax(windTowerInfoService.updateById(windTowerInfo) ? 1 : 0);
     }
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 4 - 2
neim-biz/src/main/java/com/jiayue/biz/job/AirDensityJob.java


+ 5 - 0
neim-biz/src/main/java/com/jiayue/biz/mapper/ProphaseAnemometryDataOrgMapper.java

@@ -23,4 +23,9 @@ public interface ProphaseAnemometryDataOrgMapper extends BaseMapper<ProphaseAnem
     @Select("SELECT t1.ts,t1.ws_ave,t1.wd_ave,t1.layer_height FROM prophase_anemometry_data_org t1 where  t1.equipment_id = #{equipmentId} and  t1.ts >= #{startTime} and t1.ts <= #{endTime}")
     List<ProphaseAnemometryData> selectAve(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
 
+
+
+    @Select("SELECT * FROM prophase_anemometry_data_org t1 where  t1.equipment_id = #{equipmentId} and  t1.ts >= #{startTime} and t1.ts <= #{endTime}")
+    List<ProphaseAnemometryData> selectAll(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
+
 }

+ 2 - 0
neim-biz/src/main/java/com/jiayue/biz/mapper/ProphaseWeatherDataOrgMapper.java

@@ -32,5 +32,7 @@ public interface ProphaseWeatherDataOrgMapper extends BaseMapper<ProphaseWeather
     int insertOneWithNew(ProphaseWeatherData one);
 
 
+    @Select("select * from weather_org_${equipmentId} where equipment_id = #{equipmentId} and ts >= #{startTime} and ts <= #{endTime}")
+    List<ProphaseWeatherData> selectPublicData(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
 
 }

+ 4 - 0
neim-biz/src/main/java/com/jiayue/biz/service/ProphaseAnemometryDataOrgService.java

@@ -16,4 +16,8 @@ public interface ProphaseAnemometryDataOrgService extends IService<ProphaseAnemo
     //单条保存
     void insertOneWithNew(ProphaseAnemometryData prophaseAnemometryData);
 
+
+    //查询所有数据
+    List<ProphaseAnemometryData> selectAll(String equipmentId, Timestamp startTime, Timestamp endTime);
+
 }

+ 4 - 1
neim-biz/src/main/java/com/jiayue/biz/service/ProphaseWeatherDataOrgService.java

@@ -11,9 +11,12 @@ public interface ProphaseWeatherDataOrgService extends IService<ProphaseWeatherD
     List<ProphaseWeatherData> selectTAveAndPaAveAndAir(String equipmentId, Timestamp startTime, Timestamp endTime);
 
     //批量保存
-    void insertSplice(List<ProphaseWeatherData> prophaseWeatherDataList,String equipmentId);
+    void insertSplice(List<ProphaseWeatherData> prophaseWeatherDataList, String equipmentId);
 
 
     void insertOne(ProphaseWeatherData prophaseWeatherData);
 
+    //查询所有数据
+    List<ProphaseWeatherData> selectPublicData(String equipmentId, Timestamp startTime, Timestamp endTime);
+
 }

+ 3 - 0
neim-biz/src/main/java/com/jiayue/biz/service/WindTowerInfoService.java

@@ -34,4 +34,7 @@ public interface WindTowerInfoService extends IService<WindTowerInfo> {
     String getWsHeights(String equipmentId);
 
 
+    //测风塔信息 修改 同步mongo
+    void updateWindTowerInfo(WindTowerInfo windTowerInfo);
+
 }

+ 41 - 32
neim-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -924,42 +924,27 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         HashMap<String, Object> dataMap = new HashMap<>();
         if (stationInfoList.size() > 0) {
             ArrayList<HashMap<String, Object>> arrayList = new ArrayList<>();
-            //根据风机类型分组
-            Map<String, List<FanTower>> modelMap = stationInfoList.get(0).getFanTowerList().stream()
-                    .collect(Collectors.groupingBy(FanTower::getFanModel));
-            //遍历map指定key
-            for (Map.Entry<String, List<FanTower>> entry : modelMap.entrySet()) {
-                for (FanModelData fanModelData : collect) {
-                    if (fanModelData.getModelName().equals(entry.getKey())) {
-                        HashMap<String, Object> map = new HashMap<>();
-                        //风机名称
-                        map.put("modelType", entry.getKey());
-                        //风机数量
-                        map.put("modelTotal", entry.getValue().size());
-                        //满发小时数
-                        map.put("wsAve", fanModelData.getWsAve());
-                        //主风向
-                        map.put("wdSum", fanModelData.getWdSum());
-                        //发电量
-                        map.put("generatingCapacity", fanModelData.getGeneratingCapacity());
-                        //满发小时数
-                        map.put("realTimeTotal", fanModelData.getRealTimeTotal());
-                        arrayList.add(map);
-
-                    }
+            if (stationInfoList.get(0).getStationBasicInfo().getStationType().equals("风")) {
+                //根据风机类型分组
+                Map<String, List<FanTower>> modelMap = stationInfoList.get(0).getFanTowerList().stream()
+                        .collect(Collectors.groupingBy(FanTower::getFanModel));
+                //遍历map指定key
+                for (Map.Entry<String, List<FanTower>> entry : modelMap.entrySet()) {
+                    dataPag(collect, entry.getKey(), entry.getValue().size(), arrayList);
                 }
+            } else {
+                //根据逆变器类型分组
+                Map<String, List<InverterInfo>> modelMap = stationInfoList.get(0).getInverterInfos().stream()
+                        .collect(Collectors.groupingBy(InverterInfo::getModelNumber));
+
+                //遍历map指定key
+                for (Map.Entry<String, List<InverterInfo>> entry : modelMap.entrySet()) {
+                    dataPag(collect, entry.getKey(), entry.getValue().size(), arrayList);
 
+                }
             }
             //过滤塔信息
             StationInfo stationInfo = stationInfoList.get(0);
-//            if (stationInfo.getEquipment() != null && stationInfo.getEquipment().size() > 0) {
-//                dataMap.put("longitude", stationInfo.getEquipment().get(0).getLongitude());
-//                dataMap.put("latitude", stationInfo.getEquipment().get(0).getLatitude());
-//            }
-//            if (stationInfo.getFanTowerList() != null && stationInfo.getFanTowerList().size() > 0) {
-//                dataMap.put("longitude", stationInfo.getFanTowerList().get(0).getLongitudeFan());
-//                dataMap.put("latitude", stationInfo.getFanTowerList().get(0).getLatitudeFan());
-//            }
             dataMap.put("longitude", stationInfo.getStationBasicInfo().getLongitude());
             dataMap.put("latitude", stationInfo.getStationBasicInfo().getLatitude());
 
@@ -968,6 +953,29 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         return dataMap;
     }
 
+    //组装数据
+    public void dataPag(List<FanModelData> collect, String key, int size, ArrayList<HashMap<String, Object>> arrayList) {
+        for (FanModelData fanModelData : collect) {
+            if (fanModelData.getModelName().equals(key)) {
+                HashMap<String, Object> map = new HashMap<>();
+                //风机名称
+                map.put("modelType", key);
+                //风机数量
+                map.put("modelTotal", size);
+                //满发小时数
+                map.put("wsAve", fanModelData.getWsAve());
+                //主风向
+                map.put("wdSum", fanModelData.getWdSum());
+                //发电量
+                map.put("generatingCapacity", fanModelData.getGeneratingCapacity());
+                //满发小时数
+                map.put("realTimeTotal", fanModelData.getRealTimeTotal());
+                arrayList.add(map);
+
+            }
+        }
+    }
+
     /**
      * 风场站测风塔下拉框
      *
@@ -1003,6 +1011,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
 
         return selectList;
     }
+
     /**
      * 光场站测风塔下拉框
      *
@@ -1018,7 +1027,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                 SelectLabForVal selectLabForVal = new SelectLabForVal();
                 selectLabForVal.setLabel(stationInfo.getStationBasicInfo().getStationName());
                 selectLabForVal.setValue(stationInfo.getId());
-                if (stationInfo.getWeatherStationInfos() !=null && stationInfo.getWeatherStationInfos().size() > 0) {
+                if (stationInfo.getWeatherStationInfos() != null && stationInfo.getWeatherStationInfos().size() > 0) {
                     ArrayList<WeatherStationInfo> weatherStationList = new ArrayList<>();
                     //循环数据 放入测风塔id和测风塔名称
                     for (WeatherStationInfo weatherStationInfo : stationInfo.getWeatherStationInfos()) {

+ 5 - 0
neim-biz/src/main/java/com/jiayue/biz/service/impl/ProphaseAnemometryDataOrgServiceImpl.java

@@ -24,5 +24,10 @@ public class ProphaseAnemometryDataOrgServiceImpl extends ServiceImpl<ProphaseAn
         baseMapper.insertOneWithNew(prophaseAnemometryData);
     }
 
+    //查询所有数据
+    public List<ProphaseAnemometryData> selectAll(String equipmentId, Timestamp startTime, Timestamp endTime) {
+        return baseMapper.selectAll(equipmentId, startTime, endTime);
+    }
+
 
 }

+ 4 - 1
neim-biz/src/main/java/com/jiayue/biz/service/impl/ProphaseWeatherDataOrgServiceImpl.java

@@ -27,6 +27,9 @@ public class ProphaseWeatherDataOrgServiceImpl extends ServiceImpl<ProphaseWeath
         baseMapper.insertOneWithNew(prophaseWeatherData);
     }
 
-
+    //查询所有数据
+    public List<ProphaseWeatherData> selectPublicData(String equipmentId, Timestamp startTime, Timestamp endTime) {
+        return baseMapper.selectPublicData(equipmentId, startTime, endTime);
+    }
 
 }

+ 2 - 2
neim-biz/src/main/java/com/jiayue/biz/service/impl/WindTowerDataParentTableServiceImpl.java

@@ -675,8 +675,8 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
         //获取测风塔数据
         List<WindTowerInfo> list = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, equipmentId).list();
         List<Map<String, Object>> mapList = new ArrayList<>();
-        List<ProphaseAnemometryData> prophaseAnemometryPublicData = prophaseAnemometryDataService.selectAll(equipmentId, startTime, endTime);
-        List<ProphaseWeatherData> prophaseAnemometryPublicDataList = prophaseWeatherDataService.selectPublicData(equipmentId, startTime, endTime);
+        List<ProphaseAnemometryData> prophaseAnemometryPublicData = prophaseAnemometryDataOrgService.selectAll(equipmentId, startTime, endTime);
+        List<ProphaseWeatherData> prophaseAnemometryPublicDataList = prophaseWeatherDataOrgService.selectPublicData(equipmentId, startTime, endTime);
 
         String heights = list.get(0).getHeights();
         String wdHeights = list.get(0).getWdHeights();

+ 47 - 0
neim-biz/src/main/java/com/jiayue/biz/service/impl/WindTowerInfoServiceImpl.java

@@ -3,8 +3,14 @@ package com.jiayue.biz.service.impl;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jiayue.biz.domain.Equipment;
+import com.jiayue.biz.domain.ProjectInfo;
 import com.jiayue.biz.domain.StatisticsSituation;
+import com.jiayue.biz.service.ProjectInfoService;
+import com.jiayue.common.utils.DateUtil;
+import lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jiayue.biz.mapper.WindTowerInfoMapper;
@@ -24,8 +30,12 @@ import java.util.stream.Collectors;
  */
 @Service
 public class WindTowerInfoServiceImpl extends ServiceImpl<WindTowerInfoMapper, WindTowerInfo> implements WindTowerInfoService {
+
     @Autowired
     StatisticsSituationServiceImpl statisticsSituationService;
+    @Autowired
+    ProjectInfoService projectInfoService;
+
 
     @Override
     public List<WindTowerInfo> getDashAllWindInfo() {
@@ -191,4 +201,41 @@ public class WindTowerInfoServiceImpl extends ServiceImpl<WindTowerInfoMapper, W
     }
 
 
+    //测风塔信息 修改 同步mongo
+    public void updateWindTowerInfo(WindTowerInfo windTowerInfo) {
+        List<ProjectInfo> projectInfoList = projectInfoService.getProjectInfoList();
+        //判断是否存在测风塔数据
+        List<ProjectInfo> projectInfos = projectInfoList.stream().filter(p -> p.getEquipment() != null && p.getEquipment().size() > 0).collect(Collectors.toList());
+        for (ProjectInfo projectInfo : projectInfos) {
+            if (projectInfo.getEquipment().size() > 0) {
+                for (Equipment equipment : projectInfo.getEquipment()) {
+                    if (equipment.getId().equals(windTowerInfo.getId()) || equipment.getEquipmentNo().equals(windTowerInfo.getEquipmentNo())) {
+                        equipment.setName(windTowerInfo.getName() != null ? windTowerInfo.getName() : equipment.getName());
+                        equipment.setPassword(windTowerInfo.getPassword() != null ? windTowerInfo.getPassword() : equipment.getPassword());
+                        equipment.setTerrainComplexity(windTowerInfo.getTerrainComplexity() != null ? windTowerInfo.getTerrainComplexity() : equipment.getTerrainComplexity());
+                        equipment.setStatus(windTowerInfo.getStatus() != null ? windTowerInfo.getStatus() : equipment.getStatus());
+                        equipment.setType(windTowerInfo.getType() != null ? windTowerInfo.getType() : equipment.getType());
+                        equipment.setRecorderNo(windTowerInfo.getRecorderNo() != null ? windTowerInfo.getRecorderNo() : equipment.getRecorderNo());
+                        equipment.setWdHeights(windTowerInfo.getWdHeights() != null ? windTowerInfo.getWdHeights() : equipment.getWdHeights());
+                        equipment.setManufacturer(windTowerInfo.getManufacturer() != null ? windTowerInfo.getManufacturer() : equipment.getManufacturer());
+                        equipment.setModelNumber(windTowerInfo.getModelNumber() != null ? windTowerInfo.getModelNumber() : equipment.getModelNumber());
+                        equipment.setInstallationTime(DateUtil.format(windTowerInfo.getInstallationTime(), "yyyy-MM-dd HH:mm:ss") != null ? DateUtil.format(windTowerInfo.getInstallationTime(), "yyyy-MM-dd HH:mm:ss") : equipment.getInstallationTime());
+                        equipment.setHeights(windTowerInfo.getHeights() != null ? windTowerInfo.getHeights() : equipment.getHeights());
+                        equipment.setAltitude(windTowerInfo.getAltitude() != null ? windTowerInfo.getAltitude() : equipment.getAltitude());
+                        equipment.setLongitude(windTowerInfo.getLongitude().toString() != null ? windTowerInfo.getLongitude().toString() : equipment.getLongitude());
+                        equipment.setLatitude(windTowerInfo.getLatitude().toString() != null ? windTowerInfo.getLatitude().toString() : equipment.getLatitude());
+                        equipment.setId(windTowerInfo.getId() != null ? windTowerInfo.getId() : equipment.getId());
+                        equipment.setDisplayHeight(windTowerInfo.getDisplayHeight() != null ? windTowerInfo.getDisplayHeight() : equipment.getDisplayHeight());
+                        equipment.setEquipmentNo(windTowerInfo.getEquipmentNo() != null ? windTowerInfo.getEquipmentNo() : equipment.getEquipmentNo());
+                    }
+                }
+            }
+
+            projectInfoService.saveProjectInfo(projectInfo);
+        }
+
+
+    }
+
+
 }

+ 110 - 0
neim-ui/src/views/dataQuery/windTowerStatusData/index.vue

@@ -474,6 +474,116 @@ export default {
         wsMin150: null,
         wsAve150: null,
         wsSta150: null,
+        wdInst150A: null,
+        wdMax150A: null,
+        wdMin150A: null,
+        wdAve150A: null,
+        wdSta150A: null,
+        wsInst150A: null,
+        wsMax150A: null,
+        wsMin150A: null,
+        wsAve150A: null,
+        wsSta150A: null,
+        wdInst160: null,
+        wdMax160: null,
+        wdMin160: null,
+        wdAve160: null,
+        wdSta160: null,
+        wsInst160: null,
+        wsMax160: null,
+        wsMin160: null,
+        wsAve160: null,
+        wsSta160: null,
+        wdInst160A: null,
+        wdMax160A: null,
+        wdMin160A: null,
+        wdAve160A: null,
+        wdSta160A: null,
+        wsInst160A: null,
+        wsMax160A: null,
+        wsMin160A: null,
+        wsAve160A: null,
+        wsSta160A: null,
+        wdInst170: null,
+        wdMax170: null,
+        wdMin170: null,
+        wdAve170: null,
+        wdSta170: null,
+        wsInst170: null,
+        wsMax170: null,
+        wsMin170: null,
+        wsAve170: null,
+        wsSta170: null,
+        wdInst170A: null,
+        wdMax170A: null,
+        wdMin170A: null,
+        wdAve170A: null,
+        wdSta170A: null,
+        wsInst170A: null,
+        wsMax170A: null,
+        wsMin170A: null,
+        wsAve170A: null,
+        wsSta170A: null,
+        wdInst180: null,
+        wdMax180: null,
+        wdMin180: null,
+        wdAve180: null,
+        wdSta180: null,
+        wsInst180: null,
+        wsMax180: null,
+        wsMin180: null,
+        wsAve180: null,
+        wsSta180: null,
+        wdInst180A: null,
+        wdMax180A: null,
+        wdMin180A: null,
+        wdAve180A: null,
+        wdSta180A: null,
+        wsInst180A: null,
+        wsMax180A: null,
+        wsMin180A: null,
+        wsAve180A: null,
+        wsSta180A: null,
+        wdInst190: null,
+        wdMax190: null,
+        wdMin190: null,
+        wdAve190: null,
+        wdSta190: null,
+        wsInst190: null,
+        wsMax190: null,
+        wsMin190: null,
+        wsAve190: null,
+        wsSta190: null,
+        wdInst190A: null,
+        wdMax190A: null,
+        wdMin190A: null,
+        wdAve190A: null,
+        wdSta190A: null,
+        wsInst190A: null,
+        wsMax190A: null,
+        wsMin190A: null,
+        wsAve190A: null,
+        wsSta190A: null,
+        wdInst200: null,
+        wdMax200: null,
+        wdMin200: null,
+        wdAve200: null,
+        wdSta200: null,
+        wsInst200: null,
+        wsMax200: null,
+        wsMin200: null,
+        wsAve200: null,
+        wsSta200: null,
+        wdInst200A: null,
+        wdMax200A: null,
+        wdMin200A: null,
+        wdAve200A: null,
+        wdSta200A: null,
+        wsInst200A: null,
+        wsMax200A: null,
+        wsMin200A: null,
+        wsAve200A: null,
+        wsSta200A: null,
         airDensity: null
       };
       this.resetForm("form");

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است