change - 监控单元页面调整,自动生成编号

main
wenjy 3 years ago
parent ab032051ca
commit cb2d9c6e28

@ -2,6 +2,7 @@ package com.ruoyi.web.controller.base;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto; import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto;
@ -128,6 +129,7 @@ public class BaseMonitorunitInfoController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult addSave(BaseMonitorunitInfo baseMonitorunitInfo) public AjaxResult addSave(BaseMonitorunitInfo baseMonitorunitInfo)
{ {
baseMonitorunitInfo.setMonitorunitId(UUID.randomUUID().toString());
baseMonitorunitInfo.setCreateBy(ShiroUtils.getLoginName()); baseMonitorunitInfo.setCreateBy(ShiroUtils.getLoginName());
baseMonitorunitInfo.setCreateTime(new Date()); baseMonitorunitInfo.setCreateTime(new Date());
return toAjax(baseMonitorunitInfoService.insertBaseMonitorunitInfo(baseMonitorunitInfo)); return toAjax(baseMonitorunitInfoService.insertBaseMonitorunitInfo(baseMonitorunitInfo));
@ -174,11 +176,12 @@ public class BaseMonitorunitInfoController extends BaseController
* *
*/ */
@GetMapping(value = { "/selectMonitorUnitInfoTree/{ObjId}", "/selectMonitorUnitInfoTree/" }) @GetMapping(value = { "/selectMonitorUnitInfoTree/{ObjId}", "/selectMonitorUnitInfoTree/" })
public String selectMonitorUnitInfoTree(@PathVariable(value = "ObjId", required = false) Long ObjId, ModelMap mmap) public String selectMonitorUnitInfoTree(@PathVariable(value = "ObjId", required = false) String ObjId, ModelMap mmap)
{ {
if (StringUtils.isNotNull(ObjId)) if (StringUtils.isNotNull(ObjId))
{ {
mmap.put("baseMonitorunitInfo", baseMonitorunitInfoService.selectBaseMonitorunitInfoByObjId(ObjId)); /*mmap.put("baseMonitorunitInfo", baseMonitorunitInfoService.selectBaseMonitorunitInfoByObjId(ObjId));*/
mmap.put("baseMonitorunitInfo",baseMonitorunitInfoService.selectBaseMonitorunitInfoList(new BaseMonitorunitInfo(ObjId)).get(0));
} }
return prefix + "/tree"; return prefix + "/tree";
} }

@ -6,12 +6,12 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: Haiwei123456
url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: root password: Haiwei123456
# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -73,7 +73,7 @@ spring:
redis: redis:
port: 6379 port: 6379
password: admin123 password: admin123
host: 127.0.0.1 host: 121.36.58.109
jedis: jedis:
pool: pool:
max-active: 8 max-active: 8

@ -8,20 +8,20 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-monitorUnitInfo-add"> <form class="form-horizontal m" id="form-monitorUnitInfo-add">
<input id="monitorunitImage" name="monitorunitImage" type="hidden"> <input id="monitorunitImage" name="monitorunitImage" type="hidden">
<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">
<input name="monitorunitId" class="form-control" type="text"> <input name="monitorunitId" class="form-control" type="text">
</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">
<input name="monitorunitName" class="form-control" type="text"> <input name="monitorunitName" class="form-control" type="text">
</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">
<div class="input-group"> <div class="input-group">
<input id="treeId" name="parentId" type="hidden" th:value="${baseMonitorunitInfo?.monitorunitId}"/> <input id="treeId" name="parentId" type="hidden" th:value="${baseMonitorunitInfo?.monitorunitId}"/>
@ -31,7 +31,7 @@
</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="monitorunitType" class="form-control m-b" th:with="type=${@monitorunitTypeService.getMonitorunitType()}"> <select name="monitorunitType" class="form-control m-b" th:with="type=${@monitorunitTypeService.getMonitorunitType()}">
<option value="">所有</option> <option value="">所有</option>

@ -95,7 +95,7 @@
var options = { var options = {
code: "monitorunitId", code: "monitorunitId",
parentCode: "parentId", parentCode: "parentId",
expandColumn: "2", expandColumn: "3",
uniqueId: "objId", uniqueId: "objId",
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add/{id}", createUrl: prefix + "/add/{id}",
@ -117,12 +117,14 @@
{ {
field: 'monitorunitId', field: 'monitorunitId',
title: '监控单元编号', title: '监控单元编号',
align: 'left' align: 'left',
visible: false
}, },
{ {
field: 'monitorunitName', field: 'monitorunitName',
title: '监控单元名称', title: '监控单元',
align: 'left' align: 'left',
width:'160'
}, },
{ {
field: 'parentName', field: 'parentName',
@ -154,7 +156,7 @@
}, },
{ {
field: 'monitorunitStatus', field: 'monitorunitStatus',
title: '是否启用', title: '当前状态',
align: 'left', align: 'left',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return $.table.selectDictLabel(monitorunitStatusDatas, value); return $.table.selectDictLabel(monitorunitStatusDatas, value);

@ -557,7 +557,7 @@
$.cookie('userID', '0000'); $.cookie('userID', '0000');
var wsImpl = window.WebSocket || window.MozWebSocket; var wsImpl = window.WebSocket || window.MozWebSocket;
console.log("connecting to server .."); console.log("connecting to server ..");
window.ws = new wsImpl('ws://127.0.0.1:7181'); window.ws = new wsImpl('ws://121.36.58.109:7181');
ws.onmessage = function (evt) { ws.onmessage = function (evt) {
let result = $.parseJSON(evt.data); let result = $.parseJSON(evt.data);
console.log(result); console.log(result);
@ -566,7 +566,7 @@
reportData(result); reportData(result);
break; break;
case "CMD_SENSORSTATUS": case "CMD_SENSORSTATUS":
sensorStatus(result); reportStatus(result);
break; break;
default: default:
break; break;
@ -612,7 +612,7 @@
document.getElementById(result.sensorId + "collectTime").innerHTML = result['collectTime'] == null ? "-" : collectTime(result['collectTime']); document.getElementById(result.sensorId + "collectTime").innerHTML = result['collectTime'] == null ? "-" : collectTime(result['collectTime']);
} }
//上报设备状态 //上报设备状态
const sensorStatus = function(result) { const reportStatus = function(result) {
document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']); document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']);
} }
</script> </script>

Loading…
Cancel
Save