Merge branch 'dev_lxw' of https://whyccjj@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | <td>区/县</td> <!-- 市 -->
|
| | | <td><s:text name="Computer_name"/></td> <!-- 机房名称 -->
|
| | | <td>系统类型</td>
|
| | | |
| | | </tr>
|
| | | <tr>
|
| | | <td>
|
| | |
| | | </div>
|
| | | <button class="layui-btn layui-btn-sm mrl8" id="batchAdd"><i class="fa fa-plus mrr8"></i>添加设备</button>
|
| | | <button class="layui-btn layui-btn-sm" id="sysSet">批量设置电池参数</button>
|
| | | |
| | | <button class="layui-btn layui-btn-sm" id="batchRead">批量读取电池参数</button>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格内容 -->
|
| | |
| | | {{d.signalNum}}
|
| | | {{# }else{ }}
|
| | | ???
|
| | | {{# } }}
|
| | | </script>
|
| | | <script type="text/html" id="setStatus">
|
| | | {{# if(d.setCurr == 1){ }}
|
| | | <button class="layui-btn layui-btn-sm">设置成功</button>
|
| | | {{# }else if(d.setCurr == 2){ }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-danger">设置失败</button>
|
| | | {{# }else { }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal">未设置</button>
|
| | | {{# } }}
|
| | | </script>
|
| | | <!-- STD_CAP -->
|
| | |
| | | <span style="color: #FF0000;">{{ d.OnlineVolLow }}</span>
|
| | | {{# } }}
|
| | | </script>
|
| | | |
| | | <!-- 操作栏 -->
|
| | | <script type="text/html" id="doThings">
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="read">读取</button>
|
| | | </script>
|
| | | <!-- 读取状态 -->
|
| | | <script type="text/html" id="readStatus">
|
| | | {{# if(d.readStatus == 1){ }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal">读取成功</button>
|
| | | {{# }else { }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-danger">读取失败</button>
|
| | | {{# } }}
|
| | | </script>
|
| | | <!-- 设置状态 -->
|
| | | <script type="text/html" id="setStatus">
|
| | | {{# if(d.setStatus == 1){ }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal">设置成功</button>
|
| | | {{# }else if(d.setStatus == 2) { }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-danger">设置失败</button>
|
| | | {{# }else { }}
|
| | | <button class="layui-btn layui-btn-sm layui-btn-disabled">未设置</button>
|
| | | {{# } }}
|
| | | </script>
|
| | | <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
|
| | | <script type="text/javascript" src="js/echarts.js"></script>
|
| | | <script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
|
| | |
| | | {type:'checkbox',fixed: 'left'}
|
| | | ,{field:'dev_id', title:'设备ID', align:'center', width: 160}
|
| | | ,{field:'StationName', title:'机房名称', align:'center', width: 470}
|
| | | ,{field:'readStatus', title:'读取状态', templet: '#readStatus', align:'center', width: 120}
|
| | | ,{field:'setStatus', title:'设置状态', templet: '#setStatus', align:'center', width: 120} |
| | | ,{field:'STD_CAP', title:'电池标称容量(AH)<i class="fa fa-refresh" title="同步电池标称容量参数"></i>', templet: '#STD_CAP', align:'center', width: 220}
|
| | | ,{field:'STD_RES', title:'电池标称内阻(uΩ)<i class="fa fa-refresh" title="同步电池标称内阻参数"></i>', templet: '#STD_RES', align:'center', width: 220}
|
| | | ,{field:'BattGroupCount', title:'电池组组数 <i class="fa fa-refresh" title="同步电池组组数参数"></i>', templet: '#BattGroupCount', align:'center', width: 180}
|
| | | ,{field:'EachGroupBattCount', title:'每组电池单体数量 <i class="fa fa-refresh" title="同步每组电池单体数量参数"></i>', templet: '#EachGroupBattCount', align:'center', width: 220}
|
| | | ,{field:'MonomerVol', title:'单体标称电压(V) <i class="fa fa-refresh" title="同步单体标称电压参数"></i>', templet: '#MonomerVol', align:'center', width: 220}
|
| | | ,{field:'StationName9', title:'设备版本号', align:'center', width: 180}
|
| | | ,{field:'GroupVol', title:'电池组端标称电压(V) <i class="fa fa-refresh" title="同步电池组端标称电压参数"></i>', templet: '#GroupVol', align:'center', width: 220}
|
| | | ,{field:'GroupVol', title:'电池组端标称电压(V)', align:'center', width: 220}
|
| | | ,{field:'BattTemp', title:'电池标称温度(℃) <i class="fa fa-refresh" title="同步电池标称温度参数"></i>', templet: '#BattTemp', align:'center', width: 220}
|
| | | ,{field:'FloatChargeVol', title:'电池浮充电压阀值(V) <i class="fa fa-refresh" title="同步电池浮充电压阀值参数"></i>', templet: '#FloatChargeVol', align:'center', width: 220}
|
| | | ,{field:'FloatChargeCurr', title:'电池浮充电流阀值(A) <i class="fa fa-refresh" title="同步电池浮充电流阀值参数"></i>', templet: '#FloatChargeCurr', align:'center', width: 220}
|
| | | ,{field:'OnlineVolLow', title:'在线电压低阀值(V) <i class="fa fa-refresh" title="同步在线电压低阀值参数"></i>', templet: '#OnlineVolLow', align:'center', width: 220}
|
| | | ,{field:'GroupConnType', title:'电池组连接类型', templet: '#GroupConnType', align:'center', width: 220}
|
| | | ,{field:'doThings', fixed: 'right', title: '设置状态', toolbar: '#setStatus', align: 'center', width: 160} |
| | |
|
| | | ,{field:'doThings', fixed: 'right', title: '操作', toolbar: '#doThings', align: 'center', width: 120} |
| | | ]]
|
| | | ,data:[]
|
| | | ,limit: 10000
|
| | |
| | |
|
| | | }
|
| | |
|
| | | // 表格工具栏操作
|
| | | table.on('tool(pageTbl)', function(obj){
|
| | | var event = obj.event;
|
| | | switch(event) {
|
| | | case 'read': // 读取参数
|
| | | readBattParams(obj); |
| | | break;
|
| | | case 'del': // 删除
|
| | | delItem(obj);
|
| | | break;
|
| | | }
|
| | | });
|
| | | |
| | | // 电池参数的命名
|
| | | var battParam = GLOBAL.CMD.batt;
|
| | | // 读取单行放电参数
|
| | | function readBattParams(obj) {
|
| | | var data = getCheckedData([obj.data]);
|
| | | var keyIds= getKeyId([obj.data]);
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | num: 0 // 默认为0
|
| | | ,dev_id: data[0].dev_id // 设备id
|
| | | ,op_cmd: battParam.get // 电池参数获取命令
|
| | | };
|
| | | |
| | | // 请求读取参数
|
| | | ajaxReadBattParams([tmp], keyIds);
|
| | | }
|
| | | |
| | | // 点击批量读取按钮
|
| | | $('#batchRead').click(function() {
|
| | | var checkStatus = table.checkStatus('pageTbl'); //idTest 即为基础参数 id 对应的值
|
| | | var cData = checkStatus.data;
|
| | | if(cData.length == 0) {
|
| | | layer.msg('请选择要读取的机房!');
|
| | | return;
|
| | | }
|
| | | |
| | | // 请求后台
|
| | | batchReadBattParams(cData);
|
| | | });
|
| | | |
| | | // 批量读取参数
|
| | | function batchReadBattParams(cData) {
|
| | | var data = getCheckedData(cData);
|
| | | var keyIds= getKeyId(cData);
|
| | | var tmps = [];
|
| | | // 遍历data的值,构造查询条件
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var tmp = {
|
| | | num: 0 // 默认为0
|
| | | ,dev_id: _data.dev_id // 设备id
|
| | | ,op_cmd: battParam.get // 电池参数获取命令
|
| | | };
|
| | | tmps.push(tmp);
|
| | | }
|
| | | |
| | | // 请求读取参数
|
| | | ajaxReadBattParams(tmps, keyIds);
|
| | | }
|
| | | |
| | | // 向后台发送请求读取参数
|
| | | function ajaxReadBattParams(params, keys) {
|
| | | var loading = layer.load(1);
|
| | | // 请求后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: 'Fbs9100_battparamAction_action_readPL'
|
| | | ,data: 'json='+JSON.stringify(params)
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | // 判断是否有数据
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | formaterReadDatas(data, keys);
|
| | | }else {
|
| | | layer.msg('读取失败!请重新请求');
|
| | | }
|
| | | }
|
| | | ,error: function() {
|
| | | layer.msg('读取失败,请检查网络是否正常!')
|
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(loading);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 处理读取结果集并返回指定结果集
|
| | | function formaterReadDatas(data, keys) {
|
| | | var rs = [];
|
| | | // 遍历data的值
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _key_id = keys[i].key_id; // 获取标识位
|
| | | var _tmp = {};
|
| | | _tmp.key_id = _key_id; // 添加标识位
|
| | | |
| | | // 获取对应的tr的值
|
| | | var layuiData = layuiTbl.getTr('key_id', _key_id);
|
| | | |
| | | // 判断是否存在对应的表格数据
|
| | | if(layuiData.code == 1) {
|
| | | // 判断是否读取成功
|
| | | if(_data.num==1) {
|
| | | var obj = _data.obj[0];
|
| | | _tmp = contrastData(layuiData.data, _data.obj[0]);
|
| | | _tmp.readStatus = 1; // 读取状态
|
| | | _tmp.setStatus = 0; // 设置参数状态初始化
|
| | | }else {
|
| | | _tmp.num = 0;
|
| | | _tmp.readStatus = 0;
|
| | | _tmp.setStatus = 0; // 设置参数状态初始化
|
| | | }
|
| | | |
| | | }else {
|
| | | console.log(layuiData.msg); // 输出读取失败原因
|
| | | _tmp.num = 0; |
| | | _tmp.readStatus = 0; // 读取失败
|
| | | _tmp.setStatus = 0; // 设置参数状态初始化
|
| | | }
|
| | | // 将数据添加到结果集中
|
| | | rs.push(_tmp);
|
| | | }
|
| | | // 更新表格
|
| | | layuiTbl.update('key_id', rs);
|
| | | }
|
| | | |
| | | // 对比表格数据和读取到的数据
|
| | | function contrastData(tData, rData) {
|
| | | var rs = {};
|
| | | // 遍历rData的值
|
| | | Object.keys(rData).forEach(function(key) {
|
| | | // 判断是否为num
|
| | | var _data = rData[key];
|
| | | rs.key_id = tData.key_id;
|
| | | if(key != 'num') {
|
| | | rs[key] = _data;
|
| | | // 获取其他辅助值
|
| | | var bKey = key+'_b';
|
| | | var boolKey = key+'_bool';
|
| | | var bVal = tData[bKey];
|
| | | if(bVal != undefined && bVal != _data) {
|
| | | rs[boolKey] = false;
|
| | | }
|
| | | } |
| | | });
|
| | | |
| | | return rs;
|
| | | }
|
| | | |
| | | // 删除表格的行
|
| | | function delItem(obj) {
|
| | | // 弹出是否删除面板
|
| | | layer.confirm('是否删除当前行', {icon: 2, title: '删除提示'}, function(index) {
|
| | | layer.close(index);
|
| | | layuiTbl.delTr(table.cache.pageTbl, obj); // 删除指定的行
|
| | | });
|
| | | }
|
| | | |
| | | // 批量设置电池参数的按钮
|
| | | $('#sysSet').click(function() {
|
| | | var checkStatus = table.checkStatus('pageTbl'); //idTest 即为基础参数 id 对应的值
|
| | | var cData = checkStatus.data;
|
| | | if(cData.length == 0) {
|
| | | layer.msg('请选择要批量设置的机房!');
|
| | | return;
|
| | | }
|
| | | |
| | | var data = getCheckedData(cData); // 格式化被选中行数据
|
| | | var keyIds= getKeyId(cData); // 获取标识符
|
| | | var rsData = [];
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | _data.op_cmd = battParam.set;
|
| | | _data.num = 0;
|
| | | rsData.push(_data);
|
| | | }
|
| | | |
| | | // 批量设置
|
| | | batchSetBattParams(rsData, keyIds);
|
| | | });
|
| | | |
| | | // 批量设置放电参数
|
| | | function batchSetBattParams(params, keys) {
|
| | | // 判断data的值是否为空
|
| | | if(params.length == 0) {
|
| | | layer.msg('请选择要批量设置的机房!');
|
| | | }
|
| | | // 判断是否批量设置
|
| | | layer.confirm('是否确认批量设置电池参数', {icon: 3, title: '批量设置提醒'}, function(index) {
|
| | | layer.close(index);
|
| | | var loading = layer.load(1);
|
| | | // 请求后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: 'Fbs9100_battparamAction_action_updatePro'
|
| | | ,data: 'json='+JSON.stringify(params)
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | var rsData= [];
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _key = keys[i];
|
| | | var _tmp = {
|
| | | key_id: _key.key_id
|
| | | };
|
| | | |
| | | // 判断是否设置成功
|
| | | if(_data.num == 1) {
|
| | | _tmp.setStatus = 1; // 设置成功
|
| | | }else {
|
| | | _tmp.setStatus = 2; // 设置失败
|
| | | }
|
| | | |
| | | rsData.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | for(var i=0; i<keys.length; i++) {
|
| | | var _key = keys[i];
|
| | | var _tmp = {
|
| | | key_id: _key.key_id
|
| | | ,setStatus: 2
|
| | | };
|
| | | rsData.push(_tmp);
|
| | | }
|
| | | }
|
| | | |
| | | // 更新表格
|
| | | layuiTbl.update('key_id', rsData);
|
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(loading);
|
| | | }
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | | // 点击添加电池组
|
| | |
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | console.log(rs);
|
| | | //console.log(rs);
|
| | | var data = [];
|
| | | if(rs.code == 1) {
|
| | | data = rs.data;
|
| | |
| | | layer.msg('没有可设置的电池组!');
|
| | | }
|
| | | tOptions.data = data;
|
| | | console.log(data);
|
| | | //console.log(data);
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | layuiTbl.setCache(table.cache.pageTbl);
|
| | | }
|
| | | ,complete:function() {
|
| | | layer.close(load);
|
| | |
| | |
|
| | | // 处理添加机房信息的结果
|
| | | function formatSearchData(data) {
|
| | | console.log(data);
|
| | | var rs = [];
|
| | | // 遍历data的
|
| | | for(var i=0; i<data.length; i++) {
|
| | |
| | | var obj = _data.obj[0];
|
| | | var tmp = {};
|
| | | tmp.num = _data.num; // 判断是否读取成功
|
| | | tmp.readStatus = _data.num;
|
| | | tmp.key_id = i;
|
| | | tmp.dev_id = obj.dev_id; // 设备ID
|
| | | tmp.dev_ip = obj.dev_ip; // 设备IP
|
| | | tmp.StationName = obj.StationName; // 机房名称
|
| | | tmp.GroupConnType = 0; // 电池组连接类型
|
| | | tmp.StationName9 = _data.StationName9; // 设备版本号
|
| | | |
| | | tmp.GroupVol = obj.GroupVol; // 电池组端标称电压(V)
|
| | |
|
| | | tmp.STD_CAP = obj.STD_CAP; // 电池标称容量(AH)
|
| | |
| | | function isNumEqual(num1, num2) {
|
| | | return num1==num2;
|
| | | }
|
| | | |
| | | // 获取被选中行的标识位
|
| | | function getKeyId(data) {
|
| | | var rs = [];
|
| | | // 遍历data的值
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var tmp = {};
|
| | | tmp.key_id = _data.key_id;
|
| | | rs.push(tmp);
|
| | | }
|
| | | return rs;
|
| | | }
|
| | | |
| | | |
| | | // 获取被选中的行的数据并处理返回指定的对象数组
|
| | | function getCheckedData(data) {
|
| | | var rs = [];
|
| | | // 处理数据
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var tmp = {};
|
| | | tmp.num = _data.num; // 判断是否读取成功
|
| | | tmp.dev_id = _data.dev_id; // 设备ID
|
| | | tmp.dev_ip = _data.dev_ip; // 设备IP
|
| | | tmp.StationName = _data.StationName; // 机房名称
|
| | | tmp.GroupConnType = 0; // 电池组连接类型
|
| | | tmp.StationName9 = _data.StationName9; // 设备版本号
|
| | | tmp.GroupVol = _data.GroupVol; // 电池组端标称电压(V)
|
| | | tmp.STD_CAP = _data.STD_CAP; // 电池标称容量(AH)
|
| | | tmp.STD_RES = _data.STD_RES; // 电池标称内阻(uΩ)
|
| | | tmp.BattGroupCount = _data.BattGroupCount; // 电池组组数
|
| | | tmp.EachGroupBattCount = _data.EachGroupBattCount; // 每组电池单体数量
|
| | | tmp.MonomerVol = _data.MonomerVol; // 单体标称电压(V)
|
| | | tmp.BattTemp = _data.BattTemp; // 电池标称温度(℃)
|
| | | tmp.FloatChargeVol = _data.FloatChargeVol; // 电池浮充电压阀值(V)
|
| | | tmp.FloatChargeCurr = _data.FloatChargeCurr; // 电池浮充电流阀值(A)
|
| | | tmp.OnlineVolLow = _data.OnlineVolLow; // 在线电压低阀值(V)
|
| | | // 将数据放到返回的结果集中
|
| | | rs.push(tmp);
|
| | | }
|
| | | return rs;
|
| | | }
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | |
| | | <s:text name="Goto"/><!-- 转到 --><input type="text" id="page_num" value="1"/>
|
| | | <a href="javascript:" id="go"><s:text name="Jump"/><!-- 跳转 --></a>
|
| | | </span>
|
| | | <a href="javascript:startStationThread();" class="start-station-stical">启动续航统计</a>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格选项内容 -->
|
| | |
| | | //console.info(ArrTd);
|
| | | eleform.submit();
|
| | | }
|
| | | |
| | | //启动机房续航线程
|
| | | function startStationThread(){
|
| | | load = layer.load(1);
|
| | | var temp = {
|
| | | thread_id:2019001,
|
| | | thread_en:1,
|
| | | };
|
| | | $.ajax({
|
| | | type:"post",
|
| | | url:"Thread_utilAction!update",
|
| | | async:true,
|
| | | datatype:'json',
|
| | | data:"json="+JSON.stringify(temp),
|
| | | success:function(data){
|
| | | layer.close(load);
|
| | | //console.info(data);
|
| | | var model = JSON.parse(data.result);
|
| | | if(model.code == 1){
|
| | | layer.msg("启动成功");
|
| | | }else{
|
| | | layer.msg("启动失败");
|
| | | }
|
| | | },error:function(){
|
| | | layer.msg("启动失败");
|
| | | }
|
| | | });
|
| | | }
|
| | | </script>
|
| | | </body>
|
| | | </html> |
New file |
| | |
| | | <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
| | | <%
|
| | | String path = request.getContextPath();
|
| | | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
| | | %>
|
| | | <%@ taglib uri="/struts-tags" prefix="s" %>
|
| | | <!DOCTYPE HTML>
|
| | | <html>
|
| | | <head>
|
| | | <base href="<%=basePath%>">
|
| | | <meta charset="UTF-8">
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1">
|
| | | <meta http-equiv="pragma" content="no-cache">
|
| | | <meta http-equiv="cache-control" content="no-cache">
|
| | | <meta http-equiv="expires" content="0"> |
| | | <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
| | | <meta http-equiv="description" content="This is my page">
|
| | | <title>电池注册信息查询</title> |
| | | <link rel="stylesheet" type="text/css" href="pages/css/base.css">
|
| | | <link rel="stylesheet" type="text/css" href="jqueryui/jquery-ui.css">
|
| | | <link rel="stylesheet" type="text/css" href="src/css/layui.css">
|
| | | <link rel="stylesheet" type="text/css" href="pages/css/mylayui.css">
|
| | | <style>
|
| | | .dataTypeCont {
|
| | | width: 160px;
|
| | | text-align: center;
|
| | | }
|
| | | .dataTypeCont .layui-form-switch {
|
| | | min-width: 70px;
|
| | | margin-top: 4px;
|
| | | }
|
| | | </style>
|
| | | <script>"undefined"==typeof CODE_LIVE&&(!function(e){var t={nonSecure:"56003",secure:"56008"},c={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=c[n]+r[n]+":"+t[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document),CODE_LIVE=!0);</script></head>
|
| | | <body data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-26" data-genuitec-path="/gx_tieta/WebRoot/bts-comm-mon.jsp">
|
| | | <!--头部内容开始-->
|
| | | <jsp:include page="Top.jsp" flush="true"/>
|
| | | <!--头部内容结束-->
|
| | | <!--导航开始-->
|
| | | <jsp:include page="nav.jsp" flush="true"/>
|
| | | <!-- 主体内容 -->
|
| | | <div class="layui-page-container" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-26" data-genuitec-path="/gx_tieta/WebRoot/bts-comm-mon.jsp">
|
| | | <!-- 页面主题内容 -->
|
| | | <div class="layui-page-content" style="position: relative;">
|
| | | <div class="tbl-filter" lay-filter="tblFilter" style="position: absolute;z-index: 891;top: 8px; left: 15px">
|
| | | <div class="layui-form layui-form-pane" lay-filter="tblFilter">
|
| | | 设备ID:
|
| | | <div class="layui-inline">
|
| | | <input class="layui-input" name="id" id="devId" autocomplete="off">
|
| | | </div>
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="searchById"><i class="fa fa-search"></i>搜索</button>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格内容 -->
|
| | | <table id="pageTbl" lay-filter="pageTbl"></table>
|
| | | </div>
|
| | | <div class="data-footer">
|
| | | <!-- 分页内容 -->
|
| | | <div id="paging">
|
| | | <a href="javascript:" class="search"><s:text name="Search"/></a> <!-- 查询 -->
|
| | | <a href="javascript:" id="export_table"><s:text name="Export"/></a> <!-- 导出 -->
|
| | | <span id="current">1/1</span>
|
| | | <span><s:text name="Each_page"/><input type="text" id="number" value="10"/><s:text name="Item"/></span>
|
| | | <s:text name="Total_data"/><!-- 数据总量 --><span id="total">0</span>
|
| | | <a href="javascript:" id="page_home"><s:text name="HomePage"/></a> |
| | | <a href="javascript:" id="page_pre"><s:text name="Page_Up"/></a>
|
| | | <a href="javascript:" id="page_next_p"><s:text name="Page_Down"/></a>
|
| | | <a href="javascript:" id="page_last"><s:text name="End_Page"/></a>
|
| | | <span id="cont">
|
| | | <s:text name="Goto"/><input type="text" id="page_num" value="1"/>
|
| | | <a href="javascript:" id="page_go"><s:text name="Jump"/></a>
|
| | | </span>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <script type="text/html" id="breakTypeTpl">
|
| | | {{# if(d.break_type == 0){ }}
|
| | | <span style="color: #01AAED">成功连接</span>
|
| | | {{# }else if(d.break_type == 1) { }}
|
| | | <span style="color: #FF5722">找不到对应设备ID</span>
|
| | | {{# }else if(d.break_type == 2) { }}
|
| | | <span style="color: #FF5722">通信异常断开</span>
|
| | | {{# }else { }}
|
| | | <span style="color: #FFB800">未知类型</span>
|
| | | {{# } }}
|
| | | </script>
|
| | | <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
|
| | | <script type="text/javascript" src="js/echarts.js"></script>
|
| | | <script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
|
| | | <script type="text/javascript" src="src/layui.js"></script>
|
| | | <script type="text/javascript" src="pages/js/mylayui.js"></script>
|
| | | <script type="text/javascript" src="pages/js/common.js"></script>
|
| | | <script type="text/javascript">
|
| | | layui.use(['form', 'table', 'layer', 'element'], function() {
|
| | | var table = layui.table; // 获取表格模块
|
| | | var form = layui.form; // 获取表单模块
|
| | | var layer = layui.layer; // 获取弹出框模块
|
| | | var element = layui.element; // 获取元素操作模块
|
| | | |
| | | // 表格模块
|
| | | var tOptions = {
|
| | | elem: '#pageTbl'
|
| | | ,toolbar: true
|
| | | ,defaultToolbar: []
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | | {field: 'Staionanme', title: '机房名称', align: 'center', width: 450}
|
| | | ,{field:'dev_id', title:'设备id', align:'center', width: 260}
|
| | | ,{field:'battgroup_id', title:'电池组id', align:'center', width: 260}
|
| | | ,{field:'battgroup_index', title:'电池组索引', align:'center', width: 260}
|
| | | ,{field:'battgroup_mon_cnt', title:'电池组单体个数', align:'center', width: 260}
|
| | | |
| | | ]]
|
| | | ,data:[]
|
| | | ,limit: 1000
|
| | | ,page: false
|
| | | ,height: 'full-190'
|
| | | };
|
| | | |
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | |
| | | var Page = new TblPage();
|
| | | Page.set(1, 0, 10);
|
| | | //console.log(Page);
|
| | | |
| | | // 查询后台数据
|
| | | search(createSearchParam(), true);
|
| | | function search(temp, newLoad) {
|
| | | var load;
|
| | | if(newLoad) {
|
| | | load = layer.load(1);
|
| | | }
|
| | | //console.log(temp); |
| | | $.ajax({
|
| | | type:'post',
|
| | | async:true,
|
| | | url: 'App_bts_battgroupAction!serchByCondition',
|
| | | data: "json="+JSON.stringify(temp),
|
| | | dataType: 'json',
|
| | | success:function(result) {
|
| | | var model = JSON.parse(result.result);
|
| | | console.info(model);
|
| | | var arr_td = new Array();
|
| | | if(model.code == 1){
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | var _data = model.data[i];
|
| | | var _tmp = {};
|
| | | // console.log(_data);
|
| | | _tmp.Staionanme = _data.stationName?_data.stationName:'——';
|
| | | _tmp.dev_id = _data.dev_id;
|
| | | _tmp.battgroup_id = _data.battgroup_id;
|
| | | _tmp.battgroup_index = _data.battgroup_index;
|
| | | _tmp.battgroup_mon_cnt = _data.battgroup_mon_cnt;
|
| | | |
| | | arr_td.push(_tmp);
|
| | | Page.setAll(_data.num);
|
| | | }
|
| | | }
|
| | | //console.info(tOptions);
|
| | | tOptions.data = arr_td;
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | setPageVal(Page);
|
| | | layer.close(load);
|
| | | },error:function(e){
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | // 构造查询条件
|
| | | function createSearchParam() {
|
| | | var temp = {
|
| | | FBSDeviceId: 0
|
| | | ,page: Page.getPage()
|
| | | };
|
| | | // console.log(temp);
|
| | | return temp;
|
| | | }
|
| | | |
| | | // 点击上方的设备id搜索
|
| | | $('#searchById').click(function() {
|
| | | var dev_id = $('#devId').val();
|
| | | |
| | | // 判断数据合法新
|
| | | if(!isNumber(dev_id)) {
|
| | | layer.msg('存在违法字符串');
|
| | | }else{
|
| | | dev_id = dev_id.length==0?0:dev_id;
|
| | | Page.setCurr(1);
|
| | | // 构造查询条件
|
| | | var temp = {
|
| | | FBSDeviceId: dev_id
|
| | | ,page: Page.getPage()
|
| | | };
|
| | | search(temp, true);
|
| | | } |
| | | });
|
| | | |
| | | |
| | | //点击查询按钮
|
| | | $('#paging .search').click(function(){
|
| | | search(createSearchParam(), false);
|
| | | });
|
| | | |
| | | //首页
|
| | | $('#page_home').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr != 1){
|
| | | Page.setCurr(1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | } |
| | | });
|
| | | |
| | | //点击上一页
|
| | | $("#page_pre").click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr > 1){
|
| | | Page.setCurr(Page.curr-1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //点击下一页
|
| | | $("#page_next_p").click(function(){ |
| | | if(Page != undefined){
|
| | | if(Page.num > Page.curr){
|
| | | Page.setCurr(Page.curr+1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //尾页
|
| | | $('#page_last').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr < Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //设置每页行数
|
| | | $('#number').blur(function(){
|
| | | var value=$('#number').val();
|
| | | //当输入的数大于0时
|
| | | if(value>0){
|
| | | if(value != Page.size){
|
| | | Page.setSize(parseInt(value));
|
| | | Page.setCurr(1);
|
| | | }
|
| | | }else{
|
| | | //当输入非法数字时
|
| | | alert("请输入合法的数字"); /* 请输入合法的整数 */
|
| | | $('#number').val(Page.size); |
| | | }
|
| | | });
|
| | | |
| | | //点击跳转
|
| | | $('#page_go').click(function(){
|
| | | var tarpage=$('#page_num').attr('value');
|
| | | if(tarpage > Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }else if(tarpage > 0 && tarpage!= Page.curr){
|
| | | Page.setCurr(parseInt(tarpage));
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | |
| | | });
|
| | | |
| | | // 设置页面Page
|
| | | function setPageVal(page) {
|
| | | $('#current').text(page.curr+'/'+page.num);
|
| | | $('#total').text(page.all);
|
| | | }
|
| | | |
| | | //点击导出报表
|
| | | $('#export_table').click(function(){
|
| | | var tblData = GLOBAL.Table.cTblData(tOptions); |
| | | GLOBAL.Table.expExcel.xls(tblData);
|
| | | });
|
| | | |
| | | //构造导出表格对象
|
| | | function createTableData(tOptions){
|
| | | var thead_arr = new Array(); //表头数据数组
|
| | | var thody_arr = new Array(); //表格数据数组
|
| | | var proname_arr = new Array(); //属性名数组
|
| | | //console.info(tOptions); |
| | | if(tOptions != undefined){ |
| | | //构造表头数组 |
| | | for(var i = 0;i< tOptions.cols.length;i++){
|
| | | var _th = tOptions.cols[i];
|
| | | for(var k=0;k<_th.length;k++){ |
| | | if(_th[k].field != undefined){ |
| | | proname_arr.push(_th[k].field);
|
| | | thead_arr.push(_th[k].title);
|
| | | }
|
| | | }
|
| | | }
|
| | | //构造表格内部数据数组
|
| | | for(var j = 0;j < tOptions.data.length;j++){
|
| | | var _data = tOptions.data[j];
|
| | | for(var k=0;k<proname_arr.length;k++){
|
| | | thody_arr.push(_data[proname_arr[k]]);
|
| | | }
|
| | | }
|
| | | }
|
| | | return {
|
| | | thead: [thead_arr],
|
| | | tbody:[thody_arr]
|
| | | }
|
| | | }
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | | </html> |
| | |
| | |
|
| | | // 设置原型函数
|
| | | LayuiTbl.prototype = {
|
| | | updateTr: function(index, data) {
|
| | | updateTr: function(index, data) {
|
| | | var layui = this.layui;
|
| | | var preData = this.cache[index];
|
| | | var _data = $.extend(preData||{}, data||{});
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | ,update: function(field, data) {
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | if(field in _data) { // 判断对象中是否存在标识位
|
| | | var _field = _data[field]; // 获取标识位的值
|
| | | var index = this.getIndex(field, _field); // 获取对象所在的行
|
| | | if(index != undefined) { // 判断是否获取到了行号
|
| | | this.updateTr(index, _data); // 更新指定的行
|
| | | }else {
|
| | | console.log(' 第'+i+'个对象没有对象的表格行');
|
| | | console.log(_data);
|
| | | }
|
| | | }else {
|
| | | console.log(' 第'+i+'个对象的'+field+'主键标识不存在');
|
| | | }
|
| | | }
|
| | | }
|
| | | ,_getBodyTds: function(index) {
|
| | | var layuiTableView = $(this.ele).next('.layui-table-view');
|
| | | var layuiTableBody = layuiTableView.find('.layui-table-body .layui-table tbody');
|
| | |
| | |
|
| | | return false;
|
| | | }
|
| | | ,getIndex: function(field, value) {
|
| | | ,getIndex: function(field, value) { // 获取tr的下标
|
| | | // 遍历cache的值
|
| | | var cache = this.cache;
|
| | | var index = undefined;
|
| | | for(var i=0; i<cache.length; i++) {
|
| | | var _cache = cache[i];
|
| | | console.log(_cache)
|
| | | // console.log(_cache)
|
| | | if(field in _cache && _cache[field] == value) {
|
| | | index = i;
|
| | | break;
|
| | |
| | |
|
| | | return index;
|
| | | }
|
| | | ,getTr: function(field, value) { // 获取Tr的数据
|
| | | // 遍历cache的值
|
| | | var cache = this.cache;
|
| | | var rs = {
|
| | | code: 0
|
| | | ,data: {}
|
| | | ,msg: '获取标识位'+field+',值为'+value+'对应的tr的数据失败'
|
| | | };
|
| | | // 遍历cache的值
|
| | | for(var i=0; i<cache.length; i++) {
|
| | | var _cache = cache[i];
|
| | | if(field in _cache && _cache[field] == value) {
|
| | | rs.code = 1;
|
| | | rs.data = _cache;
|
| | | rs.msg = '获取标识位'+field+',值为'+value+'对应的tr的数据成功'
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | return rs;
|
| | | }
|
| | | ,setCache: function(cache) {
|
| | | this.cache = cache;
|
| | | }
|
New file |
| | |
| | | package com.fgkj.actions;
|
| | |
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.Thread_util;
|
| | | import com.fgkj.services.Thread_utilService;
|
| | |
|
| | | public class Thread_utilAction extends ActionUtil{
|
| | | private Thread_utilService service=new Thread_utilService();
|
| | | private String json;
|
| | | private String result;
|
| | | |
| | | //启动线程
|
| | | public String update() {
|
| | | Thread_util util=getGson().fromJson(json, Thread_util.class);
|
| | | ServiceModel model=service.update(util);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | public String getResult() {
|
| | | return result;
|
| | | }
|
| | | public void setJson(String json) {
|
| | | this.json = json;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | |
|
| | | public static final int APP_BTS_BATTGROUP=101;
|
| | |
|
| | | public static final int THREAD_UTIL=102;
|
| | | |
| | | public boolean add(Object obj); // 添加
|
| | |
|
| | | public boolean update(Object obj); // 更新
|
| | |
| | | import com.fgkj.dao.impl.Positiomap_usrImpl;
|
| | | import com.fgkj.dao.impl.Process_surveyImpl;
|
| | | import com.fgkj.dao.impl.StationtrafficImpl;
|
| | | import com.fgkj.dao.impl.Thread_utilImpl;
|
| | | import com.fgkj.dao.impl.UserDAOImpl;
|
| | | import com.fgkj.dao.impl.User_ChartImpl;
|
| | | import com.fgkj.dao.impl.User_battgroup_baojigroupImpl;
|
| | |
| | | case 99:return new App_bts_comm_taskImpl();
|
| | | case 100:return new Battinf_applyImpl();
|
| | | case 101:return new App_bts_battgroupImpl();
|
| | | case 102:return new Thread_utilImpl();
|
| | | default :return null;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | //默认重启密码
|
| | | public static String RESTART_PWD="123456";
|
| | | |
| | | //进程id
|
| | | public static Integer THREAD_XUHANG=2019001;//机房续航线程
|
| | | public static Integer THREAD_LUOHOU=2019002;//落后单体线程
|
| | | }
|
| | |
| | | String orderSql=" order by dev_id limit ?,? ";
|
| | | sql+=orderSql;
|
| | | //System.out.println(sql); //"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationId()+"%","%"+binf.getStationName5()+"%",binf.getNum()
|
| | | List<App_bts_comm_task> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | List<App_bts_battgroup> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | }*/
|
| | | return list;
|
| | | }
|
| | | //批量设置系统参数时,根据省市区,电池单体型号(伏数),组数筛选出电池组<还需要获取实际容量>
|
| | | public List serchBySys_param(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | //Page page=binf.getPage();
|
| | | /*Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
|
| | | String sql=" select distinct(tb_battinf.StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
|
| | | + "FBSDeviceName,count(FBSDeviceId) as batt_num" +
|
| | | ",MonCount,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax,montmpstd,floatVolLevel,offlineVolLevel,battFloatCurrent"
|
| | | + ",GROUP_CONCAT(tb_battinf.MonCapStd order by groupIndexInFBSDevice separator '/' ) as moncapstds "
|
| | | + ",db_ram_db.tb_fbs9100_state.dev_version"
|
| | | + ",web_site.tb_batt_endurance.real_cap_group1 ,web_site.tb_batt_endurance.real_cap_group2,web_site.tb_batt_endurance.real_cap_group3,web_site.tb_batt_endurance.real_cap_group4 "
|
| | | + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state,web_site.tb_batt_endurance "
|
| | | + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
|
| | | + " and db_battinf.tb_battinf.FBSDeviceId=web_site.tb_batt_endurance.deviceid "
|
| | | + " and MonVolStd=? and Station_install=1 ";
|
| | | //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
|
| | | //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
|
| | | //条件
|
| | | String sql0=" and stationid=? "; //具体机房
|
| | | String sql1=" and stationname1=? ";//省
|
| | | String sql2=" and stationname2=? ";//市
|
| | | String sql5=" and stationname5=? ";//区县
|
| | | switch (binf.getNum()) {
|
| | | case 0:
|
| | | sql+=sql0;
|
| | | break;
|
| | | case 1:
|
| | | sql+=sql1;
|
| | | break;
|
| | | case 2:
|
| | | sql+=sql2;
|
| | | break;
|
| | | case 5:
|
| | | sql+=sql5;
|
| | | break;
|
| | | default:
|
| | | return null;
|
| | | }
|
| | | |
| | | //排序
|
| | | String orderSql=" GROUP BY FBSDeviceId order by StationId asc,GroupIndexInFBSDevice asc ";
|
| | | sql+=orderSql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
|
| | | |
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(0);
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName3(rs.getString("stationName3"));
|
| | | binf.setStationName4(rs.getString("stationName4"));
|
| | | binf.setStationName5(rs.getString("stationName5"));
|
| | | binf.setStationIp(rs.getString("stationIp"));
|
| | | binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | |
| | | /*binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
|
| | | binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
|
| | | binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));*/
|
| | | binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | binf.setBattGroupNum(rs.getInt("batt_num"));
|
| | | |
| | | binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
|
| | | binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
|
| | | binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | //binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | |
| | | binf.setMoncapstds(rs.getString("moncapstds"));
|
| | | binf.setReal_cap_group1(rs.getFloat("real_cap_group1"));
|
| | | binf.setReal_cap_group2(rs.getFloat("real_cap_group2"));
|
| | | binf.setReal_cap_group3(rs.getFloat("real_cap_group3"));
|
| | | binf.setReal_cap_group4(rs.getFloat("real_cap_group4"));
|
| | | |
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonResStd(rs.getFloat("monResStd"));
|
| | | binf.setMonSerStd(rs.getFloat("monSerStd"));
|
| | | binf.setMonTmpStd(rs.getFloat("monTmpStd"));
|
| | | /*binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
|
| | | binf.setBattProducer(rs.getString("battProducer"));
|
| | | binf.setBattModel(rs.getString("battModel"));
|
| | | binf.setBattProductDate(rs.getDate("battProductDate"));
|
| | | binf.setBattInUseDate(rs.getDate("battInUseDate"));
|
| | | binf.setInstall_user(rs.getString("install_user"));*/
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | |
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | /*binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));*/
|
| | | |
| | | |
| | | binf.setStationName9(rs.getString("dev_version"));
|
| | | list.add(binf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | /*//去掉limit条件后的总数
|
| | | int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
|
| | | //System.out.println("number: "+number);
|
| | | if(list!=null&&list.size()>0){
|
| | | list.get(list.size()-1).setNum(number);
|
| | | }*/
|
| | | return list;
|
| | | }
|
| | | public static void main(String[] args) throws ParseException {
|
| | | //new BattInfImpl().searchAll();
|
| | |
|
| | |
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(2);
|
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("广西省-玉林-玉林玉州区西城里-BTS设备");
|
| | | binf.setStationName("百色");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | |
| | | System.out.println(nums);*/
|
| | | /*boolean bl=biml.judgeBattInOrNot(binf);
|
| | | System.out.println(bl);*/
|
| | | /*List<BattInf> list=biml.serchByBatt_param(binf);
|
| | | List<BattInf> list=biml.serchBySys_param(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }*/
|
| | | }
|
| | | /*List<BattInf> list=biml.serchByDischarge(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }*/
|
| | | List list=biml.judgeBatt(binf);
|
| | | System.out.println(list);
|
| | | /*List list=biml.judgeBatt(binf);
|
| | | System.out.println(list);*/
|
| | | //System.out.println(list.size());
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.fgkj.dao.impl;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.Thread_util;
|
| | |
|
| | | public class Thread_utilImpl implements BaseDAO,CallBack{
|
| | |
|
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean add(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | | //启动线程
|
| | | @Override
|
| | | public boolean update(Object obj) {
|
| | | Thread_util util=(Thread_util) obj;
|
| | | String sql=" update web_site.tb_thread_util set thread_en=? where thread_id=? ";
|
| | | boolean bl=DAOHelper.executeUpdate( DBUtil.getConn(), sql,new Object[] {util.getThread_en(),util.getThread_id()});
|
| | | return bl;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean del(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List searchAll() {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List serchByCondition(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String DeviceId;
|
| | | private String DeviceName;
|
| | | private Integer MonCount;
|
| | | |
| | | private Float MonCapStd; //标存容量
|
| | | private String moncapstds;
|
| | | private float real_cap_group1;
|
| | | private float real_cap_group2;
|
| | | private float real_cap_group3;
|
| | | private float real_cap_group4;
|
| | | |
| | | |
| | | private Float MonResStd;
|
| | | private Float MonSerStd;
|
| | | private Float MonTmpStd;
|
| | |
| | | private Integer Size;
|
| | | private Page page;
|
| | | private Object obj;
|
| | | private String station_phone;
|
| | | private String station_phone; |
| | |
|
| | | private String install_user; //安装人
|
| | |
|
| | |
| | | public void setCharge_curr_max(float charge_curr_max) {
|
| | | this.charge_curr_max = charge_curr_max;
|
| | | }
|
| | | public String getMoncapstds() {
|
| | | return moncapstds;
|
| | | }
|
| | | public void setMoncapstds(String moncapstds) {
|
| | | this.moncapstds = moncapstds;
|
| | | }
|
| | | public float getReal_cap_group2() {
|
| | | return real_cap_group2;
|
| | | }
|
| | | public void setReal_cap_group2(float real_cap_group2) {
|
| | | this.real_cap_group2 = real_cap_group2;
|
| | | }
|
| | | public float getReal_cap_group3() {
|
| | | return real_cap_group3;
|
| | | }
|
| | | public void setReal_cap_group3(float real_cap_group3) {
|
| | | this.real_cap_group3 = real_cap_group3;
|
| | | }
|
| | | public float getReal_cap_group4() {
|
| | | return real_cap_group4;
|
| | | }
|
| | | public void setReal_cap_group4(float real_cap_group4) {
|
| | | this.real_cap_group4 = real_cap_group4;
|
| | | }
|
| | | public float getReal_cap_group1() {
|
| | | return real_cap_group1;
|
| | | }
|
| | | public void setReal_cap_group1(float real_cap_group1) {
|
| | | this.real_cap_group1 = real_cap_group1;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "BattInf [num=" + num + ", StationId=" + StationId
|
| | | + ", StationId_ex=" + StationId_ex + ", StationName="
|
| | | + StationName + ", StationName1=" + StationName1
|
| | | + ", StationName2=" + StationName2 + ", StationName3="
|
| | | + StationName3 + ", StationName4=" + StationName4
|
| | | + ", StationName5=" + StationName5 + ", StationName6="
|
| | | + StationName6 + ", StationName7=" + StationName7
|
| | | + ", StationName8=" + StationName8 + ", StationName9="
|
| | | + StationName9 + ", StationIp=" + StationIp + ", FBSDeviceId="
|
| | | + FBSDeviceId + ", FbsDeviceIp=" + FbsDeviceIp
|
| | | + ", FbsDeviceIp_YM=" + FbsDeviceIp_YM + ", FbsDeviceIp_WG="
|
| | | + FbsDeviceIp_WG + ", FbsDeviceIp_old=" + FbsDeviceIp_old
|
| | | + ", FbsDeviceIp_YM_old=" + FbsDeviceIp_YM_old
|
| | | + ", FbsDeviceIp_WG_old=" + FbsDeviceIp_WG_old
|
| | | + ", FBSDeviceName=" + FBSDeviceName
|
| | | + ", GroupIndexInFBSDevice=" + GroupIndexInFBSDevice
|
| | | + ", BattModel=" + BattModel + ", BattGroupId=" + BattGroupId
|
| | | + ", BattGroupNum=" + BattGroupNum + ", BattGroupName="
|
| | | + BattGroupName + ", BattGroupName1=" + BattGroupName1
|
| | | + ", BattGroupName2=" + BattGroupName2 + ", BattGroupName3="
|
| | | + BattGroupName3 + ", BattGroupName4=" + BattGroupName4
|
| | | + ", BattGroupName5=" + BattGroupName5 + ", BattGroupName6="
|
| | | + BattGroupName6 + ", FloatVolLevel=" + FloatVolLevel
|
| | | + ", OfflineVolLevel=" + OfflineVolLevel
|
| | | + ", BattFloatCurrent=" + BattFloatCurrent + ", DeviceId="
|
| | | + DeviceId + ", DeviceName=" + DeviceName + ", MonCount="
|
| | | + MonCount + ", MonCapStd=" + MonCapStd + ", MonResStd="
|
| | | + MonResStd + ", MonSerStd=" + MonSerStd + ", MonTmpStd="
|
| | | + MonTmpStd + ", MonVolStd=" + MonVolStd + ", MonVolLowToAvg="
|
| | | + MonVolLowToAvg + ", MonNum=" + MonNum + ", BattProducer="
|
| | | + BattProducer + ", BattProductDate=" + BattProductDate
|
| | | + ", BattProductDate1=" + BattProductDate1 + ", BattInUseDate="
|
| | | + BattInUseDate + ", BattInUseDate1=" + BattInUseDate1
|
| | | + ", BattGuarantDayCount=" + BattGuarantDayCount
|
| | | + ", SignalId=" + SignalId + ", CInterFaceId=" + CInterFaceId
|
| | | + ", Load_curr=" + Load_curr + ", DisCurrMax=" + DisCurrMax
|
| | | + ", SignalName=" + SignalName + ", StartNum=" + StartNum
|
| | | + ", Station_install=" + Station_install + ", Size=" + Size
|
| | | + ", page=" + page + ", obj=" + obj + ", station_phone="
|
| | | + station_phone + ", install_user=" + install_user
|
| | | + ", binf_ex=" + binf_ex + ", charge_curr_max="
|
| | | + charge_curr_max + ", VideoOrImage=" + VideoOrImage + "]";
|
| | | return "BattInf [num=" + num + ", StationId=" + StationId + ", StationId_ex=" + StationId_ex + ", StationName="
|
| | | + StationName + ", StationName1=" + StationName1 + ", StationName2=" + StationName2 + ", StationName3="
|
| | | + StationName3 + ", StationName4=" + StationName4 + ", StationName5=" + StationName5 + ", StationName6="
|
| | | + StationName6 + ", StationName7=" + StationName7 + ", StationName8=" + StationName8 + ", StationName9="
|
| | | + StationName9 + ", StationIp=" + StationIp + ", FBSDeviceId=" + FBSDeviceId + ", FbsDeviceIp="
|
| | | + FbsDeviceIp + ", FbsDeviceIp_YM=" + FbsDeviceIp_YM + ", FbsDeviceIp_WG=" + FbsDeviceIp_WG
|
| | | + ", FbsDeviceIp_old=" + FbsDeviceIp_old + ", FbsDeviceIp_YM_old=" + FbsDeviceIp_YM_old
|
| | | + ", FbsDeviceIp_WG_old=" + FbsDeviceIp_WG_old + ", FBSDeviceName=" + FBSDeviceName
|
| | | + ", GroupIndexInFBSDevice=" + GroupIndexInFBSDevice + ", BattModel=" + BattModel + ", BattGroupId="
|
| | | + BattGroupId + ", BattGroupNum=" + BattGroupNum + ", BattGroupName=" + BattGroupName
|
| | | + ", BattGroupName1=" + BattGroupName1 + ", BattGroupName2=" + BattGroupName2 + ", BattGroupName3="
|
| | | + BattGroupName3 + ", BattGroupName4=" + BattGroupName4 + ", BattGroupName5=" + BattGroupName5
|
| | | + ", BattGroupName6=" + BattGroupName6 + ", FloatVolLevel=" + FloatVolLevel + ", OfflineVolLevel="
|
| | | + OfflineVolLevel + ", BattFloatCurrent=" + BattFloatCurrent + ", DeviceId=" + DeviceId
|
| | | + ", DeviceName=" + DeviceName + ", MonCount=" + MonCount + ", MonCapStd=" + MonCapStd + ", moncapstds="
|
| | | + moncapstds + ", real_cap_group1=" + real_cap_group1 + ", real_cap_group2=" + real_cap_group2
|
| | | + ", real_cap_group3=" + real_cap_group3 + ", real_cap_group4=" + real_cap_group4 + ", MonResStd="
|
| | | + MonResStd + ", MonSerStd=" + MonSerStd + ", MonTmpStd=" + MonTmpStd + ", MonVolStd=" + MonVolStd
|
| | | + ", MonVolLowToAvg=" + MonVolLowToAvg + ", MonNum=" + MonNum + ", BattProducer=" + BattProducer
|
| | | + ", BattProductDate=" + BattProductDate + ", BattProductDate1=" + BattProductDate1 + ", BattInUseDate="
|
| | | + BattInUseDate + ", BattInUseDate1=" + BattInUseDate1 + ", BattGuarantDayCount=" + BattGuarantDayCount
|
| | | + ", SignalId=" + SignalId + ", CInterFaceId=" + CInterFaceId + ", Load_curr=" + Load_curr
|
| | | + ", DisCurrMax=" + DisCurrMax + ", SignalName=" + SignalName + ", StartNum=" + StartNum
|
| | | + ", Station_install=" + Station_install + ", Size=" + Size + ", page=" + page + ", obj=" + obj
|
| | | + ", station_phone=" + station_phone + ", install_user=" + install_user + ", binf_ex=" + binf_ex
|
| | | + ", charge_curr_max=" + charge_curr_max + ", VideoOrImage=" + VideoOrImage + "]";
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.fgkj.dto;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.fgkj.dao.CallBack;
|
| | |
|
| | | public class Thread_util implements Serializable{
|
| | | private int num;
|
| | | private int thread_id;
|
| | | private String thread_name;
|
| | | private Date thread_starttime;
|
| | | private int thread_en;
|
| | | private String note;
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | | public void setNum(int num) {
|
| | | this.num = num;
|
| | | }
|
| | | public int getThread_id() {
|
| | | return thread_id;
|
| | | }
|
| | | public void setThread_id(int thread_id) {
|
| | | this.thread_id = thread_id;
|
| | | }
|
| | | public String getThread_name() {
|
| | | return thread_name;
|
| | | }
|
| | | public void setThread_name(String thread_name) {
|
| | | this.thread_name = thread_name;
|
| | | }
|
| | | public Date getThread_starttime() {
|
| | | return thread_starttime;
|
| | | }
|
| | | public void setThread_starttime(Date thread_starttime) {
|
| | | this.thread_starttime = thread_starttime;
|
| | | }
|
| | | public int getThread_en() {
|
| | | return thread_en;
|
| | | }
|
| | | public void setThread_en(int thread_en) {
|
| | | this.thread_en = thread_en;
|
| | | }
|
| | | public String getNote() {
|
| | | return note;
|
| | | }
|
| | | public void setNote(String note) {
|
| | | this.note = note;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Thread_util [num=" + num + ", thread_id=" + thread_id + ", thread_name=" + thread_name
|
| | | + ", thread_starttime=" + thread_starttime + ", thread_en=" + thread_en + ", note=" + note + "]";
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | private String StationName3;
|
| | | private String StationName5;
|
| | | private String StationId;
|
| | | |
| | | private Object obj;
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | |
| | | public void setStationId(String stationId) {
|
| | | StationId = stationId;
|
| | | }
|
| | | public Object getObj() {
|
| | | return obj;
|
| | | }
|
| | | public void setObj(Object obj) {
|
| | | this.obj = obj;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Fbs9100_battparam [num=" + num + ", dev_ip=" + dev_ip
|
| | | + ", dev_id=" + dev_id + ", op_cmd=" + op_cmd + ", STD_CAP="
|
| | | + STD_CAP + ", STD_RES=" + STD_RES + ", BattGroupCount="
|
| | | + BattGroupCount + ", EachGroupBattCount=" + EachGroupBattCount
|
| | | + ", MonomerVol=" + MonomerVol + ", GroupVol=" + GroupVol
|
| | | + ", BattTemp=" + BattTemp + ", FloatChargeVol="
|
| | | + FloatChargeVol + ", FloatChargeCurr=" + FloatChargeCurr
|
| | | + ", OnlineVolLow=" + OnlineVolLow + ", GroupConnType="
|
| | | + GroupConnType + ", note=" + note + ", DeviceName="
|
| | | + DeviceName + ", StationName=" + StationName
|
| | | + ", StationName1=" + StationName1 + ", StationName2="
|
| | | + StationName2 + ", StationName3=" + StationName3
|
| | | + ", StationName5=" + StationName5 + ", StationId=" + StationId
|
| | | + "]";
|
| | | return "Fbs9100_battparam [num=" + num + ", dev_ip=" + dev_ip + ", dev_id=" + dev_id + ", op_cmd=" + op_cmd
|
| | | + ", STD_CAP=" + STD_CAP + ", STD_RES=" + STD_RES + ", BattGroupCount=" + BattGroupCount
|
| | | + ", EachGroupBattCount=" + EachGroupBattCount + ", MonomerVol=" + MonomerVol + ", GroupVol=" + GroupVol
|
| | | + ", BattTemp=" + BattTemp + ", FloatChargeVol=" + FloatChargeVol + ", FloatChargeCurr="
|
| | | + FloatChargeCurr + ", OnlineVolLow=" + OnlineVolLow + ", GroupConnType=" + GroupConnType + ", note="
|
| | | + note + ", DeviceName=" + DeviceName + ", StationName=" + StationName + ", StationName1="
|
| | | + StationName1 + ", StationName2=" + StationName2 + ", StationName3=" + StationName3 + ", StationName5="
|
| | | + StationName5 + ", StationId=" + StationId + ", obj=" + obj + "]";
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.fgkj.services;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
|
| | | public class Thread_utilService {
|
| | | private BaseDAO dao;
|
| | | private ServiceModel model;
|
| | | |
| | | public Thread_utilService() {
|
| | | super();
|
| | | model=new ServiceModel();
|
| | | dao=BaseDAOFactory.getBaseDAO(BaseDAO.THREAD_UTIL);
|
| | | }
|
| | | //启动线程
|
| | | public ServiceModel update(Object obj) {
|
| | | boolean bl=dao.update(obj);
|
| | | if(bl) {
|
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | }else {
|
| | | model.setData(0);
|
| | | model.setMsg("修改失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | if(b) {
|
| | | success+=1;
|
| | | list.get(i).setNum(1);
|
| | | List listbatt=dao.serchByCondition(fs);
|
| | | list.get(i).setObj(listbatt);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | //批量设置系统参数时,根据省市区,电池单体型号(伏数),组数筛选出电池组并读取它的实际系统参数
|
| | | public ServiceModel serchBattinfAndParam(Object obj) {
|
| | | List<BattInf> list=(new BattInfImpl()).serchByBatt_param(obj);
|
| | | List<BattInf> list=(new BattInfImpl()).serchBySys_param(obj);
|
| | | if(list!=null&&list.size()>0) {
|
| | | Calendar c = Calendar.getInstance();
|
| | | //现在的时间(单位:毫秒)
|
| | |
| | | ServiceModel model=fs.serchBattinfAndParam(binf);
|
| | | List list=(List)model.getData();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | System.out.println(((BattInf)list.get(i)).getObj());
|
| | | System.out.println(((BattInf)list.get(i)));
|
| | | }
|
| | | }
|
| | | }
|