Browse Source

onenet参数

master
lijunjie 3 years ago
parent
commit
3fd735f202
  1. 30
      ruoyi-admin/src/main/java/com/ruoyi/web/domain/po/OnenetConfig.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/web/persist/mapper/OnenetConfigMapper.java
  3. 12
      ruoyi-admin/src/main/resources/mapper/device/OnenetConfigMapper.xml
  4. 42
      ruoyi-ui/src/views/device/config/index.vue
  5. 4
      ruoyi-ui/src/views/device/equips/index.vue
  6. 4
      ruoyi-ui/src/views/device/receive/index.vue

30
ruoyi-admin/src/main/java/com/ruoyi/web/domain/po/OnenetConfig.java

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* onenet参数对象 onenet_config * onenet参数对象 onenet_config
* *
* @author lijunjie * @author lijunjie
* @date 2023-01-06 * @date 2023-02-02
*/ */
public class OnenetConfig extends BaseEntity public class OnenetConfig extends BaseEntity
{ {
@ -26,6 +26,14 @@ public class OnenetConfig extends BaseEntity
@Excel(name = "值") @Excel(name = "值")
private String configValue; private String configValue;
/** 是否可以修改 1可以 2不可以 */
@Excel(name = "是否可以修改 1可以 2不可以")
private Integer ableUpdate;
/** 是否可以删除 1可以 2不可以 */
@Excel(name = "是否可以删除 1可以 2不可以")
private Integer ableDelete;
public void setId(Integer id) public void setId(Integer id)
{ {
this.id = id; this.id = id;
@ -53,6 +61,24 @@ public class OnenetConfig extends BaseEntity
{ {
return configValue; return configValue;
} }
public void setAbleUpdate(Integer ableUpdate)
{
this.ableUpdate = ableUpdate;
}
public Integer getAbleUpdate()
{
return ableUpdate;
}
public void setAbleDelete(Integer ableDelete)
{
this.ableDelete = ableDelete;
}
public Integer getAbleDelete()
{
return ableDelete;
}
@Override @Override
public String toString() { public String toString() {
@ -60,6 +86,8 @@ public class OnenetConfig extends BaseEntity
.append("id", getId()) .append("id", getId())
.append("configKey", getConfigKey()) .append("configKey", getConfigKey())
.append("configValue", getConfigValue()) .append("configValue", getConfigValue())
.append("ableUpdate", getAbleUpdate())
.append("ableDelete", getAbleDelete())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())

2
ruoyi-admin/src/main/java/com/ruoyi/web/persist/mapper/OnenetConfigMapper.java

@ -7,7 +7,7 @@ import com.ruoyi.web.domain.po.OnenetConfig;
* onenet参数Mapper接口 * onenet参数Mapper接口
* *
* @author lijunjie * @author lijunjie
* @date 2023-01-06 * @date 2023-02-02
*/ */
public interface OnenetConfigMapper public interface OnenetConfigMapper
{ {

12
ruoyi-admin/src/main/resources/mapper/device/OnenetConfigMapper.xml

@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" /> <result property="id" column="id" />
<result property="configKey" column="config_key" /> <result property="configKey" column="config_key" />
<result property="configValue" column="config_value" /> <result property="configValue" column="config_value" />
<result property="ableUpdate" column="able_update" />
<result property="ableDelete" column="able_delete" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@ -15,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectOnenetConfigVo"> <sql id="selectOnenetConfigVo">
select id, config_key, config_value, create_by, create_time, update_by, update_time from onenet_config select id, config_key, config_value, able_update, able_delete, create_by, create_time, update_by, update_time from onenet_config
</sql> </sql>
<select id="selectOnenetConfigList" parameterType="OnenetConfig" resultMap="OnenetConfigResult"> <select id="selectOnenetConfigList" parameterType="OnenetConfig" resultMap="OnenetConfigResult">
@ -23,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="configKey != null and configKey != ''"> and config_key = #{configKey}</if> <if test="configKey != null and configKey != ''"> and config_key = #{configKey}</if>
<if test="configValue != null and configValue != ''"> and config_value = #{configValue}</if> <if test="configValue != null and configValue != ''"> and config_value = #{configValue}</if>
<if test="ableUpdate != null "> and able_update = #{ableUpdate}</if>
<if test="ableDelete != null "> and able_delete = #{ableDelete}</if>
</where> </where>
</select> </select>
@ -36,6 +40,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="configKey != null and configKey != ''">config_key,</if> <if test="configKey != null and configKey != ''">config_key,</if>
<if test="configValue != null and configValue != ''">config_value,</if> <if test="configValue != null and configValue != ''">config_value,</if>
<if test="ableUpdate != null">able_update,</if>
<if test="ableDelete != null">able_delete,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -44,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="configKey != null and configKey != ''">#{configKey},</if> <if test="configKey != null and configKey != ''">#{configKey},</if>
<if test="configValue != null and configValue != ''">#{configValue},</if> <if test="configValue != null and configValue != ''">#{configValue},</if>
<if test="ableUpdate != null">#{ableUpdate},</if>
<if test="ableDelete != null">#{ableDelete},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -56,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if> <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if> <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
<if test="ableUpdate != null">able_update = #{ableUpdate},</if>
<if test="ableDelete != null">able_delete = #{ableDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>

42
ruoyi-ui/src/views/device/config/index.vue

@ -1,10 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="configKey"> <el-form-item label="键名" prop="configKey">
<el-input <el-input
v-model="queryParams.configKey" v-model="queryParams.configKey"
placeholder="请输入" placeholder="请输入键名"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -34,28 +34,6 @@
v-hasPermi="['device:config:add']" v-hasPermi="['device:config:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:config:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:config:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -71,12 +49,13 @@
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" />
<el-table-column label="" align="center" prop="configKey" /> <el-table-column label="键名" align="center" prop="configKey" />
<el-table-column label="值" align="center" prop="configValue" /> <el-table-column label="值" align="center" prop="configValue" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.ableUpdate == 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@ -84,6 +63,7 @@
v-hasPermi="['device:config:edit']" v-hasPermi="['device:config:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
v-if="scope.row.ableDelete == 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@ -105,8 +85,8 @@
<!-- 添加或修改onenet参数对话框 --> <!-- 添加或修改onenet参数对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="" prop="configKey"> <el-form-item label="键名" prop="configKey">
<el-input v-model="form.configKey" placeholder="请输入" /> <el-input v-model="form.configKey" :disabled="config_key_disabled" placeholder="请输入键名" />
</el-form-item> </el-form-item>
<el-form-item label="值" prop="configValue"> <el-form-item label="值" prop="configValue">
<el-input v-model="form.configValue" placeholder="请输入值" /> <el-input v-model="form.configValue" placeholder="请输入值" />
@ -137,6 +117,8 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
//
config_key_disabled: false,
// //
total: 0, total: 0,
// onenet // onenet
@ -157,7 +139,7 @@ export default {
// //
rules: { rules: {
configKey: [ configKey: [
{ required: true, message: "不能为空", trigger: "blur" } { required: true, message: "键名不能为空", trigger: "blur" }
], ],
configValue: [ configValue: [
{ required: true, message: "值不能为空", trigger: "blur" } { required: true, message: "值不能为空", trigger: "blur" }
@ -216,6 +198,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.config_key_disabled = false;
this.title = "添加onenet参数"; this.title = "添加onenet参数";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
@ -225,6 +208,7 @@ export default {
getConfig(id).then(response => { getConfig(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.config_key_disabled = true;
this.title = "修改onenet参数"; this.title = "修改onenet参数";
}); });
}, },

4
ruoyi-ui/src/views/device/equips/index.vue

@ -230,8 +230,8 @@
<el-dialog title="onenet推送记录" :visible.sync="receiveDataOpen" width="80%"> <el-dialog title="onenet推送记录" :visible.sync="receiveDataOpen" width="80%">
<el-table v-loading="loading" :data="receiveDataList"> <el-table v-loading="loading" :data="receiveDataList">
<el-table-column label="主键" align="center" prop="id" /> <el-table-column width="50" label="主键" align="center" prop="id" />
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column width="200" label="创建时间" align="center" prop="createTime" />
<el-table-column label="推送数据" align="center" prop="value" /> <el-table-column label="推送数据" align="center" prop="value" />
</el-table> </el-table>
<pagination <pagination

4
ruoyi-ui/src/views/device/receive/index.vue

@ -79,9 +79,9 @@
<el-table v-loading="loading" :data="receiveList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="receiveList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" width="50"/>
<el-table-column label="imei" align="center" prop="imei" /> <el-table-column label="imei" align="center" prop="imei" />
<el-table-column label="推送数据" align="center" prop="value" /> <el-table-column label="推送数据" align="center" prop="value" min-width="500"/>
<el-table-column label="消息摘要 <el-table-column label="消息摘要
" align="center" prop="msgSignature" /> " align="center" prop="msgSignature" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">

Loading…
Cancel
Save