Преглед на файлове

1.修复切换告警类型,右侧红色铃铛图标数值不改变
2.不告警页面去掉查询按钮,默认字段查询
3.不告警页面写出失效时间,时间控件另起一行
4.不告警页面增加了不告警配置,告警页面去掉相应数据
5.中心功能预测,先展示图表在展示列表
6.中心功能预测,图表高度压缩
7.中心功能预测,没有模型数据给空
8.中心功能预测,导出时增加场站名

fanxiaoyu преди 6 месеца
родител
ревизия
69809458c2

+ 5 - 1
cpp-admin/src/main/java/com/cpp/web/controller/alarm/AlarmConfController.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cpp.common.core.domain.R;
 import com.cpp.web.domain.alarm.AlarmConf;
+import com.cpp.web.service.alarm.AbnormalAlarmService;
 import com.cpp.web.service.alarm.AlarmConfService;
 import com.cpp.web.service.alarm.AlarmLog;
 import lombok.RequiredArgsConstructor;
@@ -20,6 +21,8 @@ import java.util.Date;
 public class AlarmConfController {
     private final AlarmConfService alarmConfService;
 
+    private final AbnormalAlarmService abnormalAlarmService;
+
     @GetMapping("/pageByExpireTime")
     public R pageByExpireTime(Long currentPage, Long pageSize, Long time) {
         Page page = new Page(currentPage, pageSize);
@@ -32,7 +35,7 @@ public class AlarmConfController {
     public R save(@RequestBody AlarmConf alarmConf) {
         Boolean b = alarmConfService.saveOrUpdate(alarmConf);
         AlarmLog.getInstance().updateStationAlarmConfListMap(alarmConf,true);
-
+        abnormalAlarmService.updateStatus(alarmConf);
         return R.ok(b);
     }
 
@@ -45,6 +48,7 @@ public class AlarmConfController {
     @PostMapping("/updateById")
     public R updateById(@RequestBody AlarmConf alarmConf) {
         AlarmLog.getInstance().updateStationAlarmConfListMap(alarmConf,true);
+        abnormalAlarmService.updateStatus(alarmConf);
         return R.ok(alarmConfService.updateById(alarmConf));
     }
 

+ 9 - 2
cpp-admin/src/main/java/com/cpp/web/controller/stationDataQuery/PowerStationStatusDataController.java

@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cpp.common.core.domain.R;
 import com.cpp.system.service.ISysConfigService;
+import com.cpp.web.domain.station.ElectricField;
 import com.cpp.web.dto.DqHistoryContrastDto;
 import com.cpp.web.dto.TableColumn;
+import com.cpp.web.service.station.ElectricFieldService;
 import com.cpp.web.service.station.PowerStationStatusDataService;
 import com.cpp.web.service.station.impl.PowerStationStatusDataServiceImpl;
 import io.swagger.annotations.Api;
@@ -44,8 +46,10 @@ import java.util.*;
 public class PowerStationStatusDataController {
     @Autowired
     private ISysConfigService configService;
+
     private final PowerStationStatusDataService powerStationStatusDataService;
 
+    private final ElectricFieldService electricFieldService;
     private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 
     @ApiOperation(value = "通过条件查询", notes = "通过条件查询")
@@ -78,6 +82,9 @@ public class PowerStationStatusDataController {
 
     @GetMapping("/export")
     public void export(Long startTime, Long endTime, Integer forecastHowLongAgo, String stationCode,HttpServletResponse response){
+
+        ElectricField electricField = electricFieldService.findByStationCode(stationCode);
+
         BufferedOutputStream bos = null;
         Map<String,Object> map = new HashMap();
         try {
@@ -110,9 +117,9 @@ public class PowerStationStatusDataController {
 
             String fileName = "";
             if (sdf.format(startTime).equals(sdf.format(endTime))) {
-                fileName = sdf.format(startTime) + "中心功率预测" + ".csv";
+                fileName = electricField.getName() + sdf.format(startTime) + "中心功率预测" + ".csv";
             } else {
-                fileName = sdf.format(startTime) + "至" + sdf.format(endTime) + "中心功率预测" + ".csv";
+                fileName = electricField.getName() + sdf.format(startTime) + "至" + sdf.format(endTime) + "中心功率预测" + ".csv";
             }
 
             response.setContentType("application/x-msdownload;charset=UTF-8");

+ 3 - 0
cpp-admin/src/main/java/com/cpp/web/service/alarm/AbnormalAlarmService.java

@@ -3,6 +3,7 @@ package com.cpp.web.service.alarm;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cpp.web.domain.alarm.AbnormalAlarm;
+import com.cpp.web.domain.alarm.AlarmConf;
 import com.cpp.web.domain.enums.AlarmEnum;
 
 import java.util.Date;
@@ -38,4 +39,6 @@ public interface AbnormalAlarmService extends IService<AbnormalAlarm> {
     Boolean updateAllStatus1();
 
     Boolean updateStatus1ById(Long id);
+
+    void updateStatus(AlarmConf alarmConf);
 }

+ 26 - 2
cpp-admin/src/main/java/com/cpp/web/service/alarm/impl/AbnormalAlarmServiceImpl.java

@@ -5,14 +5,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cpp.web.domain.alarm.AbnormalAlarm;
+import com.cpp.web.domain.alarm.AlarmConf;
 import com.cpp.web.domain.enums.AlarmEnum;
 import com.cpp.web.mapper.alarm.AbnormalAlarmMapper;
 import com.cpp.web.service.alarm.AbnormalAlarmService;
+import com.cpp.web.service.alarm.AlarmConfService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.core.parameters.P;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 告警信息层实现类
@@ -25,6 +31,8 @@ import java.util.Date;
 @Service
 public class AbnormalAlarmServiceImpl extends ServiceImpl<AbnormalAlarmMapper, AbnormalAlarm> implements AbnormalAlarmService {
 
+    private final AlarmConfService alarmConfService;
+
     @Override
     public QueryWrapper<AbnormalAlarm> findByTimeBetweenAndAlarmTypeAndStationCode(Date startTime, Date endTime, AlarmEnum alarmType, String stationCode) {
 
@@ -62,7 +70,7 @@ public class AbnormalAlarmServiceImpl extends ServiceImpl<AbnormalAlarmMapper, A
 
         UpdateWrapper<AbnormalAlarm> wrapper = new UpdateWrapper<>();
 
-        wrapper.eq("id",id).set("status",1);
+        wrapper.eq("id", id).set("status", 1);
 
         return update(wrapper);
     }
@@ -78,7 +86,6 @@ public class AbnormalAlarmServiceImpl extends ServiceImpl<AbnormalAlarmMapper, A
     }
 
     /**
-     *
      * @param alarmType
      * @return
      */
@@ -103,4 +110,21 @@ public class AbnormalAlarmServiceImpl extends ServiceImpl<AbnormalAlarmMapper, A
         return baseMapper.selectCount(wrapper);
     }
 
+    @Override
+    public void updateStatus(AlarmConf alarmConf) {
+        List<AbnormalAlarm> abnormalAlarmList = list();
+        List<AbnormalAlarm> abnormalAlarms = new ArrayList<>();
+        List<AbnormalAlarm> updateStatusList = new ArrayList<>();
+        if (alarmConf.getType() == 0) {
+            abnormalAlarms = abnormalAlarmList.stream().filter(f -> null != f.getMsg() && f.getMsg().contains(alarmConf.getKeyword()) && f.getEndTime() == null && f.getStatus() == 0).collect(Collectors.toList());
+            updateStatusList.addAll(abnormalAlarms);
+        } else {
+            abnormalAlarms = abnormalAlarmList.stream().filter(f -> null != f.getMsg() && f.getMsg().contains(alarmConf.getKeyword()) && f.getEndTime() == null && f.getStatus() == 0).collect(Collectors.toList());
+            updateStatusList.addAll(abnormalAlarms);
+        }
+        abnormalAlarms.stream().forEach(f -> f.setStatus(1));
+        saveOrUpdateBatch(abnormalAlarms);
+    }
+
+
 }

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/station/impl/PowerStationStatusDataServiceImpl.java

@@ -593,7 +593,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
                     Map<Date, List<ForecastPowerShortTermCloud>> dateListMap = forecastPowerShortTermCloudModelTimeMap.get(stringStringEntry.getValue());
                     forecastPowerShortTermCloud = Optional.ofNullable(dateListMap.containsKey(time) ? dateListMap.get(time).get(0) : null).orElse(new ForecastPowerShortTermCloud());
                 }
-                dataMap.put(stringStringEntry.getValue(), forecastPowerShortTermCloud.getFpValue());
+                dataMap.put(stringStringEntry.getValue(), forecastPowerShortTermCloud.getFpValue().compareTo(new BigDecimal(-99)) == 0 ? "" : forecastPowerShortTermCloud.getFpValue());
             }
 
 

+ 5 - 5
cpp-ui/src/views/cloudDataQuery/index.vue

@@ -44,7 +44,10 @@
     </div>
     <div style="padding-top: 10px">
       <el-tabs type="card" v-model="activeName" @tab-click="tabClick">
-        <el-tab-pane label="列表" name="first">
+        <el-tab-pane label="图表" name="first">
+          <div v-loading="loading" style="float:left;width: 100%;height:  750px" id="zhxCharts"></div>
+        </el-tab-pane>
+        <el-tab-pane label="列表" name="second">
           <vxe-table
             align="center"
             :loading="loading"
@@ -77,9 +80,6 @@
           >
           </vxe-pager>
         </el-tab-pane>
-        <el-tab-pane label="图表" name="second">
-          <div v-loading="loading" style="float:left;width: 100%;height:  800px" id="zhxCharts"></div>
-        </el-tab-pane>
       </el-tabs>
     </div>
   </div>
@@ -711,7 +711,7 @@ export default {
       }
     },
     tabClick(tab) {
-      if (this.activeName == 'second') {
+      if (this.activeName == 'first') {
         this.$nextTick(function () {
           this.zhxChart.resize();
         })

+ 45 - 26
cpp-ui/src/views/largeScreen/index.vue

@@ -4,7 +4,7 @@
       <span class="sys-time">{{ sysTime }}</span>
       <div class="top-right-style flex items-center">
         <div class="top-badge">
-          <el-badge :value="badgeValue.alarm" v-if="badgeValue.alarm !== 0">
+          <el-badge :value="allBadgeValue.alarm" v-if="allBadgeValue.alarm !== 0">
             <img src="../../assets/images/svg/remind.svg" class="badge-img" @click="openAlarm()"/>
           </el-badge>
           <img src="../../assets/images/svg/remind.svg" class="badge-img" @click="openAlarm()" v-else/>
@@ -160,8 +160,23 @@
               :visible.sync="innerVisible"
               append-to-body>
               <!--  TODO 移植v3        -->
-              <div class="dark-el-dialog">
-                <el-row :gutter="10" class="mb8">
+              <div class="dark-el-dialog" style="margin-top: -20px">
+                <el-row>
+                  <el-col :span="1.5">失效时间:</el-col>
+                  <el-col :span="10">
+                    <el-date-picker
+                      :clearable="false"
+                      v-model="expireTime"
+                      type="datetime"
+                      value-format="timestamp"
+                      placeholder="选择失效时间"
+                      popper-class="cpp-popper"
+                      size="small"
+                      @change="changeInfo">
+                    </el-date-picker>
+                  </el-col>
+                </el-row>
+                <el-row :gutter="10" class="mb8" style="margin-top: 5px">
                   <el-col :span="1.5">
                     <el-button
                       type="primary"
@@ -195,28 +210,19 @@
                     >删除
                     </el-button>
                   </el-col>
-                  <el-col :span="1.5">
-                    <el-button
-                      type="danger"
-                      plain
-                      icon="el-icon-select"
-                      size="mini"
-                      popper-class="cpp-popper"
-                      @click="getAlarmConfs"
-                    >查询
-                    </el-button>
-                  </el-col>
-                  <el-col :span="1.5">
-                    <el-date-picker
-                      :clearable="false"
-                      v-model="expireTime"
-                      type="datetime"
-                      value-format="timestamp"
-                      placeholder="选择失效时间"
-                      popper-class="cpp-popper">
-                    </el-date-picker>
-                  </el-col>
+<!--                  <el-col :span="1.5">-->
+<!--                    <el-button-->
+<!--                      type="danger"-->
+<!--                      plain-->
+<!--                      icon="el-icon-select"-->
+<!--                      size="mini"-->
+<!--                      popper-class="cpp-popper"-->
+<!--                      @click="getAlarmConfs"-->
+<!--                    >查询-->
+<!--                    </el-button>-->
+<!--                  </el-col>-->
                 </el-row>
+
                 <div style="padding-top: 10px">
                   <vxe-table
                     ref="xTable"
@@ -232,7 +238,7 @@
                     :radio-config="{trigger: 'row',checkMethod: checkRadioMethod}"
                   >
                     <vxe-column type="radio" width="60"/>
-                    <vxe-table-column field="stationCode" title="场站编号"
+                    <vxe-table-column field="stationCode" title="场站名称"
                                       :formatter="alarmConfTypeStationFormat"></vxe-table-column>
                     <vxe-table-column field="keyword" title="关键词"></vxe-table-column>
                     <vxe-table-column field="type" title="类型" :formatter="alarmConfTypeFormat"></vxe-table-column>
@@ -386,6 +392,11 @@ export default {
         radiance: 0,
       },
       // 告警统计值
+      allBadgeValue: {
+        alarm: 0,
+        confirm: 0
+      },
+      // 告警统计值
       badgeValue: {
         alarm: 0,
         confirm: 0
@@ -572,11 +583,14 @@ export default {
     },
     getAlarmSize() {
       this.$axios.get('/abnormalAlarm/alarmCountStatus1').then(response => {
-        this.badgeValue.alarm = response.data
+        this.allBadgeValue.alarm = response.data
       }).catch(() => {
 
       })
     },
+    changeInfo(){
+      this.getAlarmConfs()
+    },
     getAlarmConfs() {
       this.loadingAlarmConf = true
 
@@ -614,6 +628,7 @@ export default {
       this.$axios.get('/abnormalAlarm/dashboard', {params: queryParams}).then(response => {
         this.tableDataAlarm = response.data.records
         this.alarmPage.total = response.data.total
+        this.badgeValue.alarm = response.data.total
         this.loadingAlarm = false
       }).catch(() => {
         this.loadingAlarm = false
@@ -784,6 +799,8 @@ export default {
               this.$message.success('修改成功')
               this.open = false;
               this.getAlarmConfs()
+              this.getAlarmSize()
+              this.filterInfo()
             }).catch((error) => {
             })
           } else {
@@ -794,6 +811,8 @@ export default {
               } else {
                 this.$message.success('新增成功')
                 this.getAlarmConfs()
+                this.getAlarmSize()
+                this.filterInfo()
                 this.open = false;
               }
             }).catch((error) => {