add - 振动测控点添加振动采集类型。

添加堆垛机实时监控页面,勾选某堆垛机显示对应子集点位信息。
master
yinq 2 weeks ago
parent df815750a4
commit c3253dcec6

@ -126,6 +126,15 @@ public class TVibrationsensorDataController extends BaseController {
return prefix + "/RealTimeMonitor"; return prefix + "/RealTimeMonitor";
} }
/**
*
* @return
*/
@GetMapping("stackerRealTimeMonitorView")
public String stackerRealTimeMonitorView() {
return prefix + "/StackerRealTimeMonitor";
}
/** /**
* *
* @param tVibrationsensorData * @param tVibrationsensorData
@ -138,6 +147,19 @@ public class TVibrationsensorDataController extends BaseController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
/**
* secondType=1
* @param tVibrationsensorData
* @return
*/
@PostMapping("/stackerRealTimeMonitor")
@ResponseBody
public AjaxResult stackerRealTimeMonitor(TVibrationsensorData tVibrationsensorData) {
tVibrationsensorData.setSecondType(1);
List<TVibrationsensorData> list = tVibrationsensorDataService.selectRealTimeMonitor(tVibrationsensorData);
return AjaxResult.success(list);
}
/** /**
* 线 * 线
* *

@ -4,7 +4,6 @@ import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.utils.http.HttpUtils; import com.ruoyi.common.utils.http.HttpUtils;
@ -422,5 +421,44 @@ public class T_MonitorController extends BaseController {
return ztreeslist; return ztreeslist;
} }
/**
* secondType=1
*/
@GetMapping("/treeDataSecondTypeOne")
@ResponseBody
public List<Ztree> treeDataSecondTypeOne(Integer monitorType) {
List<Ztree> ztreeslist = new ArrayList<>();
try {
T_Monitor query = new T_Monitor();
query.setMonitorType(monitorType);
query.setSecondType(1);
List<T_Monitor> secondTypeOneMonitors = t_MonitorService.selectT_MonitorList(query);
if (secondTypeOneMonitors == null || secondTypeOneMonitors.isEmpty()) {
return ztreeslist;
}
BigDecimal maxNumber = secondTypeOneMonitors.stream()
.map(item -> new BigDecimal(item.getGrade()))
.max((x1, x2) -> x1.compareTo(x2))
.get();
for (T_Monitor node : secondTypeOneMonitors) {
Ztree ztree1 = new Ztree();
ztree1.setId(node.getMonitorId());
ztree1.setName(node.getMonitorName());
ztree1.setTitle(node.getMonitorName());
ztree1.setpId(node.getpMonitorid());
ztree1.setIcon("http://caesar-bao.oss-cn-qingdao.aliyuncs.com/imagefiles/883DF83513144B648EA1DC6CD822477B.png");
if (!new BigDecimal(node.getGrade()).equals(maxNumber)) {
ztree1.setIcon("http://caesar-bao.oss-cn-qingdao.aliyuncs.com/imagefiles/17D33854A7D447749274A05232925D46.png");
ztree1.setNocheck(true);
}
ztreeslist.add(ztree1);
}
} catch (Exception ex) {
String info = ex.getMessage();
}
return ztreeslist;
}
} }

@ -48,14 +48,14 @@
<!-- </select>--> <!-- </select>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<!-- <div class="form-group">--> <div class="form-group">
<!-- <label class="col-sm-3 control-label">二级类型:</label>--> <label class="col-sm-3 control-label">振动采集类型:</label>
<!-- <div class="col-sm-8">--> <div class="col-sm-8">
<!-- <select name="secondType" class="form-control m-b" th:with="type=${@dict.getType('monitorSecondType')}">--> <select name="secondType" class="form-control m-b" th:with="type=${@dict.getType('vSecondType')}">
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<!-- </select>--> </select>
<!-- </div>--> </div>
<!-- </div>--> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">测控点位置:</label> <label class="col-sm-3 control-label">测控点位置:</label>
<div class="col-sm-8"> <div class="col-sm-8">

@ -46,14 +46,14 @@
<!-- </select>--> <!-- </select>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<!-- <div class="form-group">--> <div class="form-group">
<!-- <label class="col-sm-3 control-label">二级类型:</label>--> <label class="col-sm-3 control-label">振动采集类型:</label>
<!-- <div class="col-sm-8">--> <div class="col-sm-8">
<!-- <select name="secondType" class="form-control m-b" th:with="type=${@dict.getType('monitorSecondType')}">--> <select name="secondType" class="form-control m-b" th:with="type=${@dict.getType('vSecondType')}">
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{secondType}"></option>--> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{secondType}"></option>
<!-- </select>--> </select>
<!-- </div>--> </div>
<!-- </div>--> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">测控点位置:</label> <label class="col-sm-3 control-label">测控点位置:</label>
<div class="col-sm-8"> <div class="col-sm-8">

@ -69,6 +69,7 @@
var removeFlag = [[${@permission.hasPermi('system:Monitor:remove')}]]; var removeFlag = [[${@permission.hasPermi('system:Monitor:remove')}]];
var isKeyMonitorDatas = [[${@dict.getType('isKey')}]]; var isKeyMonitorDatas = [[${@dict.getType('isKey')}]];
var monitorStatusDatas = [[${@dict.getType('monitorStatus')}]]; var monitorStatusDatas = [[${@dict.getType('monitorStatus')}]];
var vSecondTypeDatas = [[${@dict.getType('vSecondType')}]];
var prefix = ctx + "system/Monitor"; var prefix = ctx + "system/Monitor";
$(function() { $(function() {
@ -106,9 +107,12 @@
width: '30%' width: '30%'
}, },
{ {
field: 'monitorType', field: 'secondType',
title: '类型', title: '振动采集类型',
align: 'left' align: 'left',
formatter: function(value, row, index) {
return $.table.selectDictLabel(vSecondTypeDatas, value);
}
}, },
{ {
field: 'monitorAddr', field: 'monitorAddr',

@ -0,0 +1,401 @@
<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('&#22534;&#22427;&#26426;&#28201;&#24230;&#23454;&#26102;&#30417;&#25511;')"/>
<th:block th:include="include :: layout-latest-css"/>
<th:block th:include="include :: ztree-css"/>
<th:block th:include="include :: datetimepicker-css"/>
</head>
<style>
.chartDiv {
width: 16%;
position: relative;
display: inline-block;
margin-bottom: 0.4vw;
}
.height {
height: 22vw;
}
.border {
border: 1px solid #67C23A;
padding: 0 1vw;
}
.chartDiv .chart {
width: 100%;
height: calc(100% - 50px);
position: absolute;
bottom: 0
}
.chartDiv .title {
font-size: 22px;
font-weight: 700;
width: 100%;
text-align: center;
}
.chartDiv .time {
font-size: 16px;
color: #409EFF;
width: 100%;
text-align: center;
}
.chartDiv .mileage {
position: absolute;
top: 74%;
left: 50%;
transform: translateX(-50%);
}
.chartDiv .text {
font-size: 1.25vw;
position: absolute;
top: 80%;
left: 50%;
transform: translateX(-50%);
}
.chartDiv .text1 {
font-size: 1.1vw;
line-height: 1.4vw;
width: 100%;
text-align: center;
}
.chartDiv .mileage .num {
font-size: 1vw;
margin: 0 0.1vw;
padding: 0.05vw 0.1vw;
background-color: #0001;
display: inline-block;
}
</style>
<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> &#27979;&#25511;&#28857;&#20449;&#24687;
</div>
<div class="box-tools pull-right">
<a class="btn btn-box-tool" href="#" onclick="dept()" title="&#27979;&#25511;&#28857;&#20449;&#24687;" type="button"><i
class="fa fa-edit"></i></a>
<button class="btn btn-box-tool" id="btnExpand" style="display:none;" title="&#23637;&#24320;" type="button"><i
class="fa fa-chevron-up"></i></button>
<button class="btn btn-box-tool" id="btnCollapse" title="&#25240;&#21472;" type="button"><i
class="fa fa-chevron-down"></i></button>
<button class="btn btn-box-tool" id="btnRefresh" title="&#21047;&#26032;" type="button"><i
class="fa fa-refresh"></i>
</button>
</div>
</div>
<div class="ui-layout-content">
<div class="ztree" id="tree"></div>
</div>
</div>
</div>
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<div id="chartDivs">
</div>
</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 src="../../../js/common/echarts.min.js"></script>
<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});
queryDeptTree();
});
let time1 = null
function queryDeptTree() {
var url = ctx + "system/Monitor/treeDataSecondTypeOne?monitorType=" + 20;
var options = {
url: url,
expandLevel: 1,
check: {
enable: true,
nocheckInherit: false,
chkboxType: {"Y": "", "N": ""}
},
// onClick: zOnClick,
onCheck: onCheck
};
$.tree.init(options);
function onCheck(event, treeId, treeNode) {
const intervalFun = () => {
var checkedIds = getCheckedSensorIds();
$.post(ctx + 'system/TVibrationsensorData/stackerRealTimeMonitor', {sensorId: checkedIds}, (e) => {
let data = e.data || []
$("#chartDivs").html('')
data.forEach((v, k) => {
var isOver = (v.isThreshold === 1 || v.isThreshold === '1');
var redStyle = isOver ? 'color:#d9534f;font-weight:700;' : '';
let html = `
<div class="chartDiv border" id="chartDiv">
<div class="title" style="font-size: 1.4vw;${redStyle}">${v.monitorName}</div>
<div class="time" style="font-size: 1vw">${v.collectTime}</div>
<div class="text1" style="${redStyle}">\u6e29\u5ea6\uff1a${v.temperature}\u00b0C</div>
</div>
`
$("#chartDivs").append(html)
})
})
}
intervalFun()
if (time1) {
clearInterval(time1)
time1 = null
}
time1 = setInterval(() => {
intervalFun()
}, 10000)
}
function zOnClick(event, treeId, treeNode) {
$.post(ctx + 'system/TVibrationsensorData/stackerRealTimeMonitor', {sensorId: treeNode.id}, (e) => {
if (e.code === 0) {
let data = e.data || []
$("#chartDivs").html('')
data.forEach((v, k) => {
let html = `
<div class="chartDiv height" id="chartDiv">
<div class="title">${v.monitorName}</div>
<div class="time">${v.collectTime}</div>
<div class="chart" id="chart${k}">
</div>
<div class="mileage">
${v.temperature.toString().split('').map(vv => {
return `<div class="num">${vv}</div>`
}).join('')}
</div>
<div class="text">\u6e29\u5ea6(\u00b0C)</div>
</div>
`
$("#chartDivs").append(html)
let chart = echarts.init(document.getElementById(`chart${k}`))
let option = {
series: [
{
name: 'Pressure',
type: 'gauge',
animation: false,
detail: {
formatter: '{value}',
offsetCenter:
[0, '20%'],
// offsetCenter: [0, '-40%'] ,
},
center: ['50%', '50%'],
radius:
'90%',
max:
100,
data:
[
{
value: v.speed,
name: 'mm/s',
title: {
offsetCenter: ['50%', '65%'],
fontSize: 12,
color: '#000'
},
detail: {
show: false,
fontSize: 12,
},
}
]
},
{
name: 'Pressure',
type: 'gauge',
animation: false,
splitNumber: 4,
axisLine: {
show: false
},
center: ['50%', '50%'],
radius:
'50%',
max: 5000,
data: [
{
value: v.displacement,
name: 'um',
title: {
offsetCenter: ['45%', '55%'],
fontSize: 12,
color: '#000'
},
detail: {
show: false,
fontSize: 12,
},
},
]
},
]
};
chart.setOption(option)
})
}
})
if (time1) {
clearInterval(time1)
time1 = null
}
time1 = setInterval(() => {
$.post(ctx + 'system/TVibrationsensorData/stackerRealTimeMonitor', {sensorId: treeNode.id}, (e) => {
if (e.code === 0) {
let data = e.data || []
$("#chartDivs").html('')
data.forEach((v, k) => {
let html = `
<div class="chartDiv height" id="chartDiv">
<div class="title">${v.monitorName}</div>
<div class="time">${v.collectTime}</div>
<div class="chart" id="chart${k}">
</div>
<div class="mileage">
${v.temperature.toString().split('').map(vv => {
return `<div class="num">${vv}</div>`
}).join('')}
</div>
<div class="text">\u6e29\u5ea6(\u00b0C)</div>
</div>
`
$("#chartDivs").append(html)
let chart = echarts.init(document.getElementById(`chart${k}`))
let option = {
series: [
{
name: 'Pressure',
type: 'gauge',
animation: false,
detail: {
formatter: '{value}',
offsetCenter: [0, '20%'],
// offsetCenter: [0, '-40%'] ,
},
center: ['50%', '50%'],
radius: '90%',
max: Math.max(Math.ceil(v.displacement / 100), 1) * 100,
data: [
{
value: v.displacement,
name: '\u4f4d\u79fb(um)',
title: {
show: false
},
detail: {
show: false,
fontSize: 12,
},
},
]
},
{
name: 'Pressure',
type: 'gauge',
axisLine: {
show: false
},
animation: false,
splitNumber: 4,
detail: {
formatter: '{value}',
offsetCenter:
[0, '20%'],
// offsetCenter: [0, '-40%'] ,
}
,
center: ['50%', '50%'],
radius:
'50%',
max:
Math.max(Math.ceil(v.speed / 100), 1) * 100,
data:
[
{
value: v.speed,
name: '\u901f\u5ea6(mm/s)',
title: {
show: false
},
detail: {
show: false,
fontSize: 12,
},
}
]
},
]
};
chart.setOption(option)
})
}
})
}, 10000)
}
}
// \u517c\u5bb9\u540e\u7aef\u9017\u53f7\u5206\u9694\u53c2\u6570\uff1a\u5c06\u9009\u4e2d\u7684\u6811\u8282\u70b9ID\u62fc\u6210 "id1,id2,id3"
function getCheckedSensorIds() {
var treeObj = $.fn.zTree.getZTreeObj("tree");
if (!treeObj) {
return "";
}
var checkedNode = treeObj.getCheckedNodes(true);
var ids = [];
checkedNode.forEach(function (node) {
if (node && node.id !== undefined && node.id !== null && node.id !== "") {
ids.push(node.id);
}
});
return ids.join(",");
}
</script>
</body>
</html>

@ -71,6 +71,11 @@ public class TVibrationsensorData extends BaseEntity {
*/ */
private Integer isThreshold; private Integer isThreshold;
/**
* 1 2
*/
private Integer secondType;
public Integer getIsThreshold() { public Integer getIsThreshold() {
return isThreshold; return isThreshold;
@ -80,6 +85,14 @@ public class TVibrationsensorData extends BaseEntity {
this.isThreshold = isThreshold; this.isThreshold = isThreshold;
} }
public Integer getSecondType() {
return secondType;
}
public void setSecondType(Integer secondType) {
this.secondType = secondType;
}
public String getMonitorName() { public String getMonitorName() {
return monitorName; return monitorName;
} }

@ -93,6 +93,9 @@ public class TVibrationsensorDataServiceImpl implements ITVibrationsensorDataSer
@Override @Override
public List<TVibrationsensorData> selectRealTimeMonitor(TVibrationsensorData tVibrationsensorData) { public List<TVibrationsensorData> selectRealTimeMonitor(TVibrationsensorData tVibrationsensorData) {
String sensorId = tVibrationsensorData.getSensorId(); String sensorId = tVibrationsensorData.getSensorId();
if (sensorId.isEmpty()) {
return null;
}
if (StringUtils.isNotBlank(sensorId)) { if (StringUtils.isNotBlank(sensorId)) {
List<String> sensorIdList = Arrays.stream(sensorId.split(",")) List<String> sensorIdList = Arrays.stream(sensorId.split(","))
.map(String::trim) .map(String::trim)

@ -115,10 +115,21 @@
WHERE 1=1 WHERE 1=1
-- AND collectTime > (GETDATE() - 1) -- AND collectTime > (GETDATE() - 1)
<if test="params.sensorIdList != null and params.sensorIdList.size() > 0"> <if test="params.sensorIdList != null and params.sensorIdList.size() > 0">
and sensor_id in and exists (
select 1
from T_Monitor m1
where m1.monitorId = sensor_id
and (
m1.monitorId in
<foreach collection="params.sensorIdList" item="id" open="(" separator="," close=")"> <foreach collection="params.sensorIdList" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
or m1.p_monitorId in
<foreach collection="params.sensorIdList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
)
</if> </if>
) )
SELECT m.monitorName, t.*, SELECT m.monitorName, t.*,
@ -131,6 +142,9 @@
left join T_SetMonitorThresholdValue ts on ts.monitorId = t.sensor_id left join T_SetMonitorThresholdValue ts on ts.monitorId = t.sensor_id
WHERE t.rn = 1 WHERE t.rn = 1
AND m.monitorId IS NOT NULL AND m.monitorId IS NOT NULL
<if test="secondType != null">
AND m.secondType = #{secondType}
</if>
ORDER BY sensor_id ORDER BY sensor_id
</select> </select>

@ -71,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isKeyMonitor != null "> and isKeyMonitor = #{isKeyMonitor}</if> <if test="isKeyMonitor != null "> and isKeyMonitor = #{isKeyMonitor}</if>
<if test="collectDeviceId != null "> and collectDeviceId = #{collectDeviceId}</if> <if test="collectDeviceId != null "> and collectDeviceId = #{collectDeviceId}</if>
<if test="monitorStatus != null "> and monitorStatus = #{monitorStatus}</if> <if test="monitorStatus != null "> and monitorStatus = #{monitorStatus}</if>
<if test="secondType != null "> and secondType = #{secondType}</if>
<if test="monitorName != null "> and monitorName = #{monitorName}</if> <if test="monitorName != null "> and monitorName = #{monitorName}</if>
<if test="typeFlag != null and typeFlag == 100"> <if test="typeFlag != null and typeFlag == 100">
AND monitorId NOT IN ('ML1','ML2','ML3','ML4','ML5','ML6','ML7','ML8','JTCW','MiLian') AND monitorId NOT IN ('ML1','ML2','ML3','ML4','ML5','ML6','ML7','ML8','JTCW','MiLian')

Loading…
Cancel
Save