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.List;
import java.util.UUID;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto;
@ -128,6 +129,7 @@ public class BaseMonitorunitInfoController extends BaseController
@ResponseBody
public AjaxResult addSave(BaseMonitorunitInfo baseMonitorunitInfo)
{
baseMonitorunitInfo.setMonitorunitId(UUID.randomUUID().toString());
baseMonitorunitInfo.setCreateBy(ShiroUtils.getLoginName());
baseMonitorunitInfo.setCreateTime(new Date());
return toAjax(baseMonitorunitInfoService.insertBaseMonitorunitInfo(baseMonitorunitInfo));
@ -174,11 +176,12 @@ public class BaseMonitorunitInfoController extends BaseController
*
*/
@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))
{
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";
}

@ -6,12 +6,12 @@ spring:
druid:
# 主库数据源
master:
# 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
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: 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:
# 从数据源开关/默认关闭

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

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

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

@ -557,7 +557,7 @@
$.cookie('userID', '0000');
var wsImpl = window.WebSocket || window.MozWebSocket;
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) {
let result = $.parseJSON(evt.data);
console.log(result);
@ -566,7 +566,7 @@
reportData(result);
break;
case "CMD_SENSORSTATUS":
sensorStatus(result);
reportStatus(result);
break;
default:
break;
@ -612,7 +612,7 @@
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']);
}
</script>

Loading…
Cancel
Save