Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | <link href="css/basic.css" rel="stylesheet">
|
| | | <link rel="stylesheet" href="css/BrdwMaint.css">
|
| | | <link rel="stylesheet" type="text/css" href="css/loading.css">
|
| | | |
| | | <link rel="stylesheet" type="text/css" href="css/dischargeplan_layout.css">
|
| | | <meta http-equiv="pragma" content="no-cache">
|
| | | <meta http-equiv="cache-control" content="no-cache">
|
| | | <meta http-equiv="expires" content="0">
|
| | |
| | | <td>省</td> <!-- 省 -->
|
| | | <td>市</td> <!-- 市 -->
|
| | | <td><s:text name="Computer_name"/></td> <!-- 机房名称 -->
|
| | | <td>续航类型</td> <!--续航类型 -->
|
| | | <td>续航时间</td>
|
| | | <td>掉站</td> |
| | | <td>实际续航时间</td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>
|
| | |
| | | </select>
|
| | | </td>
|
| | | <td>
|
| | | <select id="endurance_state">
|
| | | <option value=0>全部</option>
|
| | | <option value=1>实时续航</option>
|
| | | <option value=2>潜在续航</option>
|
| | | <select id="is_stand">
|
| | | <option value=100>全部</option>
|
| | | <option value=1>是</option>
|
| | | <option value=0>否</option>
|
| | | </select>
|
| | | </td>
|
| | | <td>
|
| | | <select id="endurance_timelong">
|
| | | <select id="actual_timelong">
|
| | | <option value =0>全部</option>
|
| | | <option value=60>续航时间小于1小时</option>
|
| | | <option value=120>续航时间小于2小时</option>
|
| | | <option value=180>续航时间小于3小时</option>
|
| | | <option value=60>实际续航时间小于1小时</option>
|
| | | <option value=120>实际续航时间小于2小时</option>
|
| | | <option value=180>实际续航时间小于3小时</option>
|
| | | </select>
|
| | | </td>
|
| | |
|
| | |
| | | var tblStatus = new Array(); // 表格状态数组
|
| | | var tblOptsHd = new Array(); // 表格选项头部
|
| | | var tblOptsBd = new Array(); // 表格选项数组
|
| | | arrTh = ['设备ID', '机房名称', '续航状态 ','实际容量', '标称容量','实际电流','续航时间(min)'];
|
| | | arrTh = ['设备ID', '机房名称', '实际容量', '标称容量','实际电流','实际续航时间(min)', '理论续航时间(min)', '是否掉站'];
|
| | | //arrTh = ['<s:text name="Maintenance_area"/>', '<s:text name="Computer_name"/>', '<s:text name="Nominal_capacity"/>(AH)', '<s:text name="Actual_capacity"/>(AH)','<s:text name="Residual_capacity"/>(AH)', '<s:text name="real_time"/><s:text name="Current"/>(A)', '<s:text name="Power_cut"/><s:text name="Endurance"/><s:text name="Time"/>'];
|
| | | //tblOptsHd = ['编号', '选项', '是否选择'];
|
| | | tblOptsHd = ['<s:text name="Number"/>', '<s:text name="Options"/>', '<s:text name="IsChecked"/>'];
|
| | |
| | | var _attr = {
|
| | | StationId: __data.StationId
|
| | | };
|
| | | var tmp = getOptionsData(__data.StationName3, __data.StationName3, __data, _attr);
|
| | | var tmp = getOptionsData(__data.StationName3, __data.StationName, __data, _attr);
|
| | | optsList.push(tmp);
|
| | | }
|
| | |
|
| | |
| | | //构造查询条件
|
| | | function createSearchParam(){
|
| | | //alert($('#endu_type').val());
|
| | | //Page.pageCurr = $('#number').val();
|
| | | var temp = {
|
| | | num:3, //电池状态
|
| | | BattGroupId:$("#endu_type").val(), //查询数据 |
| | | StationName:$('#station_name').val(), //机房名
|
| | | StationName2:$('#city').val(), //市
|
| | | StationName1:$('#station_name1').val(), //维护区
|
| | | BattProductDate:$('#starttime').val()+" 00:00:00",
|
| | | BattProductDate1:$('#endtime').val()+" 23:59:59", //生产日期段
|
| | | page:{
|
| | | pageSize:$('#number').val(),
|
| | | pageCurr:Page.pageCurr,
|
| | | },
|
| | | stationName:$('#station_name').val(), //机房名
|
| | | stationName2:$('#city').val(), //市
|
| | | stationName1:$('#station_name1').val(), //省
|
| | | is_out_stand:$('#is_stand').val(), //是否掉站
|
| | | endurance_actual_timelong:$('#actual_timelong').val(), //实际
|
| | | };
|
| | | //console.info(temp);
|
| | | return temp;
|
| | | }
|
| | |
|
| | | function searchBattLife(){
|
| | | var temp = createSearchParam();
|
| | | var json = JSON.stringify(temp);
|
| | | var arr = new Array();
|
| | | $.ajax({
|
| | | type:"post",
|
| | | url:"Batt_enduranceAction!serchByCondition",
|
| | | async:true,
|
| | | datatype:'json',
|
| | | data:"json="+json,
|
| | | success:function(data){
|
| | | //console.info(data);
|
| | | var data = JSON.parse(data.result); |
| | | //console.info(data);
|
| | | if(data.code==1&&data.data.length>0){
|
| | | data=data.data;
|
| | | var index = 0;
|
| | | var ArryTb= new Array();
|
| | | for(i=0;i<data.length;i++){
|
| | | arrTd[index++]=data[i].deviceId;
|
| | | arrTd[index++]=data[i].stationName;
|
| | | arrTd[index++]=data[i].real_cap;
|
| | | arrTd[index++]=data[i].moncapstd;
|
| | | arrTd[index++]=data[i].real_curr;
|
| | | arrTd[index++]=data[i].endurance_actual_timelong;
|
| | | arrTd[index++]=data[i].endurance_theory_timelong;
|
| | | if(data[i].is_out_stand==0){ //未掉站(绿色)
|
| | | arrTd[index++]='<div class="status effect" ></div>';
|
| | | }
|
| | | else if(data[i].is_out_stand==1){
|
| | | arrTd[index++]='<div class="status no-effect"></div>'; |
| | | } |
| | | //arrTd[index++]=data[i].is_out_stand;
|
| | | } |
| | | Page.pageAll = data[data.length-1].page.pageAll;
|
| | | var pageNum=Math.ceil(Page.pageAll/Page.pageSize);
|
| | | $('#total').text(Page.pageAll);
|
| | | $('#current').text(Page.pageCurr+"/"+pageNum);
|
| | | createAllTbl(tblHd, tblBd, arrTh, arrTd, tblStatus);
|
| | | }
|
| | |
|
| | | }
|
| | | })
|
| | | }
|
| | | //首页
|
| | | $('#home').click(function(){
|
| | | if(Page!=undefined){
|
| | |
| | | function exprotTable(eleTh,eleTd,eleform,eleTh_Text,eleTd_Text){
|
| | | //alert("导出");
|
| | | var ArrTh=new Array();
|
| | | var a=0;
|
| | | for(var i=0;i<eleTh.length;i++)
|
| | | {
|
| | | ArrTh[i]=eleTh.eq(i).text();
|
| | |
| | | var ArrTd="";
|
| | | for(var i=0;i<eleTd.length;i++)
|
| | | {
|
| | | if((i+1)%eleTh.length==0){
|
| | | //console.info(eleTd.eq(i).text());
|
| | | if(eleTd.eq(i).find('div class').is('status no-effect')){
|
| | | ArrTd+="已掉站";
|
| | | }else{
|
| | | ArrTd+="未掉站";
|
| | | }
|
| | | ArrTd+=eleTd.eq(i).text()+"&";
|
| | | }else{
|
| | | ArrTd+=eleTd.eq(i).text()+"&";
|
| | | }
|
| | | }
|
| | | eleTh_Text.attr('value',ArrTh);
|
| | | eleTd_Text.attr('value',ArrTd);
|
| | |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binformation.getStationId()}, new BattMap_informationImpl());
|
| | | return list;
|
| | | }
|
| | | |
| | | //地图上根据机房名称查询经纬度
|
| | | public List serchTudeByStationName(Object obj){
|
| | | BattMap_information binformation=(BattMap_information) obj;
|
| | | String sql="select num, StationId,StationName,address,longitude,latitude,information from web_site.tb_battmap_information " +
|
| | | " where StationName like ?";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binformation.getStationName()}, new BattMap_informationImpl());
|
| | | return list;
|
| | | }
|
| | | public static void main(String[] args) {
|
| | | BattMap_informationImpl bimpl=new BattMap_informationImpl();
|
| | | Batt_Maint_Dealarm bmd=new Batt_Maint_Dealarm();
|
| | |
| | | package com.fgkj.dao.impl;
|
| | |
|
| | | import java.sql.Connection;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | | import java.util.ArrayList;
|
| | |
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.LimitNumberFactory;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.Batt_endurance;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.mysql.fabric.xmlrpc.base.Array;
|
| | |
|
| | | public class Batt_enduranceImpl implements BaseDAO,CallBack{
|
| | |
| | | //续航时间的查询
|
| | | public List serchByCondition(Object obj) {
|
| | | Batt_endurance bendurance=(Batt_endurance) obj;
|
| | | String sql="select distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,endurance_state,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_timelong " +
|
| | | ",db_battinf.tb_battinf.StationName " +
|
| | | Page page=bendurance.getPage();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_theory_timelong,endurance_actual_timelong,is_out_stand " +
|
| | | ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2 " +
|
| | | " from web_site.tb_batt_endurance,db_battinf.tb_battinf " +
|
| | | " where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid " ;
|
| | | //机房筛选
|
| | | String stationSql=" and db_battinf.tb_battinf.StationName like ?";
|
| | | String stationSql=" and db_battinf.tb_battinf.StationName like ? and db_battinf.tb_battinf.StationName1 like ? and db_battinf.tb_battinf.StationName2 like ?";
|
| | | sql+=stationSql;
|
| | | //续航状态
|
| | | String enduranceSqlT=" and endurance_state=? ";
|
| | | String enduranceSqlF=" and endurance_state!=? ";//全部
|
| | | if(bendurance.getEndurance_state()==0){
|
| | | sql+=enduranceSqlF;
|
| | | }else{
|
| | | sql+=enduranceSqlT;
|
| | | }
|
| | | //续航时间
|
| | | String timelongSqlT=" and endurance_timelong<=? ";//小于某一时间
|
| | | String timelongSqlF=" and endurance_timelong!=?";//全部
|
| | | if(bendurance.getEndurance_timelong()==0){
|
| | | //实际续航时间
|
| | | String timelongSqlT=" and endurance_actual_timelong<=? ";//小于某一时间
|
| | | String timelongSqlF=" and endurance_actual_timelong>-1? ";//全部
|
| | | if(bendurance.getEndurance_actual_timelong()==0){
|
| | | sql+=timelongSqlF;
|
| | | }else{
|
| | | sql+=timelongSqlT;
|
| | | }
|
| | | //是否掉站
|
| | | String is_out_standSqlT=" and is_out_stand!=? ";//全部
|
| | | String is_out_standSqlF=" and is_out_stand=? ";
|
| | | if(bendurance.getIs_out_stand()==100){
|
| | | sql+=is_out_standSqlT;
|
| | | }else{
|
| | | sql+=is_out_standSqlF;
|
| | | }
|
| | | //排序时间
|
| | | String orderSql=" order by endurance_timelong asc";
|
| | | String orderSql=" order by endurance_actual_timelong asc ";
|
| | | sql+=orderSql;
|
| | | //分页
|
| | | String limitSql=" limit ?,? ";
|
| | | sql+=limitSql;
|
| | | |
| | | |
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+bendurance.getNote()+"%",bendurance.getEndurance_state(),bendurance.getEndurance_timelong()}, new CallBack() {
|
| | | List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
|
| | | ,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | b.setNum(rs.getInt("num"));
|
| | | b.setDeviceId(rs.getInt("deviceId"));
|
| | | b.setStationid(rs.getString("stationid"));
|
| | | b.setEndurance_state(rs.getInt("endurance_state"));
|
| | | b.setReal_cap(rs.getFloat("real_cap"));
|
| | | b.setMoncapstd(rs.getFloat("moncapstd"));
|
| | | b.setReal_curr(rs.getFloat("real_curr"));
|
| | | b.setEndurance_timelong(rs.getInt("endurance_timelong"));
|
| | | b.setNote(rs.getString("stationname"));
|
| | | b.setEndurance_theory_timelong(rs.getInt("endurance_theory_timelong"));
|
| | | b.setEndurance_actual_timelong(rs.getInt("endurance_actual_timelong"));
|
| | | b.setStationName(rs.getString("stationname"));
|
| | | b.setStationName1(rs.getString("stationname1"));
|
| | | b.setStationName2(rs.getString("stationname2"));
|
| | | Page p=new Page();
|
| | | b.setPage(p);
|
| | | list.add(b);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | return list;
|
| | | }
|
| | | });
|
| | | //去掉limit条件后的总数
|
| | | int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
|
| | | //System.out.println("number: "+number);
|
| | | if(list!=null&&list.size()>0){
|
| | | list.get(list.size()-1).getPage().setPageAll(number);
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | |
| | | public static void main(String[] args) {
|
| | | Batt_enduranceImpl bimpl=new Batt_enduranceImpl();
|
| | | Batt_endurance ben=new Batt_endurance();
|
| | | ben.setNote("");
|
| | | ben.setEndurance_state(0);
|
| | | ben.setEndurance_timelong(0);
|
| | | List list=bimpl.serchByCondition(ben);
|
| | | ben.setStationName("");
|
| | | ben.setStationName1("");
|
| | | ben.setStationName2("");
|
| | | ben.setEndurance_actual_timelong(120);
|
| | | ben.setIs_out_stand(100);
|
| | | Page page=new Page();
|
| | | page.setPageCurr(1);
|
| | | page.setPageSize(10);
|
| | | ben.setPage(page);
|
| | | List<Batt_endurance> list=bimpl.serchByCondition(ben);
|
| | | for (Batt_endurance b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | | System.out.println(list.size());
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | private int num;
|
| | | private int deviceId;
|
| | | private String stationid;
|
| | | private int endurance_state;
|
| | | private float real_cap;
|
| | | private float moncapstd;
|
| | | private float real_curr;
|
| | | private int endurance_timelong;
|
| | | private int endurance_theory_timelong;//理论
|
| | | private int endurance_actual_timelong;//实际
|
| | | private int is_out_stand;
|
| | | private String note;
|
| | | private String stationName;
|
| | | private String stationName1;//省级
|
| | | private String stationName2;//市级
|
| | | |
| | | private Page page;//分页
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | |
| | | }
|
| | | public void setStationid(String stationid) {
|
| | | this.stationid = stationid;
|
| | | }
|
| | | public int getEndurance_state() {
|
| | | return endurance_state;
|
| | | }
|
| | | public void setEndurance_state(int endurance_state) {
|
| | | this.endurance_state = endurance_state;
|
| | | }
|
| | | public float getReal_cap() {
|
| | | return real_cap;
|
| | |
| | | public void setReal_curr(float real_curr) {
|
| | | this.real_curr = real_curr;
|
| | | }
|
| | | public int getEndurance_timelong() {
|
| | | return endurance_timelong;
|
| | | |
| | | public int getEndurance_theory_timelong() {
|
| | | return endurance_theory_timelong;
|
| | | }
|
| | | public void setEndurance_timelong(int endurance_timelong) {
|
| | | this.endurance_timelong = endurance_timelong;
|
| | | public void setEndurance_theory_timelong(int endurance_theory_timelong) {
|
| | | this.endurance_theory_timelong = endurance_theory_timelong;
|
| | | }
|
| | | public int getEndurance_actual_timelong() {
|
| | | return endurance_actual_timelong;
|
| | | }
|
| | | public void setEndurance_actual_timelong(int endurance_actual_timelong) {
|
| | | this.endurance_actual_timelong = endurance_actual_timelong;
|
| | | }
|
| | | public int getIs_out_stand() {
|
| | | return is_out_stand;
|
| | | }
|
| | | public void setIs_out_stand(int is_out_stand) {
|
| | | this.is_out_stand = is_out_stand;
|
| | | }
|
| | | public String getNote() {
|
| | | return note;
|
| | |
| | | public void setNote(String note) {
|
| | | this.note = note;
|
| | | }
|
| | | public String getStationName() {
|
| | | return stationName;
|
| | | }
|
| | | public void setStationName(String stationName) {
|
| | | this.stationName = stationName;
|
| | | }
|
| | | public String getStationName1() {
|
| | | return stationName1;
|
| | | }
|
| | | public void setStationName1(String stationName1) {
|
| | | this.stationName1 = stationName1;
|
| | | }
|
| | | public String getStationName2() {
|
| | | return stationName2;
|
| | | }
|
| | | public void setStationName2(String stationName2) {
|
| | | this.stationName2 = stationName2;
|
| | | }
|
| | | public Page getPage() {
|
| | | return page;
|
| | | }
|
| | | public void setPage(Page page) {
|
| | | this.page = page;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Batt_endurance [num=" + num + ", deviceId=" + deviceId
|
| | | + ", stationid=" + stationid + ", endurance_state="
|
| | | + endurance_state + ", real_cap=" + real_cap + ", moncapstd="
|
| | | + moncapstd + ", real_curr=" + real_curr
|
| | | + ", endurance_timelong=" + endurance_timelong + ", note="
|
| | | + note + "]";
|
| | | + ", stationid=" + stationid + ", real_cap=" + real_cap
|
| | | + ", moncapstd=" + moncapstd + ", real_curr=" + real_curr
|
| | | + ", endurance_theory_timelong=" + endurance_theory_timelong
|
| | | + ", endurance_actual_timelong=" + endurance_actual_timelong
|
| | | + ", is_out_stand=" + is_out_stand + ", note=" + note
|
| | | + ", stationName=" + stationName + ", stationName1="
|
| | | + stationName1 + ", stationName2=" + stationName2 + ", page="
|
| | | + page + "]";
|
| | | }
|
| | | |
| | | |
| | |
|
| | |
|
| | | }
|