change - add震动实时监控页面

master
yinq 2 months ago
parent 4899d48f69
commit b67d812523

@ -1,8 +1,12 @@
海威演示测温能源管理系统
一、海威演示测温、阵列、能源管理系统
新疆昆仑工程轮胎有限责任公司
二、 新疆昆仑工程轮胎有限责任公司
炼胶工区高压配电室母排及车间电机测温系统
1、服务器登录用户名Administrator 密码haiwei@2024
2、采集服务地址端口服务器IP地址:5656
3、SqlServer数据库用户名sa 密码haiwei@2024
3、SqlServer数据库用户名sa 密码haiwei@2024
三、沈阳赛轮
数据库 ip地址是192.168.100.60
SqlServer数据库用户名sa 密码abc@123
采集服务地址192.168.100.60:6001

@ -115,4 +115,27 @@ public class TVibrationsensorDataController extends BaseController {
public AjaxResult remove(String ids) {
return toAjax(tVibrationsensorDataService.deleteTVibrationsensorDataByIds(ids));
}
/**
*
* @return
*/
@GetMapping("realTimeMonitorView")
public String realTimeMonitorView() {
return prefix + "/RealTimeMonitor";
}
/**
*
* @param tVibrationsensorData
* @return
*/
@PostMapping("/realTimeMonitor")
@ResponseBody
public AjaxResult realTimeMonitor(TVibrationsensorData tVibrationsensorData) {
List<TVibrationsensorData> tVibrationsensorData1 = tVibrationsensorDataService.selectRealTimeMonitor(tVibrationsensorData);
return AjaxResult.success(tVibrationsensorData1);
}
}

@ -7,9 +7,9 @@ spring:
# 主库数据源
master:
# 海威环境
url: jdbc:sqlserver://175.27.215.92:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems
url: jdbc:sqlserver://119.45.202.115:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems
username: sa
password: Hawei@123
password: haiwei@123
# 新疆库尔勒测温环境
# url: jdbc:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=hw_iot_ems
# username: sa

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('振动传感器实时监控')" />
<th:block th:include="include :: layout-latest-css"/>
<th:block th:include="include :: ztree-css"/>
<th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-west">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 测控点信息
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="测控点信息"><i
class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i
class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i
class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i>
</button>
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<input type="hidden" id="sensorId" name="sensorId">
<div class="select-list">
<ul>
<li class="select-time">
<label>采集时间:</label>
<input type="text" style="width: 150px" class="form-control" id="laydate-demo-3" placeholder="开始时间" name="params[beginCollectTime]"/>
<span>-</span>
<input type="text" style="width: 150px" class="form-control" id="laydate-demo-4" placeholder="结束时间" name="params[endCollectTime]"/>
</li>
<!-- <li>-->
<!-- <label>振动传感器ID</label>-->
<!-- <input type="text" name="sensorId"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>记录时间:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginRecodeTime]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endRecodeTime]"/>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:TVibrationsensorData:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:TVibrationsensorData:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:TVibrationsensorData:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:TVibrationsensorData:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:TVibrationsensorData:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:TVibrationsensorData:remove')}]];
var prefix = ctx + "system/TVibrationsensorData";
$(function () {
var panehHidden = false;
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({initClosed: panehHidden, west__size: 245});
queryUserList();
queryDeptTree();
});
function queryUserList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "振动传感器数据",
columns: [{
checkbox: true
},
{
field: 'objId',
title: '主键标识',
visible: false
},
{
field: 'sensorId',
title: '振动传感器ID'
},
{
field: 'speed',
title: '速度(mm/s)'
},
{
field: 'displacement',
title: '位移(um)'
},
{
field: 'acceleration',
title: '加速度(g)'
},
{
field: 'temperature',
title: '温度(℃)'
},
{
field: 'collectTime',
title: '采集时间'
},
{
field: 'recodeTime',
title: '记录时间'
},
{
field: 'remark',
title: '备注',
visible: false
},
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
};
function queryDeptTree() {
var url = ctx + "system/Monitor/treeData?monitorType=" + 20;
var options = {
url: url,
expandLevel: 1,
onClick: zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
$("#sensorId").val(treeNode.id);
/*alert(treeNode.id)*/
$.table.search();
}
}
$('#btnExpand').click(function () {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function () {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function () {
queryDeptTree();
});
/* 测控点信息 */
function dept() {
var url = ctx + "system/Monitor?id=20";
$.modal.openTab("测控点信息", url);
}
layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({
elem: '#laydate-demo-3',
type: 'datetime',
trigger: 'click'
});
laydate.render({
elem: '#laydate-demo-4',
type: 'datetime',
trigger: 'click'
});
});
</script>
</body>
</html>

@ -58,4 +58,7 @@ public interface TVibrationsensorDataMapper {
* @return
*/
public int deleteTVibrationsensorDataByIds(String[] objIds);
List<TVibrationsensorData> selectRealTimeMonitor(TVibrationsensorData tVibrationsensorData);
}

@ -58,4 +58,12 @@ public interface ITVibrationsensorDataService
* @return
*/
public int deleteTVibrationsensorDataById(Long objId);
/**
*
* @param tVibrationsensorData
* @return
*/
public List<TVibrationsensorData> selectRealTimeMonitor(TVibrationsensorData tVibrationsensorData);
}

@ -85,4 +85,9 @@ public class TVibrationsensorDataServiceImpl implements ITVibrationsensorDataSer
public int deleteTVibrationsensorDataById(Long objId) {
return tVibrationsensorDataMapper.deleteTVibrationsensorDataById(objId);
}
@Override
public List<TVibrationsensorData> selectRealTimeMonitor(TVibrationsensorData tVibrationsensorData) {
return tVibrationsensorDataMapper.selectRealTimeMonitor(tVibrationsensorData);
}
}

@ -105,4 +105,20 @@
</foreach>
</delete>
<select id="selectRealTimeMonitor" parameterType="TVibrationsensorData"
resultMap="TVibrationsensorDataResult">
WITH RankedData AS (
SELECT *,
ROW_NUMBER() OVER (PARTITION BY sensor_id ORDER BY collectTime DESC) AS rn
FROM T_VibrationSensor_Data
-- WHERE collectTime > (GETDATE() - 1)
<if test="sensorId != null and sensorId != ''"> and sensor_id like concat(#{sensorId}, '%') </if>
)
SELECT m.monitorName, t.*
FROM RankedData t
left join T_Monitor m on m.monitorId = t.sensor_id
WHERE t.rn = 1
ORDER BY sensorId
</select>
</mapper>

Loading…
Cancel
Save