Jelajahi Sumber

修改页面风机数据为下拉框 给风速 功率 加上单位

hxf 2 tahun lalu
induk
melakukan
e7aafa07bc

+ 15 - 6
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/CutOutSpeedSpecifyInfo/index.vue

@@ -14,7 +14,7 @@
           action=""
           :show-file-list = false
         >
-          <el-button size="small" type="primary" >读取excel</el-button>
+          <el-button size="small" type="primary" >导入</el-button>
         </el-upload>
         <el-button size="small" type="primary" @click="exportToExcel">导出</el-button>
       </el-row>
@@ -99,7 +99,12 @@
               <el-input v-model="form.powerGeneration" style="width: 70%"></el-input>
             </el-form-item>
             <el-form-item label="所属机组" prop="unitBelongs">
-              <el-input v-model="form.fanId" style="width: 70%"></el-input>
+              <el-select v-model="form.fanId" style="width: 70%">
+                <el-option v-for="item in fanIdList"
+                           :key="item.value"
+                           :label="item.fanIdStr"
+                           :value="item.fanId"></el-option>
+              </el-select>
             </el-form-item>
 
           </el-form>
@@ -120,6 +125,8 @@
 export default {
   data() {
     return {
+      fanIdList:[],
+      value:'',
       tableData: [],
       form: {},
       dialogVisible: false,
@@ -149,8 +156,7 @@ export default {
       this.$axios.get("/cutOutSpeedSpecifyInfo/" + this.currentPage + '/' + this.pageSize).then(response => {
         this.tableData = response.data.content
         this.total = response.data.count
-        console.log(response.data);
-        console.log(response.data.content[0].unitBelongs);
+
 
       })
     },
@@ -169,14 +175,14 @@ export default {
       this.initPage()
     },
     handleEdit(index, row) {
-      console.log(index, row);
+
       this.form = JSON.parse(JSON.stringify(row))
       this.dialogVisible = true
       this.initPage()
     },
     // 删除
     handleDelete(index, row) {
-      console.log(index, row);
+
       this.$XModal.confirm('您确定要删除该数据?').then(type => {
         if (type === 'confirm') {
           this.$axios.delete("/cutOutSpeedSpecifyInfo/", {data: row}).then(response => {
@@ -217,6 +223,9 @@ export default {
   },
   mounted() {
     this.initPage()
+    this.$axios.get("/cutOutSpeedSpecifyInfo/getAllFan").then(res=>{
+     this.fanIdList =  res.data
+    })
   }
 }
 </script>

+ 1 - 1
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/FanUnitInfo/index.vue

@@ -14,7 +14,7 @@
           action=""
           :show-file-list = false
         >
-          <el-button size="small" type="primary" >读取excel</el-button>
+          <el-button size="small" type="primary" >导入</el-button>
         </el-upload>
         <el-button size="small" type="primary" @click="exportToExcel">导出</el-button>
       </el-row>

+ 14 - 2
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/WindSpeedPointInfo/index.vue

@@ -155,11 +155,16 @@
             <el-form-item label="风向" prop="wind">
               <el-input v-model="form.wind" style="width: 70%"></el-input>
             </el-form-item>
-            <el-form-item label="风速" prop="speed">
+            <el-form-item label="风速(m/s)" prop="speed">
               <el-input v-model="form.speed" style="width: 70%"></el-input>
             </el-form-item>
             <el-form-item label="所属机组" prop="unitBelongs">
-              <el-input v-model="form.unitBelongs" style="width: 70%"></el-input>
+              <el-select v-model="form.unitBelongs" style="width: 70%">
+                <el-option v-for="item in fanIdList"
+                           :key="item.empty"
+                           :label="item.fanIdStr"
+                           :value="item.fanId"></el-option>
+              </el-select>
             </el-form-item>
             <el-form-item label="所属行" prop="belong">
               <el-input v-model="form.belong" style="width: 70%"></el-input>
@@ -183,6 +188,8 @@
 export default {
   data() {
     return {
+      fanIdList:[],
+      empty:'',
       tableData: [],
       tableColumn: [],
       form: {},
@@ -254,6 +261,7 @@ export default {
     }
   },
   methods: {
+
     handlePageChange({currentPage, pageSize}) {
       this.currentPage = currentPage
       this.pageSize = pageSize
@@ -360,6 +368,10 @@ export default {
   },
   mounted() {
     this.findBySomeConditions();
+    this.$axios.get("/windSpeedPointInfo/getAllData").then(res=>{
+      this.fanIdList = res.data
+      console.log(res)
+    })
   }
 }
 </script>

+ 18 - 4
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/WindTurbinePowerCurve/index.vue

@@ -11,7 +11,7 @@
           action=""
           :show-file-list = false
         >
-          <el-button size="small" type="primary" >读取excel</el-button>
+          <el-button size="small" type="primary" >导入</el-button>
         </el-upload>
         <el-button size="small" type="primary" @click="exportToExcel">导出</el-button>
       </div>
@@ -80,15 +80,21 @@
       width="30%"
     >
       <el-form ref="form" :model="form" label-width="120px" :rules="rules">
-        <el-form-item label="风速" prop="speed">
+        <el-form-item label="风速(m/s)" prop="speed">
           <el-input v-model="form.speed" style="width: 70%"></el-input>
         </el-form-item>
-        <el-form-item label="功率" prop="power">
+        <el-form-item label="功率(Kw)" prop="power">
           <el-input v-model="form.power" style="width: 70%"></el-input>
         </el-form-item>
         <el-form-item label="所属机组" prop="fanId">
-          <el-input v-model="form.fanId" style="width: 70%"></el-input>
+          <el-select v-model="form.fanId" style="width: 70%">
+            <el-option   v-for="item in fanIdData"
+                         :key="item.value"
+                         :label="item.fanIdStr"
+                         :value="item.fanId"></el-option>
+          </el-select>
         </el-form-item>
+
       </el-form>
       <template #footer>
         <span class="dialog-footer">
@@ -111,6 +117,9 @@
     mixins: [resize],
     data(){
       return{
+        fanIdStr:'',
+        value: '',
+        fanIdData:[],
         styleStr:{},
         styleTableStr:{},
         tableToolbar: {
@@ -161,6 +170,9 @@
     },
     mounted() {
       this.init()
+      this.$axios.get("/windTurbinePowerCurve/getFanId").then(res =>{
+        this.fanIdData = res.data
+      })
     },
     methods:{
       exportDataEvent() {
@@ -183,6 +195,7 @@
       getDraw(){
         this.drawLoading = true
         this.$axios.get('/windTurbinePowerCurve/new/').then((res) => {
+
           this.drawData = res.data
           this.drawLoading = false
           if(!this.drawLoading && !this.tableLoading){
@@ -303,6 +316,7 @@
         })
         this.dialogVisible = false;
         this.findBySomeConditions()
+
       },
       exportToExcel(){
         this.dialogVisible = true;

+ 9 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/CutOutSpeedSpecifyInfoController.java

@@ -63,5 +63,14 @@ public class CutOutSpeedSpecifyInfoController {
     map = this.cutOutSpeedSpecifyInfoService.get(page,size);
     return ResponseVO.success(map);
   }
+
+  /**
+   * 获取所有机组信息
+   * @return
+   */
+  @GetMapping("/getAllFan")
+  public ResponseVO getAllFan(){
+    return ResponseVO.success(cutOutSpeedSpecifyInfoService.getAllFan());
+  }
 }
 

+ 6 - 3
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/FanUnitInfoController.java

@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -33,7 +34,7 @@ public class FanUnitInfoController {
   }
 
   /**
-   * 修改 检修计划接口
+   * 修改 机组信息
    */
   @PutMapping
   public ResponseVO update(@RequestBody FanUnitInfo fanUnitInfo) throws BusinessException {
@@ -42,7 +43,7 @@ public class FanUnitInfoController {
   }
 
   /**
-   * 删除 检修计划接口
+   * 删除 机组信息接口
    * @param fanUnitInfo
    * @return 操作结果
    */
@@ -53,7 +54,7 @@ public class FanUnitInfoController {
   }
 
   /**
-   * 获取 检修计划接口
+   * 获取 机组信息接口
    * @param page 页码
    * @param size 条数
    * @return 操作结果
@@ -64,5 +65,7 @@ public class FanUnitInfoController {
     map = this.fanUnitInfoService.get(page,size);
     return ResponseVO.success(map);
   }
+
+
 }
 

+ 11 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/WindSpeedPointInfoController.java

@@ -9,6 +9,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -90,5 +91,15 @@ public class WindSpeedPointInfoController {
     Page<WindSpeedPointInfo> bySomeConditions = this.windSpeedPointInfoService.getBySomeConditions(page, size, fanNumber, wind, speed, unitBelongs, belong);
     return ResponseVO.success(bySomeConditions);
   }
+
+  /**
+   * 获取机组信息
+   * @return
+   */
+  @GetMapping("/getAllData")
+  public ResponseVO<Object> getAllData(){
+    return ResponseVO.success( windSpeedPointInfoService.getAllData());
+  }
+
 }
 

+ 12 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/WindTurbinePowerCurveController.java

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -75,4 +76,15 @@ public class WindTurbinePowerCurveController {
     map = this.windTurbinePowerCurveService.getByFanId();
     return ResponseVO.success(map);
   }
+  /**
+   * 获取风机编号
+   */
+  @GetMapping("getFanId")
+  public ResponseVO getFanId(){
+    List<Object> dataFanId = windTurbinePowerCurveService.getDataFanId();
+    return ResponseVO.success(dataFanId);
+
+  }
+
+
 }

+ 27 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/CutOutSpeedSpecifyInfoService.java

@@ -2,7 +2,9 @@ package com.jiayue.ipfcst.service;
 
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.data.entity.CutOutSpeedSpecifyInfo;
+import com.jiayue.ipfcst.common.data.entity.FanUnitInfo;
 import com.jiayue.ipfcst.common.data.repository.CutOutSpeedSpecifyInfoRepository;
+import com.jiayue.ipfcst.common.data.repository.FanUnitInfoRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
@@ -15,6 +17,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author shd
@@ -26,6 +29,9 @@ public class CutOutSpeedSpecifyInfoService {
     private CutOutSpeedSpecifyInfoRepository cutOutSpeedSpecifyInfoRepository;
 
     @Autowired
+    private FanUnitInfoRepository fanUnitInfoRepository;
+
+    @Autowired
     public CutOutSpeedSpecifyInfoService(CutOutSpeedSpecifyInfoRepository cutOutSpeedSpecifyInfoRepository){
       this.cutOutSpeedSpecifyInfoRepository = cutOutSpeedSpecifyInfoRepository;
     }
@@ -70,6 +76,27 @@ public class CutOutSpeedSpecifyInfoService {
       return cutOutSpeedSpecifyInfoRepository.findAll();
     }
 
+  /**
+   * 获取机组信息
+   * @return
+   */
+  public List<Object> getAllFan(){
+      ArrayList<Object> list = new ArrayList<>();
+      List<FanUnitInfo> all = fanUnitInfoRepository.findAll();
+      for (FanUnitInfo fanUnitInfo : all) {
+        list.add(fanUnitInfo.getFanId());
+      }
+      List<Object> collect = list.stream().distinct().sorted().collect(Collectors.toList());
+      ArrayList<Object> fanIdList = new ArrayList<>();
+      for (Object fanId : collect) {
+        HashMap<Object, Object> fanIdMap = new HashMap<>();
+        fanIdMap.put("fanIdStr","机组" + fanId.toString());
+        fanIdMap.put("fanId",fanId);
+        fanIdList.add(fanIdMap);
+      }
+      return fanIdList;
+    }
+
     /**
      * (分页)
      */

+ 26 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/WindSpeedPointInfoService.java

@@ -1,7 +1,9 @@
 package com.jiayue.ipfcst.service;
 
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.data.entity.FanUnitInfo;
 import com.jiayue.ipfcst.common.data.entity.WindSpeedPointInfo;
+import com.jiayue.ipfcst.common.data.repository.FanUnitInfoRepository;
 import com.jiayue.ipfcst.common.data.repository.WindSpeedPointInfoRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -12,6 +14,7 @@ import org.springframework.stereotype.Service;
 
 import javax.persistence.criteria.Predicate;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  *
@@ -24,6 +27,8 @@ public class WindSpeedPointInfoService {
   private WindSpeedPointInfoRepository windSpeedPointInfoRepository;
 
   @Autowired
+  private FanUnitInfoRepository fanUnitInfoRepository;
+  @Autowired
   public WindSpeedPointInfoService(WindSpeedPointInfoRepository windSpeedPointInfoRepository){
     this.windSpeedPointInfoRepository = windSpeedPointInfoRepository;
   }
@@ -101,6 +106,27 @@ public class WindSpeedPointInfoService {
     return this.windSpeedPointInfoRepository.findAll();
   }
 
+  /**
+   * 获取机组信息
+   * @return
+   */
+  public List<Object> getAllData(){
+    ArrayList<Object> list = new ArrayList<>();
+    List<FanUnitInfo> all = fanUnitInfoRepository.findAll();
+    for (FanUnitInfo fanUnitInfo : all) {
+      list.add(fanUnitInfo.getFanId());
+    }
+    List<Object> collect = list.stream().distinct().sorted().collect(Collectors.toList());
+    ArrayList<Object> fanIdList = new ArrayList<>();
+    for (Object fanId : collect) {
+      HashMap<String, Object> fanIdMap = new HashMap<>();
+      fanIdMap.put("fanIdStr","机组" + fanId);
+      fanIdMap.put("fanId",fanId);
+      fanIdList.add(fanIdMap);
+    }
+    return fanIdList;
+  }
+
 
   public Page<WindSpeedPointInfo> getBySomeConditions(Integer page, Integer size, String fanNumber,String wind,
                                                  String speed, String unitBelongs, String belong){

+ 33 - 0
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/WindTurbinePowerCurveService.java

@@ -1,7 +1,9 @@
 package com.jiayue.ipfcst.service;
 
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.data.entity.FanUnitInfo;
 import com.jiayue.ipfcst.common.data.entity.WindTurbinePowerCurve;
+import com.jiayue.ipfcst.common.data.repository.FanUnitInfoRepository;
 import com.jiayue.ipfcst.common.data.repository.WindTurbinePowerCurveRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -11,8 +13,10 @@ import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 
 import javax.persistence.criteria.Predicate;
+import java.security.Key;
 import java.text.DecimalFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author shd
@@ -21,6 +25,10 @@ import java.util.*;
 @Service
 public class WindTurbinePowerCurveService {
   private WindTurbinePowerCurveRepository windTurbinePowerCurveRepository;
+
+  @Autowired
+  private FanUnitInfoRepository fanUnitInfoRepository;
+
   @Autowired
   public WindTurbinePowerCurveService(WindTurbinePowerCurveRepository windTurbinePowerCurveRepository){
     this.windTurbinePowerCurveRepository = windTurbinePowerCurveRepository;
@@ -66,6 +74,31 @@ public class WindTurbinePowerCurveService {
     return windTurbinePowerCurveRepository.findAll();
   }
 
+  /**
+   * 获取风机编号
+   */
+  public List<Object> getDataFanId(){
+    ArrayList<Integer> list = new ArrayList<>();
+    List<FanUnitInfo> all = fanUnitInfoRepository.findAll();
+    //循环获取所有机组编号
+    for (FanUnitInfo fanUnitInfo : all) {
+      list.add(fanUnitInfo.getFanId());
+    }
+    //过滤重复数据
+    List<Integer> collect = list.stream().distinct().sorted().collect(Collectors.toList());
+
+    ArrayList<Object> fanIdList = new ArrayList<>();
+    //给机组编号起名
+    for (Integer integer : collect) {
+      HashMap<String,Object> fanIdMap = new HashMap<>();
+      //拼接字符串
+      String fanId = "机组" + integer.toString();
+      fanIdMap.put("fanIdStr",fanId);
+      fanIdMap.put("fanId",integer);
+      fanIdList.add(fanIdMap);
+    }
+    return fanIdList;
+  }
 
   /**
    * (分页)