1、增加充电功率
2、去掉消息的备注 3、消息查询like deviceid改为等
This commit is contained in:
parent
9dce80fc67
commit
21abf45b5b
@ -94,6 +94,4 @@ public class GnssStatusJoin {
|
||||
Double longitude;
|
||||
@ExcelProperty("海拔")
|
||||
Double altitude;
|
||||
@ExcelProperty("备注")
|
||||
String remark;
|
||||
}
|
||||
|
||||
@ -56,13 +56,12 @@ public class GnssStatusMsg {
|
||||
Integer solarvoltage;
|
||||
@ExcelProperty("充电电流")
|
||||
Integer chargecurrency;
|
||||
|
||||
@ExcelProperty("充电电量")
|
||||
Float chargewatt;
|
||||
@ExcelProperty("温度")
|
||||
Float temperature;
|
||||
|
||||
@ExcelProperty("湿度")
|
||||
Float humidity;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
String remark;
|
||||
}
|
||||
|
||||
@ -69,8 +69,6 @@ public class GnssTrxMsg {
|
||||
|
||||
@ExcelProperty("浮点解")
|
||||
Integer floatnum;
|
||||
@ExcelProperty("备注")
|
||||
String remark;
|
||||
@ExcelProperty("JumpCount")
|
||||
Integer jumpcount;
|
||||
}
|
||||
|
||||
@ -93,7 +93,10 @@ public class D3F0SelfCheckMessage extends BaseMessage {
|
||||
}
|
||||
if(src.readableBytes()>=4){
|
||||
statusMsg.setSolarvoltage(src.readUnsignedShort());
|
||||
statusMsg.setChargecurrency(src.readUnsignedShort());
|
||||
statusMsg.setChargecurrency(src.readUnsignedShort()*10/8); // 1A 0.8V
|
||||
}
|
||||
if(src.readableBytes()>=2){
|
||||
statusMsg.setChargewatt((float) (src.readUnsignedShort()*0.03));// 1V 30wh
|
||||
}
|
||||
|
||||
// read 会移动 bytebuf 的指针,所以保存原始码流需要将此指针挑拨回开始处
|
||||
|
||||
@ -2,7 +2,6 @@ package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.GnssStatusMsg;
|
||||
import com.imdroid.secapi.dto.GnssStatusMsgMapper;
|
||||
@ -11,9 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -46,27 +43,6 @@ public class GnssMsgStatusController extends BasicController implements CommonEx
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
@PostMapping("/gnss/msg/status/remark")
|
||||
@ResponseBody
|
||||
public String updateRemark(HttpSession session, @RequestParam Long id, @RequestParam String remark) {
|
||||
GnssStatusMsg statusMsg = statusMsgMapper.selectById(id);
|
||||
int num = 0;
|
||||
if(statusMsg!=null){
|
||||
opLogManager.addLog(getLoginUser(session),getTenantId(session),
|
||||
OpLogManager.OP_TYPE_UPDATE,
|
||||
OpLogManager.OP_OBJ_DEVICE_MSG,
|
||||
statusMsg.getRemark() + "->" + remark);
|
||||
statusMsg.setRemark(remark);
|
||||
num = statusMsgMapper.updateById(statusMsg);
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
} else{
|
||||
return HttpResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
|
||||
@ -2,7 +2,6 @@ package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.GnssTrxMsg;
|
||||
import com.imdroid.secapi.dto.GnssTrxMsgMapper;
|
||||
@ -11,9 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -46,27 +43,6 @@ public class GnssMsgTrxController extends BasicController implements CommonExcel
|
||||
return this.pageList(session, page, limit, searchParams);
|
||||
}
|
||||
|
||||
@PostMapping("/gnss/msg/trx/remark")
|
||||
@ResponseBody
|
||||
public String updateRemark(HttpSession session, @RequestParam Long id, @RequestParam String remark) {
|
||||
GnssTrxMsg trxMsg = trxMsgMapper.selectById(id);
|
||||
int num = 0;
|
||||
if(trxMsg!=null){
|
||||
opLogManager.addLog(getLoginUser(session),getTenantId(session),
|
||||
OpLogManager.OP_TYPE_UPDATE,
|
||||
OpLogManager.OP_OBJ_DEVICE_MSG,
|
||||
trxMsg.getRemark() + "->" + remark);
|
||||
trxMsg.setRemark(remark);
|
||||
num = trxMsgMapper.updateById(trxMsg);
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
} else{
|
||||
return HttpResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
|
||||
@ -199,6 +199,7 @@ CREATE TABLE IF NOT EXISTS `gnssstatusmsg` (
|
||||
`voltage` int DEFAULT NULL,
|
||||
`solarvoltage` int DEFAULT NULL,
|
||||
`chargecurrency` int DEFAULT NULL,
|
||||
`chargewatt` float DEFAULT NULL,
|
||||
`temperature` float DEFAULT NULL,
|
||||
`humidity` float DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -43,9 +43,7 @@
|
||||
</fieldset>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
<script type="text/html" id="currentTableBar">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">备注</a>
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
@ -59,22 +57,17 @@
|
||||
var cfg_cols = [
|
||||
{field: 'deviceid', title: '设备号', width: 100},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'roll', title: 'roll'},
|
||||
{field: 'pitch', title: 'pitch'},
|
||||
{field: 'yaw', title: 'yaw'},
|
||||
{field: 'roll', title: 'roll', templet: "<div>{{d.roll.toFixed(2)}}</div>"},},
|
||||
{field: 'pitch', title: 'pitch', templet: "<div>{{d.pitch.toFixed(2)}}</div>"},},
|
||||
{field: 'yaw', title: 'yaw', templet: "<div>{{d.yaw.toFixed(2)}}</div>"},},
|
||||
{field: 'rssi', title: '信号强度'},
|
||||
{field: 'voltage', title: '电压(mV)'},
|
||||
{field: 'solarvoltage', title: '光伏电压(mV)'},
|
||||
{field: 'chargecurrency', title: '充电电流(mA)'},
|
||||
{field: 'chargewatt', title: '充电电量(Wh)', templet: "<div>{{d.chargewatt.toFixed(2)}}</div>"},},
|
||||
{field: 'temperature', title: '温度(°C)'},
|
||||
{field: 'humidity', title: '湿度(%)'},
|
||||
{field: 'remark', title: '备注', width: 120},
|
||||
{title: '操作', toolbar: '#currentTableBar', fixed: "right", width: 80}
|
||||
{field: 'humidity', title: '湿度(%)'}
|
||||
];
|
||||
if([[${role}]] != "SUPER_ADMIN") {
|
||||
cfg_cols[11].hide = true;
|
||||
cfg_cols[12].hide = true;
|
||||
}
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
@ -128,34 +121,6 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
table.on('tool(currentTableFilter)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'edit') {
|
||||
layer.prompt({
|
||||
formType: 0,
|
||||
value: data.remark,
|
||||
title: '输入备注',
|
||||
btn: ['确定','取消'],
|
||||
btnAlign: 'c'
|
||||
}, function(value,index){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"/gnss/msg/status/remark",
|
||||
data:{
|
||||
'id':data.id,
|
||||
'remark':value
|
||||
},
|
||||
success: function (data) {
|
||||
//data是cotroller相应处理函数的返回值
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
@ -43,9 +43,6 @@
|
||||
</fieldset>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
<script type="text/html" id="currentTableBar">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">备注</a>
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -71,9 +68,7 @@
|
||||
{field: 'uart2txbytes', title: '串口2发'},
|
||||
{field: 'uart2rxbytes', title: '串口2收'},
|
||||
{field: 'uart2unknown', title: '串口2未知'},
|
||||
{field: 'satelliteinuse', title: '使用卫星数'},
|
||||
{field: 'remark', title: '备注', width: 120},
|
||||
{title: '操作', toolbar: '#currentTableBar', fixed: "right", width: 80}
|
||||
{field: 'satelliteinuse', title: '使用卫星数'}
|
||||
];
|
||||
if([[${role}]] != "SUPER_ADMIN") {
|
||||
data_cols[2].hide = true;
|
||||
@ -86,8 +81,6 @@
|
||||
data_cols[11].hide = true;
|
||||
data_cols[12].hide = true;
|
||||
data_cols[13].hide = true;
|
||||
data_cols[14].hide = true;
|
||||
data_cols[15].hide = true;
|
||||
}
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
@ -142,35 +135,6 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
table.on('tool(currentTableFilter)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'edit') {
|
||||
layer.prompt({
|
||||
formType: 0,
|
||||
value: data.remark,
|
||||
title: '输入备注',
|
||||
btn: ['确定','取消'],
|
||||
btnAlign: 'c'
|
||||
}, function(value,index){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"/gnss/msg/trx/remark",
|
||||
data:{
|
||||
'id':data.id,
|
||||
'remark':value
|
||||
},
|
||||
success: function (data) {
|
||||
//data是cotroller相应处理函数的返回值
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_deviceid" id="input_deviceid" class="layui-input" style="position:absolute;z-index:2;width:85%;" value="" autocomplete="off">
|
||||
<input type="text" name="s_deviceid" id="input_deviceid" class="layui-input" style="position:absolute;z-index:2;width:85%;" value="" autocomplete="off">
|
||||
<select id="deviceid" lay-search="" lay-filter="device" >
|
||||
<option value="">全部</option>
|
||||
</select>
|
||||
|
||||
@ -61,12 +61,6 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" th:if="${role=='SUPER_ADMIN'}">
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_d.remark" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-export-btn"><i class="layui-icon"></i>导出</button>
|
||||
@ -98,7 +92,6 @@
|
||||
table = layui.table;
|
||||
var cfg_cols = [
|
||||
{field: 'deviceid', title: '设备号', sort: true},
|
||||
{field: 'remark', title: '备注', width: 100},
|
||||
{field: 'devicetype', title: '设备类型',templet: '#typeTrans'},
|
||||
{field: 'updatetime', title: '更新时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'state', title: '状态',templet: '#stateTrans'},
|
||||
@ -114,9 +107,6 @@
|
||||
{field: 'latitude', title: '纬度'},
|
||||
{title: '操作', toolbar: '#currentTableBar', fixed: "right", width: 80}
|
||||
];
|
||||
if([[${role}]] != "SUPER_ADMIN") {
|
||||
cfg_cols[1].hide = true;
|
||||
}
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">设备号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sl_deviceid" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="s_deviceid" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user