Browse Source

增加气象站

xusl 1 year ago
parent
commit
9d47ab58a8

+ 59 - 59
ipp-ap/src/const/crud/weatherstationinfo.js

@@ -74,64 +74,64 @@ export const tableOption = {
         trigger: 'blur'
       }],
     }
-    , {
-      "type": "select",
-      "label": "是否上报",
-      "prop": "report",
-      rules: [{
-        required: true,
-        message: '请选择是否上报',
-        trigger: 'blur'
-      }],
-      dicData: [{
-        value: '1',
-        label: '是'
-      }, {
-        value: '0',
-        label: '否'
-      }],
-    }
-    , {
-      "type": "select",
-      "label": "入库时间间隔",
-      "prop": "timeInterval",
-      labelWidth: 120,
-      rules: [{
-        required: true,
-        message: '请选择入库时间间隔',
-        trigger: 'blur'
-      }],
-      dicData: [{
-        value: 1,
-        label: '一分钟'
-      }, {
-        value: 5,
-        label: '五分钟'
-      }],
-    }
-    , {
-      "type": "input",
-      "label": "绑定数据采集通道",
-      "prop": "bindTunnel",
-      labelWidth: 140,
-      rules: [{
-        required: true,
-        message: '请选择通道',
-        trigger: 'blur'
-      }],
-    } , {
-      "type": "select",
-      "label": "是否为模板机",
-      "prop": "analyticUse",
-      value: '0',
-      labelWidth: 120,
-      rules: [{
-        required: true,
-        message: '请选择是否为模板机',
-        trigger: 'blur'
-      }],
-      dicData: [{value: '1', label: '是',disabled: false},
-        {value: '0', label: '否'}]
-    }
+    // , {
+    //   "type": "select",
+    //   "label": "是否上报",
+    //   "prop": "report",
+    //   rules: [{
+    //     required: true,
+    //     message: '请选择是否上报',
+    //     trigger: 'blur'
+    //   }],
+    //   dicData: [{
+    //     value: '1',
+    //     label: '是'
+    //   }, {
+    //     value: '0',
+    //     label: '否'
+    //   }],
+    // }
+    // , {
+    //   "type": "select",
+    //   "label": "入库时间间隔",
+    //   "prop": "timeInterval",
+    //   labelWidth: 120,
+    //   rules: [{
+    //     required: true,
+    //     message: '请选择入库时间间隔',
+    //     trigger: 'blur'
+    //   }],
+    //   dicData: [{
+    //     value: 1,
+    //     label: '一分钟'
+    //   }, {
+    //     value: 5,
+    //     label: '五分钟'
+    //   }],
+    // }
+    // , {
+    //   "type": "input",
+    //   "label": "绑定数据采集通道",
+    //   "prop": "bindTunnel",
+    //   labelWidth: 140,
+    //   rules: [{
+    //     required: true,
+    //     message: '请选择通道',
+    //     trigger: 'blur'
+    //   }],
+    // } , {
+    //   "type": "select",
+    //   "label": "是否为模板机",
+    //   "prop": "analyticUse",
+    //   value: '0',
+    //   labelWidth: 120,
+    //   rules: [{
+    //     required: true,
+    //     message: '请选择是否为模板机',
+    //     trigger: 'blur'
+    //   }],
+    //   dicData: [{value: '1', label: '是',disabled: false},
+    //     {value: '0', label: '否'}]
+    // }
   ]
 }

+ 14 - 0
ipp-ap/src/router/views/index.js

@@ -100,6 +100,20 @@ export default [
         permission: "",
         sort: 1,
         spread: false
+      }, {
+        children: [],
+        hasChildren: false,
+        icon: "icon-bangzhushouji",
+        id: "4172",
+        keepAlive: "0",
+        label: "气象站管理",
+        menuType: "0",
+        name: "气象站管理",
+        parentId: "4051",
+        path: "/idp/control/weatherstationinfo/index",
+        permission: "",
+        sort: 1,
+        spread: false
       }
     ]
   },

+ 8 - 9
ipp-ap/src/views/idp/control/weatherstationinfo/index.vue

@@ -37,7 +37,6 @@
       <avue-crud ref="crud"
                  :page.sync="page"
                  :data="tableData"
-                 :permission="permissionList"
                  :table-loading="tableLoading"
                  :option="tableOption"
                  :before-open="beforeOpen"
@@ -89,14 +88,14 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['permissions']),
-    permissionList() {
-      return {
-        addBtn: this.vaildData(this.permissions.idp_weatherstationinfo_add, false),
-        delBtn: this.vaildData(this.permissions.idp_weatherstationinfo_del, false),
-        editBtn: this.vaildData(this.permissions.idp_weatherstationinfo_edit, false)
-      };
-    }
+    // ...mapGetters(['permissions']),
+    // permissionList() {
+    //   return {
+    //     addBtn: this.vaildData(this.permissions.idp_weatherstationinfo_add, false),
+    //     delBtn: this.vaildData(this.permissions.idp_weatherstationinfo_del, false),
+    //     editBtn: this.vaildData(this.permissions.idp_weatherstationinfo_edit, false)
+    //   };
+    // }
   },
   mounted() {
     this.getStationCode()

+ 0 - 1
ipp-ap/src/views/idp/control/windtowerinfo/index.vue

@@ -38,7 +38,6 @@
       <avue-crud ref="crud"
                  :page.sync="page"
                  :data="tableData"
-                 :permission="permissionList"
                  :table-loading="tableLoading"
                  :option="tableOption"
                  @on-load="dataQuery"

+ 143 - 0
ipp-common/ipp-common-data/src/main/java/com/jiayue/ipp/common/data/entity/WeatherStationInfo.java

@@ -0,0 +1,143 @@
+package com.jiayue.ipp.common.data.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jiayue.ipp.common.data.enums.EquipmentTypeEnum;
+import com.jiayue.ipp.common.mybatis.base.BaseDataEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDate;
+
+/**
+ * idp_weather_station_info
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:41
+ */
+@Data
+@TableName("idp_weather_station_info")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "idp_weather_station_info")
+public class WeatherStationInfo extends BaseDataEntity<WeatherStationInfo> {
+    private static final long serialVersionUID = 1L;
+
+    public WeatherStationInfo() {
+        this.setEquipmentType(EquipmentTypeEnum.WEATHERSTATION.getCode());
+    }
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    @ApiModelProperty(value = "主键ID")
+    private String id;
+
+
+    /**
+     * 备用字段A
+     */
+    @ApiModelProperty(value = "备用字段A")
+    private String backupA;
+
+
+    /**
+     * 备用字段B
+     */
+    @ApiModelProperty(value = "备用字段B")
+    private String backupB;
+
+
+    /**
+     * 备用字段C
+     */
+    @ApiModelProperty(value = "备用字段C")
+    private String backupC;
+
+
+    /**
+     * 备用字段D
+     */
+    @ApiModelProperty(value = "备用字段D")
+    private String backupD;
+
+
+    /**
+     * 备用字段E
+     */
+    @ApiModelProperty(value = "备用字段E")
+    private String backupE;
+
+
+    /**
+     * 设备类型
+     */
+    @ApiModelProperty(value = "设备类型")
+    private Integer equipmentType;
+
+
+    /**
+     * 名称
+     */
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+
+    /**
+     * 制造商
+     */
+    @ApiModelProperty(value = "制造商")
+    private String manufacturer;
+
+
+    /**
+     * 型号
+     */
+    @ApiModelProperty(value = "型号")
+    private String modelNumber;
+
+
+    /**
+     * 安装时间
+     */
+    @ApiModelProperty(value = "安装时间")
+    private LocalDate installationTime;
+
+
+    /**
+     * 是否上报 1:是 0 否
+     */
+    @ApiModelProperty(value = "是否上报 1:是 0 否")
+    private String report;
+
+
+    /**
+     * 入库时间间隔 单位 s
+     */
+    @ApiModelProperty(value = "入库时间间隔 单位 s")
+    private Integer timeInterval;
+
+
+    /**
+     * 设备编号
+     */
+    @ApiModelProperty(value = "设备编号")
+    private String equipmentNo;
+
+
+    /**
+     * 绑定数据采集通道
+     */
+    @ApiModelProperty(value = "绑定数据采集通道")
+    private String bindTunnel;
+
+    /**
+     * 是否作为解析使用 1:是 0 否
+     */
+    @ApiModelProperty(value = "是否解析 1:是 0 否")
+    private String analyticUse;
+
+}

+ 144 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/controller/WeatherStationInfoController.java

@@ -0,0 +1,144 @@
+package com.jiayue.ipp.idp.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import com.jiayue.ipp.common.data.entity.WeatherStationInfo;
+import com.jiayue.ipp.idp.service.WeatherStationInfoService;
+import com.jiayue.ipp.idp.util.R;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * idp_weather_station_info
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:41
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/weatherstationinfo")
+@Api(value = "weatherstationinfo", tags = "idp_weather_station_info管理")
+public class WeatherStationInfoController {
+
+    private final WeatherStationInfoService weatherStationInfoService;
+
+    /**
+     * 分页查询
+     *
+     * @param page               分页对象
+     * @param weatherStationInfo idp_weather_station_info
+     * @return
+     */
+    @ApiOperation(value = "分页查询", notes = "分页查询")
+    @GetMapping("/page")
+    public R getWeatherStationInfoPage(Page page, WeatherStationInfo weatherStationInfo) {
+        return R.ok(weatherStationInfoService.page(page, Wrappers.query(weatherStationInfo)));
+    }
+
+    /**
+     * 根据场站编号分页查询
+     *
+     * @param currentPage
+     * @param pageSize
+     * @param stationCode
+     * @return
+     */
+    @ApiOperation(value = "根据场站编号分页查询", notes = "分页查询")
+    @PostMapping("/getByStationCode")
+    public R getByStationCode(Long currentPage, Long pageSize, String stationCode) {
+        Page page = new Page(currentPage, pageSize);
+        page.setMaxLimit((long) -1);
+        return R.ok(weatherStationInfoService.page(page, weatherStationInfoService.findByStationCode(stationCode)));
+    }
+
+    /**
+     * 通过id查询idp_weather_station_info
+     *
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id查询", notes = "通过id查询")
+    @GetMapping("/{id}")
+    public R getById(@PathVariable("id") String id) {
+        return R.ok(weatherStationInfoService.getById(id));
+    }
+
+    /**
+     * 新增idp_weather_station_info
+     *
+     * @param weatherStationInfo idp_weather_station_info
+     * @return R
+     */
+    @ApiOperation(value = "新增idp_weather_station_info", notes = "新增idp_weather_station_info")
+    @PostMapping
+    public R save(@RequestBody WeatherStationInfo weatherStationInfo) {
+        return R.ok(weatherStationInfoService.save(weatherStationInfo));
+    }
+
+    /**
+     * 修改idp_weather_station_info
+     *
+     * @param weatherStationInfo idp_weather_station_info
+     * @return R
+     */
+    @ApiOperation(value = "修改idp_weather_station_info", notes = "修改idp_weather_station_info")
+    @PutMapping
+    public R updateById(@RequestBody WeatherStationInfo weatherStationInfo) {
+        return R.ok(weatherStationInfoService.updateById(weatherStationInfo));
+    }
+
+    /**
+     * 通过id删除idp_weather_station_info
+     *
+     * @param id id
+     * @return R
+     */
+    @ApiOperation(value = "通过id删除idp_weather_station_info", notes = "通过id删除idp_weather_station_info")
+    @DeleteMapping("/{id}")
+    public R removeById(@PathVariable String id) {
+        return R.ok(weatherStationInfoService.removeById(id));
+    }
+
+    /**
+     * 根据场站编号查询 返回map格式
+     *
+     * @param stationCode
+     * @return
+     */
+    @ApiOperation(value = "根据场站编号查询", notes = "分页查询")
+    @PostMapping("/getByStationCodeReturnMap")
+    public R getByStationCode(String stationCode) {
+        List<WeatherStationInfo> windTurbineInfoList = weatherStationInfoService.getByStationCode(stationCode);
+        List<Map<String, String>> list = new ArrayList<>();
+        for (WeatherStationInfo e : windTurbineInfoList) {
+            Map<String, String> map = new HashMap<>();
+            map.put("label", e.getName());
+            map.put("value", e.getEquipmentNo());
+            list.add(map);
+        }
+        return R.ok(list);
+    }
+
+    @GetMapping("/all")
+    public R findAll() {
+        List<WeatherStationInfo> weatherStationInfoList = weatherStationInfoService.list();
+        List<Map<String, String>> list = new ArrayList<>();
+        for (WeatherStationInfo w : weatherStationInfoList) {
+            Map<String, String> map = new HashMap<>();
+            map.put("label", w.getName());
+            map.put("value", w.getEquipmentNo());
+            list.add(map);
+        }
+        return R.ok(list);
+    }
+}

+ 16 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/mapper/WeatherStationInfoMapper.java

@@ -0,0 +1,16 @@
+package com.jiayue.ipp.idp.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jiayue.ipp.common.data.entity.WeatherStationInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * idp_weather_station_info
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:41
+ */
+@Mapper
+public interface WeatherStationInfoMapper extends BaseMapper<WeatherStationInfo> {
+
+}

+ 20 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/WeatherStationInfoService.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipp.idp.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jiayue.ipp.common.data.entity.WeatherStationInfo;
+
+import java.util.List;
+
+
+/**
+ * idp_weather_station_info
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:41
+ */
+public interface WeatherStationInfoService extends IService<WeatherStationInfo> {
+    QueryWrapper<WeatherStationInfo> findByStationCode(String stationCode);
+
+    List<WeatherStationInfo> getByStationCode(String stationCode);
+}

+ 37 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/WeatherStationInfoServiceImpl.java

@@ -0,0 +1,37 @@
+package com.jiayue.ipp.idp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jiayue.ipp.common.data.entity.WeatherStationInfo;
+import com.jiayue.ipp.idp.mapper.WeatherStationInfoMapper;
+import com.jiayue.ipp.idp.service.WeatherStationInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * idp_weather_station_info
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:41
+ */
+@Service
+public class WeatherStationInfoServiceImpl extends ServiceImpl<WeatherStationInfoMapper, WeatherStationInfo> implements WeatherStationInfoService {
+    @Override
+    public QueryWrapper<WeatherStationInfo> findByStationCode(String stationCode) {
+        QueryWrapper<WeatherStationInfo> wrapper = new QueryWrapper<>();
+        if (stationCode != null && !stationCode.equals("")) {
+            wrapper.eq("station_code", stationCode);
+        }
+        return wrapper;
+    }
+
+    @Override
+    public List<WeatherStationInfo> getByStationCode(String stationCode) {
+        QueryWrapper<WeatherStationInfo> wrapper = new QueryWrapper<>();
+        if (stationCode != null && !stationCode.equals("")) {
+            wrapper.eq("station_code", stationCode);
+        }
+        return baseMapper.selectList(wrapper);
+    }
+}

+ 49 - 0
ipp-idp/src/main/resources/mapper/WeatherStationInfoMapper.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~
+  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
+  ~
+  ~  Redistribution and use in source and binary forms, with or without
+  ~  modification, are permitted provided that the following conditions are met:
+  ~
+  ~ Redistributions of source code must retain the above copyright notice,
+  ~  this list of conditions and the following disclaimer.
+  ~  Redistributions in binary form must reproduce the above copyright
+  ~  notice, this list of conditions and the following disclaimer in the
+  ~  documentation and/or other materials provided with the distribution.
+  ~  Neither the name of the pig4cloud.com developer nor the names of its
+  ~  contributors may be used to endorse or promote products derived from
+  ~  this software without specific prior written permission.
+  ~  Author: lengleng (wangiegie@gmail.com)
+  ~
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.jiayue.ipp.idp.mapper.WeatherStationInfoMapper">
+
+    <resultMap id="weatherStationInfoMap" type="com.jiayue.ipp.common.data.entity.WeatherStationInfo">
+        <id property="id" column="id"/>
+        <result property="stationCode" column="station_code"/>
+        <result property="backupA" column="backup_a"/>
+        <result property="backupB" column="backup_b"/>
+        <result property="backupC" column="backup_c"/>
+        <result property="backupD" column="backup_d"/>
+        <result property="backupE" column="backup_e"/>
+        <result property="equipmentType" column="equipment_type"/>
+        <result property="name" column="name"/>
+        <result property="manufacturer" column="manufacturer"/>
+        <result property="modelNumber" column="model_number"/>
+        <result property="installationTime" column="installation_time"/>
+        <result property="report" column="report"/>
+        <result property="timeInterval" column="time_interval"/>
+        <result property="equipmentNo" column="equipment_no"/>
+        <result property="bindTunnel" column="bind_tunnel"/>
+        <result property="creator" column="creator"/>
+        <result property="createTime" column="create_time"/>
+        <result property="lastModifier" column="last_modifier"/>
+        <result property="lastModifyTime" column="last_modify_time"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+</mapper>

+ 50 - 0
ipp-idp/src/main/resources/mapper/WindTowerInfoMapper.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~
+  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
+  ~
+  ~  Redistribution and use in source and binary forms, with or without
+  ~  modification, are permitted provided that the following conditions are met:
+  ~
+  ~ Redistributions of source code must retain the above copyright notice,
+  ~  this list of conditions and the following disclaimer.
+  ~  Redistributions in binary form must reproduce the above copyright
+  ~  notice, this list of conditions and the following disclaimer in the
+  ~  documentation and/or other materials provided with the distribution.
+  ~  Neither the name of the pig4cloud.com developer nor the names of its
+  ~  contributors may be used to endorse or promote products derived from
+  ~  this software without specific prior written permission.
+  ~  Author: lengleng (wangiegie@gmail.com)
+  ~
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.jiayue.ipp.idp.mapper.WindTowerInfoMapper">
+
+    <resultMap id="windTowerInfoMap" type="com.jiayue.ipp.common.data.entity.WindTowerInfo">
+        <id property="id" column="id"/>
+        <result property="stationCode" column="station_code"/>
+        <result property="backupA" column="backup_a"/>
+        <result property="backupB" column="backup_b"/>
+        <result property="backupC" column="backup_c"/>
+        <result property="backupD" column="backup_d"/>
+        <result property="backupE" column="backup_e"/>
+        <result property="equipmentType" column="equipment_type"/>
+        <result property="name" column="name"/>
+        <result property="manufacturer" column="manufacturer"/>
+        <result property="modelNumber" column="model_number"/>
+        <result property="installationTime" column="installation_time"/>
+        <result property="report" column="report"/>
+        <result property="timeInterval" column="time_interval"/>
+        <result property="equipmentNo" column="equipment_no"/>
+        <result property="sample" column="sample"/>
+        <result property="bindTunnel" column="bind_tunnel"/>
+        <result property="creator" column="creator"/>
+        <result property="createTime" column="create_time"/>
+        <result property="lastModifier" column="last_modifier"/>
+        <result property="lastModifyTime" column="last_modify_time"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+</mapper>