Переглянути джерело

风速点表增加检索条件及其他页面修正

songhaodong 3 роки тому
батько
коміт
8d0d00b0b6

+ 4 - 4
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/WindSpeedPointInfo.java

@@ -23,14 +23,14 @@ public class WindSpeedPointInfo {
     private String fanNumber;
     //风向
     @Column
-    private int wind;
+    private Integer wind;
     //风速
     @Column
-    private float speed;
+    private Float speed;
     //所属机组
     @Column
-    private int UnitBelongs;
+    private Integer unitBelongs;
     //所属行
     @Column
-    private int belong;
+    private Integer belong;
 }

+ 0 - 7
ipfcst/ipfcst-reportquery/src/main/frontend/router/modules/parameterConfiguration.js

@@ -41,13 +41,6 @@ const parameterConfigurationRouter = {
       meta: {title: '风机曲线', noCache: true},
       sign: 'currency'
     },
-    {
-      path: 'WindSpeedPointInfo1',
-      component: () => import('@/views/parameterConfiguration/windSpeedPointInfo1'),
-      name: 'WindSpeedPointInfo1',
-      meta: {title: '风速点表1', noCache: true},
-      sign: 'currency'
-    },
   ]
 }
 

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

@@ -145,7 +145,7 @@ export default {
     },
     saveRowEvent() {
       this.$axios.post('/cutOutSpeedSpecifyInfo', this.form).then(res => {
-        this.$message.success(res.data.message)
+        this.$message.success(res.message)
         this.initPage()
       }).catch(e => {
         this.$message.error(e)
@@ -185,7 +185,7 @@ export default {
     cutOutSpeedSpecifyInfo() {
       this.loading = true
       this.$axios.get("/readToMysql/cutOutSpeedSpecifyInfo").then((res=>{
-        this.$message.success(res.data.message)
+        this.$message.success(res.message)
         this.loading = false
         this.initPage()
       }))

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

@@ -150,15 +150,15 @@ export default {
         ],
         fanUnitCapacity: [
           {required: true, message: '不能为空'},
-          {pattern: /^[0-9]*[1-9][0-9]*$/,  trigger: 'blur'}
+          {pattern: /^[0-9]*[1-9][0-9]*$/, message:'填写数字', trigger: 'blur'}
         ],
         fullWindSpeed: [
           {required: true, message: '不能为空'},
-          {pattern: /^[0-9]*[1-9][0-9]*$/,  trigger: 'blur'}
+          {pattern: /^[0-9]*[1-9][0-9]*$/,  message:'填写数字', trigger: 'blur'}
         ],
         cutOutSpeed: [
           {required: true, message: '不能为空'},
-          {pattern: /^[0-9]*[1-9][0-9]*$/,  trigger: 'blur'}
+          {pattern: /^[0-9]*[1-9][0-9]*$/, message:'填写数字', trigger: 'blur'}
         ],
         benchmarkFan: [
           {required: true, message: '不能为空'},
@@ -204,7 +204,6 @@ export default {
     },
     // 删除
     handleDelete(index, row) {
-      console.log(index, row);
       this.$XModal.confirm('您确定要删除该数据?').then(type => {
         if (type === 'confirm') {
           this.$axios.delete("/fanUnitInfo/", {data: row}).then(response => {

+ 166 - 119
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/WindSpeedPointInfo/index.vue

@@ -4,21 +4,71 @@
       <div slot="header" class="clearfix">
         <span>风速点表</span>
       </div>
-      <div >
+      <div class="toolMenu">
         <el-row>
-          <el-col :span="16">
-            <el-button type="primary" size="small" @click="insertEvent" >新增</el-button>
-            <el-button type="primary" size="small" :loading="loading" @click="readSpeedSheet" >读取excel</el-button>
+          <el-col :span="4">
+            风机编号
+            <el-input type="text"
+                      v-model="fanNumber"
+                      placeholder="请输入风机编号"
+                      prefix-icon="el-icon-search"
+                      clearable
+                      style="max-width: 180px;"
+                      size="small"
+            ></el-input>
+          </el-col>
+          <el-col :span="4">
+            风向
+            <el-select
+              v-model="wind"
+              clearable
+              size="small"
+              placeholder="请选择">
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-col>
+          <el-col :span="4">
+            风速
             <el-input type="text"
                       v-model="speed"
                       placeholder="请输入风速"
                       prefix-icon="el-icon-search"
                       clearable
-                      style="width: 200px;"
+                      style="max-width: 200px;"
                       size="small"
-                      disabled
             ></el-input>
-            <el-button type="primary" size="small" :loading="loading" @click="findBySpeed" disabled>查询</el-button>
+          </el-col>
+          <el-col :span="4">
+            所属机组
+            <el-input type="text"
+                      v-model="unitBelongs"
+                      placeholder="请输入所属机组"
+                      prefix-icon="el-icon-search"
+                      clearable
+                      style="max-width: 180px;"
+                      size="small"
+            ></el-input>
+          </el-col>
+          <el-col :span="4">
+            所属行
+            <el-input type="text"
+                      v-model="belong"
+                      placeholder="请输入所属行"
+                      prefix-icon="el-icon-search"
+                      clearable
+                      style="max-width: 180px;"
+                      size="small"
+            ></el-input>
+          </el-col>
+          <el-col :span="4">
+            <el-button type="primary" size="small" :loading="loading" @click="findBySomeConditions">查询</el-button>
+            <el-button type="primary" size="small" @click="insertEvent">新增</el-button>
+            <el-button type="primary" size="small" :loading="loading" @click="readSpeedSheet">读取excel</el-button>
           </el-col>
         </el-row>
       </div>
@@ -95,15 +145,15 @@
         >
           <el-form ref="form" :model="form" label-width="120px" :rules="rules">
             <el-form-item label="风机编号" prop="fanNumber">
-              <el-input v-model="form.fanNumber" style="width: 70%" ></el-input>
+              <el-input v-model="form.fanNumber" style="width: 70%"></el-input>
             </el-form-item>
-            <el-form-item label="风向" prop="wind" >
+            <el-form-item label="风向" prop="wind">
               <el-input v-model="form.wind" style="width: 70%"></el-input>
             </el-form-item>
             <el-form-item label="风速 MW" prop="speed">
               <el-input v-model="form.speed" style="width: 70%"></el-input>
             </el-form-item>
-            <el-form-item label="所属机组" prop="UnitBelongs">
+            <el-form-item label="所属机组" prop="unitBelongs">
               <el-input v-model="form.unitBelongs" style="width: 70%"></el-input>
             </el-form-item>
             <el-form-item label="所属行" prop="belong">
@@ -113,46 +163,12 @@
           <template #footer>
         <span class="dialog-footer">
           <el-button @click="dialogVisible = false" style="color: #000000; border: 1px solid #000000">取 消</el-button>
-          <el-button type="primary" @click="saveRowEvent" style="color: #000000; border: 1px solid #000000">确 定</el-button>
+          <el-button type="primary" @click="saveRowEvent"
+                     style="color: #000000; border: 1px solid #000000">确 定</el-button>
         </span>
           </template>
         </el-dialog>
       </div>
-
-
-<!--      <div class="tableContent">-->
-<!--        <vxe-grid-->
-<!--          id="nwpTable"-->
-<!--          ref="nwpRef"-->
-<!--          border-->
-<!--          export-config-->
-<!--          :loading="loading"-->
-<!--          @sort-change="sortChangeEvent"-->
-<!--          :custom-config="{storage: true, checkMethod: checkColumnMethod}"-->
-<!--          :auto-resize="true"-->
-<!--          highlight-hover-row-->
-<!--          :header-cell-style="styleStr"-->
-<!--          max-height="90%"-->
-<!--          :cell-style="styleTableStr"-->
-<!--          align="center"-->
-<!--          :data="tableData"-->
-<!--          :columns="tableColumn"-->
-<!--        >-->
-<!--        </vxe-grid>-->
-<!--        <div class="rtPageturning">-->
-<!--          <vxe-pager-->
-<!--            background-->
-<!--            :loading="loading"-->
-<!--            :current-page.sync="currentPage"-->
-<!--            :page-size.sync="pageSize"-->
-<!--            :total="total"-->
-<!--            @page-change="handlePageChange"-->
-<!--            :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">-->
-<!--          </vxe-pager>-->
-<!--        </div>-->
-<!--      </div>-->
-
-
     </el-card>
   </div>
 </template>
@@ -172,94 +188,107 @@ export default {
       pageSize: 10,
       // 总条数
       total: 0,
-      loading:false,
-      speed: 1,
-      fanNumber: '2',
-      wind: 3,
-      UnitBelongs: 4,
-      belong: '5',
+      loading: false,
+      speed: null,
+      fanNumber: null,
+      wind: null,
+      unitBelongs: null,
+      belong: null,
       rules: {
-        fanNumber: [ { type: 'string',required: true,message: "名称必填", trigger: 'blur'}],
-        wind: [ {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, required: true,message: "填写数字", trigger: 'blur'}],
-        speed: [ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,required: true,message: "填写数字", trigger: 'blur'}],
-        power: [ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,required: true,message: "填写数字", trigger: 'blur'}],
-        UnitBelongs: [ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,required: true,message: "填写数字", trigger: 'blur'}],
-      }
+        fanNumber: [
+          {required: true, message: '此处为必填项'},
+        ],
+        wind: [
+          {required: true, message: '此处为必填项'},
+          {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'},
+        ],
+        speed: [
+          {required: true, message: '此处为必填项'},
+          {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'}
+        ],
+        power: [
+          {required: true, message: '此处为必填项'},
+          {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'}
+        ],
+        unitBelongs: [
+          {required: true, message: '此处为必填项'},
+          {pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: "填写数字", trigger: 'blur'}
+        ],
+      },
+
+      options: [{
+        value: '1',
+        label: '北风'
+      }, {
+        value: '2',
+        label: '东北风'
+      }, {
+        value: '3',
+        label: '东风'
+      }, {
+        value: '4',
+        label: '东南风'
+      }, {
+        value: '5',
+        label: '南风'
+      }, {
+        value: '6',
+        label: '西南风'
+      }, {
+        value: '7',
+        label: '西风'
+      }, {
+        value: '8',
+        label: '西北风'
+      }],
+      value: ''
     }
   },
   methods: {
-    handlePageChange ({ currentPage, pageSize }) {
+    handlePageChange({currentPage, pageSize}) {
       this.currentPage = currentPage
       this.pageSize = pageSize
-      this.initPage()
+      this.findBySomeConditions()
     },
-    windF: function (row, index){
-      if(row.wind == "1"){
+    windF: function (row, index) {
+      if (row.wind == "1") {
         return "北风"
-      }else if(row.wind == "2"){
+      } else if (row.wind == "2") {
         return "东北风"
-      }else if(row.wind == "3"){
+      } else if (row.wind == "3") {
         return "东风"
-      }else if(row.wind == "4"){
+      } else if (row.wind == "4") {
         return "东南风"
-      }else if(row.wind == "5"){
+      } else if (row.wind == "5") {
         return "南风"
-      }else if(row.wind == "6"){
+      } else if (row.wind == "6") {
         return "西南风"
-      }else if(row.wind == "7"){
+      } else if (row.wind == "7") {
         return "西风"
-      }else {
+      } else {
         return "西北风"
       }
     },
 
-    // 获取分页数据
-    initPage() {
-      this.$axios.get("/windSpeedPointInfo/" + this.currentPage + '/' + this.pageSize).then(response => {
-        this.tableData = response.data.content
-        this.total = response.data.count
-        //
-        // this.tableColumn = [
-        //   { field: 'id', title: 'id',sortable:true,minWidth:"150",width:"180" },
-        //   { field: 'fanNumber', title: '风机编号',minWidth:"60"},
-        //   { field: 'wind', title: '风向',minWidth:"60"},
-        //   { field: 'speed', title: '风速',minWidth:"60"},
-        //   { field: 'unitBelongs', title: '所属机组',minWidth:"60"},
-        //   { field: 'belong', title: '所属',minWidth:"60"},
-        //
-        // ]
 
-      })
-    },
-// /{size}/{fanNumber}/{wind}/{speed}/{unitBelongs}/{belong}
-    init2() {
-      this.$axios.get("/windSpeedPointInfo/bySomeConditions/" + this.currentPage + "/" + this.pageSize + "/" + this.fanNumber + '/' + this.wind + '/' + this.speed + '/' + this.UnitBelongs   + '/' + this.belong).then(res =>{
-        console.log(res.data.content);
-      })
-    },
     insertEvent() {
       this.form = {};
       this.dialogVisible = true;
     },
     saveRowEvent() {
       this.$axios.post('/windSpeedPointInfo', this.form).then(res => {
-        this.$message.success(
-          '操作成功!!!'
-        )
-        this.initPage()
+        this.$message.success(res.message)
+        this.findBySomeConditions()
       }).catch(e => {
-        this.$message.error(
-          '操作失败!!!'
-        )
+        this.$message.error(e)
       })
       this.dialogVisible = false;
-      this.initPage()
+      this.findBySomeConditions()
     },
     handleEdit(index, row) {
-      console.log(index, row);
       this.form = JSON.parse(JSON.stringify(row))
       this.dialogVisible = true
-      this.initPage()
+      this.findBySomeConditions()
     },
     // 删除
     handleDelete(index, row) {
@@ -267,37 +296,50 @@ export default {
         if (type === 'confirm') {
           this.$axios.delete("/windSpeedPointInfo/", {data: row}).then(response => {
             this.$XModal.message({status: 'warning', message: response.message})
-            this.initPage()
+            this.findBySomeConditions()
           })
         }
       })
     },
 
-    readSpeedSheet(){
+    readSpeedSheet() {
       this.$XModal.confirm('是否从Excel读取数据?').then(type => {
         if (type === 'confirm') {
           this.loading = true
-          this.$axios.get("/readToMysql/readSpeedSheet").then( res => {
-            this.$message.success(
-              res.message
-            )
+          this.$axios.get("/readToMysql/readSpeedSheet").then(res => {
+            this.$message.success(res.message)
             this.loading = false
-            this.initPage()
+            this.findBySomeConditions()
+          }).catch(e => {
+            this.$message.error(e)
           })
         }
       })
     },
-    findBySpeed(){
-      this.$axios.get("/windSpeedPointInfo/" + this.currentPage + '/' + this.pageSize + '/' + this.speed).then(response => {
-        this.tableData = response.data.content
-        this.total = response.data.count
-
+    findBySomeConditions() {
+      if (this.fanNumber == '') {
+        this.fanNumber = null
+      }
+      if (this.wind == '') {
+        this.wind = null
+      }
+      if (this.speed == '') {
+        this.speed = null
+      }
+      if (this.unitBelongs == '') {
+        this.unitBelongs = null
+      }
+      if (this.belong == '') {
+        this.belong = null
+      }
+      this.$axios.get("/windSpeedPointInfo/bySomeConditions/" + this.currentPage + "/" + this.pageSize + "/" + this.fanNumber + '/' + this.wind + '/' + this.speed + '/' + this.unitBelongs + '/' + this.belong).then(res => {
+        this.tableData = res.data.content
+        this.total = res.data.totalElements
       })
     }
   },
   mounted() {
-    this.initPage();
-    // this.init2()
+    this.findBySomeConditions();
   }
 }
 </script>
@@ -307,6 +349,7 @@ export default {
   background: transparent;
   color: #ffffff;
 }
+
 .el-button {
   round-clip: 10px;
   color: #ffffff;
@@ -314,23 +357,27 @@ export default {
   border: 1px solid #fff;
 
 }
+
 ::v-deep .el-table, .el-table__expanded-cell {
   margin-top: 20px;
   background-color: transparent;
   color: #ffffff;
 }
-/deep/ .el-table--enable-row-hover .el-table__body tr:hover>td {
+
+/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td {
   background-color: transparent;
 }
 
 ::v-deep .el-table tr {
   background-color: transparent !important;
 }
-::v-deep .el-table__body td,::v-deep .el-table__header th, .el-table .cell {
+
+::v-deep .el-table__body td, ::v-deep .el-table__header th, .el-table .cell {
   background-color: transparent;
 }
+
 ::v-deep .el-table::before {
-left: 0;
+  left: 0;
   bottom: 0;
   width: 100%;
   height: 0px;

+ 0 - 247
ipfcst/ipfcst-reportquery/src/main/frontend/views/parameterConfiguration/windSpeedPointInfo1/index.vue

@@ -1,247 +0,0 @@
-<template>
-  <div className="app-container">
-    <div className="xTable">
-      <vxe-grid ref='xGrid' v-bind="gridOptions"></vxe-grid>
-    </div>
-  </div>
-</template>
-
-<script>
-
-export default {
-  data() {
-    return {
-      gridOptions: {
-        border: true,
-        resizable: true,
-        showHeaderOverflow: true,
-        showOverflow: true,
-        highlightHoverRow: true,
-        keepSource: true,
-        id: 'full_edit_1',
-        height: 600,
-        rowId: 'id',
-        customConfig: {
-          storage: true,
-          checkMethod: this.checkColumnMethod
-        },
-        printConfig: {
-          columns: [
-            {field: 'name'},
-            {field: 'email'},
-            {field: 'nickname'},
-            {field: 'age'},
-            {field: 'amount'}
-          ]
-        },
-        sortConfig: {
-          trigger: 'cell',
-          remote: true
-        },
-        filterConfig: {
-          remote: true
-        },
-        pagerConfig: {
-          pageSize: 10,
-          pageSizes: [5, 10, 15, 20, 50, 100, 200, 500, 1000]
-        },
-        formConfig: {
-          titleWidth: 100,
-          titleAlign: 'right',
-          items: [
-            {
-              field: 'name',
-              title: '风机编号',
-              span: 8,
-              titlePrefix: {message: 'app.body.valid.rName', icon: 'fa fa-exclamation-circle'},
-              itemRender: {name: '$input', props: {placeholder: '请输入风机编号'}}
-            },
-            {field: 'wind', title: '风向', span: 8, itemRender: {name: '$select', options: [
-                  {}
-                ]}},
-            {field: 'speed', title: '风速', span: 8, itemRender: {name: '$input', props: {placeholder: '请输入风速'}}},
-            {
-              field: 'unitBelong',
-              title: '所属机组',
-              span: 8,
-              itemRender: {name: '$input', props: {placeholder: '请输入所属机组'}}
-            },
-            {field: 'belong', title: '所属行', span: 8, itemRender: {name: '$input', props: {placeholder: '请输入所属行'}}},
-            // { field: 'unitBelong', title: '所属机组', span: 8, folding: true, itemRender: { name: '$input', props: { placeholder: '请输入所属机组' } } },
-            // { field: 'belong', title: '所属行', span: 8, folding: true, titleSuffix: { message: '注意,必填信息!', icon: 'fa fa-info-circle' }, itemRender: { name: '$select', options: [] } },
-            // { field: 'age', title: '年龄', span: 8, folding: true, itemRender: { name: '$input', props: { type: 'number', min: 1, max: 120, placeholder: '请输入年龄' } } },
-            {
-              span: 24,
-              align: 'center',
-              itemRender: {
-                name: '$buttons',
-                children: [{props: {type: 'submit', content: '提交', status: 'primary'}}, {
-                  props: {
-                    type: 'reset',
-                    content: '重置'
-                  }
-                }]
-              }
-            }
-          ]
-        },
-        toolbarConfig: {
-          buttons: [
-            {code: 'insert_actived', name: '新增', icon: 'fa fa-plus'},
-            {code: 'delete', name: '直接删除', icon: 'fa fa-trash-o'},
-            {code: 'mark_cancel', name: '删除/取消', icon: 'fa fa-trash-o'},
-            {code: 'save', name: '保存', icon: 'fa fa-save', status: 'success'}
-          ],
-          refresh: true,
-          import: true,
-          export: true,
-          print: true,
-          zoom: true,
-          custom: true
-        },
-        proxyConfig: {
-          seq: true, // 启用动态序号代理
-          sort: true, // 启用排序代理
-          filter: true, // 启用筛选代理
-          form: true, // 启用表单代理
-          props: {
-            result: 'result',
-            total: 'page.total'
-          },
-          ajax: {
-            // // 接收 Promise 对象
-            // query: ({ page, sorts, filters, form }) => {
-            //   const queryParams = Object.assign({}, form)
-            //   // 处理排序条件
-            //   const firstSort = sorts[0]
-            //   if (firstSort) {
-            //     queryParams.sort = firstSort.property
-            //     queryParams.order = firstSort.order
-            //   }
-            //   // 处理筛选条件
-            //   filters.forEach(({ property, values }) => {
-            //     queryParams[property] = values.join(',')
-            //   })
-            //   return XEAjax.get(`${this.serveApiUrl}/api/pub/page/list/${page.pageSize}/${page.currentPage}`, queryParams)
-            // },
-            delete: ({body}) => XEAjax.post(`${this.serveApiUrl}/api/pub/save`, body),
-            save: ({body}) => XEAjax.post(`${this.serveApiUrl}/api/pub/save`, body)
-          }
-        },
-        columns: [
-          {type: 'checkbox', title: 'ID', width: 120},
-          {field: 'id', title: 'ID', sortable: true, editRender: {name: 'input'}},
-          {field: 'fanNumber', title: '风机编号', sortable: true, editRender: {name: 'input'}},
-          {field: 'wind', title: '风向', sortable: true, editRender: {name: 'input'}},
-          {field: 'speed', title: '风速', sortable: true, editRender: {name: 'input'}},
-          {field: 'unitBelongs', title: '所属机组', sortable: true, editRender: {name: 'input'}},
-          {field: 'belong', title: '所属行', sortable: true, editRender: {name: 'input'}},
-
-        ],
-        importConfig: {
-          remote: true,
-          importMethod: this.importMethod,
-          types: ['xlsx'],
-          modes: ['insert']
-        },
-        exportConfig: {
-          remote: true,
-          exportMethod: this.exportMethod,
-          types: ['xlsx'],
-          modes: ['current', 'selected', 'all']
-        },
-        checkboxConfig: {
-          labelField: 'id',
-          reserve: true,
-          highlight: true,
-          range: true
-        },
-        editRules: {},
-        editConfig: {
-          trigger: 'click',
-          mode: 'row',
-          showStatus: true
-        }
-      }
-    }
-  },
-  computed: {
-    // ...mapState([
-    //   'serveApiUrl'
-    // ])
-  },
-  created() {
-    this.findSexList()
-  },
-  methods: {
-    async findSexList() {
-      // const sexList = await XEAjax.get('/api/conf/sex/list')
-      // // 异步更新下拉选项
-      // this.sexList = sexList
-      // const xGrid = this.$refs.xGrid
-      // if (xGrid) {
-      //   const sexColumn = xGrid.getColumnByField('sex')
-      //   sexColumn.editRender.options = sexList
-      //   const sexItem = xGrid.getFormItems(4)
-      //   sexItem.itemRender.options = sexList
-      // }
-    },
-    formatAmount({cellValue}) {
-      // return cellValue ? `$${XEUtils.commafy(XEUtils.toNumber(cellValue), { digits: 2 })}` : ''
-    },
-    formatDate({cellValue}) {
-      // return XEUtils.toDateString(cellValue, 'yyyy-MM-dd HH:ss:mm')
-    },
-    checkColumnMethod({column}) {
-      // if (['nickname', 'role'].includes(column.property)) {
-      //   return false
-      // }
-      // return true
-    },
-    importMethod({file}) {
-      // const formBody = new FormData()
-      // formBody.append('file', file)
-      // return XEAjax.post(`${this.serveApiUrl}/api/pub/import`, formBody).then(data => {
-      //   this.$XModal.message({ message: `成功导入 ${data.result.insertRows} 条记录!`, status: 'success' })
-      //   // 导入完成,刷新表格
-      //   this.$refs.xGrid.commitProxy('query')
-      // }).catch(() => {
-      //   this.$XModal.message({ message: '导入失败,请检查数据是否正确!', status: 'error' })
-      // })
-    },
-    exportMethod({options}) {
-      // const proxyInfo = this.$refs.xGrid.getProxyInfo()
-      // // 传给服务端的参数
-      // const body = {
-      //   filename: options.filename,
-      //   sheetName: options.sheetName,
-      //   isHeader: options.isHeader,
-      //   original: options.original,
-      //   mode: options.mode,
-      //   pager: proxyInfo.pager,
-      //   ids: options.mode === 'selected' ? options.data.map(item => item.id) : [],
-      //   fields: options.columns.map(column => {
-      //     return {
-      //       field: column.property,
-      //       title: column.title
-      //     }
-      //   })
-      // }
-      // // 开始服务端导出
-      // return XEAjax.post(`${this.serveApiUrl}/api/pub/export`, body).then(data => {
-      //   if (data.id) {
-      //     this.$XModal.message({ message: '导出成功,开始下载', status: 'success' })
-      //     // 读取路径,请求文件流 => 开始下载
-      //     location.href = `${this.serveApiUrl}/api/pub/export/download/${data.id}`
-      //   }
-      // }).catch(() => {
-      //   this.$XModal.message({ message: '导出失败!', status: 'error' })
-      // })
-    }
-  }
-}
-</script>
-
-<style scoped>
-
-</style>

+ 7 - 7
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/controller/WindSpeedPointInfoServiceController.java

@@ -5,6 +5,7 @@ import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.WindSpeedPointInfo;
 import com.jiayue.ipfcst.service.WindSpeedPointInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -81,13 +82,12 @@ public class WindSpeedPointInfoServiceController {
   public ResponseVO getBySomeConditions(@PathVariable("page") Integer page,
                         @PathVariable("size") Integer size,
                         @PathVariable("fanNumber") String fanNumber,
-                        @PathVariable("wind") Integer wind,
-                        @PathVariable("speed") Float speed,
-                        @PathVariable("unitBelongs") Integer unitBelongs,
-                        @PathVariable("belong") Integer belong){
-    Map<String, Object> map;
-    map = this.windSpeedPointInfoService.getBySomeConditions(page, size, fanNumber, wind, speed, unitBelongs, belong);
-    return ResponseVO.success(map);
+                        @PathVariable("wind") String wind,
+                        @PathVariable("speed") String speed,
+                        @PathVariable("unitBelongs") String unitBelongs,
+                        @PathVariable("belong") String belong){
+    Page<WindSpeedPointInfo> bySomeConditions = this.windSpeedPointInfoService.getBySomeConditions(page, size, fanNumber, wind, speed, unitBelongs, belong);
+    return ResponseVO.success(bySomeConditions);
   }
 }
 

+ 31 - 23
ipfcst/ipfcst-reportquery/src/main/java/com/jiayue/ipfcst/service/WindSpeedPointInfoService.java

@@ -105,21 +105,23 @@ public class WindSpeedPointInfoService {
   }
 
 
-  public Map<String, Object> getBySomeConditions(Integer page, Integer size, String FanNumber,Integer wind, Float speed, Integer unitBelongs, Integer belong){
+  public Page<WindSpeedPointInfo> getBySomeConditions(Integer page, Integer size, String fanNumber,String wind,
+                                                 String speed, String unitBelongs, String belong){
     Map<String, Object> map = new HashMap<>();
-    WindSpeedPointInfo windSpeedPointInfo = new WindSpeedPointInfo();
-    windSpeedPointInfo.setFanNumber(FanNumber);
-    windSpeedPointInfo.setWind(wind);
-    windSpeedPointInfo.setSpeed(speed);
-    windSpeedPointInfo.setUnitBelongs(unitBelongs);
-    windSpeedPointInfo.setBelong(belong);
-    Specification<WindSpeedPointInfo> specification = this.specificationBySomeConditions(windSpeedPointInfo);
+    String nFanNumber = "null";
+    if(!fanNumber.equals("null")){
+      nFanNumber = "#"+fanNumber+"#";
+    }
+
+    Specification<WindSpeedPointInfo> specification = this.specificationBySomeConditions(nFanNumber, wind, speed, unitBelongs, belong);
     Pageable pageable = PageRequest.of(page - 1, size);
     Page<WindSpeedPointInfo> windSpeedPointInfos = windSpeedPointInfoRepository.findAll(specification, pageable);
-    List<WindSpeedPointInfo> windSpeedPointInfoList = windSpeedPointInfos.getContent();
-    map.put("content", windSpeedPointInfoList);
-    map.put("count", windSpeedPointInfos.getTotalElements());
-    return map;
+//    List<WindSpeedPointInfo> windSpeedPointInfos = windSpeedPointInfoRepository.findAll(specification);
+//    List<WindSpeedPointInfo> windSpeedPointInfoList = windSpeedPointInfos.getContent();
+//    map.put("content", windSpeedPointInfos);
+//    map.put("count", windSpeedPointInfos.getTotalElements());
+//    map.put("count", windSpeedPointInfos.size());
+    return windSpeedPointInfos;
   }
 
 
@@ -138,35 +140,41 @@ public class WindSpeedPointInfoService {
   }
 
 
-  Specification<WindSpeedPointInfo> specificationBySomeConditions(final WindSpeedPointInfo windSpeedPointInfo) {
+  Specification<WindSpeedPointInfo> specificationBySomeConditions(final String fanNumber,final String wind,
+                                                                  final String speed, final String unitBelongs,
+                                                                  final String belong) {
     return (Specification<WindSpeedPointInfo>) (root, criteriaQuery, cb) -> {
       List<Predicate> predicates = new ArrayList<>();
 
+
       // 风机编号模糊查询
-      if (!StringUtils.isEmpty(windSpeedPointInfo.getFanNumber())) {
-        predicates.add(cb.equal(root.get("fanNumber"), windSpeedPointInfo.getWind()));
+      if (!fanNumber.equals("null")) {
+        predicates.add(cb.equal(root.get("fanNumber"), fanNumber));
       }
 
       // 风向查询
-      if (!StringUtils.isEmpty(Integer.toString(windSpeedPointInfo.getWind()))) {
-        predicates.add(cb.like(root.get("wind"), "%"+windSpeedPointInfo.getFanNumber()+"%"));
+      if (!wind.equals("null")) {
+        predicates.add(cb.equal(root.get("wind"), wind));
       }
 
       // 风速查询
-      if (!StringUtils.isEmpty(Float.toString(windSpeedPointInfo.getSpeed()))) {
-        predicates.add(cb.equal(root.get("speed"), windSpeedPointInfo.getSpeed()));
+      if (!speed.equals("null")) {
+        predicates.add(cb.equal(root.get("speed"), speed));
       }
 
       // 所属机组
-      if (!StringUtils.isEmpty(Integer.toString(windSpeedPointInfo.getUnitBelongs()))) {
-        predicates.add(cb.equal(root.get("UnitBelongs"), windSpeedPointInfo.getUnitBelongs()));
+      if (!unitBelongs.equals("null")) {
+        predicates.add(cb.equal(root.get("unitBelongs"), unitBelongs));
       }
 
       // 所属行
-      if (!StringUtils.isEmpty(Integer.toString(windSpeedPointInfo.getUnitBelongs()))) {
-        predicates.add(cb.equal(root.get("belong"), windSpeedPointInfo.getBelong()));
+      if (!belong.equals("null")) {
+        predicates.add(cb.equal(root.get("belong"), belong));
       }
 
+//      if (predicates.isEmpty()) {
+//        return cb.isNotNull(root.get("id"));
+//      }
       //添加排序的功能
       return cb.and(predicates.toArray(new Predicate[predicates.size()]));