瀏覽代碼

场站信息和逆变器

zy 1 年之前
父節點
當前提交
684a3c31f7

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

@@ -41,6 +41,7 @@ public class InverterInfoController extends BaseController {
             HashMap map = new HashMap();
             map.put("id",pvModuleModel.getId());
             map.put("model",pvModuleModel.getModelNumber());
+            list.add(map);
         }
         return AjaxResult.success(list);
     }

+ 2 - 1
neim-biz/src/main/java/com/jiayue/biz/controller/WeatherStationInfoController.java

@@ -45,7 +45,8 @@ public class WeatherStationInfoController extends BaseController {
         for(WeatherStationInfo weatherStationInfo : weatherStationInfos){
             HashMap map = new HashMap();
             map.put("id",weatherStationInfo.getId());
-            map.put("model",weatherStationInfo.getName());
+            map.put("name",weatherStationInfo.getName());
+            list.add(map);
         }
         return AjaxResult.success(list);
     }

+ 15 - 1
neim-biz/src/main/java/com/jiayue/biz/service/impl/StationInfoServiceImpl.java

@@ -76,7 +76,17 @@ public class StationInfoServiceImpl implements StationInfoService {
                 if (builder.length() > 0) {
                     builder.delete(builder.length() - 1, builder.length());
                 }
-
+                stationInfoDto.setEquipment(builder.toString());
+            }
+            if (stationInfo.getWeatherStationInfos() != null) {
+                StringBuilder builder = new StringBuilder();
+                List<String> collect = stationInfo.getWeatherStationInfos().stream().map(WeatherStationInfo::getId).collect(Collectors.toList());
+                for (String s : collect) {
+                    builder.append(s).append(",");
+                }
+                if (builder.length() > 0) {
+                    builder.delete(builder.length() - 1, builder.length());
+                }
                 stationInfoDto.setEquipment(builder.toString());
             }
             list.add(stationInfoDto);
@@ -130,12 +140,16 @@ public class StationInfoServiceImpl implements StationInfoService {
             if (stationInfoDto.getEquipment() != null && !stationInfoDto.getEquipment().equals("")) {
                 List<Equipment> equipment = CalculationUtil.getEquipment(list, stationInfoDto.getEquipment());
                 stationInfo.setEquipment(equipment);
+            }else {
+                stationInfo.setEquipment(new ArrayList<>());
             }
 
         } else if (stationInfo.getStationBasicInfo().getStationType().equals("光")) {
             if (stationInfoDto.getEquipment() != null && !stationInfoDto.getEquipment().equals("")) {
                 List<WeatherStationInfo> weatherStationInfo = this.getWeatherStationInfo(weatherStationInfoList, stationInfoDto.getEquipment());
                 stationInfo.setWeatherStationInfos(weatherStationInfo);
+            }else {
+                stationInfo.setWeatherStationInfos(new ArrayList<>());
             }
 
         }

+ 7 - 1
neim-ui/src/api/biz/dataQuery/weatherStationInfo.js

@@ -1,7 +1,13 @@
 import request from '@/utils/request'
 
 
-// 查询所有环境监测仪信息
+// 查询环境监测仪信息下拉框
+export function infoList() {
+  return request({
+    url: '/dataQuery/weatherStationInfo/infoList',
+    method: 'get'
+  })
+}// 查询所有环境监测仪信息
 export function list() {
   return request({
     url: '/dataQuery/weatherStationInfo/list',

+ 33 - 15
neim-ui/src/views/dataQuery/electrucStation/index.vue

@@ -22,11 +22,11 @@
         <el-table-column label="简称" align="center" prop="abbreviation"/>
         <el-table-column label="场站经度" align="center" prop="longitude"/>
         <el-table-column label="场站纬度" align="center" prop="latitude"/>
-        <el-table-column label="场站类型" align="center" prop="stationType" :formatter="formatStatus" />
-        <el-table-column label="关联设备" align="center" prop="equipment">
-<!--          <template slot-scope="scope">-->
-<!--            <span>{{ formatEquipment(scope.row.equipment) }}</span>-->
-<!--          </template>-->
+        <el-table-column label="场站类型" align="center" prop="stationType" :formatter="formatStatus"/>
+        <el-table-column label="关联设备" align="center" prop="equipment" :formatter="formatEquipment">
+          <!--          <template slot-scope="scope">-->
+          <!--            <span>{{ formatEquipment(scope.row.equipment) }}</span>-->
+          <!--          </template>-->
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
@@ -95,7 +95,8 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="场站类型" prop="stationType">
-              <el-select v-model="form.stationType" placeholder="请选择" style="width: 100%" clearable @change="typeChange">
+              <el-select v-model="form.stationType" placeholder="请选择" style="width: 100%" clearable
+                         @change="typeChange">
                 <el-option
                   v-for="item in terrain"
                   :key="item.value"
@@ -122,10 +123,10 @@
           <el-select v-model="form.equipment" placeholder="请选择" style="width: 100%" multiple clearable>
             <el-option
               v-for="item in gEquipment"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-              :disabled="item.disabled">
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
             </el-option>
           </el-select>
         </el-form-item>
@@ -148,6 +149,7 @@ import {
   delElectricStation
 } from "@/api/biz/dataQuery/electricStation";
 import {listAllDisabled} from "@/api/biz/dataQuery/windTowerStatusInfo";
+import {infoList} from "@/api/biz/dataQuery/weatherStationInfo";
 import axios from "axios";
 
 export default {
@@ -238,8 +240,16 @@ export default {
   },
   mounted() {
     this.getAllWindTowerInfo()
+    this.getWeatherStationInfo()
   },
   methods: {
+    getWeatherStationInfo() {
+      infoList().then(res => {
+        this.gEquipment = res.data
+      }).catch(err => {
+        console.log('获取环境监测仪信息异常:' + err)
+      })
+    },
     /*获取所有的测风塔*/
     getAllWindTowerInfo() {
       listAllDisabled().then(res => {
@@ -275,7 +285,7 @@ export default {
         this.loading = false;
       })
     },
-    typeChange(){
+    typeChange() {
       this.eType = this.form.stationType
     },
     // 取消按钮
@@ -328,7 +338,8 @@ export default {
       var a = null
       const id = row.id || this.ids
       this.modId = id
-      if (row. equipment!== null) {
+      console.log(row.equipment)
+      if (row.equipment !== null) {
         a = row.equipment.split(",")
         a = a.length === 1 && a[0] === "" ? null : row.equipment.split(",")
       }
@@ -388,9 +399,16 @@ export default {
     handleCurrentChange(val) {
       this.page.currentPage = val
     },
-    formatStatus(row){
-      let option = this.terrain.find(w=>w.value === row.stationType)
-      return option !==undefined?option.label:row.stationType
+    formatStatus(row) {
+      let option = this.terrain.find(w => w.value === row.stationType)
+      return option !== undefined ? option.label : row.stationType
+    },
+    formatEquipment(row) {
+      if (row.stationType !== '风') {
+        let option = this.gEquipment.find(w => w.id === row.equipment)
+        return option !== undefined ? option.name : row.equipment
+      }
+      return row.equipment
     },
     // formatType(row){
     //   let option = this.status.find(w=>w.value === row.stationStatus)

+ 9 - 1
neim-ui/src/views/dataQuery/inverterInfo/index.vue

@@ -74,7 +74,14 @@
           <el-row :gutter="20" class="mb8">
             <el-col :span="12">
               <el-form-item label="场站名称" prop="stationName">
-                <el-input v-model="form.stationName" placeholder="请输入名称"/>
+                <el-select v-model="form.stationName" clearable placeholder="请选择场站">
+                  <el-option
+                    v-for="item in stationOption"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -199,6 +206,7 @@ export default {
       form: {},
       // 表单校验
       rules: {
+        stationName: [{required: true,  message:'请选择场站', trigger: 'blur'}],
         name: [{required: true, validator: checkName, trigger: 'blur'}],
         // modelNumber: [{required: true,  message:'请输入型号', trigger: 'blur'}],
         longitude: [{required: true, validator: checkLongitude, trigger: 'blur'}],