Merge branch 'dev_lxw' of https://didiyu@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | searchpoweroff(); //查询机房停电总数
|
| | | searchdevalarm(); //查询设备实时告警总数
|
| | | searchnotcomplan(); //查询未放电的计划总数
|
| | | |
| | | searchWeakHome(); //查询机房续航不足的个数
|
| | | /* setInterval(function(){
|
| | | searchlowmon(); //查询落后单体总数
|
| | | searchpoweroff(); //查询机房停电总数
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | // 机房续航不足个数
|
| | | function searchWeakHome() {
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: 'Batt_enduranceAction!serchxuhangNotInThree'
|
| | | ,data: null
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | $('#weak_home').text(rs.sum);
|
| | | |
| | | setTimeout(searchWeakHome, 5000);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | |
|
| | | $(function(){
|
| | | $.ajax({
|
| | |
| | | // 添加天气插件和电池信息长度控制
|
| | | $(function() {
|
| | | limitWidth();
|
| | | //addWeather();
|
| | | });
|
| | |
|
| | | // 限制显示个数
|
| | |
| | | // 给每一行添加数据
|
| | | var trList = tblBd.find('tbody tr');
|
| | | // 遍历内容给tr添加attr
|
| | | for(var i=0; i<model.data.length; i++) {
|
| | | trList.eq(i).data('attr', model.data[i]);
|
| | | for(var i=0; i<data.length; i++) {
|
| | | trList.eq(i).data('attr', data[i]);
|
| | | }
|
| | |
|
| | | window.clearTimeout(myTimeOut);
|
| | |
| | | margin-left: -250px;
|
| | | top: 50%;
|
| | | margin-top: -150px;
|
| | | }
|
| | | .hdw-dialog-content-container {
|
| | | position: relative;
|
| | | } |
| | |
| | | <i class="fa fa-cog"></i>
|
| | | </a>
|
| | | </div>
|
| | | <!--电池故障修复图-->
|
| | | <div class="repair-pie module"></div>
|
| | | <!-- 电池故障饼状图 -->
|
| | | <div class="brdn-pie module"></div>
|
| | | <!-- 电池告警饼状图 -->
|
| | | <div class="warn-pie module"></div>
|
| | | <!--电池健康饼状图-->
|
| | | <div class="health-pie module"></div>
|
| | | <!--清除浮动-->
|
| | | <div class="clear"></div>
|
| | | <div class="pie-item-con">
|
| | | <!-- 机房停电 -->
|
| | | <div class="repair-pie module"></div>
|
| | | <!-- 电池状态饼状图 -->
|
| | | <div class="brdn-pie module"></div>
|
| | | <!-- 电池告警饼状图 -->
|
| | | <div class="warn-pie module"></div>
|
| | | <!--电池容量饼状图-->
|
| | | <div class="health-pie module"></div>
|
| | | <!-- 机房续航能力饼状图 -->
|
| | | <div class="endur-pie module"></div>
|
| | | <!--清除浮动-->
|
| | | <div class="clear"></div>
|
| | | </div>
|
| | | |
| | | </div>
|
| | | <c:forEach var="cust" items="${sessionScope.custompages}">
|
| | | <c:if test="${cust.submenu eq 'My_work' && cust.subflag eq 1}">
|
| | |
| | |
|
| | | ];
|
| | |
|
| | | |
| | | // 设置页面中pie的模块
|
| | | ;(function() {
|
| | | var pieStatus = GLOBAL.Index.Pie.pieStatus; // 查询饼状图显示的状态
|
| | | var pieItemCon = $('.pie-con .pie-item-con');
|
| | | pieItemCon.text('');
|
| | | var pieItems = pieStatus();
|
| | | pieItemCon.html(pieItems);
|
| | | })();
|
| | |
|
| | |
|
| | | var locationcity;
|
| | |
| | | }
|
| | |
|
| | | $(function() {
|
| | | flushFourPie();
|
| | | |
| | | if($('#content .brdn-pie').length>0){
|
| | | //生成电池状态饼状图
|
| | | var $brdn=$('#content .pie-con .brdn-pie'); //获取故障容器的jquery对象
|
| | | var brdn=$brdn.get(0); //将容器的jquery对象转化为dom对象
|
| | | brdnPie=echarts.init(brdn); //初始化表格容器
|
| | | brdnPie.showLoading();
|
| | | }
|
| | | |
| | | if($('#content .repair-pie').length>0){
|
| | | var $repair=$('#content .pie-con .repair-pie'); //获取机房停电图容器的jquery对象
|
| | | var repair=$repair.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | repairPie=echarts.init(repair); //初始化表格容器
|
| | | repairPie.showLoading();
|
| | | }
|
| | | flushFourPie(true);
|
| | | });
|
| | |
|
| | | //更新四种饼状图
|
| | | function flushFourPie(){
|
| | | function flushFourPie(create){
|
| | | var cityname = $('#panelCity').val();
|
| | | locationcity = getCityByName(cityname);
|
| | | if(create) {
|
| | | initPieObj();
|
| | | }
|
| | | |
| | | |
| | | searchalarm_data(); //查询告警率
|
| | | searchGood(); //查询健康率
|
| | | searchmaintByMap(); //查询电池状态
|
| | | |
| | | searchBatt_maint_inf(); //查询机房停电比例
|
| | | |
| | | |
| | | |
| | | searchEndurHome(); //查询续航饼状图
|
| | | }
|
| | |
|
| | | //查询最近的故障维护记录
|
| | |
| | | });
|
| | |
|
| | | }
|
| | | |
| | | var warnPie;
|
| | | //查询告警信息并显示告警率
|
| | | function searchalarm_data(){
|
| | | if($('#content .warn-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | //生成电池告警率饼状图
|
| | | var $warn=$('#content .pie-con .warn-pie'); //获取告警容器的jquery对象
|
| | | if($warn.length!=0){
|
| | | var warn=$warn.get(0); //将告警容器的jquery对象转化为dom对象
|
| | | var warnPie=echarts.init(warn); //初始化图表容器
|
| | | window.warnPie = warnPie;
|
| | | warnPie.showLoading();
|
| | | var isEcharts = isObject(warnPie)?true:false;
|
| | | if(!isEcharts) {
|
| | | var warn=$warn.get(0); //将告警容器的jquery对象转化为dom对象
|
| | | warnPie=echarts.init(warn); //初始化图表容器
|
| | | warnPie.showLoading();
|
| | | }
|
| | | |
| | |
|
| | | var cityname='';
|
| | | //console.info("="+locationcity.pinyin+"=");
|
| | |
| | | }
|
| | | //创建电池告警饼状图
|
| | | var warnTle="<s:text name='Battery_alarm_rate'/>"; /* 电池告警率 */
|
| | | createPie(warnPie,warnTle,Almarr);
|
| | | warnPie.on('click', function(param) {
|
| | | // 0:在线电压 1:组端电压 2:充电电流 3:放电电流 4:单体电压 5:容量告警 |
| | | if(param.dataIndex == 5) {
|
| | | if(!isEcharts) {
|
| | | createPie(warnPie,warnTle,Almarr);
|
| | | warnPie.on('click', function(param) {
|
| | | // 0:在线电压 1:组端电压 2:充电电流 3:放电电流 4:单体电压 5:容量告警 |
| | | if(param.dataIndex == 5) {
|
| | | |
| | | }else {
|
| | | window.open('elewarn.jsp?warntype='+param.dataIndex+'&warntxt='+param.name);
|
| | | }
|
| | |
|
| | | }else {
|
| | | window.open('elewarn.jsp?warntype='+param.dataIndex+'&warntxt='+param.name);
|
| | | }
|
| | | |
| | | });
|
| | | });
|
| | | }else {
|
| | | var opts = getOpt(warnTle, Almarr);
|
| | | warnPie.setOption(opts);
|
| | | }
|
| | | |
| | | setTimeout(searchalarm_data, 10000)
|
| | | |
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | var battstate_isExist = true;
|
| | | var brdnPie;
|
| | | //查询各个机房的电池状态
|
| | | function searchmaintByMap(){
|
| | | if($('#content .brdn-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断是否为Echarts对象
|
| | | var isEcharts = isObject(brdnPie)?true:false;
|
| | | |
| | | if(!isEcharts) {
|
| | | //生成电池状态饼状图
|
| | | var $brdn=$('#content .pie-con .brdn-pie'); //获取故障容器的jquery对象
|
| | | var brdn=$brdn.get(0); //将容器的jquery对象转化为dom对象
|
| | | brdnPie=echarts.init(brdn); //初始化表格容器
|
| | | }
|
| | | |
| | | |
| | | var brdnTle="<s:text name='Batte_state'/>"; /* 电池状态 */
|
| | | $.post("Batt_rtstateAction!serchBattStateRate",null,function(data){
|
| | | var model=eval("("+data.result+")");
|
| | | //console.info(model);
|
| | | var maintarr = new Array();
|
| | | setBatt_list(maintarr,model.data);
|
| | | if(battstate_isExist){
|
| | | if(!isEcharts){
|
| | | //创建电池故障率状图
|
| | | createPie(brdnPie,brdnTle,maintarr);
|
| | | battstate_isExist = false;
|
| | | brdnPie.on('click', function(param) {
|
| | | console.info(param);
|
| | | window.open('elestatus.jsp?battstate='+param.dataIndex);
|
| | | });
|
| | | }else{
|
| | | brdnPie.setOption(getOpt(brdnTle, maintarr));
|
| | | //console.info("更新成功");
|
| | | }
|
| | | setTimeout("searchmaintByMap()",10000); |
| | | setTimeout(searchmaintByMap, 10000); |
| | | });
|
| | | }
|
| | |
|
| | |
| | | {state:4,value:"<s:text name='Average_charge'/>",color:'#800080'}, //均充
|
| | | ];
|
| | |
|
| | | var repairPie;
|
| | | var powercut_isNew = true; |
| | | var repairPie; |
| | | //查询机房停电状态
|
| | | function searchBatt_maint_inf(){
|
| | | if($('#content .repair-pie').length==0){
|
| | | return;
|
| | | }
|
| | | // 判断是否为Echarts对象
|
| | | var isEcharts = isObject(repairPie)?true:false;
|
| | | if(!isEcharts) {
|
| | | var $repair=$('#content .pie-con .repair-pie'); //获取机房停电图容器的jquery对象
|
| | | var repair=$repair.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | repairPie=echarts.init(repair); //初始化表格容器
|
| | | }
|
| | | |
| | | // 请求后台
|
| | | $.ajax({
|
| | | type: "post",
|
| | | //url: "BattPower_offAction!serchPowerOff",
|
| | |
| | | {name:"机房掉站", val: model.code}]; /* '未修复' */
|
| | | }
|
| | | var repairTle="<s:text name='Computer_room'/><s:text name='Power_cut'/>"; /* '机房停电' */
|
| | | if(powercut_isNew){
|
| | | //创建机房停电饼状图
|
| | | powercut_isNew = false;
|
| | | if(!isEcharts){
|
| | | createPie(repairPie,repairTle,repairObj);
|
| | | repairPie.on('click', function() {
|
| | | window.open('batt-state-manage.jsp');
|
| | |
| | | var opt = getOpt(repairTle, repairObj);
|
| | | repairPie.setOption(opt);
|
| | | }
|
| | | //console.info(repairPie);
|
| | | setTimeout("searchBatt_maint_inf()", 10000);
|
| | | |
| | | setTimeout(searchBatt_maint_inf, 10000);
|
| | | },
|
| | | error:function(){
|
| | | //setTimeout("searchBatt_maint_inf()", 10000);
|
| | |
| | | }
|
| | |
|
| | | //查询健康率
|
| | | var healthPie;
|
| | | function searchGood(){
|
| | | if($('#content .health-pie').length==0){
|
| | | return;
|
| | |
| | | //生成电池健康率
|
| | | var $health=$('#content .pie-con .health-pie'); //获取故障容器的jquery对象
|
| | | if($health.length!=0){
|
| | | var health=$health.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | var healthPie=echarts.init(health); //初始化表格容器
|
| | | window.healthPie = healthPie;
|
| | | // 是否echarts对象
|
| | | var isEcharts = isObject(healthPie)?true:false;
|
| | | if(!isEcharts) {
|
| | | var health=$health.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | healthPie=echarts.init(health); //初始化表格容器
|
| | | healthPie.showLoading(); |
| | | }
|
| | | |
| | | var healthTle="<s:text name='Monomer_cap_health_rate'/>"; /* '电池健康率' */
|
| | | healthPie.showLoading();
|
| | | $.post("Battalarm_dataAction!serchGood",null,function(data){
|
| | | var model=eval("("+data.result+")");
|
| | | //console.info(model);
|
| | | var healthObj;
|
| | | //console.info(model); |
| | | if(model.code==1){
|
| | | healthObj=[
|
| | | {name:"单体容量健康",val:model.sum-model.data[0]-model.data[1],color:'#31CB36'}, /* '健康电池' */
|
| | |
| | | {name:"单体容量更换",val:0,color:'#FF0000'}
|
| | | ];
|
| | | }
|
| | | //创建电池故障饼状图
|
| | | createPie(healthPie,healthTle,healthObj);
|
| | | if(!isEcharts) {
|
| | | //创建电池故障饼状图
|
| | | createPie(healthPie,healthTle,healthObj);
|
| | | |
| | | // 点击饼状图进行跳转
|
| | | healthPie.on('click', function(param) {
|
| | | window.open('taskplan.jsp'); // 跳转到落后单体查询
|
| | | });
|
| | | }else {
|
| | | var opt = getOpt(healthTle, healthObj);
|
| | | healthPie.setOption(opt);
|
| | | }
|
| | |
|
| | | // 点击饼状图进行跳转
|
| | | healthPie.on('click', function(param) {
|
| | | window.open('taskplan.jsp'); // 跳转到落后单体查询
|
| | | });
|
| | | setTimeout(searchGood, 10000);
|
| | | });
|
| | | }
|
| | | }
|
| | | |
| | | // 查询续航不足的机房数
|
| | | var endurPie;
|
| | | function searchEndurHome() {
|
| | | if($('#content .endur-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | //生成电池告警率饼状图
|
| | | var $endur=$('#content .pie-con .endur-pie'); //获取告警容器的jquery对象
|
| | | if($endur.length!=0){
|
| | | var isEcharts = endurPie?true:false;
|
| | | if(!isEcharts) {
|
| | | var endur=$endur.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | endurPie=echarts.init(endur); //初始化表格容器
|
| | | }
|
| | | |
| | | var endurTle="机房续航能力"; /* 机房续航能力 */
|
| | | // 查询后台内容
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: 'Batt_enduranceAction!serchByState_xuhang'
|
| | | ,data: null
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | var endurObj =[
|
| | | {name:"续航不足1小时",val:data[0],color:'#FF0000'}
|
| | | ,{name:"续航1~2小时",val:data[1],color:'#D1D105'}
|
| | | ,{name:"续航2~3小时",val:data[2],color:'#31CB36'}
|
| | | ,{name:"续航3小时以上",val:data[3],color:'#800080'}
|
| | | ];
|
| | | |
| | | if(!isEcharts) {
|
| | | //创建电池故障饼状图
|
| | | createPie(endurPie,endurTle,endurObj);
|
| | | }else {
|
| | | var opts = getOpt(endurTle, endurObj);
|
| | | endurPie.setOption(opts);
|
| | | }
|
| | | }
|
| | | |
| | | setTimeout(searchEndurHome, 10000);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | }
|
| | | |
| | | // 初始化饼状图容器对象
|
| | | function initPieObj() {
|
| | | warnPie = false;
|
| | | brdnPie = false;
|
| | | repairPie = false;
|
| | | healthPie = false;
|
| | | endurPie = false;
|
| | | }
|
| | | |
| | | //让地图和饼状图随浏览器窗口的改变而改变
|
| | | $(window).resize(function(){
|
| | | getMapHt();
|
| | | if(isObject(warnPie))
|
| | | {
|
| | | warnPie.resize();
|
| | | }
|
| | | if(isObject(brdnPie))
|
| | | {
|
| | | brdnPie.resize();
|
| | | }
|
| | | if(isObject(repairPie))
|
| | | {
|
| | | repairPie.resize();
|
| | | }
|
| | | if(isObject(healthPie)) {
|
| | | healthPie.resize();
|
| | | }
|
| | | if(isObject(endurPie)) {
|
| | | endurPie.resize();
|
| | | }
|
| | | });
|
| | |
|
| | | //查询所有的公告信息
|
| | | function searchAnnounceall(){
|
| | |
| | | //查询放电测试的比例
|
| | | function searchTestsCale(){
|
| | | if($('#content .discharge-test').length==0){
|
| | | //alert(); |
| | | return;
|
| | | }
|
| | | //生成电池未放电比例图
|
| | | var $health=$('#content .discharge-test .test-pie'); //获取故障容器的jquery对象
|
| | | if($health.length!=0){
|
| | | var health=$health.get(0); //将故障容器的jquery对象转化为dom对象
|
| | | //console.info(health); |
| | | //healthPie.showLoading();
|
| | | var healthTle="<s:text name='Battery_discharge_scale_map'/>"; /* '电池放电比例图' */
|
| | | Batttest_Td=new Array();
|
| | | $.post("Batttestdata_infAction!searchTestsCale",$('#batttest_form').serialize(),function(data){
|
| | |
| | | });
|
| | | });
|
| | |
|
| | | $(window).resize(function() {
|
| | | console.log(123);
|
| | | getMapHt();
|
| | | });
|
| | | |
| | | // 改变div的大小
|
| | | function changeDivBig(ele) {
|
| | | // 隐藏面板
|
| | |
| | | var _data = data[i];
|
| | | var _list = formatUpdateStation(_data);
|
| | | updateStationData.push(_list);
|
| | | //_list.msg = 'item-nuclear_cap';
|
| | | // 判断是否更新
|
| | | if(mapPages.pageNew) {
|
| | | bmap.updateDots(_list);
|
| | |
| | |
|
| | | $(function() {
|
| | | searchProvince();
|
| | | }); |
| | | |
| | | //让地图和饼状图随浏览器窗口的改变而改变
|
| | | $(window).resize(function(){
|
| | | if(warnPie != undefined)
|
| | | {
|
| | | warnPie.resize();
|
| | | }
|
| | | if(brdnPie != undefined)
|
| | | {
|
| | | brdnPie.resize();
|
| | | }
|
| | | if(repairPie != undefined)
|
| | | {
|
| | | repairPie.resize();
|
| | | }
|
| | | if(healthPie != undefined) {
|
| | | healthPie.resize();
|
| | | }
|
| | | });
|
| | |
|
| | | // 点击切换内容
|
| | |
| | | var model = eval('('+data.result+')');
|
| | | if(model.code == 1) {
|
| | | var result = model.data;
|
| | | //console.log(result);
|
| | | var formatData = formatPieRsData(result[0]);
|
| | | laytpl(pieConfTpl).render(formatData, function(html) {
|
| | | layer.open({
|
| | |
| | |
|
| | | // 更新当前用户设置饼状图的使能状态
|
| | | function updateUserBieState(temp, dialog, load){
|
| | | var pieItemCon = $('.pie-con .pie-item-con');
|
| | | // 更新后台数据
|
| | | $.ajax({
|
| | | type:"post",
|
| | |
| | | data:'json='+JSON.stringify(temp),
|
| | | success: function(data){
|
| | | layer.closeAll();
|
| | | |
| | | var model = eval('('+data.result+')');
|
| | | if(model.code == 1) {
|
| | | // 更具temp的值设置饼状图的内容
|
| | | var formaterTmp = GLOBAL.Index.Pie.formaterPieStauts(temp);
|
| | | //console.log(formaterTmp);
|
| | | var pieItems = GLOBAL.Index.Pie.getPieList(formaterTmp);
|
| | | //console.log(pieItems);
|
| | | pieItemCon.text('');
|
| | | pieItemCon.append(pieItems);
|
| | | |
| | | // 设置高度
|
| | | getMapHt();
|
| | | |
| | | // 更新饼状图
|
| | | flushFourPie(true);
|
| | | |
| | | layer.msg('配置成功!!!');
|
| | | }else {
|
| | | layer.msg('配置失败!!!');
|
| | |
| | |
|
| | | initDBpool();
|
| | |
|
| | | // 配置拖动验证图像
|
| | | $('#lVerify').slideVerify({
|
| | | type : 2, //类型
|
| | | vOffset : 5, //误差量,根据需求自行调整
|
| | | vSpace : 5, //间隔
|
| | | imgName : ['1.jpg', '2.jpg'],
|
| | | imgSize : {
|
| | | width: '498px',
|
| | | height: '250px',
|
| | | },
|
| | | blockSize : {
|
| | | width: '40px',
|
| | | height: '40px',
|
| | | },
|
| | | barSize : {
|
| | | width : '498px',
|
| | | height : '40px',
|
| | | },
|
| | | ready : function() {
|
| | | |
| | | },
|
| | | success : function() {
|
| | | $('#lVerify-dialog').addClass('hdw-dialog-hide'); // 隐藏验证
|
| | | checkuser(); // 验证用户
|
| | | },
|
| | | error : function() {
|
| | | // alert('验证失败!');
|
| | | }
|
| | | });
|
| | | // 点击空白区域关闭验证
|
| | | $('#lVerify-dialog .hdw-dialog-bg').click(function() {
|
| | | $('#sub').children('.faa-spin').css('visibility', 'hidden');
|
| | | $('#sub').removeClass('page-loading');
|
| | | $('#lVerify-dialog').addClass('hdw-dialog-hide');
|
| | | });
|
| | | });
|
| | |
|
| | | // 初始化verify拖动验证
|
| | |
| | | type : 2, //类型
|
| | | vOffset : 5, //误差量,根据需求自行调整
|
| | | vSpace : 5, //间隔
|
| | | imgName : ['1.jpg', '2.jpg'],
|
| | | imgName : ['verify.png'],
|
| | | imgSize : {
|
| | | width: '498px',
|
| | | height: '250px',
|
| | |
| | | updataSelStation($Ostation_name1, arr);
|
| | | }
|
| | |
|
| | | findserchByBattGroupNamebystationname(); |
| | | // findserchByBattGroupNamebystationname(); |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //根据机房获取电池组 |
| | | function findserchByBattGroupNamebystationname(){
|
| | | var stationid = $("#country").find('option:selected').attr('stationid')?$("#station_name").find('option:selected').attr('stationid'):'';
|
| | | |
| | | var data = {
|
| | | StationName1: $("#mainteArea").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#country").val(),
|
| | | StationName: $("#homeName").val(),
|
| | | StationId: stationid
|
| | | };
|
| | | |
| | | //console.info(data);
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchBattByStation", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.warn();
|
| | | //console.info(data);
|
| | | //console.info(data.code); |
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#battgroup_name");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:0,
|
| | | txt:"全部(共"+data.data.length+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].BattGroupId,
|
| | | txt:data.data[i-1].BattGroupName,
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($Ostation_name1, arr);
|
| | | }
|
| | | |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | |
| | | //当省改变时更新市
|
| | | $('#mainteArea').change(function(){
|
| | | findCity();
|
| | |
| | | $('#country').change(function(){
|
| | | findStationNamebyStationname1();
|
| | | });
|
| | | //当机房改变时,更新电池组 |
| | | $('#homeName').change(function(){
|
| | | findserchByBattGroupNamebystationname();
|
| | | });
|
| | | |
| | |
|
| | |
|
| | |
|
| | | $(function() {
|
| | |
| | | gl.namespace('Index.Pie');
|
| | |
|
| | | var pieType = [
|
| | | {
|
| | | name: '机房停电'
|
| | | ,cla: 'repair-pie'
|
| | | },
|
| | | {
|
| | | name: '电池状态',
|
| | | action: 'Batt_rtstateAction!serchBattStateRate',
|
| | | formatData: eleStatus
|
| | | name: '电池状态'
|
| | | ,cla: 'brdn-pie'
|
| | | },
|
| | | {
|
| | | name: '电池告警率',
|
| | | action: 'Battalarm_dataAction!serchAlm',
|
| | | formatData: eleWarn
|
| | | name: '电池告警率'
|
| | | ,cla: 'warn-pie' |
| | | },
|
| | | {
|
| | | name: '机房停电',
|
| | | action: 'BattPower_offAction!serchPowerOff',
|
| | | formatData: homeCut
|
| | | name: '单体容量健康率'
|
| | | ,cla: 'health-pie'
|
| | | },
|
| | | {
|
| | | name: '单体容量健康率',
|
| | | action: 'Battalarm_dataAction!serchGood',
|
| | | formatData: monCapGood
|
| | | name: '机房续航能力'
|
| | | ,cla: 'endur-pie'
|
| | | }
|
| | | ];
|
| | |
|
| | | // 将pieType绑定到Index.Pie命名空间下
|
| | | gl.Index.Pie.pieType = pieType;
|
| | |
|
| | | // 根据数组调用查询内容
|
| | | function search(arr) {
|
| | | for(var i=0; i<arr.length; i++) {
|
| | | if(arr[i]) {
|
| | | ajax(pieType[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 将search绑定到Index.Pie命名空间下
|
| | | gl.Index.Pie.search = search;
|
| | | |
| | | // 请求后台
|
| | | function ajax(obj) {
|
| | | // ajax请求后台
|
| | | // 查询饼状图状态返回需要显示饼状图
|
| | | function pieStatus() {
|
| | | // 设置一个同步查询返回一个div.pie-item-list
|
| | | var pieItems;
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | url: obj.action,
|
| | | data: null,
|
| | | async: true,
|
| | | dataType: 'json',
|
| | | success:function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var pieData = obj.formatData(rs);
|
| | | |
| | | type: 'post'
|
| | | ,async: false
|
| | | ,url: 'Echarts_usrAction!serchByCondition'
|
| | | ,data: null
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | //console.log(rs);
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data[0];
|
| | | var rsStatus = formaterPieStauts(data);
|
| | | pieItems = getPieList(rsStatus);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | return pieItems;
|
| | | }
|
| | |
|
| | | // 电池状态
|
| | | function eleStatus(data) {
|
| | | console.log(data);
|
| | | // 将pieStatus绑定到Index.Pie命名空间下
|
| | | gl.Index.Pie.pieStatus = pieStatus;
|
| | | |
| | | // 根据数组返回
|
| | | function getPieList(arr) {
|
| | | var pieItems = $('<div class="pie-item-list"></div>');
|
| | | for(var i=0; i<arr.length; i++) {
|
| | | if(arr[i] == 1) {
|
| | | var cla = pieType[i].cla;
|
| | | var pieItem = $('<div class="'+cla+' module"></div>');
|
| | | pieItems.append(pieItem);
|
| | | }
|
| | | |
| | | }
|
| | | return pieItems;
|
| | | }
|
| | |
|
| | | // 电池告警
|
| | | function eleWarn(data) {
|
| | | console.log(data);
|
| | | // 将getPieList绑定到Index.Pie命名空间下
|
| | | gl.Index.Pie.getPieList = getPieList;
|
| | | |
| | | // 构造更新饼状图参数
|
| | | function formaterPieStauts(obj) {
|
| | | var rs = [];
|
| | | // 遍历pieType的类型
|
| | | for(var i=0; i<pieType.length; i++) {
|
| | | var num = i+1;
|
| | | var key = 'echarts'+num+'_enable';
|
| | | rs.push(obj[key]);
|
| | | }
|
| | | return rs;
|
| | | }
|
| | |
|
| | | // 机房停电
|
| | | function homeCut(data) {
|
| | | console.log(data);
|
| | | }
|
| | | // 单体容量健康率
|
| | | function monCapGood(data) {
|
| | | console.log(data);
|
| | | }
|
| | | // 将getPieList绑定到Index.Pie命名空间下
|
| | | gl.Index.Pie.formaterPieStauts = formaterPieStauts;
|
| | | })(jQuery, window, document, GLOBAL); |
| | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.omg.CORBA.Request;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
|
| | |
| | |
|
| | | public final static String CROSS_DOMAIN_KEY = "44c4a294cb66d13727c14b065dbe8548"; //跨域请求 key
|
| | |
|
| | | public void doFilter(ServletRequest req, ServletResponse response,
|
| | | public void doFilter(ServletRequest req, ServletResponse resp,
|
| | | FilterChain chain) throws IOException, ServletException {
|
| | | HttpServletRequest request=(HttpServletRequest)req;
|
| | | HttpServletResponse response =(HttpServletResponse)resp;
|
| | | String URL=request.getRequestURI();
|
| | | request.setCharacterEncoding("UTF-8");
|
| | | response.setCharacterEncoding("UTF-8");
|
| | | response.setContentType("text/html;charset=utf-8");
|
| | | //检测跨域访问的请求
|
| | | if(URL != null && URL.endsWith("_ky") && false){
|
| | | String key = req.getParameter("key"); //获取校验码
|
| | | ServiceModel model = new ServiceModel(); //是否允许访问
|
| | | boolean isAlowVisit = false; |
| | | System.out.println(key+"=="+CROSS_DOMAIN_KEY);
|
| | | ServiceModel model = new ServiceModel(); |
| | | boolean isAlowVisit = false; //是否允许访问
|
| | | //System.out.println(key+"=="+CROSS_DOMAIN_KEY);
|
| | | if(key != null && CROSS_DOMAIN_KEY.equals(key)){
|
| | | isAlowCrossDomain(response);
|
| | | //System.out.println("开始休眠500毫秒秒");
|
| | | try {
|
| | | Thread.sleep(500);
|
| | |
| | |
|
| | | isAlowVisit = true;
|
| | | }else{
|
| | | model.setMsg("校验码发送失败");
|
| | | model.setMsg("校验码发送失败,key:"+key);
|
| | | }
|
| | | if(isAlowVisit){
|
| | | //通过请求
|
| | | chain.doFilter(request, response); //不允许跨域
|
| | | chain.doFilter(request, response); //允许跨域
|
| | | }else{
|
| | | //不能放行的请求
|
| | | PrintWriter out = response.getWriter();
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 允许跨域访问
|
| | | * @param response
|
| | | */
|
| | | public void isAlowCrossDomain(HttpServletResponse response){
|
| | | response.setHeader("Access-Control-Allow-Origin", "*"); //允许跨域访问
|
| | | response.setHeader("Access-Control-Allow-Headers", "X-Requested-With,content-type,token");
|
| | | response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
|
| | | }
|
| | | |
| | | public static void main(String[] args) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | System.out.println(sdf.format(new Date()));
|
| | |
| | |
|
| | | //跨域访问获取所有电池组的信息<-------跨域----------->
|
| | | public String searchInform_ky(){
|
| | | isAllowHeaders(); //允许跨域访问
|
| | | //isAllowHeaders(); //允许跨域访问
|
| | | ServiceModel model = new ServiceModel();
|
| | | model = service.searchInform_ky();
|
| | | result = ActionUtil.tojson(model);
|
| | |
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | | |
| | | //导航上续航不足3小时的个数
|
| | | public String serchxuhangNotInThree() {
|
| | | User_inf uinf=(User_inf) getUser();
|
| | | ServiceModel model=service.serchxuhangNotInThree(uinf);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | | public String getResult() {
|
| | | return result;
|
| | |
| | |
|
| | | //跨域访问查询电池组的单体数据 < ! ---- ---- 跨域访问 ------------>
|
| | | public String serchByCondition_ky(){
|
| | | ActionUtil.isAllowHeaders();
|
| | | //ActionUtil.isAllowHeaders();
|
| | | ServiceModel model = new ServiceModel();
|
| | | Batt_rtdata rtdata=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_rtdata.class);
|
| | | model=service.serchByCondition_ky(rtdata);
|
| | |
| | |
|
| | | //实时监测中的查询实时组端信息 <!-- 跨域访问 --->
|
| | | public String serchByCondition_ky(){
|
| | | ActionUtil.isAllowHeaders(); //允许跨域访问
|
| | | //ActionUtil.isAllowHeaders(); //允许跨域访问
|
| | | model = new ServiceModel();
|
| | | //System.out.println("开始查询rtstate");
|
| | | rtstate = ActionUtil.getGson().fromJson(json, Batt_rtstate.class);
|
| | |
| | | * @return
|
| | | */
|
| | | public String findhistory_ky(){
|
| | | isAllowHeaders();
|
| | | //isAllowHeaders();
|
| | | ServiceModel model = new ServiceModel();
|
| | | btd = ActionUtil.getGson().fromJson(json, Batttestdata.class);
|
| | | model = service.serchByCondition_ky(btd);
|
| | |
| | | * 根据电池组id查询电池组的inf表中的放电信息 <!------ 跨域访问 --------->
|
| | | */
|
| | | public String searchBattTestInfDataById_ky(){
|
| | | isAllowHeaders();
|
| | | //isAllowHeaders();
|
| | | Batttestdata_inf bti = ActionUtil.getGson().fromJson(json, Batttestdata_inf.class);
|
| | | model=service.serchByCondition_ky(bti);
|
| | | result=ActionUtil.tojson(model);
|
| | |
| | |
|
| | | //11.1FBS9100设备通信状态查询 <-- 跨域 -->
|
| | | public String serchByCondition_ky(){
|
| | | isAllowHeaders(); //允许跨域访问
|
| | | //isAllowHeaders(); //允许跨域访问
|
| | | ServiceModel model = new ServiceModel();
|
| | | model = service.serchByCondition_ky();
|
| | | result = tojson(model);
|
| | |
| | | public int serchByDeviceId(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " +
|
| | | " limit 1";
|
| | | " where StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id " +
|
| | | " and db_user.tb_user_battgroup_baojigroup_usr.uId=? " +
|
| | | " ) " +
|
| | | " and db_battinf.tb_battinf.station_install=1";
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? " +
|
| | | " limit 1";
|
| | | " limit 1 ";
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | //9.1查询已经添加物理信息的机房(用户管理的,l查询全部打开页面)
|
| | | public List serchInBattMapByUid(Object obj) {
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql="select distinct tb_battmap_information.num,tb_battmap_information.StationId,tb_battmap_information.StationName,address,longitude,latitude,information,db_battinf.tb_battinf.FBSDeviceId " +
|
| | | String sql="select distinct tb_battmap_information.num,tb_battmap_information.StationId,tb_battmap_information.StationName,address,longitude,latitude,information,db_battinf.tb_battinf.FBSDeviceId,db_battinf.tb_battinf.monvolstd " +
|
| | | " from web_site.tb_battmap_information,db_battinf.tb_battinf " +
|
| | | " where tb_battmap_information.StationId=db_battinf.tb_battinf.StationId " +
|
| | | " and tb_battmap_information.StationId in (" +
|
| | |
| | | binformation.setLatitude(rs.getDouble("latitude"));
|
| | | binformation.setInformation(rs.getString("information"));
|
| | | binformation.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | binformation.setMonvolstd(rs.getFloat("monvolstd")); //表明设备是2V还是12V
|
| | | list.add(binformation);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | int uid=page.getPageAll();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql="SELECT FOUND_ROWS() number";//存放总数
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_battmap_information.num,tb_battmap_information.StationId,tb_battmap_information.StationName,address,longitude,latitude,information,db_battinf.tb_battinf.FBSDeviceId,db_battinf.tb_battinf.station_install " +
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_battmap_information.num,tb_battmap_information.StationId,tb_battmap_information.StationName,address,longitude,latitude,information,db_battinf.tb_battinf.FBSDeviceId,db_battinf.tb_battinf.station_install,db_battinf.tb_battinf.monvolstd " +
|
| | | " from web_site.tb_battmap_information,db_battinf.tb_battinf " +
|
| | | " where tb_battmap_information.StationId=db_battinf.tb_battinf.StationId " +
|
| | | " and tb_battmap_information.StationId in (" +
|
| | |
| | | binformation.setInformation(rs.getString("information"));
|
| | | binformation.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | binformation.setInformation(rs.getString("station_install"));
|
| | | binformation.setMonvolstd(rs.getFloat("monvolstd")); //表明设备是2V还是12V
|
| | | Page p=new Page();
|
| | | binformation.setPage(p);
|
| | | list.add(binformation);
|
| | |
| | | });
|
| | | return list;
|
| | | }
|
| | | public List serchByInfo(Object obj) {
|
| | | //导航上续航不足3小时的个数
|
| | | public int serchxuhangNotInThree(Object obj) {
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql="select count(distinct tb_batt_endurance.deviceid) as nums from web_site.tb_batt_endurance " +
|
| | | " where endurance_actual_timelong<180 " +
|
| | | " and tb_batt_endurance.stationid in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.station_install=1) " ;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | int nums=rs.getInt("nums");
|
| | | list.add(nums);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int nums=0;//续航不足3小时数
|
| | | if(list!=null&&list.size()>0){
|
| | | nums=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return nums;
|
| | | }
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
| | |
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | | List<Integer> list=bimpl.serchByState_xuhang(uinf);
|
| | | /*List<Integer> list=bimpl.serchByState_xuhang(uinf);
|
| | | for (int num : list) {
|
| | | System.out.println(num);
|
| | | }
|
| | | }*/
|
| | | //System.out.println(list.size());
|
| | | int nums=bimpl.serchxuhangNotInThree(uinf);
|
| | | System.out.println(nums);
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | | private String stationName2;
|
| | | private String stationName3;
|
| | | private String stationName5;
|
| | | private float monvolstd; //设备是2v还是12的电池
|
| | | public BattMap_information() {
|
| | | super();
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return "BattMap_information [num=" + num + ", StationId=" + StationId
|
| | | + ", StationName=" + StationName + ", Address=" + Address
|
| | | + ", longitude=" + longitude + ", latitude=" + latitude
|
| | | + ", information=" + information + ", FBSDeviceId="
|
| | | + FBSDeviceId + ", page=" + page + ", stationName1="
|
| | | + stationName1 + ", stationName2=" + stationName2
|
| | | + ", stationName3=" + stationName3 + ", stationName5="
|
| | | + stationName5 + "]";
|
| | | }
|
| | |
|
| | |
|
| | | public String getStationName1() {
|
| | | return stationName1;
|
| | | }
|
| | |
| | |
|
| | |
|
| | |
|
| | | public float getMonvolstd() {
|
| | | return monvolstd;
|
| | | }
|
| | |
|
| | |
|
| | | public void setMonvolstd(float monvolstd) {
|
| | | this.monvolstd = monvolstd;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return "BattMap_information [num=" + num + ", StationId=" + StationId
|
| | | + ", StationName=" + StationName + ", Address=" + Address
|
| | | + ", longitude=" + longitude + ", latitude=" + latitude
|
| | | + ", information=" + information + ", FBSDeviceId="
|
| | | + FBSDeviceId + ", page=" + page + ", stationName1="
|
| | | + stationName1 + ", stationName2=" + stationName2
|
| | | + ", stationName3=" + stationName3 + ", stationName5="
|
| | | + stationName5 + ", monvolstd=" + monvolstd + "]";
|
| | | }
|
| | | |
| | |
|
| | | |
| | | |
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | return model;
|
| | | }
|
| | | //导航上续航不足3小时的个数
|
| | | public ServiceModel serchxuhangNotInThree(Object obj) {
|
| | | int nums=((Batt_enduranceImpl)dao).serchxuhangNotInThree(obj);
|
| | | model.setMsg("查询成功!");
|
| | | model.setSum(nums);
|
| | | return model;
|
| | | }
|
| | |
|
| | | }
|