Commit 8fc4920c authored by wangjinjing's avatar wangjinjing

修复监控在线不在线统计方法

parent b2b4c081
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>impyw</display-name>
<display-name>impnhyw</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
......@@ -39,6 +39,14 @@
<filter-name>AppSessionOutFilter</filter-name>
<filter-class>cn.base.filter.AppSessionOutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AppSessionOutFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AppSessionOutFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
......
......@@ -129,23 +129,23 @@
}
// function uuid() {
// return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c = > (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
// )
// }
function uuid() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c = > (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
)
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4";
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
s[8] = s[13] = s[18] = s[23] = "-";
// function uuid() {
// var s = [];
// var hexDigits = "0123456789abcdef";
// for (var i = 0; i < 36; i++) {
// s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
// }
// s[14] = "4";
// s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
// s[8] = s[13] = s[18] = s[23] = "-";
//
// var uuid = s.join("");
// return uuid;
// }
var uuid = s.join("");
return uuid;
}
</script>
\ No newline at end of file
......@@ -51,7 +51,7 @@ function getQueryParams(){
}else if(chosed[i]=="2"){
currentstate += " or a.networkerror=1 ";
}else if(chosed[i]=="3"){
currentstate += " or a.isonline=1 ";
currentstate += " or ( a.isonline is not null and a.isonline!=0 )";
}else if(chosed[i]=="4"){
currentstate += " or a.vqcstate=1 ";
}else if(chosed[i]=="5"){
......@@ -61,7 +61,7 @@ function getQueryParams(){
}
}
if (currentstate == "1") {
sParam.tableparam = " and a.isonline=1 ";
sParam.tableparam = " and a.isonline is not null and a.isonline!=0 ";
}else{
if(currentstate!=""){
sParam.tableparam = " and ("+currentstate.substr(3)+") ";
......@@ -335,7 +335,7 @@ function initCacheStatus(){
}
function transStatus(data){
if(data=="1"){
if(data!="0"){
return "<div style='height:13px;width:13px;background-color:#60b631;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
} else if (data=="0") {
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
......
......@@ -100,10 +100,6 @@ function getQueryParams(){
// 加载列表
function initGrid(){
toolbar = [{
text : '查询',
iconCls : 'icon-search',
handler : doSearch
},{
text:'待办事项',
iconCls:'icon-showList',
handler:showToDoList
......
......@@ -212,13 +212,13 @@ function xhdRate() {
if (res) {
//console.log(res);
// 信号灯在线率
$("#xhdOnline").text(res.online);
$("#xhdUnOnline").text(res.unonline);
$("#xhdOnline").text(res.xhdonline);
$("#xhdUnOnline").text(res.xhdunonline);
var data = [{
value: res.online,
value: res.xhdonline,
name: '在线'
}, {
value: res.unonline,
value: res.xhdunonline,
name: '不在线'
}];
EchartsBase.circularGraphChart({
......
......@@ -22,7 +22,7 @@ $(function(){
success:function(result){
var str="";
for(var i=0;i<result.length;i++){
str+="<a class=\"ahref\" href='"+CommonData.uploadurl+"/"+result[i].foldername+"'>"+result[i].name+" </a>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;";
str+="<a class=\"ahref\" href='"+CommonData.downloadurl+"/"+result[i].foldername+"'>"+result[i].name+" </a>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;";
}
$("#receiverdata").html(str);
}
......@@ -84,7 +84,7 @@ function renderOrder(){
$("#accuracyofinfo").text(transEmptyObj(records.accuracyofinfo));
$("#construction").text(transEmptyObj(records.construction));
$("#completiontime").text(transEmptyObj(records.completiontime));
$("#receivercompany").text(transEmptyObj(records.receivercompany));
$("#receivercompany").text(transEmptyObj(records.receivercompanyname));
$("#receiverpeople").text(transEmptyObj(records.receiverpeople));
$("#receiverphone").text(transEmptyObj(records.receiverphone));
$("#receivertime").text(transEmptyObj(records.receivertime));
......
......@@ -17,9 +17,9 @@ function getQueryParams(){
var state = records.state;
if(type=="isonline"){//监控点是否在线详细展示
if(state=='1'){//正常
tableparam = " and isonline!=0";
tableparam = " and ( isonline is not null and isonline!=0)";
}else{
tableparam = " and isonline=0";
tableparam = " and (isonline is null or isonline=0)";
}
}else if(type=="video"){//监控点设备异常详细展示
if(state=='1'){//正常
......
......@@ -17,9 +17,9 @@ function getQueryParams(){
var state = records.state;
if(type=="isonline"){//监控点是否在线详细展示
if(state=='1'){//正常
tableparam = " and isonline!=0";
tableparam = " and (isonline is not null and isonline!=0) ";
}else{
tableparam = " and isonline=0";
tableparam = " and ( isonline is null or isonline=0) ";
}
}else if(type=="video"){//监控点设备异常详细展示
if(state=='1'){//正常
......
......@@ -388,10 +388,10 @@ function shownArea(xzbh,xzmc,flag){
//tableparam = " and b.currentstateid is null";
}else if(flag==3){
title = "在线数";
tableparam = " and b.isonline=1 "
tableparam = " and b.isonline is not null and b.isonline!=0 "
}else if(flag==4){
title = "离线数";
tableparam = " and b.isonline=0 "
tableparam = " and ( b.isonline=0 or b.isonline is null) "
}
params.tableparam = tableparam;
params.title = title;
......
......@@ -22,9 +22,9 @@ function getQueryParams(){
var state = records.state;
if(type=="isonline"){//监控点是否在线详细展示
if(state=='1'){//正常
tableparam = " and isonline=1";
tableparam = " and isonline is not null and isonline!=0";
}else{
tableparam = " and isonline=0";
tableparam = " and ( isonline=0 or isonline is null) ";
}
}else if(type=="video"){//监控点设备异常详细展示
if(state=='1'){//正常
......
......@@ -428,9 +428,9 @@ function shownArea(xzbh,xzmc,flag){
}
if(params.alarmdevicetype =="1") {
if(flag == 3) {
tableparam = " and b.isonline=1 "
tableparam = " and b.isonline is not null and b.isonline!=0 "
} else if (flag == 4) {
tableparam = " and b.isonline=0 "
tableparam = " and ( b.isonline=0 or b.isonline is null) "
}
}else if(params.alarmdevicetype =="2") {//服務器
if(flag == 3) {
......
......@@ -22,9 +22,9 @@ function getQueryParams(){
var state = records.state;
if(type=="isonline"){//监控点是否在线详细展示
if(state=='1'){//正常
tableparam = " and isonline=1";
tableparam = " and isonline is not null and isonline!=0 ";
}else{
tableparam = " and isonline=0";
tableparam = " and ( isonline=0 or isonline is null) ";
}
}else if(type=="video"){//监控点设备异常详细展示
if(state=='1'){//正常
......
var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
$(function(){
var windowId, proName = window.location.pathname.split("/")[1],
sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
var sParam = {};
$(function () {
initDefault();
});
//默认
function initDefault(){
$("#startTime").datetimebox("setValue",$.getTodayStart(0,"00:00:00"));
$("#endTime").datetimebox("setValue",$.getTodayEnd("23:59:59"));
function initDefault() {
$("#startTime").datetimebox("setValue", $.getTodayStart(0, "00:00:00"));
$("#endTime").datetimebox("setValue", $.getTodayEnd("23:59:59"));
initGrid();
}
//查询条件
function getQueryParams(){
var sParam = {};
function getQueryParams() {
var startTime = $('#startTime').datetimebox("getValue");
var endTime = $('#endTime').datetimebox("getValue");
sParam.LIKEmachinename = $('#LIKEmachinename').textbox("getValue");
sParam.TaskMachine="0";
if($('#TaskMachine').is(':checked')){
sParam.TaskMachine="1";
$("#taskDiv").show();
$("#notaskDiv").hide();
}else{
$("#taskDiv").hide();
$("#notaskDiv").show();
}
sParam.TaskMachine = $('#TaskMachine').combobox("getValue");
var tableparam = "";
if(!(startTime==null||startTime==""||startTime==undefined)){
tableparam += " AND statusuptime > '" +startTime + "'";
if (!(startTime == null || startTime == "" || startTime == undefined)) {
tableparam += " AND statusuptime > '" + startTime + "'";
}
if(!(endTime==null||endTime==""||endTime==undefined)){
tableparam += " AND statusuptime < '" +endTime + "'";
if (!(endTime == null || endTime == "" || endTime == undefined)) {
tableparam += " AND statusuptime < '" + endTime + "'";
}
sParam.tableparam = tableparam;
return sParam;
}
//加载列表
function initGrid(){
$("#taskDiv").show();
$("#notaskDiv").hide();
function initGrid() {
var toolbar = [{
text : '查询',
iconCls : 'icon-search',
handler : doSearch
}/*,{
text : '增加',
iconCls : 'icon-add',
handler : doAdd
},{
text : '修改',
iconCls : 'icon-cut',
handler : doEdit
},{
text : '删除',
iconCls : 'icon-delete',
handler : doDelete
}*/];
text: '查询',
iconCls: 'icon-search',
handler: doSearch
}];
$('#tableGrid').datagrid({
toolbar : toolbar,
singleSelect:true,
rownumbers:true,
queryParams:getQueryParams(),
url : 'ywmachinestatusinfoAction!listYwmachinestatusinfoByPage.do',
// url : 'ywmachinestatusinfoAction!get_ywmachinestatusinfo.do',
columns : [[
toolbar: toolbar,
singleSelect: true,
rownumbers: true,
queryParams: getQueryParams(),
url: 'ywmachinestatusinfoAction!listYwmachinestatusinfoByPage.do',
columns: [[
{
field: 'A',
checkbox:'true',
width:30
checkbox: 'true',
width: 30
},
{field:'machinestatusid',title:'machinestatusid',hidden:true,width:120,
formatter:function showClick(value,record,num){
return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>";
{field: 'machineid', title: 'id', hidden: true, width: 120},
{
field: 'machinestatusid', title: 'machinestatusid', hidden: true, width: 120,
formatter: function showClick(value, record, num) {
return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate(" + num + ")'>" + value + "</a>";
}
},
{field:'machinename',title:'机器名称',hidden:false,width:120},
{field:'machineip',title:'设备ip',hidden:false,width:110},
{field:'zjzt',title:'主机状态',hidden:true,width:60,
formatter:function showClick(value,record,num){
{field: 'machinename', title: '机器名称', hidden: false, width: 120},
{field: 'machineip', title: '设备ip', hidden: false, width: 110},
{
field: 'zjzt', title: '主机状态', hidden: true, width: 60,
formatter: function showClick(value, record, num) {
// console.log("主机:",value,record);
if(value==1){
if (value == 1) {
return "<div style='height:13px;width:13px;background-color:green;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}else if(value==0){
} else if (value == 0) {
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}else{
} else {
return value;
}
}
},
{field:'cpuzt',title:'cpu使用率',hidden:false,width:120,
formatter:function(value,record,num){
{
field: 'cpuzt', title: 'cpu使用率', hidden: false, width: 120,
formatter: function (value, record, num) {
var cpu = record.cpusy;
if(cpu != null){
cpu = cpu.indexOf('%')>0 ? cpu.replace("%",""):cpu;
if(value == 0){
return '<div class="progress"><div class="progress-value" style="background-color:red;width: ' + (cpu || 0) + 'px;"><div class="progress-text" style="border:1px solid red;">' + (cpu+"%" || "") + "</div></div></div>"
}else {
return $.gridProgressBar(cpu+"%",100*cpu/100.00);
if (cpu != null) {
cpu = cpu.indexOf('%') > 0 ? cpu.replace("%", "") : cpu;
if (value == 0) {
return '<div class="progress"><div class="progress-value" style="background-color:red;width: ' + (cpu || 0) + 'px;"><div class="progress-text" style="border:1px solid red;">' + (cpu + "%" || "") + "</div></div></div>"
} else {
return $.gridProgressBar(cpu + "%", 100 * cpu / 100.00);
}
}else{
} else {
return "未知";
}
}
},
{field:'nczt',title:'内存使用率',hidden:false,width:225,
formatter:function(value,record,num){
{
field: 'nczt', title: '内存使用率', hidden: false, width: 225,
formatter: function (value, record, num) {
var nc = record.ncsy;
var ncrl = Math.round(record.ncrl);
var sync = "";
if(nc != null){
nc = Math.round(nc.indexOf('%')>0 ? nc.replace("%",""):nc);
sync = (ncrl * nc)/100;
if (nc != null) {
nc = Math.round(nc.indexOf('%') > 0 ? nc.replace("%", "") : nc);
sync = (ncrl * nc) / 100;
sync = sync.toFixed(2);
if(value == 0){
return '<div class="progress">'+
'<div class="progress-value" style="background-color:red;width: ' + (nc || 0) + 'px;">'+
'<div class="progress-text progress-textRed" style="border:1px solid red;">' + (nc+"%" || "") + "</div>" +
if (value == 0) {
return '<div class="progress">' +
'<div class="progress-value" style="background-color:red;width: ' + (nc || 0) + 'px;">' +
'<div class="progress-text progress-textRed" style="border:1px solid red;">' + (nc + "%" || "") + "</div>" +
"</div>" +
"<div style='position: relative;left: 105px; top: -18px;'>"+parseFloat(sync)+"G / "+parseFloat(ncrl)+"G(总)</div>"+
"<div style='position: relative;left: 105px; top: -18px;'>" + parseFloat(sync) + "G / " + parseFloat(ncrl) + "G(总)</div>" +
"</div>";
}else {
return '<div class="progress">'+
'<div class="progress-value" style="width: ' + (nc || 0) + 'px;">'+
'<div class="progress-text">' + (nc+"%" || "") + "</div>" +
} else {
return '<div class="progress">' +
'<div class="progress-value" style="width: ' + (nc || 0) + 'px;">' +
'<div class="progress-text">' + (nc + "%" || "") + "</div>" +
"</div>" +
"<div style='position: relative;left: 105px; top: -18px;'>"+parseFloat(sync)+"G / "+parseFloat(ncrl)+"G(总)</div>"+
"<div style='position: relative;left: 105px; top: -18px;'>" + parseFloat(sync) + "G / " + parseFloat(ncrl) + "G(总)</div>" +
"</div>";
}
// return $.gridProgressBar(nc+"%",100*nc/100.00);
}else{
} else {
return "未知";
}
}
},
{field:'ypzt',title:'硬盘使用率',hidden:false,width:250,
formatter:function(value,record,num){
{
field: 'ypzt', title: '硬盘使用率', hidden: false, width: 250,
formatter: function (value, record, num) {
var yp = record.ypsy;
var yprl = Math.round(record.yprl);
var ypsy="";
if(yp != null){
yp = Math.round(yp.indexOf('%')>0 ? yp.replace("%",""):yp);
ypsy = (yprl * yp)/100;
var ypsy = "";
if (yp != null) {
yp = Math.round(yp.indexOf('%') > 0 ? yp.replace("%", "") : yp);
ypsy = (yprl * yp) / 100;
ypsy = ypsy.toFixed(2);
if(value == 0){
return '<div class="progress">'+
'<div class="progress-value" style="background-color:red;width: ' + (yp || 0) + 'px;">'+
'<div class="progress-text progress-textRed" style="border:1px solid red;">' + (yp+"%" || "") + "</div>" +
if (value == 0) {
return '<div class="progress">' +
'<div class="progress-value" style="background-color:red;width: ' + (yp || 0) + 'px;">' +
'<div class="progress-text progress-textRed" style="border:1px solid red;">' + (yp + "%" || "") + "</div>" +
"</div>" +
"<div style='position: relative;left: 105px; top: -18px;'>"+parseFloat(ypsy)+"G / "+parseFloat(yprl)+"G(总)</div>"+
"<div style='position: relative;left: 105px; top: -18px;'>" + parseFloat(ypsy) + "G / " + parseFloat(yprl) + "G(总)</div>" +
"</div>";
}else {
return '<div class="progress">'+
'<div class="progress-value" style="width: ' + (yp || 0) + 'px;">'+
'<div class="progress-text">' + (yp+"%" || "") + "</div>" +
} else {
return '<div class="progress">' +
'<div class="progress-value" style="width: ' + (yp || 0) + 'px;">' +
'<div class="progress-text">' + (yp + "%" || "") + "</div>" +
"</div>" +
"<div style='position: relative;left: 105px; top: -18px;'>"+parseFloat(ypsy)+"G / "+parseFloat(yprl)+"G(总)</div>"+
"<div style='position: relative;left: 105px; top: -18px;'>" + parseFloat(ypsy) + "G / " + parseFloat(yprl) + "G(总)</div>" +
"</div>";
}
}else{
} else {
return "未知";
}
}
},
{field:'statusuptime',title:'检测时间',hidden:false,width:125},
{field:'machineid',title:'操作',hidden:false,width:70,
formatter:function showClick(value,record,num){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="lookdetail('+num+')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">详情</span></span></a>';
}
}
]]
});
$('#tableNoTaskGrid').datagrid({
toolbar : toolbar,
singleSelect:true,
rownumbers:true,
queryParams:getQueryParams(),
url : 'ywmachinestatusinfoAction!listYwmachinestatusinfoByPage.do',
columns : [[
{field: 'statusuptime', title: '检测时间', hidden: false, width: 125},
{field: 'csmc', title: '是否启用', hidden: true, width: 125},
{
field: 'A',
checkbox:'true',
width:30
},
{field:'machineid',title:'machineid',hidden:true,width:120,
formatter:function showClick(value,record,num){
return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>";
field: 'xxx', title: '操作', hidden: false, width: 70,
formatter: function showClick(value, record, num) {
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px 5px;" class="l-btn l-btn-small" onclick="lookdetail(' + num + ')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">详情</span></span></a>';
}
}
},
{field:'machinename',title:'服务器名称',hidden:false,width:120},
{field:'machineip',title:'服务器ip',hidden:false,width:100},
{field:'csmc',title:'是否启用',hidden:false,width:80}
]]
});
}
......@@ -200,220 +165,31 @@ function initGrid(){
function lookdetail(index) {
var selRows = $('#tableGrid').datagrid('getRows')[index];
windowId = top.$.createWin({
title : '查看详情',
width : 800,
height : 500,
data : selRows,
url : sysUrl+"/yw/patroltask/machinetaskhistory/ywmachinestatusinfo_show.jsp"
title: '查看详情',
width: 800,
height: 500,
data: selRows,
url: sysUrl + "/yw/patroltask/machinetaskhistory/ywmachinestatusinfo_show.jsp"
});
}
//删除
function doDelete(){
var selRows = $('#tableGrid').datagrid('getSelected');
if(!selRows){
$.showMsg('请先选择记录! ');
return;
}
top.$.dlg.confirm('确认删除?',function(){
$.ajax({
type:'post',
dataType : 'json',
url:'ywmachinestatusinfoAction!delete_Ywmachinestatusinfo.do',
data:{
machinestatusid : selRows.machinestatusid
},
success:function(flag){
if(flag == "success"){
$.showMsg("操作成功!");
doSearch();
}else{
$.showMsg("操作失败!");
}
}
});
});
}
//批量删除
function doDelete_batch(){
var selRows = $('#tableGrid').datagrid('getChecked');
var keyword = [];
if(selRows===null){
$.showMsg('请先选择一行! ');
}else{
for(var i=0; i<selRows.length; i++){
keyword.push(selRows[i].machinestatusid);
}
top.$.dlg.confirm('你确认要删除吗?',function(){
$.ajax({
type:'post',
dataType : 'json',
url:'ywmachinestatusinfoAction!batch_delete_Ywmachinestatusinfo.do',
data:{keyword : keyword.join(",")},
success:function(flag){
if(!$.isNull(flag)){
$.showMsg("操作成功!");
doSearch();
}else{
$.showMsg("操作失败!");
}
}
});
});
}
}
//查询
function doSearch(){
if($('#TaskMachine').is(':checked')){
$('#tableGrid').datagrid('load',getQueryParams());
}else{
$('#tableNoTaskGrid').datagrid('load',getQueryParams());
}
}
//增加
function doAdd(){
toEdit=false;
windowId = top.$.createWin({
title : '增加信息',
width : 650,
height : 300,
buttons: [{
text:$.fn.textbox.defaults.ok,
handler:saveNodeInfo
}],
url : sysUrl+"/im/ywgl/ywmachinestatusinfo_show.jsp"
});
}
//修改
function doUpdate(index){
toEdit=true;
var selRows = $('#tableGrid').datagrid('getRows')[index];
windowId = top.$.createWin({
title : '修改信息',
width : 650,
height : 300,
data : selRows,
buttons: [{
text:$.fn.textbox.defaults.ok,
handler:saveNodeInfo
}],
url : sysUrl+"/im/ywgl/ywmachinestatusinfo_show.jsp"
});
}
//保存
function saveNodeInfo(){
var win = $.getTopWindowById(windowId);
var jq = win.$;
var model = $.getFormValues("childform",windowId);
//console.log(model);
if(!win.$('#childform').form('enableValidation').form('validate')){
return;
}
if(toEdit){//修改
model.XGTJmachinestatusid = jq('#machinestatusid').val();
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type:'post',
dataType : 'json',
url:'ywmachinestatusinfoAction!update_Ywmachinestatusinfo.do',
data:model,
success:function(value){
if(value=="success"){
$.showMsg("操作成功!");
top.$("#"+windowId).dialog('close');
doSearch();
}else if(value=="same"){
$.showMsg("已存在!");
}else{
$.showMsg("操作失败!");
}
}
});
}else{
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type:'post',
dataType : 'json',
url:'ywmachinestatusinfoAction!insert_Ywmachinestatusinfo.do',
data:model,
success:function(value){
if(value=="success"){
$.showMsg("操作成功!");
top.$("#"+windowId).dialog('close');
doSearch();
}else if(value=="same"){
$.showMsg("已存在!");
}else{
$.showMsg("操作失败!");
}
}
});
}
}
//打开修改
function doEdit(){
var selIndex = $('#tableGrid').datagrid('getRowIndex', $("#tableGrid").datagrid('getSelected'));
if(selIndex==-1){
$.showMsg('请先选择一行! ');
}else{
doUpdate(selIndex);
}
}
//模板下载
function doTemplate(){
var baseUrl = $.proPath();
var downFile = baseUrl+"/down/down.xls";
window.location.href= downFile;
}
//导入
function doImport(){
toEdit=false;
windowId = top.$.createWin({
id : $.uniqueId(),
title : '导入',
width : 400,
height : 130,
url : sysUrl+"/im/xx/ywmachinestatusinfo_imp.jsp"
});
}
//导出
function doExport(){
var model = getQueryParams();
$.ajax({
type : 'post',
dataType : 'json',
data : model,
url : 'ywmachinestatusinfoAction!count_Ywmachinestatusinfo.do',
success : function(value) {
if(!$.isNull(value)){
countExport(value);
}else{
$.showMsg("操作失败!");
}
}
});
}
// 导出传参条件
function countExport(totalSize) {
var limit = 5000;
if (totalSize > 5000) {
top.$.dlg.confirm('记录过多支持前5000条,确定要将记录导出Excel为表格吗?',function(){
execExport();
});
function doSearch() {
$('#tableGrid').datagrid('load', getQueryParams());
//控制列显示隐藏
if (sParam.TaskMachine == "0") {
$('#tableGrid').datagrid('hideColumn', 'zjzt');
$('#tableGrid').datagrid('hideColumn', 'cpuzt');
$('#tableGrid').datagrid('hideColumn', 'ypzt');
$('#tableGrid').datagrid('hideColumn', 'statusuptime');
$('#tableGrid').datagrid('hideColumn', 'xxx');
$('#tableGrid').datagrid('showColumn', 'csmc');
} else {
top.$.dlg.confirm('确认导出?',function(){
execExport();
})
$('#tableGrid').datagrid('showColumn', 'zjzt');
$('#tableGrid').datagrid('showColumn', 'cpuzt');
$('#tableGrid').datagrid('showColumn', 'ypzt');
$('#tableGrid').datagrid('showColumn', 'statusuptime');
$('#tableGrid').datagrid('showColumn', 'xxx');
$('#tableGrid').datagrid('hideColumn', 'csmc');
}
}
// 调用后台
function execExport() {
var model =JSON.stringify(getQueryParams());
document.excelForm.action = 'ywmachinestatusinfoAction!exp_Ywmachinestatusinfo.do?downParam='+encodeURIComponent(model);
document.excelForm.submit();
}
......@@ -39,7 +39,15 @@
<input class="easyui-datetimebox" id="endTime" >
</div>
<div style="margin-top:5px">
<label> <input type="checkbox" id="TaskMachine" checked οnclick="checkboxOnclick()"> 是否已加入巡检 </label>
<div class='fl'>
<span class="text-content" style="width:100px">是否已加入巡检:</span>
<select id="TaskMachine" class="easyui-combobox">
<option >全部</option>
<option value="1" selected></option>
<option value="0"></option>
</select>
</div>
<%--<label> <input type="checkbox" id="TaskMachine" checked onclick="checkboxOnclick()"> 是否已加入巡检 </label>--%>
</div>
</div>
<div class="form-line hidden">
......@@ -122,9 +130,9 @@
<div style="height:100%;" id="taskDiv">
<table id='tableGrid'></table>
</div>
<div style="height:100%;height:100%;display:none;" id="notaskDiv">
<table id='tableNoTaskGrid'></table>
</div>
<%--<div style="height:100%;height:100%;display:none;" id="notaskDiv">--%>
<%--<table id='tableNoTaskGrid'></table>--%>
<%--</div>--%>
</div>
<form action="" method="post" name="excelForm" id="excelForm" style="display: none;">
</form>
......
......@@ -60,18 +60,10 @@
</html>
<script type="text/javascript">
var winId = $.getUrlParam("winId");
var records = top.$("#"+winId).panel("options").data;
console.log("跳转iframe: ",records);
var data = top.$("#"+winId).panel("options").data;
console.log("跳转iframe: ",data);
$(function(){
$.ajax({
type : 'post',
dataType : 'json',
url : 'ywmachinestatusinfoAction!listYwmachinestatusinfoByPage.do',
data : {'machineid':records.machineid,'statusupbatch':records.statusupbatch,'page':0,'rows':20},
success : function(res){
// console.log("测试:",res);
var data = res.rows[0]
// console.log("返回结果:",data);
$('#mc').html(data.machinename);
$('#ip').html(data.machineip);
$('#jcsj').html(data.statusuptime);
......@@ -83,7 +75,7 @@ $(function(){
zjzt = "正常";
zjhtml = "<div style='height:13px;width:13px;background-color:green;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto 0 0;'></div>";
} else if (zjzt == '0') {
zjzt = "异常"
zjzt = "异常";
zjhtml = "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto 0 0;'></div>";
}
$('#zjzt').html(zjzt);
......@@ -269,8 +261,6 @@ $(function(){
if(ypzt=='正常'){
$("#diskTitle").parent().css("color","#000");
}
}
});
});
function cpuGrap(data){
......@@ -367,7 +357,7 @@ function cpuGrap(data){
}]
}
]
}
};
option.series[0].data[0].value =data;
myChart.setOption(option, true);
}
......
var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var arrs=[];
$(function(){
initDefault();
});
//默认
function initDefault(){
ywDc();
initGrid();
}
function ywDc(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "ksh_ZxldCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
formatter: function (row) {
var opts = $(this).combobox('options');
return row[opts.textField];
}
});
var firstShowPanel = true;
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
var values = $('#currentstate').combobox('getValues');
$(".handleCom1").hide();
$("#_easyui_combobox_i1_0").show();
}
}
},
onChange: function () {
var values = $('#currentstate').combobox('getValues');
},
onHidePanel: function () {
selectedValues = $('#currentstate').combobox('getValues');
firstShowPanel = false;
},
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
}
}
}
},
onSelect: function (record) {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").hide();
}
return false;
}
});
}
//查询条件
function getQueryParams(){
var sParam = {};
......@@ -15,6 +124,22 @@ function getQueryParams(){
sParam.LIKEbz = $('#bz').textbox("getValue");
sParam.order = " order by updatetime desc";
sParam.emptyremarks = $("#combobz").combobox("getValue");
var chosed = $('#currentstate').combobox('getValues');
var state = "";
for (var i in chosed) {
if(chosed[i]=="0"){
state += " or STATE is null or STATE=0";
}else{
state += " or STATE= " + chosed[i];
}
}
if (state == "") {
sParam.tableparam = "";
} else {
if (state != "") {
sParam.tableparam = " and (" + state.substr(3) + ") ";
}
}
return sParam;
}
//加载列表
......
......@@ -46,6 +46,10 @@
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
</div>
</div>
......
......@@ -46,6 +46,10 @@
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
......
......@@ -53,13 +53,17 @@
</div>
<div class='fl'>
<span class="text-content" style="width: 200px">备注是否为空:</span>
<span class="text-content" style="width: 160px">备注是否为空:</span>
<select class="easyui-combobox" id="combobz">
<option value="">全部</option>
<option value="1">不为空</option>
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
......
var windowId, proName = window.location.pathname.split("/")[1],
sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
var arrs=[];
$(function () {
initDefault();
});
//默认
function initDefault() {
ywXhd();
initGrid();
}
function ywXhd(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "nhywjtxhdglCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
formatter: function (row) {
var opts = $(this).combobox('options');
return row[opts.textField];
}
});
var firstShowPanel = true;
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
var values = $('#currentstate').combobox('getValues');
$(".handleCom1").hide();
$("#_easyui_combobox_i1_0").show();
}
}
},
onChange: function () {
var values = $('#currentstate').combobox('getValues');
},
onHidePanel: function () {
selectedValues = $('#currentstate').combobox('getValues');
firstShowPanel = false;
},
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
}
}
}
},
onSelect: function (record) {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").hide();
}
return false;
}
});
}
//查询条件
function getQueryParams() {
var sParam = {};
......@@ -24,7 +132,22 @@ function getQueryParams() {
// sParam.startTime = startTime;
// sParam.endTime = endTime;
// sParam.order = " order by createtime desc"
var chosed = $('#currentstate').combobox('getValues');
var currentstate = "";
for (var i in chosed) {
if(chosed[i]=="0"){
currentstate += " or STATE is null or STATE=0";
}else{
currentstate += " or STATE= " + chosed[i];
}
}
if (currentstate == "") {
sParam.tableparam = "";
} else {
if (currentstate != "") {
sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
}
}
return sParam;
}
......@@ -64,10 +187,18 @@ function initGrid() {
{
field: 'mode', title: '当前状态', hidden: false, width: 60,
formatter: function showClick(value, record, num) {
if (value == 20) {
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
} else {
// if (value == 20) {
// return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
// } else {
// return "<div style='height:13px;width:13px;background-color:green;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
// }
if (value == 1) {
return "<div style='height:13px;width:13px;background-color:green;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
} else if (value == 0){
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}
else {
return "未知";
}
}
},
......
......@@ -4,7 +4,6 @@ $(function () {
// console.log("历史记录:",currentstateid);
initDefault();
});
//默认
function initDefault() {
// 设置默认时间
......
var windowId, proName = window.location.pathname.split("/")[1],
sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
var arrs=[];
$(function () {
initDefault();
});
//默认
function initDefault() {
ywYdp();
initGrid();
}
function ywYdp(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "nhywjtledydpglCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
formatter: function (row) {
var opts = $(this).combobox('options');
return row[opts.textField];
}
});
var firstShowPanel = true;
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
var values = $('#currentstate').combobox('getValues');
$(".handleCom1").hide();
$("#_easyui_combobox_i1_0").show();
}
}
},
onChange: function () {
var values = $('#currentstate').combobox('getValues');
},
onHidePanel: function () {
selectedValues = $('#currentstate').combobox('getValues');
firstShowPanel = false;
},
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
}
}
}
},
onSelect: function (record) {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").hide();
}
return false;
}
});
}
//查询条件
function getQueryParams() {
var sParam = {};
......@@ -19,7 +125,19 @@ function getQueryParams() {
sParam.LIKEledmc = $('#LIKEledmc').textbox("getValue");
sParam.LIKEbz = $('#bz').textbox("getValue");
sParam.emptyremarks = $('#combobz').combobox("getValue");
var chosed = $('#currentstate').combobox('getValues');
var currentstate = "";
for (var i in chosed) {
currentstate += " or STATE= " + chosed[i];
}
if (currentstate == "1") {
sParam.tableparam = " and (STATE is not null and STATE!=0)";
} else {
if (currentstate != "") {
sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
}
}
// sParam.startTime = startTime;
// sParam.endTime = endTime;
return sParam;
......
......@@ -45,6 +45,10 @@
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
......
var windowId, proName = window.location.pathname.split("/")[1],
sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
var arrs=[];
$(function () {
initDefault();
});
//默认
function initDefault() {
ywFwq();
initGrid();
}
function ywFwq(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "ywMachineCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
formatter: function (row) {
var opts = $(this).combobox('options');
return row[opts.textField];
}
});
var firstShowPanel = true;
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
var values = $('#currentstate').combobox('getValues');
$(".handleCom1").hide();
$("#_easyui_combobox_i1_0").show();
}
}
},
onChange: function () {
var values = $('#currentstate').combobox('getValues');
},
onHidePanel: function () {
selectedValues = $('#currentstate').combobox('getValues');
firstShowPanel = false;
},
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
}
}
}
},
onSelect: function (record) {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").hide();
}
return false;
}
});
}
//查询条件
function getQueryParams() {
var sParam = {};
......@@ -18,9 +128,47 @@ function getQueryParams() {
sParam.LIKEmachinename = $('#LIKEmachinename').textbox("getValue");
sParam.LIKEbz = $('#bz').textbox("getValue");
sParam.emptyremarks = $('#combobz').combobox("getValue");
// sParam.startTime = startTime;
// sParam.endTime = endTime;
var chosed = $('#currentstate').combobox('getValues');
var currentstate = "";
// for (var i in chosed) {
// currentstate += " or CURRENTSTATE= " + chosed[i];
//
// }
// if (currentstate == "1") {
// sParam.tableparam = " and (CURRENTSTATE is not null and CURRENTSTATE!=0)";
// } else {
// if (currentstate != "") {
// sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
// }
// }
// for (var i in chosed) {
// currentstate += " or isonline= " + chosed[i];
//
// }
// if (currentstate == "1") {
// sParam.tableparam = " and (isonline is not null and isonline!=0)";
// } else {
// if (currentstate != "") {
// sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
// }
// }
for (var i in chosed) {
currentstate += " or currentstate= " + chosed[i];
}
if (currentstate == "") {
sParam.tableparam = "";
} else {
if (currentstate != "") {
sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
}
}
// sParam.tableparam = " and (isonline is not null and isonline!=0)";
sParam.order = " order by createtime desc";
return sParam;
......
......@@ -45,6 +45,10 @@
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
......
var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var arrs=[];
$(function(){
initDefault();
});
//默认
function initDefault(){
ywLd();
initGrid();
}
function ywLd(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "ksh_ZxldCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
formatter: function (row) {
var opts = $(this).combobox('options');
return row[opts.textField];
}
});
var firstShowPanel = true;
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
var values = $('#currentstate').combobox('getValues');
$(".handleCom1").hide();
$("#_easyui_combobox_i1_0").show();
}
}
},
onChange: function () {
var values = $('#currentstate').combobox('getValues');
},
onHidePanel: function () {
selectedValues = $('#currentstate').combobox('getValues');
firstShowPanel = false;
},
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
}
}
}
},
onSelect: function (record) {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
for(var i=0;i<arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").hide();
}
return false;
}
});
}
//查询条件
function getQueryParams(){
var sParam = {};
sParam.LIKEldmc= $('#LIKEldmc').textbox("getValue");
sParam.LIKEbz = $('#bz').textbox("getValue");
sParam.emptyremarks = $('#combobz').combobox("getValue");
var chosed = $('#currentstate').combobox('getValues');
var state = "";
for (var i in chosed) {
if(chosed[i]=="0"){
state += " or STATE is null or STATE=0";
}else{
state += " or STATE= " + chosed[i];
}
}
if (state == "") {
sParam.tableparam = "";
} else {
if (state != "") {
sParam.tableparam = " and (" + state.substr(3) + ") ";
}
}
return sParam;
}
//加载列表
......
......@@ -44,6 +44,10 @@
<option value="0">为空</option>
</select>
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
......
......@@ -31,7 +31,7 @@ document.write("<script src='"+script_init+"'><\/script>");
<script type='text/javascript' src='../szmap/business/base/item/CheGpsLayer.js'></script>
<!-- 首页弹出层响应事件 -->
<script type='text/javascript' src='../../common/mapUtil.js'></script>
<script type='text/javascript' src='business/base/BaseDataYzd.js'></script>
<%--<script type='text/javascript' src='business/base/BaseDataYzd.js'></script>--%>
<script type='text/javascript' src='../szmap/business/base/item/js/map.js'></script>
<%--<script type="text/javascript" src="../../frame/main/area/console/rtcServer.js"></script>--%>
<%--<script type="text/javascript" src="../../frame/main/area/console/rtcResponse.js"></script>--%>
......
......@@ -7,9 +7,10 @@ var detailWindowId = $.uniqueId();
var cacheStatusObj = {};
var AllTree = null;
var videoalarmTree = null;
var arrs=[];
$(function () {
initDefault();
initCacheStatus();
ywVideo();
//initTreePanel();
});
......@@ -68,12 +69,27 @@ function getQueryParams() {
// sParam.currentstate = $("#currentstate").combobox("getValue");
var chosed = $('#currentstate').combobox('getValues');
var currentstate = "";
// for (var i in chosed) {
// currentstate += " or isonline= " + chosed[i];
//
// }
// if (currentstate == "1") {
// sParam.tableparam = " and (isonline is not null and isonline!=0)";
// } else {
// if (currentstate != "") {
// sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
// }
// }
for (var i in chosed) {
// if(chosed[i]=="3"){
// currentstate += " or isonline !=3";
// }else{
currentstate += " or isonline= " + chosed[i];
// }
}
if (currentstate == "1") {
sParam.tableparam = " and isonline!=0";
if (currentstate == "") {
sParam.tableparam = "";
} else {
if (currentstate != "") {
sParam.tableparam = " and (" + currentstate.substr(3) + ") ";
......@@ -90,7 +106,7 @@ function getQueryParams() {
}
}
//sParam.order = "order by currentstatetime desc ";
sParam.order = "order by isonline ";
return sParam;
}
......@@ -277,23 +293,44 @@ function videoStatistics() {
data: {},//getQueryParams(),
success: function (res) {
if (res != null) {
$("#frontDeviceTotal").html(res.total);
$("#normalFrontDeviceTotal").html(res.normalNum);
$("#abnormalFrontDeviceTotal").html(res.total - res.normalNum);
var num = 0;
var num_zc = 0;
for(var i in res.data){
if(res.data[i].csmc=='normal'){
$("#normalFrontDeviceTotal").html(res.data[i].cnt);
}
if(res.data[i].csmc=='total'){
$("#frontDeviceTotal").html(res.data[i].cnt);
}
if(res.data[i].csmc=='abnormal'){
$("#abnormalFrontDeviceTotal").html(res.data[i].cnt);
}
}
var colors=["#e16616","#754599","#84ccc9"];
var data = {
"title": "设备故障类型占比分析",
data: [
{name: "正常:" + res.normalNum, value: res.normalNum, color: "#fe0000"},
//{name:"网络异常:" + res.abnormalNetNum,value:res.abnormalNetNum,color:"#e16616"},
{name: "设备不在线:" + res.abnormalOnlineNum, value: res.abnormalOnlineNum, color: "#32c99d"},
{name: "抽帧异常:" + res.abnormalVQCNum, value: res.abnormalVQCNum, color: "#e36d6d"},
{name: "质量诊断异常:" + res.abnormalVQDNum, value: res.abnormalVQDNum, color: "#754599"},
{name: "录像异常:" + res.abnormalRecordNum, value: res.abnormalRecordNum, color: "#84ccc9"}
]
data: []
};
//遍历返回结果
for (var i in res.data) {
if( res.data[i].csdm=="normal") {
data.data.push({
name: "正常", value: res.data[i].cnt, color: "#32c99d"
})
}
else if( res.data[i].csdm=="abnormal") {
data.data.push({
name: "异常", value: res.data[i].cnt, color: "#fe0000"
})
}
}
EchartsBase.pieChart({
id: "deviceAnalysisGraphChart",
data: data
data: data,
orient: 'horizontal', // 'vertical'
});
}
//console.log("resresres",res);
......@@ -325,13 +362,41 @@ function handleA(e) {
//e.stopPropagation();
//e.preventDefault();
}
function ywVideo(){
$.ajax({
type: 'post',
async:true,
dataType: 'json',
url: 'xtclAction!listXtclByPage.do',//dac 行政树
// url:'ptxzsAction!query_Ptxzs.do' ,//本地 行政树
data:{
LIKEcsdl: "ywVideoCurrent",
LIKEcslm:"",
LIKEcsdm:"",
LIKEcsmc:"",
order: "order by csdl asc",
page: 1,
rows: 20,
},
}).done(function (data) {
var arr=[];
if(data.rows.length>0){
for(var i in data.rows){
arr.push({name:data.rows[i].csmc,value:data.rows[i].csdm});
}
}
arrs = arr;
initCacheStatus();
// var a =data;
});
}
//初始化下拉框
function initCacheStatus() {
var ywDeviceStatusArr = [];
var videoStatus = Constants.videoStatus;
// var videoStatus = Constants.videoStatus;
var videoStatus = arrs;
for (var i in videoStatus) {
ywDeviceStatusArr.push({"id": i, "text": videoStatus[i]})
ywDeviceStatusArr.push({"id": videoStatus[i].value, "text": videoStatus[i].name})
}
$("#currentstate").combobox("loadData", ywDeviceStatusArr);
$('#currentstate').combobox({
......@@ -341,28 +406,39 @@ function initCacheStatus() {
}
});
var firstShowPanel = true;
var html = $("#_easyui_combobox_i1_0").html();
var html1 = $("#_easyui_combobox_i1_1").html();
var html2 = $("#_easyui_combobox_i1_2").html();
var html3 = $("#_easyui_combobox_i1_3").html();
var html4 = $("#_easyui_combobox_i1_4").html();
var html5 = $("#_easyui_combobox_i1_5").html();
$("#_easyui_combobox_i1_1").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html1 + "</div>");
$("#_easyui_combobox_i1_2").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html2 + "</div>");
$("#_easyui_combobox_i1_3").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html3 + "</div>");
$("#_easyui_combobox_i1_4").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html4 + "</div>");
$("#_easyui_combobox_i1_5").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html5 + "</div>");
$("#_easyui_combobox_i1_0").after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + html + "</div>");
var ht=[];
for(var i=0;i<arrs.length;i++){
var str = "#_easyui_combobox_i1_"+i;
ht.push({id:str});
}
for(var i=0;i<ht.length;i++){
$(ht[i].id).after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + $(ht[i].id).html() + "</div>");
}
// var html = $("#_easyui_combobox_i1_0").html();
// var html1 = $("#_easyui_combobox_i1_1").html();
// var html2 = $("#_easyui_combobox_i1_2").html();
// var html3 = $("#_easyui_combobox_i1_3").html();
// var html4 = $("#_easyui_combobox_i1_4").html();
// var html5 = $("#_easyui_combobox_i1_5").html();
// $("#_easyui_combobox_i1_0").after("<div onclick='handleA' class='handleCom1' style='display:none;'>" + html + "</div>");
// $("#_easyui_combobox_i1_1").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html1 + "</div>");
// $("#_easyui_combobox_i1_2").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html2 + "</div>");
// $("#_easyui_combobox_i1_3").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html3 + "</div>");
// $("#_easyui_combobox_i1_4").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html4 + "</div>");
// $("#_easyui_combobox_i1_5").after("<div onclick='handleA' class='handleCom' style='display:none;'>" + html5 + "</div>");
$('#currentstate').combobox({
onUnselect: function (record) {
var opts = $(this).combobox('options');
var values = $('#currentstate').combobox('getValues');
if (record.id == 1) {
$("#_easyui_combobox_i1_1").show();
$("#_easyui_combobox_i1_2").show();
$("#_easyui_combobox_i1_3").show();
$("#_easyui_combobox_i1_4").show();
$("#_easyui_combobox_i1_5").show();
// $("#_easyui_combobox_i1_1").show();
// $("#_easyui_combobox_i1_2").show();
// $("#_easyui_combobox_i1_3").show();
// $("#_easyui_combobox_i1_4").show();
// $("#_easyui_combobox_i1_5").show();
for(var i=1;i<=arrs.length;i++){
$("#_easyui_combobox_i1_"+i).show();
}
$(".handleCom").hide();
} else {
if (values.length <= 1) {
......@@ -382,11 +458,9 @@ function initCacheStatus() {
onShowPanel: function () {
if (!firstShowPanel) {
if (selectedValues.indexOf("1") != -1) {
$("#_easyui_combobox_i1_1").hide();
$("#_easyui_combobox_i1_2").hide();
$("#_easyui_combobox_i1_3").hide();
$("#_easyui_combobox_i1_4").hide();
$("#_easyui_combobox_i1_5").hide();
for(var i=1;i<=arrs.length;i++){
$("#_easyui_combobox_i1_"+i).hide();
}
} else {
if (selectedValues.length > 0) {
$("#_easyui_combobox_i1_0").hide();
......@@ -398,15 +472,13 @@ function initCacheStatus() {
var values = $('#currentstate').combobox('getValues');
var opts = $(this).combobox('options');
if (record.id == 1) {
$("#_easyui_combobox_i1_1").hide();
$("#_easyui_combobox_i1_2").hide();
$("#_easyui_combobox_i1_3").hide();
$("#_easyui_combobox_i1_4").hide();
$("#_easyui_combobox_i1_5").hide();
// for(var i=1;i<=arrs.length;i++){
// $("#_easyui_combobox_i1_"+i).hide();
// }
$(".handleCom").show();
} else {
$("#_easyui_combobox_i1_0").hide();
$(".handleCom1").show();
$(".handleCom1").hide();
}
return false;
}
......@@ -414,9 +486,9 @@ function initCacheStatus() {
}
function transStatus(data) {
if (data == "1") {
if (data != "0") {
return "<div style='height:13px;width:13px;background-color:#60b631;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
} else if (data == "0") {
} else {
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}
return "";
......
......@@ -68,9 +68,6 @@ function initGrid(){
]]
});
if(devicetype!="1") {
$('#tableGrid').datagrid('showColumn', 'tdbh');
}
}
function getSelectedRows(){
......@@ -81,40 +78,14 @@ function getSelectedRows(){
function getSelected(){
var rows = $('#tableGrid').datagrid('getChecked');
// console.log("勾选:",rows);
return rows;
}
/*parent.parent.$(".l-btn-text").on("click",function(){
if($(this).text()=="关闭"){
return;
}
var insertParam = {};
// insertParam.channelsetid = channelsetid;
var rows = $('#tableGrid').datagrid('getChecked');
// top.$("#"+winId).panel("options").data.insertParam = insertParam;
// top.$("#"+winId).panel("options").data.channelsetid = channelsetid;
$.ajax({
type:'post',
dataType : 'json',
url:'ywvideochannelsetlistAction!batch_add_Ywvideochannelsetlist.do',
data:{channelsetid:channelsetid,param:JSON.stringify(rows)},
success:function(value){
if(value=="success"){
$.showMsg("操作成功!");
// top.$("#"+winId).dialog('close');
// doSearch();
}else if(value=="same"){
$.showMsg("已存在!");
}else{
$.showMsg("操作失败!");
}
}
});
});*/
//删除
function doSearch(){
$('#tableGrid').datagrid('load',getQueryParams());
if(devicetype=="1") {
$('#tableGrid').datagrid('showColumn', 'tdbh');
}else{
$('#tableGrid').datagrid('hideColumn', 'tdbh');
}
}
......@@ -129,13 +129,7 @@ function initGrid(){
{field:'extend4',title:'扩展4',hidden:true,width:120}
]]
});
//控制显影
if(devicetype=="1") {
$('#tableGrid').datagrid('showColumn', 'channelnum');
$('#tableGrid').datagrid('showColumn', 'videomodelname');
$('#tableGrid').datagrid('showColumn', 'recordxdays');
$('#tableGrid').datagrid('showColumn', 'recordmodelname');
}
}
//删除
function doDelete(){
......@@ -254,6 +248,20 @@ function doend_batch(){
//查询
function doSearch(){
$('#tableGrid').datagrid('load',getQueryParams());
//控制显影
if(devicetype=="1") {
$('#tableGrid').datagrid('showColumn', 'channelnum');
$('#tableGrid').datagrid('showColumn', 'videomodelname');
$('#tableGrid').datagrid('showColumn', 'recordxdays');
$('#tableGrid').datagrid('showColumn', 'recordmodelname');
}
else{
$('#tableGrid').datagrid('hideColumn', 'channelnum');
$('#tableGrid').datagrid('hideColumn', 'videomodelname');
$('#tableGrid').datagrid('hideColumn', 'recordxdays');
$('#tableGrid').datagrid('hideColumn', 'recordmodelname');
}
}
//增加
function doAdd(){
......
#数据源1
#
#datasource1.driver=oracle.jdbc.OracleDriver
#
#datasource1.url=jdbc:oracle:thin:@192.168.168.212:1521:helowin
#
#datasource1.username=zn06
#
#datasource1.password=znznzn8
#数据源1
datasource1.driver=oracle.jdbc.OracleDriver
......
......@@ -32,7 +32,7 @@
<sqlMap resource="sqlmap/Ptlxccqzgl.xml" />
<sqlMap resource="sqlmap/Sbtdjqqx.xml" />
<sqlMap resource="sqlmap/Sbtdtpqx.xml" />
<sqlMap resource="sqlmap/Sbtdspyzd.xml" />
<!--<sqlMap resource="sqlmap/Sbtdspyzd.xml" />-->
<!-- 平台信息/end -->
<!-- 系统常量变化量/start -->
......
......@@ -99,21 +99,13 @@
"clickFun": "MapToolBar.frameSelect()"
}
],
"menulist": [{
"title": "̨",
"id": "jklk-tab",
"content": ""
}, {
"menulist": [ {
"title": "资源列表",
"id": "monitor-tab",
"content": ""
}
],
"selectedlist": [{
"title": "̨",
"id": "jklk-tab-selected",
"content": ""
}, {
"selectedlist": [ {
"title": "资源列表",
"id": "monitor-tab-selected",
"content": ""
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<conelement value="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0" />
<conelement value="org.eclipse.jst.j2ee.internal.web.container" />
<conelement value="org.eclipse.jst.j2ee.internal.module.container" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
<src_folder value="file://$MODULE_DIR$/config" expected_position="1" />
</src_description>
</component>
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration>
<fileset id="fileset" name="Spring Application Context" removed="false">
<file>file://$MODULE_DIR$/WebRoot/WEB-INF/springBase.xml</file>
<file>file://$MODULE_DIR$/WebRoot/WEB-INF/springService.xml</file>
</fileset>
</configuration>
</facet>
<facet type="web" name="Web">
<configuration>
<descriptors>
......@@ -27,24 +10,35 @@
<root url="file://$MODULE_DIR$/WebRoot" relative="/" />
</webroots>
<sourceRoots>
<root url="file://$MODULE_DIR$/src" />
<root url="file://$MODULE_DIR$/config" />
<root url="file://$MODULE_DIR$/WebRoot" />
<root url="file://$MODULE_DIR$/src" />
</sourceRoots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration>
<fileset id="fileset" name="Spring Application Context" removed="false">
<file>file://$MODULE_DIR$/WebRoot/WEB-INF/springBase.xml</file>
<file>file://$MODULE_DIR$/WebRoot/WEB-INF/springService.xml</file>
</fileset>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/out" />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/production/impnhyw/WEB-INF/classes" />
<output-test url="file://$MODULE_DIR$/out/test/impnhyw" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/config" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/WebRoot" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/.externalToolBuilders" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/.idea" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/.settings" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="lib5" level="project" />
<orderEntry type="library" name="lib2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5.53" level="application_server_libraries" />
</component>
</module>
\ No newline at end of file
......@@ -18,29 +18,40 @@ public class AppSessionOutFilter implements Filter {
public void destroy() {}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filter) throws IOException, ServletException {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filter) {
HttpServletRequest httpRequst = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String path=httpRequst.getContextPath();
String head = httpRequst.getHeader("x-requested-with");
String remoteAddr = httpRequst.getRequestURI();
try {
if (remoteAddr.indexOf("userloginValidation.do") == -1
&& remoteAddr.indexOf("selectUserRole.do") == -1
&& remoteAddr.indexOf("getMenuGroupList.do") == -1
&& remoteAddr.indexOf("selectUser.do") == -1
&& remoteAddr.indexOf("listXtbbxxByPage.do") == -1
&& remoteAddr.indexOf("restartAweb.do") == -1
&& remoteAddr.indexOf("index.jsp") == -1
&& remoteAddr.indexOf("login.jsp") == -1
){
if (head != null && (head.equalsIgnoreCase("XMLHttpRequest"))) {
// if (head != null && (head.equalsIgnoreCase("XMLHttpRequest"))) {
Object adminUser = httpRequst.getSession().getAttribute("userInfo");
if (adminUser == null) {
httpResponse.setHeader("sessionstatus", "timeout");
httpResponse.sendError(999);
return;
}
httpResponse.setContentType("text/html;utf-8");
httpResponse.setCharacterEncoding("utf-8");
httpResponse.sendRedirect(path+"/index.jsp");
return ;
}else {
filter.doFilter(request, response);
}
//}
}
else {
filter.doFilter(request, response);
}
} catch (Exception e) {}
}
}
......@@ -34,7 +34,7 @@ public class DetectorAction extends BaseAction {
map.put("limit", rows);
Struts2Utils.renderJson(this.service.listDetectorByPage(map));
} catch (Exception e) {
e.printStackTrace();
//e.printStackTrace();
iLog.error("DetectorAction-listDetectorByPage-error:" + e);
Struts2Utils.renderJson(null);
}
......@@ -54,7 +54,7 @@ public class DetectorAction extends BaseAction {
map.put("limit", rows);
Struts2Utils.renderJson(this.service.listDetectortaskByPage(map));
} catch (Exception e) {
e.printStackTrace();
//e.printStackTrace();
iLog.error("DetectorAction-listDetectorMy-error:" + e);
Struts2Utils.renderJson(null);
}
......@@ -70,7 +70,7 @@ public class DetectorAction extends BaseAction {
try {
Struts2Utils.renderJson(this.service.count_Detector(map));
} catch (Exception e) {
e.printStackTrace();
//e.printStackTrace();
iLog.error("DetectorAction-count_Detector-error:" + e);
Struts2Utils.renderJson(null);
}
......@@ -198,7 +198,7 @@ public class DetectorAction extends BaseAction {
public void update_DetectorRemarks() {
Map map = Struts2Utils.getRequestParameterMap();
try {
if(RHUtil.isNotEmpty(map.get("remarks")) && map.get("remarks").equals("survey")){
if(RHUtil.isNotEmpty(map.get("remarks")) && map.get("remarks").toString().indexOf("survey")>0){
map.put("repairstate",900);
}
int result = service.update_DetectorRemarks(map);
......
......@@ -186,7 +186,7 @@ public class YwmachineinfoAction extends BaseAction{
public void update_YwmachineinfoRemarks(){
Map map = Struts2Utils.getRequestParameterMap();
try {
if(RHUtil.isNotEmpty(map.get("remarks"))&& map.get("remarks").equals("survey")){
if(RHUtil.isNotEmpty(map.get("remarks"))&& map.get("remarks").toString().contains("survey")){
map.put("repairstate",900);
this.service.update_YwmachinecurrentstateRepairstate(map);
}
......
......@@ -175,7 +175,7 @@ public class NhywjtledydpglAction extends BaseAction {
public void update_NhywjtledydpglRemarks() {
Map map = Struts2Utils.getRequestParameterMap();
try {
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").equals("survey")){
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").toString().contains("survey")){
map.put("repairstate",900);
}
int result = service.update_NhywjtledydpglRemarks(map);
......
......@@ -93,8 +93,8 @@ public class NhywjtledydpglDao extends BaseSqlMapDAO{
}
public List<Map> statisticsYDPOnlineRate() throws SQLException{
return (List<Map>) this.queryForList("statisticsYDPOnlineRate",null);
public Map statisticsYDPOnlineRate() throws SQLException{
return (Map)this.queryForObject("statisticsYDPOnlineRate",null);
}
public List<Map> query_NhywjtledydpglStatus(Map map) throws SQLException{
return (List<Map>) this.queryForPage("query_NhywjtledydpglStatus",map);
......
......@@ -132,15 +132,7 @@ public class NhywjtledydpglService extends BaseService {
* @throws SQLException
*/
public Map statisticsYDPOnlineRate() throws SQLException{
Map<String,Object> result = new HashMap<String,Object>();
List<Map> list = nhywjtledydpglDao.statisticsYDPOnlineRate();
if(list!=null && list.size()>0){
for(Map m : list){
String name = m.get("name")+"";
result.put(name, m.get("totalcount"));
}
}
return result;
return nhywjtledydpglDao.statisticsYDPOnlineRate();
}
public Map listNhywjtledydpglStatusByPage(Map map) throws SQLException {
List<Map> list = nhywjtledydpglDao.query_NhywjtledydpglStatus(map);
......
......@@ -203,7 +203,7 @@ public class NhywjtxhdglAction extends BaseAction {
public void update_NhywjtxhdglRemarks() {
Map map = Struts2Utils.getRequestParameterMap();
try {
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").equals("survey")){
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").toString().indexOf("survey")>0){
map.put("repairstate",900);
}
this.service.update_NhywjtxhdglRepairstate(map);
......@@ -404,21 +404,10 @@ public class NhywjtxhdglAction extends BaseAction {
Map map = Struts2Utils.getRequestParameterMap();
Map<String, Object> result = new HashMap<String, Object>();
try {
Map m = service.countNhywjtxhdgl(map);
if (null != m.get("总数")) {
Integer mtotal = (Integer) m.get("总数");
Integer onlinesum = service.xhdOnline();
if (mtotal >= onlinesum) {
result.put("unonline", mtotal - onlinesum);
} else {
result.put("unonline", 0);
}
result.put("online", onlinesum);
}
Struts2Utils.renderJson(result);
Struts2Utils.renderJson(service.xhdOnline());
} catch (Exception e) {
e.printStackTrace();
iLog.error("nhywjtxhdglAction-listNhywjtxhdglHistoryStateByPage-error:" + e);
iLog.error("nhywjtxhdglAction-xhdRate-error:" + e);
Struts2Utils.renderJson(null);
}
......
......@@ -109,8 +109,8 @@ public class NhywjtxhdglDao extends BaseSqlMapDAO{
public List<Map> query_NhywjtxhdglStateStatis(Map map) throws SQLException{
return this.queryForPage("query_NhywjtxhdglStateStatis",map);
}
public Integer xhdOnline() throws SQLException{
return (Integer)this.queryForObject("xhdOnline",null);
public Map xhdOnline() throws SQLException{
return (Map)this.queryForObject("xhdOnline",null);
}
public List<Map> query_Ywxhdstatusinfo(Map map) throws SQLException{
return this.queryForPage("query_Ywxhdstatusinfo",map);
......
......@@ -165,7 +165,7 @@ public class NhywjtxhdglService extends BaseService {
}
//@DS("datasource2")
public Integer xhdOnline()throws SQLException{
public Map xhdOnline()throws SQLException{
return nhywjtxhdglDao.xhdOnline();
}
public Map listYwxhdstatusinfoByPage(Map map)throws SQLException{
......
......@@ -485,6 +485,7 @@ public class YwrepairjobinfoAction extends BaseAction {
}else if("2".equals(deviceType)){//服务器
ywmachinecurrentstateService.update_Ywmachinecurrentstate_WorkOrder(map);
}*/
//更新状态表
updateState(deviceType, StringUtil.transEmpty(map.get("processstatus") + ""),
StringUtil.transEmpty(map.get("XGTJfaultdeviceid") + ""),
StringUtil.transEmpty(map.get("XGTJchannelnum") + ""),
......@@ -547,7 +548,6 @@ public class YwrepairjobinfoAction extends BaseAction {
public void edit_confirmOrder() {
Map map = Struts2Utils.getRequestParameterMap();
try {
// 更新 Ywrepairjobinfo 表
PtyhBean ptyh = (PtyhBean) Struts2Utils.getSession().getAttribute("userInfo");
map.put("modifyaccount", ptyh.getYhzh());
......@@ -570,7 +570,6 @@ public class YwrepairjobinfoAction extends BaseAction {
String channelnum = map.get("channelnum") == null ? "" : String.valueOf(map.get("channelnum"));
String alarmeventid = map.get("alarmeventid") == null ? "" : String.valueOf(map.get("alarmeventid"));
updateState(alarmdevicetype, repairstate, alarmdeviceid, channelnum, alarmeventid);
// 向日志表增加记录
// PtyhBean ptyh = (PtyhBean)Struts2Utils.getSession().getAttribute("userInfo");
String jobid = String.valueOf(map.get("XGTJjobid"));
......@@ -646,12 +645,10 @@ public class YwrepairjobinfoAction extends BaseAction {
+ " or (confirmcompany='" + bmbh + "' and confirmpeople='" + yhzh + "') )";
queryMap.put("comprehensive", comprehensive);
}
queryMap.put("start", 0);
queryMap.put("limit", 5000);
Map resMap = service.listYwrepairjobinfoByPage(queryMap);
List<Map> sList = (List<Map>) resMap.get("rows");
String[] zdbm = {"jobnum", "jobprocessstatename", "faultdevicetypename", "faultdevicename", "faultdeviceid", "channelnum", "faulttypename", "faultdescription", "jobreporttime"};
String[] zdmc = {"工单编号", "工单状态", "故障设备类型", "故障设备名称", "故障设备编号", "通道编号", "故障类型", "故障描述", "上报时间"};
int excelNum = zdbm.length;
......@@ -677,7 +674,6 @@ public class YwrepairjobinfoAction extends BaseAction {
int page = Integer.parseInt(Struts2Utils.getParameter("page"));
int rows = Integer.parseInt(Struts2Utils.getParameter("rows"));
int start = ((page == 0 ? 1 : page) - 1) * rows;
map.put("start", start);
map.put("limit", rows);
Struts2Utils.renderJson(this.service.listYwrepairDevicejobinfoByPage(map));
......@@ -695,9 +691,7 @@ public class YwrepairjobinfoAction extends BaseAction {
map.put("start", 0);
map.put("limit", 5000);
Map resMap = service.listYwrepairjobinfoByPage(map);
List<Map> sList = (List<Map>) resMap.get("rows");
String[] zdbm = {"jobnum", "jobprocessstatename", "faultdevicetypename", "faultdevicename", "faultdeviceid", "channelnum", "faulttypename", "faultdescription", "jobreporttime"};
String[] zdmc = {"工单编号", "工单状态", "故障设备类型", "故障设备名称", "故障设备编号", "通道编号", "故障类型", "故障描述", "上报时间"};
int excelNum = zdbm.length;
......
......@@ -1051,7 +1051,7 @@ public class YwvideocurrentstateAction extends BaseAction{
//请求参数update_Ywmachineinfo
Map map = Struts2Utils.getRequestParameterMap();
//有“survey”这个内容就让设备维修状态改变下,可以不让做告警处理
if(RHUtil.isNotEmpty(map.get("remarks"))&& map.get("remarks").equals("survey")){
if(RHUtil.isNotEmpty(map.get("remarks"))&& map.get("remarks").toString().contains("survey")){
map.put("repairstate",900);
this.service.update_ywvideocurrentstateRepairState(map);
}
......
......@@ -43,13 +43,14 @@ public class YwvideocurrentstateService extends BaseService {
return ywvideocurrentstateDao.statisticsRecordIntactRate();
}
public Map videoCurrentStateStatistics(Map map) throws SQLException{
Map<String,String> result= new HashMap<String,String>();
Map<String,List<Map>> result= new HashMap<String,List<Map>>();
List<Map> lists = ywvideocurrentstateDao.videoCurrentStateStatistics(map);
if(lists!=null && lists.size()>0){
for(Map m : lists){
result.put(m.get("name")+"", m.get("total")+"");
}
}
// if(lists!=null && lists.size()>0){
// for(Map m : lists){
// result.put(m.get("name")+"", m.get("total")+"");
// }
// }
result.put("data",lists);
return result;
}
......
......@@ -181,7 +181,7 @@ public class ZxldAction extends BaseAction {
public void update_ZxldRemarks() {
Map map = Struts2Utils.getRequestParameterMap();
try {
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").equals("survey")){
if(RHUtil.isNotEmpty(map.get("bz"))&& map.get("bz").toString().indexOf("survey")>0){
map.put("repairstate",900);
}
int result = service.update_ZxldRemarks(map);
......
......@@ -120,8 +120,8 @@ public class ZxldDao extends BaseSqlMapDAO {
return this.update("edit_Zxld", map);
}
public List<Map> statisticsZxldRate() throws SQLException {
return (List<Map>) this.queryForList("statisticsZxldRate", null);
public Map statisticsZxldRate() throws SQLException {
return (Map) this.queryForObject("statisticsZxldRate", null);
}
public List<Map> query_ZxldcurrentstateByPage(Map map) throws SQLException {
......
......@@ -159,15 +159,7 @@ public class ZxldService extends BaseService {
* @throws SQLException
*/
public Map statisticsZxldRate() throws SQLException{
Map<String,Object> result = new HashMap<String,Object>();
List<Map> list = zxldDao.statisticsZxldRate();
if(list!=null && list.size()>0){
for(Map m : list){
String name = m.get("name")+"";
result.put(name, m.get("totalcount"));
}
}
return result;
return zxldDao.statisticsZxldRate();
}
/**
......
......@@ -195,6 +195,9 @@
<isNotEmpty prepend='AND ' property='statusupbatch'>
(statusupbatch =#statusupbatch# )
</isNotEmpty>
<isNotEmpty prepend='AND ' property='currentstate'>
(a.STATE = #currentstate# )
</isNotEmpty>
<isNotEmpty property='tableparam'>
$tableparam$
</isNotEmpty>
......@@ -392,14 +395,10 @@
</insert>
<select id="statisticsYDPOnlineRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select COUNT(*) as totalcount ,'totalcount' as name
from nhywjtledydpgl
union ALL
(select COUNT(state) as totalcount,'ydponlinenum' as name from nhywjtledydpgl where state ='1' )
union ALL
select COUNT(*) as totalcount ,'ydpunonlinenum' as name from
nhywjtledydpgl where (state='0' or state is null)
select count(*) as totalcount,
SUM(case when a.state is not null and a.state=1 then 1 else 0 end) as ydponlinenum,
SUM(case when a.state =0 or a.state is null then 1 else 0 end) as ydpunonlinenum
from nhywjtledydpgl a
</select>
<select id="query_NhywjtledydpglStatus" resultClass="java.util.HashMap" parameterClass="java.util.Map">
......
......@@ -251,6 +251,9 @@
<isNotEmpty prepend='AND ' property='Likemc'>
(xhdmc like '%Likemc%')
</isNotEmpty>
<isNotEmpty prepend='AND ' property='currentstate'>
(a.STATE = #currentstate# )
</isNotEmpty>
<isNotEmpty property='tableparam'>
$tableparam$
</isNotEmpty>
......@@ -501,10 +504,10 @@
) a
left join nhywjtxhdstate_history b on a.lkh=b.nojunc and a.qybh=b.noarea
<isNotEmpty prepend="and" property="startTime">
<![CDATA[ b.create_time >= #startTime# ]]>
<![CDATA[ b.create_time >= to_date(#startTime#,'yyyy-mm-dd hh24:mi:ss')]]>
</isNotEmpty>
<isNotEmpty prepend="and" property="endTime">
<![CDATA[ b.create_time <=#endTime# ]]>
<![CDATA[ b.create_time <=to_date(#endTime# ,'yyyy-mm-dd hh24:mi:ss') ]]>
</isNotEmpty>
</select>
......@@ -516,10 +519,10 @@
) a
left join nhywjtxhdstate_history b on a.lkh=b.nojunc and a.qybh=b.noarea
<isNotEmpty prepend="and" property="startTime">
<![CDATA[ b.create_time >= #startTime# ]]>
<![CDATA[ b.create_time >= to_date(#startTime#,'yyyy-mm-dd hh24:mi:ss') ]]>
</isNotEmpty>
<isNotEmpty prepend="and" property="endTime">
<![CDATA[ b.create_time <=#endTime# ]]>
<![CDATA[ b.create_time <=to_date(#endTime# ,'yyyy-mm-dd hh24:mi:ss') ]]>
</isNotEmpty>
</select>
<select id="query_NhywjtxhdglStateStatis" resultClass="java.util.HashMap" parameterClass="java.util.Map"
......@@ -532,8 +535,12 @@
<include refid="condition_Nhywjtxhdgl"/>
and (state=0 or state is null)
</select>
<select id="xhdOnline" resultClass="java.lang.Integer" remapResults="true">
select count(*) from NHYWJTXHDGL where state=1
<select id="xhdOnline" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select count(*) as totalcount,
SUM(case when a.state is not null and a.state=1 then 1 else 0 end) as xhdonline,
SUM(case when a.state =0 or a.state is null then 1 else 0 end) as xhdunonline
from nhywjtxhdgl a
</select>
<select id="query_Ywxhdstatusinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select a.*,b.xhdbh,b.qybh,b.qymc,b.lkh,b.lkmc from (
......
......@@ -204,7 +204,7 @@
where 1=1
<isNotEmpty prepend='AND ' property='keyword'>
key in (#keyword#)
</isNotEmpty>
</isNotEmpty>videoCurrentStateStatistics
</delete>
<!-- ??? -->
......
......@@ -717,7 +717,7 @@
</isNotEmpty>) as jobnormalnum, sum(case when jd is not null and wd is not null then 1 else 0 end)
lalnormalnum,
(select count(*) as jobtotal from ywvideocurrentstate e ,sbtdspsr f where e.videonum=f.sbbh and
e.channelnum=f.tdbh and e.isonline!=0 and c.xzbh=f.xzbh) as zxsc
e.channelnum=f.tdbh and e.isonline is not null and e.isonline!=0 and c.xzbh=f.xzbh) as zxsc
from sbtdspsr c left join ptxzs b on b.xzbh=c.xzbh where sbbh is not null
<isNotEmpty prepend='AND ' property='xzbh'>
<![CDATA[ c.xzbh in ]]>
......@@ -1004,7 +1004,7 @@
</isNotEmpty>) as jobnormalnum, sum(case when jd is not null and wd is not null then 1 else 0 end)
lalnormalnum,
(select count(*) as jobtotal from ywvideocurrentstate e where e.videonum=c.sbbh and
e.channelnum=c.tdbh and e.isonline!=0) as zxsc
e.channelnum=c.tdbh and e.isolation is not null and e.isonline!=0) as zxsc
from sbtdspsr c
<isNotEmpty prepend='where ' property='areanum'>
(c.xzbh = #areanum# or (c.xzbh in (select xzbh from Ptxzs start with sjxzbh=
......
......@@ -362,6 +362,12 @@
(b.remarks is not null and b.remarks !=' ' )
</isEqual>
</isNotEmpty>
<isNotEmpty prepend='AND ' property='currentstate'>
(a.currentstate = #currentstate# )
</isNotEmpty>
<isNotEmpty property='tableparam'>
$tableparam$
</isNotEmpty>
</select>
<!-- query objects by page-->
<select id="get_Ywmachinecurrentstate" resultClass="java.util.HashMap" parameterClass="java.util.Map"
......
......@@ -432,7 +432,7 @@
<select id="count_HomepageDeviceCount" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select count(*) as zs, 'fwqzl' as name from ywmachineinfo
union all
select count(*) as zs, 'jkzxs' as name from ywvideocurrentstate where isonline=1
select count(*) as zs, 'jkzxs' as name from ywvideocurrentstate where (isolation is not null and isonline!=0)
union all
select count(*) as zs, 'jkzl' as name from sbtdspsr
union all
......
......@@ -758,61 +758,145 @@
<!-- query objects by page-->
<select id="query_Ywrepairjobinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map"
remapResults="true">
select
jobid,jobnum,jobsource,alarmeventid,
faultdevicetype,(select csmc from xtcl b where b.csdl='ywAlarmDeviceType' and b.csdm=faultdevicetype) as
faultdevicetypename,
faultdevicename,faultdeviceid,channelnum,faultpictureurl,
faultgrade,(select csmc from xtcl b where b.csdl='ywAlarmRuleLevel' and b.csdm=faultgrade) as faultgradename,
faulttype,(select csmc from xtcl b where b.csdl='ywAlarmDeviceType' and b.csdm=faulttype) as faulttypename,
faultdescription,faultoccurtime,requirefinishtime,actualfinishtime,
jobprocessstate,(select alarmname from ywalarmeventcode b where b.alarmcode=jobprocessstate) as
jobprocessstatename,
jobreportcompany,(select bmmc from ptyhbm b where b.bmbh=jobreportcompany) as jobreportcompanyname,
jobreportpeople,(select yhzh from ptyh b where b.yhbh=jobreportpeople) as jobreportpeoplename,
jobreportphone,jobreporttime,jobacceptstate,jobaccepttime,
jobacceptcompany,(select bmmc from ptyhbm b where b.bmbh=jobacceptcompany) as jobacceptcompanyname,
jobacceptpeople,(select yhzh from ptyh b where b.yhbh=jobacceptpeople ) as jobacceptpeoplename,
jobacceptphone,rejectcause,ishangup,hangupcause,
hanguppeople,(select yhzh from ptyh b where b.yhbh=hanguppeople ) as hanguppeoplename,
hangupcompany,(select bmmc from ptyhbm b where b.bmbh=hangupcompany) as hangupcompanyname,
hanguptime,unhanguptime,
unhanguppeople,(select yhzh from ptyh b where b.yhbh=unhanguppeople ) as unhanguppeoplename,
unhangupcompany,(select bmmc from ptyhbm b where b.bmbh=unhangupcompany) as unhangupcompanyname,
select jobid,
jobnum,
jobsource,
alarmeventid,
faultdevicetype,
(select csmc
from xtcl b
where b.csdl = 'ywAlarmDeviceType'
and b.csdm = faultdevicetype) as faultdevicetypename,
faultdevicename,
faultdeviceid,
channelnum,
faultpictureurl,
faultgrade,
(select csmc
from xtcl b
where b.csdl = 'ywAlarmRuleLevel'
and b.csdm = faultgrade) as faultgradename,
faulttype,
(select csmc
from xtcl b
where b.csdl = 'ywAlarmDeviceType'
and b.csdm = faulttype) as faulttypename,
faultdescription,
faultoccurtime,
requirefinishtime,
actualfinishtime,
jobprocessstate,
(select alarmname
from ywalarmeventcode b
where b.alarmcode = jobprocessstate) as jobprocessstatename,
jobreportcompany,
(select bmmc from ptyhbm b where b.bmbh = jobreportcompany) as jobreportcompanyname,
jobreportpeople,
(select yhzh from ptyh b where b.yhbh = jobreportpeople) as jobreportpeoplename,
jobreportphone,
jobreporttime,
jobacceptstate,
jobaccepttime,
jobacceptcompany,
(select bmmc from ptyhbm b where b.bmbh = jobacceptcompany) as jobacceptcompanyname,
jobacceptpeople,
(select yhzh from ptyh b where b.yhbh = jobacceptpeople) as jobacceptpeoplename,
jobacceptphone,
rejectcause,
ishangup,
hangupcause,
hanguppeople,
(select yhzh from ptyh b where b.yhbh = hanguppeople) as hanguppeoplename,
hangupcompany,
(select bmmc from ptyhbm b where b.bmbh = hangupcompany) as hangupcompanyname,
hanguptime,
unhanguptime,
unhanguppeople,
(select yhzh from ptyh b where b.yhbh = unhanguppeople) as unhanguppeoplename,
unhangupcompany,
(select bmmc from ptyhbm b where b.bmbh = unhangupcompany) as unhangupcompanyname,
faultacceptinfo,
feedbackcompany,(select bmmc from ptyhbm b where b.bmbh=feedbackcompany) as feedbackcompanyname,
feedbackpeople,feedbacktime,feedbackphone,feedbackstate,feedbackinfo,isdelay,delaytime,delaycause,delayforcompany,delayforpeople,delayfortime,delayforstate,delayfordescription,
confirmfaulttype, (select csmc from Xtcl where csdl='ywAlarmRuleSource' and
csdm=confirmfaulttype)confirmfaulttypename,confirmfaultinfo,repairdays,
confirmcompany,(select bmmc from ptyhbm b where b.bmbh=confirmcompany) as confirmcompanyname,
confirmpeople,confirmtime,confirmphone,confirmstate,confirmdescription,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4,
isreject,maintenanceresult,confirmmaintenance,completiontime,
receivertime,receivercompany,receiverpeople,receiverphone,accuracyofinfo,construction,jd,wd
<!-- (select b.bmmc from ptyh a left join ptyhbm b on (a.bmbh = b.bmbh) where
1=1
<isNotEmpty prepend='AND ' property='yhbh'>
a.yhbh = #yhbh#
</isNotEmpty>
) as bmmc -->
feedbackcompany,
(select bmmc from ptyhbm b where b.bmbh = feedbackcompany) as feedbackcompanyname,
feedbackpeople,
feedbacktime,
feedbackphone,
feedbackstate,
feedbackinfo,
isdelay,
delaytime,
delaycause,
delayforcompany,
delayforpeople,
delayfortime,
delayforstate,
delayfordescription,
confirmfaulttype,
(select csmc
from Xtcl
where csdl = 'ywAlarmRuleSource'
and csdm = confirmfaulttype) confirmfaulttypename,
confirmfaultinfo,
repairdays,
confirmcompany,
(select bmmc from ptyhbm b where b.bmbh = confirmcompany) as confirmcompanyname,
confirmpeople,
confirmtime,
confirmphone,
confirmstate,
confirmdescription,
createaccount,
createtime,
modifyaccount,
modifytime,
remarks,
extend1,
extend2,
extend3,
extend4,
isreject,
maintenanceresult,
confirmmaintenance,
completiontime,
receivertime,
receivercompany,
(select bmmc from ptyhbm b where b.bmbh = receivercompany) as receivercompanyname,
receiverpeople,
receiverphone,
accuracyofinfo,
construction,
jd,
wd
from ywrepairjobinfo
left join (
SELECT sbbh xh ,tdbh , jd,wd, '1' devicetype FROM sbtdspsr
left join (SELECT sbbh xh, tdbh, jd, wd, '1' devicetype
FROM sbtdspsr
union all
SELECT xh,null tdbh, jd,wd, '3' devicetype
SELECT xh, null tdbh, jd, wd, '3' devicetype
FROM nhywjtxhdgl n
UNION ALL
SELECT xh,null tdbh, jd,wd, '4' devicetype FROM nhywjtledydpgl
SELECT xh, null tdbh, jd, wd, '4' devicetype
FROM nhywjtledydpgl
UNION ALL
SELECT id AS xh,null tdbh,to_char(longitude) jd, to_char(latitude) wd, '10' AS devicetype
FROM its.ksh_detector WHERE detectortype = 'GVD'
SELECT id AS xh,
null tdbh,
to_char(longitude) jd,
to_char(latitude) wd,
'10' AS devicetype
FROM its.ksh_detector
WHERE detectortype = 'GVD'
UNION ALL
SELECT id AS xh,null tdbh, to_char(longitude) jd, to_char(latitude) wd, '11' AS devicetype
FROM its.ksh_detector WHERE detectortype = 'SMARTSENSOR'
SELECT id AS xh,
null tdbh,
to_char(longitude) jd,
to_char(latitude) wd,
'11' AS devicetype
FROM its.ksh_detector
WHERE detectortype = 'SMARTSENSOR'
UNION ALL
SELECT xh,null tdbh, jd,wd, '12' AS detectortype
FROM its.ksh_zxld
) a on faultdeviceid=a.xh and channelnum=a.tdbh
SELECT xh, null tdbh, jd, wd, '12' AS detectortype
FROM its.ksh_zxld) a
on faultdeviceid = a.xh
and channelnum = a.tdbh
<include refid="condition_Ywrepairjobinfo"/>
<!-- <isNotEmpty prepend=' ' property='start'>
limit #start# ,#limit#
......
......@@ -743,12 +743,12 @@
<!-- <select id="statisticsVideoOnlineRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">-->
<!-- select -->
<!-- count(*) as totalcount,-->
<!-- SUM((case when a.isonline=1 then 1 else 0 end)) as onlinenum,-->
<!-- SUM((case when a.isonline=0 or a.isonline is null then 1 else 0 end)) as unonlinenum,-->
<!-- SUM((case when a.vqdstate=1 then 1 else 0 end)) as intactnum,-->
<!-- SUM((case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end)) as unIntactnum,-->
<!-- SUM((case when a.recordstate=1 then 1 else 0 end)) as recordIntactnum,-->
<!-- SUM((case when a.recordstate=0 or a.recordstate is null then 1 else 0 end)) as unrecordIntactnum-->
<!-- SUM(case when a.isonline=1 then 1 else 0 end) as onlinenum,-->
<!-- SUM(case when a.isonline=0 or a.isonline is null then 1 else 0 end) as unonlinenum,-->
<!-- SUM(case when a.vqdstate=1 then 1 else 0 end) as intactnum,-->
<!-- SUM(case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end) as unIntactnum,-->
<!-- SUM(case when a.recordstate=1 then 1 else 0 end) as recordIntactnum,-->
<!-- SUM(case when a.recordstate=0 or a.recordstate is null then 1 else 0 end) as unrecordIntactnum-->
<!-- from ywvideocurrentstate a-->
<!-- <isNotEmpty prepend=' ' property='bmbh'>-->
<!-- LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )-->
......@@ -762,10 +762,10 @@
<select id="statisticsVideoOnlineRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select count(*) as totalcount,
SUM((case when a.isonline is not null and a.isonline!=0 then 1 else 0 end)) as onlinenum,
SUM((case when a.isonline =0 or a.isonline is null then 1 else 0 end)) as unonlinenum
SUM(case when a.isonline is not null and a.isonline!=0 then 1 else 0 end) as onlinenum,
SUM(case when a.isonline =0 or a.isonline is null then 1 else 0 end) as unonlinenum
from ywvideocurrentstate a
RIGHT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
</select>
<select id="statisticsVideoIntactRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
......@@ -780,43 +780,39 @@
</select>
<select id="videoCurrentStateStatistics" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select 'total' as name, count(*) as total from sbtdspsr a
UNION ALL
select 'normalNum' as name, count(*) as total from ywvideocurrentstate a
where
isonline=1
UNION ALL
select 'abnormalVQCNum' as name, count(*) as total from ywvideocurrentstate a
where vqcstate=0
UNION ALL
select 'abnormalVQDNum' as name, count(*) as total from ywvideocurrentstate a
where vqdstate=0
UNION ALL
select 'abnormalRecordNum' as name, count(*) as total from ywvideocurrentstate a
where recordstate=0
UNION ALL
select 'abnormalOnlineNum' as name, count(*) as total from ywvideocurrentstate a
where (isonline=0 or isonline is null)
UNION ALL
select 'abnormalNetNum' as name, count(*) as total from ywvideocurrentstate a
where networkerror=0
select 'total' csdm , 'total'csmc , count(*) cnt
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
union
select 'abnormal' csdm ,'abnormal'csmc , count(*) cnt
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum ) where isonline=0 or isonline is null
union
select 'normal' csdm ,'normal'csmc , count(*) cnt
from ywvideocurrentstate a right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum ) where a.isonline is not null and isonline!=0
union
select isonline csdm, csmc, count(*) cnt
from ywvideocurrentstate a
left join xtcl b
on a.isonline = b.csdm
and b.csdl = 'ywVideoCurrentState'
right join sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
group by isonline,csmc
</select>
<select id="vdqStatisticsRegion" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select d.xzbh videocatalog, (select XZMC from ptxzs where xzbh=d.xzbh) as videocatalogname,
count(*) as jknum,
(select count(1) from sbtdspsr e where (e.xzbh = d.xzbh) ) as totalnum,
SUM((case when a.isonline=0 or a.isonline is null then 1 else 0 end)) as lxnum,
SUM((case when a.isonline=1 then 1 else 0 end)) as zxnum,
SUM((case when a.vqdstate=0 then 1 else 0 end)) as videoabnormalnum,
SUM((case when a.vqdstate=1 then 1 else 0 end)) as videonormalnum,
SUM((case when a.nosignalstatus in (2,3,4) then 1 else 0 end)) as nosignalstatusnum,
SUM((case when a.videoocclusionstatus=0 then 1 else 0 end)) as videoocclusionstatusnum,
SUM((case when a.scenechangestatus=0 then 1 else 0 end)) as scenechangestatusnum,
SUM((case when a.imgtoodarkstatus=0 then 1 else 0 end)) as imgtoodarkstatusnum,
SUM((case when a.imgoverbrightstatus=0 then 1 else 0 end)) as imgoverbrightstatusnum,
SUM((case when a.imgclearstatus=0 then 1 else 0 end)) as imgclearstatusnum,
SUM((case when a.imgcolorstatus=0 then 1 else 0 end)) as imgcolorstatusnum
SUM(case when a.isonline=0 or a.isonline is null then 1 else 0 end) as lxnum,
SUM(case when a.isonline is not null and a.isonline!=0 then 1 else 0 end) as zxnum,
SUM(case when a.vqdstate=0 then 1 else 0 end) as videoabnormalnum,
SUM(case when a.vqdstate=1 then 1 else 0 end) as videonormalnum,
SUM(case when a.nosignalstatus in (2,3,4) then 1 else 0 end) as nosignalstatusnum,
SUM(case when a.videoocclusionstatus=0 then 1 else 0 end) as videoocclusionstatusnum,
SUM(case when a.scenechangestatus=0 then 1 else 0 end) as scenechangestatusnum,
SUM(case when a.imgtoodarkstatus=0 then 1 else 0 end) as imgtoodarkstatusnum,
SUM(case when a.imgoverbrightstatus=0 then 1 else 0 end) as imgoverbrightstatusnum,
SUM(case when a.imgclearstatus=0 then 1 else 0 end) as imgclearstatusnum,
SUM(case when a.imgcolorstatus=0 then 1 else 0 end) as imgcolorstatusnum
FROM ywvideocurrentstate a
right JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
WHERE 1=1
......@@ -851,14 +847,15 @@
</select>
<!-- 区域在线率统计 ============================ / start -->
<select id="query_areaOnline" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select b.xzbh xzqh,b.xzmc, sum(f.mcount)mcount,sum(notonlinecount)notonlinecount,sum(onlinecount)onlinecount,sum(wxj)wxj from(
select b.xzbh xzqh,b.xzmc,
sum(f.mcount)mcount,sum(notonlinecount)notonlinecount,sum(onlinecount)onlinecount,sum(wxj)wxj from(
<isEqual prepend="" property="alarmdevicetype" compareValue="1">
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select d.xzbh xzqh ,
(select count(*) from sbtdspsr e where e.xzbh = d.xzbh ) as mcount,
(select XZMC from ptxzs where xzbh=d.xzbh) as xzmc,
SUM((case when a.isonline=0 or a.isonline is null then 1 else 0 end)) as notonlinecount,
SUM((case when a.isonline!=0 then 1 else 0 end)) as onlinecount
SUM(case when a.isonline=0 or a.isonline is null then 1 else 0 end) as notonlinecount,
SUM(case when a.isonline is not null and a.isonline!=0 then 1 else 0 end) as onlinecount
from ywvideocurrentstate a
LEFT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
<isNotEmpty prepend='AND ' property='xzbh'>
......@@ -875,8 +872,8 @@
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select c.machineareanum xzqh,count(*)mcount ,
(select XZMC from ptxzs where xzbh=c.MACHINEAREANUM) as xzmc,
SUM((case when currentstate!=1 or currentstate is null then 1 else 0 end)) as notonlinecount,
SUM((case when currentstate=1 then 1 else 0 end)) as onlinecount
SUM(case when currentstate!=1 or currentstate is null then 1 else 0 end) as notonlinecount,
SUM(case when currentstate=1 then 1 else 0 end) as onlinecount
from ywmachinecurrentstate a right join ywmachineinfo c on a.machineid=c.machineid
<isNotEmpty prepend='where' property='xzbh'>
<![CDATA[ c.MACHINEAREANUM in ]]>
......@@ -910,8 +907,8 @@
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select qybh xzqh,count(*) mcount,
(select XZMC from ptxzs where xzbh=qybh) as xzmc,
SUM((case when state=0 or state is null then 1 else 0 end)) as notonlinecount,
SUM((case when state=1 then 1 else 0 end)) as onlinecount
SUM(case when state=0 or state is null then 1 else 0 end) as notonlinecount,
SUM(case when state=1 then 1 else 0 end) as onlinecount
from nhywjtledydpgl
<isNotEmpty prepend='where' property='xzbh'>
<![CDATA[qybh in ]]>
......@@ -926,8 +923,8 @@
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select regionid xzqh,count(*) mcount,
(select XZMC from ptxzs where xzbh=regionid) as xzmc,
SUM((case when state =0 or state is null then 1 else 0 end)) as notonlinecount,
SUM((case when state =1 then 1 else 0 end)) as onlinecount
SUM(case when state =0 or state is null then 1 else 0 end) as notonlinecount,
SUM(case when state =1 then 1 else 0 end) as onlinecount
from its.ksh_detector where detectortype='GVD'
<isNotEmpty prepend='AND ' property='xzbh'>
<![CDATA[regionid in ]]>
......@@ -943,8 +940,8 @@
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select regionid xzqh,count(*) mcount,
(select XZMC from ptxzs where xzbh=regionid) as xzmc,
SUM((case when state =0 or state is null then 1 else 0 end)) as notonlinecount,
SUM((case when state =1 then 1 else 0 end)) as onlinecount
SUM(case when state =0 or state is null then 1 else 0 end) as notonlinecount,
SUM(case when state =1 then 1 else 0 end) as onlinecount
from its.ksh_detector where detectortype='SMARTSENSOR'
<isNotEmpty prepend='AND ' property='xzbh'>
<![CDATA[regionid in ]]>
......@@ -960,8 +957,8 @@
select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
select gxdwbh xzqh,count(*) mcount,
(select XZMC from ptxzs where xzbh=gxdwbh) as xzmc,
SUM((case when state =0 or state is null then 1 else 0 end)) as notonlinecount,
SUM((case when state =1 then 1 else 0 end)) as onlinecount
SUM(case when state =0 or state is null then 1 else 0 end) as notonlinecount,
SUM(case when state =1 then 1 else 0 end) as onlinecount
from its.KSH_ZXLD
<isNotEmpty prepend='where' property='xzbh'>
<![CDATA[gxdwbh in ]]>
......@@ -972,7 +969,8 @@
GROUP BY gxdwbh
) f
</isEqual>
) f ,(SELECT t.xzbh,xzmc ,level FROM ptxzs t where level=2 START WITH sjxzbh='-1' CONNECT BY PRIOR xzbh=sjxzbh) b where f.xzqh in
) f ,(SELECT t.xzbh,xzmc ,level FROM ptxzs t where level=2 START WITH sjxzbh='-1' CONNECT BY PRIOR xzbh=sjxzbh)
b where f.xzqh in
(select xzbh from ptxzs START WITH sjxzbh=b.xzbh CONNECT BY PRIOR xzbh=sjxzbh
) group by b.xzbh,b.xzmc order by b.xzbh asc
</select>
......@@ -1076,7 +1074,8 @@
GROUP BY gxdwbh
) f
</isEqual>
) f ,(SELECT t.xzbh,xzmc ,level FROM ptxzs t where level=2 START WITH sjxzbh='-1' CONNECT BY PRIOR xzbh=sjxzbh) b where f.xzqh in
) f ,(SELECT t.xzbh,xzmc ,level FROM ptxzs t where level=2 START WITH sjxzbh='-1' CONNECT BY PRIOR xzbh=sjxzbh)
b where f.xzqh in
(select xzbh from ptxzs START WITH sjxzbh=b.xzbh CONNECT BY PRIOR xzbh=sjxzbh
) group by b.xzbh,b.xzmc order by b.xzbh asc
</select>
......@@ -1287,11 +1286,11 @@
<select id="count_HomepageFalultType" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select
count(*) as zs,
SUM((case when a.isonline=0 or a.isonline is null then 1 else 0 end)) as sbbzx,
SUM((case when a.networkerror=0 or a.networkerror is null then 1 else 0 end)) as wlyc,
SUM((case when a.vqcstate=0 or a.vqcstate is null then 1 else 0 end)) as czyc,
SUM((case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end)) as zlzdyc,
SUM((case when a.recordstate=0 or a.recordstate is null then 1 else 0 end)) as lxyc
SUM(case when a.isonline=0 or a.isonline is null then 1 else 0 end) as sbbzx,
SUM(case when a.networkerror=0 or a.networkerror is null then 1 else 0 end) as wlyc,
SUM(case when a.vqcstate=0 or a.vqcstate is null then 1 else 0 end) as czyc,
SUM(case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end) as zlzdyc,
SUM(case when a.recordstate=0 or a.recordstate is null then 1 else 0 end) as lxyc
from ywvideocurrentstate a
RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
</select>
......@@ -1331,7 +1330,7 @@
a.videocatalog = #xzqh#
</isNotEmpty>
<isNotEmpty prepend='AND ' property='normal'>
a.isonline!=0
(a.isolation is not null and a.isonline!=0)
</isNotEmpty>
<isNotEmpty prepend='AND ' property='abnormal'>
(a.isonline=0 or a.isonline is null)
......@@ -1358,7 +1357,7 @@
a.videocatalog = #xzqh#
</isNotEmpty>
<isNotEmpty prepend='AND ' property='normal'>
a.isonline!=0
(a.isolation is not null and a.isonline!=0)
</isNotEmpty>
<isNotEmpty prepend='AND ' property='abnormal'>
(a.isonline=0 or a.isonline is null)
......@@ -1374,13 +1373,12 @@
<select id="getDpIntact" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select
count(*) as total,
sum((case when a.isonline=1 and a.vqcstate = 1 and a.vqdstate = 1 and recordstate = 1 then 1 else 0 end)) as
sum(case when a.isonline is not null and a.isonline!=0 and a.vqcstate = 1 and a.vqdstate = 1 and recordstate =
1 then 1 else 0 end) as
intactnum
from ywvideocurrentstate a
RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
where 1=1
<isNotEmpty prepend=' ' property='tableparam'>
$tableparam$
</isNotEmpty>
......@@ -1390,7 +1388,7 @@
<select id="getDpVideoByXzbh" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
select
a.videonum,a.channelnum,a.channelname,a.videocatalog,
(case when isonline=1 then isonline else 0 end) as isonline,
(case when isonline is not null and isonline !=0 then isonline else 0 end) as isonline,
(case when vqcstate=1 then vqcstate else 0 end) as vqcstate,
(case when vqdstate=1 then vqdstate else 0 end) as vqdstate,
(case when recordstate=1 then recordstate else 0 end) as recordstate
......
......@@ -606,7 +606,7 @@
(a.videonum like '%$LIKEvideonum$%' )
</isNotEmpty>
<isNotEmpty prepend='AND ' property='LIKEip'>
(a.sbip like '%$LIKEip$%' )
(e.sbip like '%$LIKEip$%' )
</isNotEmpty>
<isNotEmpty prepend='AND ' property='currentstate'>
(a.currentstate = #currentstate# )
......
......@@ -314,12 +314,10 @@
</select>
<select id="statisticsZxldRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
select COUNT(*) as totalcount ,'totalcount' as name
from its.ksh_zxld
union ALL
select COUNT(a.xh) as totalcount,'onlinenum' as name from its.ksh_zxld a where state=1
union ALL
select COUNT(a.xh) as totalcount ,'unonlinenum' as name from its.ksh_zxld a where ( state=0 or state is null)
select count(*) as totalcount,
SUM(case when a.state is not null and a.state=1 then 1 else 0 end) as onlinenum,
SUM(case when a.state =0 or a.state is null then 1 else 0 end) as unonlinenum
from its.ksh_zxld a
</select>
<!-- query objects by page-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment