Merge branch 'dev_lxw' of https://didiyu@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | <filter-mapping>
|
| | | <filter-name>LoginFilter</filter-name>
|
| | | <url-pattern>*.jsp</url-pattern>
|
| | | <url-pattern>*.html</url-pattern>
|
| | | </filter-mapping>
|
| | | <filter>
|
| | | <filter-name>HotlinkFilter</filter-name>
|
| | |
| | | if(len) {
|
| | | _rsData = tOptions.data[len-1];
|
| | | }
|
| | | |
| | | // 打开面板设置新建电池组个数
|
| | | layer.open({
|
| | | type: 1
|
| | | ,title: '选择新建电池组个数'
|
| | | ,content: addGroupContent
|
| | | ,fixed: true
|
| | | ,resize: false
|
| | | ,btn:['确定', '取消']
|
| | | ,yes: function(index) {
|
| | | var groupNum = $('#addGroupnum').val();
|
| | | layer.close(index);
|
| | | // 生成数组
|
| | | var _arr = [];
|
| | | for(var i=0; i<groupNum; i++) {
|
| | | _arr.push(i+1);
|
| | | getMaxDevId(function(id) {
|
| | | // 打开面板设置新建电池组个数
|
| | | layer.open({
|
| | | type: 1
|
| | | ,title: '选择新建电池组个数'
|
| | | ,content: addGroupContent
|
| | | ,fixed: true
|
| | | ,resize: false
|
| | | ,btn:['确定', '取消']
|
| | | ,yes: function(index) {
|
| | | var groupNum = $('#addGroupnum').val();
|
| | | layer.close(index);
|
| | | // 生成数组
|
| | | var _arr = [];
|
| | | for(var i=0; i<groupNum; i++) {
|
| | | _arr.push(i+1);
|
| | | }
|
| | | |
| | | _rsData.addGroupNum = _arr;
|
| | | _rsData.FBSDeviceId = id;
|
| | | $('#iframeEdit').data('data', _rsData);
|
| | | |
| | | iframePopup = layer.open({
|
| | | type: 2
|
| | | ,title: '新建电池组'
|
| | | ,area:['1200px', '520px']
|
| | | ,resize: false
|
| | | ,content: 'iframe/batt-info-add.html'
|
| | | });
|
| | | }
|
| | | |
| | | _rsData.addGroupNum = _arr;
|
| | | $('#iframeEdit').data('data', _rsData);
|
| | | |
| | | iframePopup = layer.open({
|
| | | type: 2
|
| | | ,title: '新建电池组'
|
| | | ,area:['1200px', '520px']
|
| | | ,resize: false
|
| | | ,content: 'iframe/batt-info-add.html'
|
| | | });
|
| | | }
|
| | | });
|
| | | });
|
| | | }); |
| | | |
| | | });
|
| | |
|
| | | // 获取最大设备id
|
| | | function getMaxDevId(callback) {
|
| | | var load = layer.load(1);
|
| | | // 查询后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: 'BattInfAction!searchmaxdev_id'
|
| | | ,data:null
|
| | | ,dataType: 'json'
|
| | | ,success:function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | if(rs.data.length != 0) {
|
| | | if(isFunction(callback)) {
|
| | | callback(rs.data);
|
| | | }
|
| | | }else {
|
| | | layer.msg('计算设备id失败!')
|
| | | }
|
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | |
| | | });
|
| | | }
|
| | | |
| | |
|
| | | // 查询电池组信息
|
| | | function search(temp, newLoad) {
|
| | |
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备ID<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FBSDeviceId" lay-verify="devid" id="devid" autocomplete="off" class="layui-input" value="{{= d.FBSDeviceId }}">
|
| | | <input type="text" name="FBSDeviceId" lay-verify="devid" id="devid" autocomplete="off" disabled="" class="layui-input layui-bg-gray" value="{{= d.FBSDeviceId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | |
|
| | | var battInfoTpl = $('#battInfoTpl').html();
|
| | | var editInfo = parent.$('#iframeEdit').data('data');
|
| | | |
| | | |
| | | editInfo.FbsDeviceIp = getDevIp(editInfo.FBSDeviceId);
|
| | | //console.log(editInfo);
|
| | | var data = {
|
| | | StationId: '4011100'
|
| | |
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <title>电池组信息配置模板</title>
|
| | | <title>电池组安装提交申请</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <meta name="apple-mobile-web-app-capable" content="yes">
|
| | | <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <title>电池组安装提交申请</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <meta name="apple-mobile-web-app-capable" content="yes">
|
| | | <meta name="apple-mobile-web-app-status-bar-style" content="black">
|
| | | <link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
|
| | | <link href="mobilCss/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
|
| | | <link href="mobilCss/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
|
| | | <link rel="stylesheet" type="text/css" href="css/tbl.css">
|
| | | <script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
| | | <script src="mobilJs/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
|
| | | <script src="mobilJs/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
|
| | | <script src="mobilJs/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
|
| | | <script src="mobilJs/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
|
| | | <script type="text/javascript" src="js/tbl.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/base.js"></script>
|
| | | <script type="text/javascript">
|
| | | function creatAllView(num){
|
| | | var allString=''
|
| | | ,i=0;
|
| | | if(num>4){return false}
|
| | | for(i=0;i<num;i++){
|
| | | allString+=creatBattView(i);
|
| | | }
|
| | | $("#battdata").html(allString); |
| | | } |
| | | |
| | | |
| | | function creatBattView(index){
|
| | | var count=index+1
|
| | | ,battTitle='<div>'+'<h1 class="hbg">'+'电池组'+count+'</h1>'+
|
| | | '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'设备索引'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select>'
|
| | | ,allOption=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>' |
| | | ,battName='<tr>'+'<td>'+'电池组名称'+'</td>'+'<td>'+'<input type="text" '+'id='+'battname'+index+' data-mini="true"'+'value='+'电池组'+count+' />'+'</td>'+'</tr>'+'</tbody>'+'</table>'+'</div>';
|
| | | return battTitle+allOption+battName; |
| | | |
| | | } |
| | | |
| | | function selectedIndex(index){
|
| | | var selected='',
|
| | | i=0;
|
| | | for(i=0;i<4;i++){ |
| | | if(i==index){selected+='<option '+'value='+i+' selected'+'>'+i+'</option>';continue;}
|
| | | selected+='<option value='+i+'>'+i+'</option>';
|
| | | |
| | | }
|
| | | |
| | | return selected; |
| | | } |
| | | var temp = getCookie("eleparm");
|
| | | //console.info(temp);
|
| | | temp=JSON.parse(temp);
|
| | | console.info(temp);
|
| | | console.info(temp[30]);
|
| | | console.info(temp[33]);
|
| | | var suoyin = temp[33];
|
| | | |
| | | $(function(){creatAllView(suoyin)});
|
| | | </script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | <style type="text/css"> |
| | | |
| | | table {
|
| | | margin-top:.5em;
|
| | | border-collapse:separate; |
| | | border-spacing:0 .5em;
|
| | | }
|
| | | |
| | | tbody tr td{
|
| | | overflow: hidden;
|
| | | text-overflow:ellipsis;
|
| | | white-space: nowrap;
|
| | | }
|
| | | .uncheck{
|
| | | background-color: #dddddd38!important;
|
| | | color: #bdbdbdc4!important;
|
| | | }
|
| | | .ui-btn-icon-right {
|
| | | padding-right: 8.5em;
|
| | | }
|
| | | .hbg{
|
| | | background-color:#ddd9;
|
| | | }
|
| | | #battdata {
|
| | | background-color:#dddddd54
|
| | | }
|
| | | .ui-select .ui-btn select{
|
| | | width:77%;
|
| | | }
|
| | | </style>
|
| | | <link rel="stylesheet" href="css/fgpanel.css">
|
| | | </head>
|
| | | <body>
|
| | | <div data-role="page">
|
| | | |
| | | <!-- 头部内容 -->
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="ele-param1.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
| | | <h1>电池组申请安装</h1>
|
| | | |
| | | </div>
|
| | | <!-- 主体内容 -->
|
| | | <div data-role="main">
|
| | | <!-- <div class="set-option"> -->
|
| | | <table class="layout-set">
|
| | | <tbody>
|
| | | <tr>
|
| | | <td>机房编号</td>
|
| | | <td>
|
| | | <input type="text" id="StationId" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>省</td>
|
| | | <td>
|
| | | <input type="text" id="station_name1" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>城市</td>
|
| | | <td>
|
| | | <input type="text" id="city" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>区县</td>
|
| | | <td>
|
| | | <input type="text" id="county" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>机房名称</td>
|
| | | <td>
|
| | | <input type="text" id="StationName3" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>设备名称</td>
|
| | | <td>
|
| | | <input type="text" id="StationName4" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>机房IP</td>
|
| | | <td>
|
| | | <input type="text" id="StationIp" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>FBS设备ID(重要)</td>
|
| | | <td>
|
| | | <input type="text" id="FBSDeviceId" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>FBS设备IP(重要)</td>
|
| | | <td>
|
| | | <input type="text" id="FbsDeviceIp" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>子网掩码</td>
|
| | | <td>
|
| | | <input type="text" id="FbsDeviceIp_YM" class="unable" data-mini="true" value="456"/>
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>网关</td>
|
| | | <td>
|
| | | <input type="text" id="FbsDeviceIp_WG" class="unable" data-mini="true" value="456"/>
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>FBS设备名称</td>
|
| | | <td>
|
| | | <input type="text" id="FBSDeviceName" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>FBS电池索引(0-3)</td>
|
| | | <td>
|
| | | <input type="text" id="GroupIndexInFBSDevice" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池组ID</td>
|
| | | <td>
|
| | | <input type="text" readonly unselectable="on" value="123" id="BattGroupId" class="uncheck" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>机房内电池组编号</td>
|
| | | <td>
|
| | | <input type="text" readonly unselectable="on" value="123" id="BattGroupNum" class="uncheck" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池组名称</td>
|
| | | <td>
|
| | | <input type="text" id="BattGroupName" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>浮充电压阀值(V)</td>
|
| | | <td>
|
| | | <input type="text" id="FloatVolLevel" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>离线电压阀值(V)</td>
|
| | | <td>
|
| | | <input type="text" id="OfflineVolLevel" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>浮充电流阀值(A)</td>
|
| | | <td>
|
| | | <input type="text" id="BattFloatCurrent" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>单体数量</td>
|
| | | <td>
|
| | | <input type="text" id="MonCount" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>标称容量(AH)</td>
|
| | | <td>
|
| | | <input type="text" id="MonCapStd" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>标称单体电压(V)</td>
|
| | | <td>
|
| | | <input type="text" id="MonVolStd" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>标称单体内阻(mΩ)</td>
|
| | | <td>
|
| | | <input type="text" id="MonResStd" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>标称单体电导</td>
|
| | | <td>
|
| | | <input type="text" id="MonSerStd" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>单体电压次低偏移量(V)</td>
|
| | | <td>
|
| | | <input type="text" id="MonVolLowToAvg" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>负载电流(A)</td>
|
| | | <td>
|
| | | <input type="text" id="Load_curr" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>最大核容电流(A)</td>
|
| | | <td>
|
| | | <input type="text" id="DisCurrMax" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>基站号码</td>
|
| | | <td>
|
| | | <input type="text" id="station_phone" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池品牌</td>
|
| | | <td>
|
| | | <input type="text" id="BattProducer" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池型号</td>
|
| | | <td>
|
| | | <input type="text" id="BattModel" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>电池生产日期</td>
|
| | | <td>
|
| | | <input id="startTestrecord" type="text" name="appDate" class="appDatefir" value="2000-01-01" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>投入使用日期 </td>
|
| | | <td>
|
| | | <input id="endTestrecord" type="text" name="appDate" class="appDatesec" value="2017-01-01" />
|
| | | </td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td>安装人员</td>
|
| | | <td>
|
| | | <input type="text" id="install_user" data-mini="true" />
|
| | | </td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | <!-- </div> -->
|
| | | <div id="battdata">
|
| | | <!-- <div>
|
| | | <h1 class="hbg">电池组1</h1>
|
| | | <table class="layout-set"> |
| | | <tbody>
|
| | | <tr>
|
| | | <td>设备索引</td>
|
| | | <td>
|
| | | <fieldset data-role="controlgroup" data-type="horizontal"> |
| | | <select>
|
| | | <option value="">0</option>
|
| | | <option value="mon">1</option>
|
| | | <option value="mon">2</option>
|
| | | <option value="mon">3</option>
|
| | | |
| | | </select>
|
| | | </fieldset> |
| | | </td> |
| | | </tr>
|
| | | <tr>
|
| | | <td>电池组名称</td>
|
| | | <td><input type="text" id="" data-mini="true" /></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div> -->
|
| | | </div> |
| | | |
| | | |
| | | </div>
|
| | | |
| | | <div data-role="footer" data-position="fixed" data-theme="a"> |
| | | <div data-role="navbar">
|
| | | <ul>
|
| | | <li><a href="#yourPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-check" data-position-to="window" data-icon="check" data-role="button">确定</a></li>
|
| | | <li><a href="" id="cancel" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-delete" data-position-to="window" data-icon="delete" data-role="button">取消</a></li>
|
| | | </ul>
|
| | | </div> |
| | | </div> |
| | | <div data-role="popup" id="yourPopup" class="ui-content" data-overlay-theme="b">
|
| | | <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">关闭</a>
|
| | | <a href="" data-rel="back" id="sure" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-check" >提交</a>
|
| | | <a href="" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-delete" >放弃</a>
|
| | | </div> |
| | | </div>
|
| | | </body>
|
| | |
|
| | |
|
| | | <script type="text/javascript"> |
| | | $(function () {
|
| | | //setTimes($("#startTestrecord"),'2000-01-01');
|
| | | //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
|
| | | installstartdata(temp);
|
| | | |
| | | });
|
| | | |
| | | function installstartdata(temp){
|
| | | //$("#StationId").value=temp[0];
|
| | | //var t=document.getElementById("station_name1");
|
| | | document.getElementById("StationId").value = temp[0];
|
| | | document.getElementById("station_name1").value = temp[1];
|
| | | document.getElementById("city").value = temp[2]; //市
|
| | | document.getElementById("county").value = temp[3]; //区县
|
| | | document.getElementById("StationName3").value = temp[4]; //机房名称
|
| | | document.getElementById("StationName4").value = temp[5]; //设备名称
|
| | | document.getElementById("StationIp").value = temp[6]; //设备IP
|
| | | document.getElementById("FBSDeviceId").value = temp[7];
|
| | | document.getElementById("FbsDeviceIp").value = temp[8];
|
| | | document.getElementById("FbsDeviceIp_YM").value = temp[9];
|
| | | document.getElementById("FbsDeviceIp_WG").value = temp[10];
|
| | | document.getElementById("FBSDeviceName").value = temp[11];
|
| | | document.getElementById("GroupIndexInFBSDevice").value = temp[12];
|
| | | document.getElementById("BattGroupId").value = temp[13];
|
| | | document.getElementById("BattGroupNum").value = temp[14];
|
| | | document.getElementById("BattGroupName").value = temp[15];
|
| | | document.getElementById("FloatVolLevel").value = temp[16];
|
| | | document.getElementById("OfflineVolLevel").value = temp[17];
|
| | | document.getElementById("BattFloatCurrent").value = temp[18];
|
| | | document.getElementById("MonCount").value = temp[19];
|
| | | document.getElementById("MonCapStd").value = temp[20];
|
| | | document.getElementById("MonVolStd").value = temp[21];
|
| | | document.getElementById("MonResStd").value = temp[22];
|
| | | document.getElementById("MonSerStd").value = temp[23];
|
| | | document.getElementById("MonVolLowToAvg").value = temp[24];
|
| | | document.getElementById("Load_curr").value = temp[25];
|
| | | document.getElementById("DisCurrMax").value = temp[26];
|
| | | document.getElementById("station_phone").value = temp[27];
|
| | | document.getElementById("BattProducer").value = temp[28];
|
| | | document.getElementById("BattModel").value = temp[29];
|
| | | //document.getElementById("startTestrecord").value = temp[30];
|
| | | //document.getElementById("endTestrecord").value = temp[31];
|
| | | setTimes($("#startTestrecord"),temp[30]);
|
| | | setTimes($("#endTestrecord"),temp[31]);
|
| | | document.getElementById("install_user").value = temp[32];
|
| | | }
|
| | |
|
| | | |
| | | // 格式化提交后台信息的对象数组并返回 单个修改,手机方式不修改多个电池组
|
| | | function getUpdateArr(){
|
| | | var arr = new Array();
|
| | | var obj = new Object();
|
| | | obj.StationId = $("#StationId").val(); // 机房编号
|
| | | obj.StationName = ($("#station_name1").val()+"-"+$("#city").val()+"-"+$("#StationName3").val()+"-"+$("#StationName4").val()); // 拼接机房名称
|
| | | obj.StationName1 = $("#station_name1").val(); // 省
|
| | | obj.StationName2 = $("#city").val(); // 市
|
| | | obj.StationName5 = $("#county").val(); // 区/县
|
| | | obj.StationName3 = $("#StationName3").val(); // 机房名称
|
| | | obj.StationName4 = $("#StationName4").val(); // 设备名称
|
| | | obj.StationIp = $("#StationIp").val(); //机房ip
|
| | | obj.FBSDeviceId = $("#FBSDeviceId").val(); //设备id
|
| | | obj.FbsDeviceIp = $("#FbsDeviceIp").val(); //设备ip
|
| | | obj.FbsDeviceIp_YM = $("#FbsDeviceIp_YM").val(); // 设备掩码
|
| | | obj.FbsDeviceIp_WG = $("#FbsDeviceIp_WG").val(); // 网关
|
| | | obj.FBSDeviceName = $("#FBSDeviceName").val(); //设备名称
|
| | | obj.GroupIndexInFBSDevice = $("#GroupIndexInFBSDevice").val(); //fbs设备索引
|
| | | obj.BattGroupId = $("#BattGroupId").val(); //电池组id
|
| | | obj.BattGroupNum = $("#BattGroupNum").val(); //机房内电池组编号
|
| | | obj.BattGroupName = $("#BattGroupName").val(); //电池组名称
|
| | | obj.FloatVolLevel = $("#FloatVolLevel").val(); //浮充电压阀值
|
| | | obj.OfflineVolLevel = $("#OfflineVolLevel").val(); //离线电压阀值
|
| | | obj.BattFloatCurrent = $("#BattFloatCurrent").val(); //浮充电流阀值
|
| | | obj.MonCount = $("#MonCount").val(); //单体数量
|
| | | obj.MonCapStd = $("#MonCapStd").val(); //标称容量
|
| | | obj.MonVolStd = $("#MonVolStd").val(); //标称电压
|
| | | obj.MonResStd = $("#MonResStd").val(); //标称内阻
|
| | | obj.MonSerStd = $("#MonSerStd").val(); //标称电导
|
| | | obj.MonVolLowToAvg = $("#MonVolLowToAvg").val(); //单体电压次低偏移量
|
| | | |
| | | |
| | | obj.Load_curr = $("#Load_curr").val(); //负载电流
|
| | | obj.DisCurrMax = $("#DisCurrMax").val(); //最大核容电流
|
| | | obj.station_phone = $("#station_phone").val(); //基站号码
|
| | | |
| | | obj.BattProducer = $("#BattProducer").val(); //电池品牌
|
| | | obj.BattModel = $("#BattModel").val(); //电池型号
|
| | | obj.BattProductDate = $("#startTestrecord").val(); //电池生产日期
|
| | | obj.BattInUseDate = $("#endTestrecord").val(); //电池使用日期
|
| | | obj.install_user = $("#install_user").val(); //安装人员
|
| | | arr.push(obj);
|
| | | console.info(arr);
|
| | | return arr;
|
| | | }
|
| | | |
| | | </script> |
| | | <script type="text/javascript"> |
| | | $(function(){
|
| | | $(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
|
| | | $("#sure").click(function(){
|
| | | if(temp[33]&&temp[33]=="new"){
|
| | | addBatt();
|
| | | }else{
|
| | | editParm();
|
| | | } |
| | | function backpage(){window.location.href="ele-param1.html";}
|
| | | setTimeout(backpage,500); |
| | | });
|
| | | $("#cancel").click(function(){
|
| | | window.location.href="ele-param1.html";
|
| | | });
|
| | | });
|
| | | function editParm(){
|
| | | var parm = getUpdateArr(); |
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!update", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(parm), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | console.info(model);
|
| | | if(model.code ==1){
|
| | | alert("修改成功");
|
| | | }else{
|
| | | alert("修改失败!");
|
| | | } |
| | | },
|
| | | error:function(){
|
| | | alert("修改电池组失败!");
|
| | | }
|
| | | });
|
| | | }
|
| | | function addBatt(){
|
| | | var parm = getUpdateArr(); |
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!add", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(parm), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | //console.info(model);
|
| | | if(model.code ==1){
|
| | | alert("添加电池组成功!");
|
| | | }else{
|
| | | alert("添加电池组失败!");
|
| | | } |
| | | },
|
| | | error:function(){
|
| | | alert("添加电池组发生错误!");
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | /* 操作成功 |
| | | $('#changeSuc').popup('open');
|
| | | 操作失败
|
| | | $('#changeErr').popup('open'); */
|
| | | </script>
|
| | | </html> |
| | |
| | | $(document).ready(function(){
|
| | | setCookie('batt', '');
|
| | | //temp = JSON.parse(temp);
|
| | | //console.info(temp);
|
| | | console.info(temp);
|
| | | init();
|
| | | //searchkBattByStationid();
|
| | | });
|
| | |
| | |
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: '省'},
|
| | | {url: 'javascript:JumpcityPage();', txt: '市'},
|
| | | {url: 'machineroomM.html', txt: '区/县' },
|
| | | {url: 'selectbatt.html', txt: '机房'},
|
| | | {url: 'javascript:JumpFirstPage();', txt:temp.StationName1},
|
| | | {url: 'javascript:JumpcityPage();', txt: temp.StationName2},
|
| | | {url: 'selectcounty.html', txt: temp.StationName5 },
|
| | | {url: 'selectbatt.html', txt: temp.StationName3},
|
| | | {url: 'javascript:;', txt: '蓄电池组'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | |
| | | createTbl(tblCon, arrTh, arrTd);
|
| | | }
|
| | | });
|
| | | |
| | | /* 模拟数据做好就删!!!!!!!! */
|
| | | |
| | | /*for(i=0;i<340;i++){
|
| | | if(i%34==33){
|
| | | //<a href="count-report.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
| | | arrTd[i]='<a href="#myPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but" data-position-to="window" >修改或删除</a>';
|
| | | console.warn(i);
|
| | | continue;
|
| | | |
| | | } |
| | | |
| | | arrTd[i]=i*10;
|
| | | }
|
| | |
|
| | | createTbl(tblCon, arrTh, arrTd);
|
| | | |
| | | /* 模拟数据做好就删!!!!!!!! */ |
| | | }
|
| | | function getUpdateArr(temp){
|
| | | var arr = new Array();
|
| | |
| | | }else{
|
| | | setcookieCreat(Page.pageSize-1);
|
| | | }
|
| | | window.location.href="batt-infor-conf-temp.html"; |
| | | window.location.href="batt-infor-conf-temp1.html"; |
| | | });
|
| | |
|
| | | var arrTh = [ '机房编号', '省', '城市','区县','机房名称','设备名称','机房IP','FBS设备ID(重要)','FBS设备IP(重要)','子网掩码','网关','FBS设备名称','FBS电池索引(0-3)','电池组ID','机房内电池组编号','电池组名称','浮充电压阀值(V)','离线电压阀值(V)','浮充电流阀值(A)','单体数量','标称容量(AH)','标称单体电压(V)','标称单体内阻(mΩ)','标称单体电导','单体电压次低偏移量(V)','负载电流(A)','最大核容电流(A)','基站号码','电池品牌','电池型号','电池生产日期','投入使用日期','安装人员'];
|
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html>
|
| | | <head>
|
| | | <title>elegroup-batt-conf-temp1.html</title>
|
| | | |
| | | <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
| | | <meta http-equiv="description" content="this is my page">
|
| | | <meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
| | | |
| | | <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
|
| | |
|
| | | </head>
|
| | | |
| | | <body>
|
| | | This is my HTML page. <br>
|
| | | </body>
|
| | | </html>
|
| | |
| | | <body>
|
| | | <div data-role="page" id='main'>
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="loginm.html" class="ui-btn ui-btn-icon-left ui-btn-inline ui-btn-b ui-corner-all" style="padding-top:0.7em;padding-bottom:0.7em;" target="_top" |
| | | <a href="javascript:exitUser();" class="ui-btn ui-btn-icon-left ui-btn-inline ui-btn-b ui-corner-all" style="padding-top:0.7em;padding-bottom:0.7em;" target="_top" |
| | | data-i18n="toptitle.exit">退出</a>
|
| | | <h1 data-i18n="toptitle.headline">蓄电池组监控系统</h1>
|
| | | </div>
|
| | |
| | | delCookie("stationId");
|
| | | $(document.body).css( "visibility", "visible") ;
|
| | | });
|
| | | |
| | | //安全退出
|
| | | function exitUser(){
|
| | | $.post("../LoginAction!exitUser",null,function(data){
|
| | | //console.info(data);
|
| | | window.location.replace("loginm.html");
|
| | | });
|
| | | }
|
| | | </script>
|
| | | </div>
|
| | |
|
| | | </body>
|
| | | </html> |
| | | </html> |
| | |
| | |
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: '省'},
|
| | | {url: 'javascript:JumpcityPage();', txt: '市'},
|
| | | {url: 'machineroomM.html', txt: '区/县' },
|
| | | {url: 'javascript:JumpFirstPage();', txt:temp.StationName1},
|
| | | {url: 'javascript:JumpcityPage();', txt: temp.StationName2},
|
| | | {url: 'machineroomM.html', txt: temp.StationName5 },
|
| | | {url: 'javascript:;', txt: '机房'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | |
| | | $(function(){
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: '省'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: temp.StationName1},
|
| | | {url: 'javascript:;', txt: '市'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | |
| | | $(function(){
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: '省'},
|
| | | {url: 'javascript:JumpcityPage();', txt: '市'},
|
| | | {url: 'javascript:JumpFirstPage();', txt: temp.StationName1},
|
| | | {url: 'javascript:JumpcityPage();', txt: temp.StationName2},
|
| | | {url: 'javascript:;', txt: '区/县'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dao.CheckMobile;
|
| | | import com.fgkj.dto.User;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.dto.Vip_user;
|
| | |
| | | //System.out.println(source);
|
| | | User_inf user=(User_inf)ActionUtil.getSession().getAttribute("user");
|
| | | Vip_user vuser=(Vip_user)ActionUtil.getSession().getAttribute("vip");
|
| | | if(source.equals("login.jsp") || source.equals("fuguang") || source.equals("CheckClient.jsp")){
|
| | | if(("login.jsp").equals(source)|| ("loginm.html").equals(source) || ("gx_tieta").equals(source) || ("CheckClient.jsp").equals(source)){
|
| | | chain.doFilter(req, resp);
|
| | | }else if(user!=null && !source.equals("navConfig.jsp")){
|
| | | chain.doFilter(req, resp);
|
| | |
| | | }else{
|
| | | //System.out.println("还未登陆请登陆 LoginFilter");
|
| | | PrintWriter out=ActionUtil.getOut();
|
| | | out.print("<script charset='UTF-8'>window.location.href='login.jsp'</script>");
|
| | | //判断当前登陆的是手机端还是web端
|
| | | if(CheckIsMobile(request)){
|
| | | out.print("<script charset='UTF-8'>window.location.href='loginm.html'</script>");
|
| | | }else{ |
| | | out.print("<script charset='UTF-8'>window.location.href='login.jsp'</script>");
|
| | | } |
| | | //out.print("<script charset='UTF-8'>alert('"+getText("You are not logged in, please log in")+"');window.location.href='login.jsp'</script>");
|
| | | }
|
| | | }
|
| | |
| | | //System.out.println("初始化过滤器");
|
| | | }
|
| | |
|
| | | |
| | | public static boolean CheckIsMobile(HttpServletRequest request){
|
| | | String userAgent = getRequest().getHeader( "USER-AGENT" ).toLowerCase(); |
| | | if(null == userAgent){ |
| | | userAgent = ""; |
| | | } |
| | | return CheckMobile.check(userAgent); |
| | | }
|
| | | }
|
| | |
| | | //System.out.println(result);
|
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | | |
| | | //添加操作时查询出设备id
|
| | | public String searchmaxdev_id(){
|
| | | model = service.searchmaxdev_id();
|
| | | result = ActionUtil.tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | public String searchAll() {
|
| | | model = service.searchAll();
|
| | | result = ActionUtil.tojson(model);
|
New file |
| | |
| | | package com.fgkj.actions;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Battinf_apply;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.services.Battinf_applyService;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | |
|
| | | public class Battinf_applyAction extends ActionUtil{
|
| | | |
| | | private Battinf_applyService service=new Battinf_applyService();
|
| | | private String json;
|
| | | private String result;
|
| | | |
| | | |
| | | //确认申请(多条)
|
| | | public String update(){
|
| | | List<Battinf_apply> list=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,new TypeToken<List<Battinf_apply>>(){}.getType() );
|
| | | ServiceModel model=service.update(list);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | //添加申请
|
| | | public String add(){
|
| | | List<Battinf_apply> list=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json,new TypeToken<List<Battinf_apply>>(){}.getType() );
|
| | | ServiceModel model=service.add(list);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | |
| | | public String getResult() {
|
| | | return result;
|
| | | }
|
| | | public void setJson(String json) {
|
| | | this.json = json;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | |
|
| | | public static final int APP_BTS_COMM_TASK=99;
|
| | |
|
| | | public static final int BATTINF_APPLY=100;
|
| | | |
| | | public boolean add(Object obj); // 添加
|
| | |
|
| | | public boolean update(Object obj); // 更新
|
| | |
| | | import com.fgkj.dao.impl.Battalarm_dataDAOImpl;
|
| | | import com.fgkj.dao.impl.Battalarm_data_historyImpl;
|
| | | import com.fgkj.dao.impl.BattinfThirdImpl;
|
| | | import com.fgkj.dao.impl.Battinf_applyImpl;
|
| | | import com.fgkj.dao.impl.Battinf_exImpl;
|
| | | import com.fgkj.dao.impl.BattresdataDAOImpl;
|
| | | import com.fgkj.dao.impl.Battresdata_infDAOImpl;
|
| | |
| | | case 97:return new Bts_gprs_stateImpl();
|
| | | case 98:return new Fbs9100_battparamImpl();
|
| | | case 99:return new App_bts_comm_taskImpl();
|
| | | case 100:return new Battinf_applyImpl();
|
| | | default :return null;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import com.fgkj.dao.impl.BattInfImpl;
|
| | | import com.fgkj.dao.impl.Batt_rtstateDAOImpl;
|
| | | import com.fgkj.dao.impl.Battinf_applyImpl;
|
| | | import com.fgkj.dao.impl.Database_backupImpl;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Database_backup;
|
| | |
| | | int station_next=station_max+1;
|
| | | return station_next;
|
| | | }
|
| | | |
| | | //查询当前最大的dev_id
|
| | | public static int searchmaxdev_id(){
|
| | | int dev_id=0;
|
| | | int devid_inf=(new BattInfImpl()).searchMaxdevId_binf();
|
| | | int devid_apply=(new Battinf_applyImpl()).searchMaxdevId_apply();
|
| | | if(devid_inf>=devid_apply){
|
| | | dev_id=devid_inf+1;
|
| | | }else{
|
| | | dev_id=devid_apply+1;
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | //当对battinf表中数据进行增删改的操作时,先备份db_battinf.tb_battinf
|
| | | public static boolean backup_battinf(){
|
| | | boolean en=false;
|
| | |
| | | }
|
| | | //添加电池组时查询出最大的机房id和电池组id
|
| | | public int searchMaxId(){
|
| | | //,max(battgroupid) as maxb
|
| | | String sql="select max(stationid) as stationid_maxs from db_battinf.tb_battinf limit 1";
|
| | | String sql="SELECT GREATEST((select max(StationId) from db_battinf.tb_battinf) ,(select max(StationId) from db_battinf.tb_battinf_apply)) as id";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | try {
|
| | |
|
| | | while(rs.next()){
|
| | | int maxs=42000000;
|
| | | int maxs=42010000;
|
| | | //int maxb=1000001;
|
| | | if(rs.getString("stationid_maxs") != null){
|
| | | maxs=Integer.parseInt(rs.getString("stationid_maxs"));
|
| | | if(rs.getString("id") != null){
|
| | | maxs=Integer.parseInt(rs.getString("id"));
|
| | | }
|
| | | /*if(rs.getInt("maxb")!=0){
|
| | | maxb=rs.getInt("maxb");
|
| | |
| | | }
|
| | | return stationid;
|
| | | }
|
| | | //查询出当前存在内存中最大的设备的id(很重要**********)
|
| | | public int searchMaxdevId_binf(){
|
| | | String sql="select max(FbsDeviceId) as id from db_battinf.tb_battinf limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | int dev_id=0;
|
| | | if(rs.getString("id")!=null){}
|
| | | dev_id=rs.getInt("id");
|
| | | list.add(dev_id);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int dev_id=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | dev_id=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | //判断新增的电池组是否存在
|
| | | public List judgeBatt(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | |
| | |
|
| | | //查询出当前存在内存中最大的电池组id(很重要**********)
|
| | | public int searchMaxBattgroupId(){
|
| | | String sql=" select max(BattGroupId) as max_id from db_ram_db.tb_batt_rtstate limit 1";
|
| | | String sql=" SELECT GREATEST((select max(battgroupId) from db_battinf.tb_battinf) ,(select max(battgroupId) from db_battinf.tb_battinf_apply)) as id limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | int battgroupid=rs.getInt("max_id");
|
| | | int battgroupid=1010000;
|
| | | if(rs.getString("id")!=null){
|
| | | battgroupid=rs.getInt("id");
|
| | | }
|
| | | list.add(battgroupid);
|
| | | }
|
| | | } catch (SQLException e) {
|
New file |
| | |
| | | package com.fgkj.dao.impl;
|
| | |
|
| | | import java.sql.Connection;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BattinfGroupFactory;
|
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.LimitNumberFactory;
|
| | | import com.fgkj.dao.UinfDaoFactory;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Battinf_apply;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.dto.User_log;
|
| | | import com.fgkj.services.User_logService;
|
| | |
|
| | | public class Battinf_applyImpl implements BaseDAO,CallBack{
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | | //添加申请
|
| | | public boolean add(Object obj) {
|
| | | List<Battinf_apply> list=(List<Battinf_apply>) obj;
|
| | | List<User_log> listU=new ArrayList<User_log>();//存放user_log
|
| | | ArrayList<String> sql_str=new ArrayList();
|
| | | //获取当前最大的stationid和battgroupid
|
| | | int maxs=BattinfGroupFactory.searchStationId();
|
| | | int maxb=BattinfGroupFactory.searchMaxBattgroupId();
|
| | | if(list!=null && list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | /*int uid=((User_inf)ActionUtil.getUser()).getUId();
|
| | | bapply.setApply_uid(uid);*/
|
| | | BattInf binf=bapply.getBinf();
|
| | | //验证新添加的机房是否存在
|
| | | List listS=(new BattInfImpl()).judgeBatt(binf);
|
| | | if(listS!=null&&listS.size()>0){
|
| | | binf.setStationId((String) listS.get(listS.size()-1));
|
| | | }else{
|
| | | binf.setStationId(String.valueOf(maxs));
|
| | | }
|
| | | binf.setBattGroupId(maxb);
|
| | | String sql = "insert into db_battinf.tb_battinf_apply(" +
|
| | | "apply_uid,apply_date,StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone" +
|
| | | ") values("+bapply.getApply_uid()+",'"+DAOHelper.sdf.format(bapply.getApply_date())+"','"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
|
| | | "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
|
| | | ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
|
| | | ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
|
| | | ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"')";
|
| | | |
| | | if(binf.getStationId().equals(maxs)){
|
| | | maxs++;
|
| | | }
|
| | | maxb++;
|
| | | sql_str.add(sql);
|
| | | /*{
|
| | | String msg=((User_inf)ActionUtil.getUser()).getUId()+"申请添加"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
|
| | | listU.add(ulog);
|
| | | }*/
|
| | | }
|
| | | }
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | //(new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | |
| | | return bl;
|
| | | }
|
| | | //确认申请(多条)
|
| | | public boolean update(Object obj) {
|
| | | List<Battinf_apply> list=(List<Battinf_apply>) obj;
|
| | | List<User_log> listU=new ArrayList<User_log>();//存放user_log
|
| | | ArrayList<String> sql_str=new ArrayList();
|
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Battinf_apply bapply=list.get(i);
|
| | | bapply.setConfrim_uid(((User_inf)ActionUtil.getUser()).getUId());
|
| | | BattInf binf=bapply.getBinf();
|
| | | binf.setStation_install(1);
|
| | | String sql_update_apply=" update db_battinf.tb_battinf_apply set confrim_uid="+bapply.getConfrim_uid()+",apply_en=1 where num="+bapply.getNum();
|
| | | sql_str.add(sql_update_apply);
|
| | | String sql_insert_binf="insert into db_battinf.tb_battinf(" +
|
| | | "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install" +
|
| | | ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
|
| | | "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
|
| | | ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
|
| | | ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
|
| | | ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"',"+binf.getStation_install()+")";
|
| | | sql_str.add(sql_insert_binf);
|
| | | {
|
| | | String msg=((User_inf)ActionUtil.getUser()).getUId()+"确认添加"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
|
| | | listU.add(ulog);
|
| | | }
|
| | | }
|
| | | }
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | return bl;
|
| | | |
| | | }
|
| | |
|
| | | public boolean del(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | | |
| | | public List searchAll() {
|
| | | |
| | | return null;
|
| | | }
|
| | | //查询出所有需要确认的申请
|
| | | public List serchByCondition(Object obj) {
|
| | | Battinf_apply bapply=(Battinf_apply) obj;
|
| | | BattInf b=bapply.getBinf();
|
| | | Page page=b.getPage();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql=" select SQL_CALC_FOUND_ROWS distinct num,apply_uid,confrim_uid,apply_date,apply_en,apply_note,StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FbsDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp"+
|
| | | ",FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone " +
|
| | | " from db_battinf.tb_battinf_apply " +
|
| | | " where apply_en=0 and stationName1 like ? and stationName2 like ? and stationId like ? and stationName5 like ? " +
|
| | | " limit ?,? ";
|
| | | List<Battinf_apply> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+b.getStationName1()+"%","%"+b.getStationName2()+"%","%"+b.getStationId()+"%","%"+b.getStationName5()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | Battinf_apply apply=new Battinf_apply();
|
| | | apply.setNum(rs.getInt("num"));
|
| | | apply.setApply_uid(rs.getInt("apply_uid"));
|
| | | apply.setConfrim_uid(rs.getInt("confrim_uid"));
|
| | | apply.setApply_en(rs.getInt("apply_en"));
|
| | | apply.setApply_date(rs.getTimestamp("apply_date"));
|
| | | apply.setApply_note(rs.getString("apply_note"));
|
| | | |
| | | BattInf binf=new BattInf();
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName3(rs.getString("stationName3"));
|
| | | binf.setStationName4(rs.getString("stationName4"));
|
| | | binf.setStationName5(rs.getString("stationName5"));
|
| | | binf.setStationIp(rs.getString("stationIp"));
|
| | | binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | |
| | | binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
|
| | | binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
|
| | | binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));
|
| | | binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
|
| | | binf.setBattGroupId(rs.getInt("battGroupId"));
|
| | | binf.setBattGroupNum(rs.getInt("battGroupNum"));
|
| | | binf.setBattGroupName(rs.getString("battGroupName"));
|
| | | binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
|
| | | binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
|
| | | binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonResStd(rs.getFloat("monResStd"));
|
| | | binf.setMonSerStd(rs.getFloat("monSerStd"));
|
| | | binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
|
| | | binf.setBattProducer(rs.getString("battProducer"));
|
| | | binf.setBattModel(rs.getString("battModel"));
|
| | | binf.setBattProductDate(rs.getDate("battProductDate"));
|
| | | binf.setBattInUseDate(rs.getDate("battInUseDate"));
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | binf.setInstall_user(rs.getString("install_user"));
|
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | binf.setStation_phone(rs.getString("station_phone"));
|
| | | |
| | | apply.setBinf(binf);
|
| | | list.add(apply);
|
| | | |
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | //去掉limit条件后的总数
|
| | | int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
|
| | | //System.out.println("number: "+number);
|
| | | if(list!=null&&list.size()>0){
|
| | | list.get(list.size()-1).setNum(number);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | //查询出当前存在内存中最大的设备的id(很重要**********)
|
| | | public int searchMaxdevId_apply(){
|
| | | String sql="select max(FbsDeviceId) as id from db_battinf.tb_battinf_apply limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | int dev_id=0;
|
| | | if(rs.getString("id")!=null){}
|
| | | dev_id=rs.getInt("id");
|
| | | list.add(dev_id);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int dev_id=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | dev_id=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | | public static void main(String[] args) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | Date date1 = sdf.parse("2000-01-01 00:00:00");
|
| | | Date date2 = sdf.parse("2020-01-01 23:59:59");
|
| | | Battinf_applyImpl bimpl=new Battinf_applyImpl();
|
| | | Battinf_apply bapply=new Battinf_apply();
|
| | | bapply.setApply_date(ActionUtil.getSimpDate(date2));
|
| | | bapply.setApply_uid(1002);
|
| | | |
| | | |
| | | BattInf binf=new BattInf();
|
| | | binf.setStationName1("湖北省");
|
| | | binf.setStationName2("武汉市");
|
| | | binf.setStationName3("荆门市");
|
| | | binf.setStationName4("BTS设备");
|
| | | binf.setStationName5("钟祥");
|
| | | binf.setStationId("4011100");
|
| | | binf.setStationIp("");
|
| | | binf.setFBSDeviceId(910001000);
|
| | | binf.setFbsDeviceIp("127.0.0.1");
|
| | | binf.setFbsDeviceIp_YM("255.255.255.0");
|
| | | binf.setFbsDeviceIp_WG("127.0.0.1");
|
| | | binf.setFBSDeviceName("设备名称");
|
| | | binf.setGroupIndexInFBSDevice(1); |
| | | binf.setBattGroupId(1000005); |
| | | binf.setBattGroupNum(2); |
| | | binf.setBattGroupName("电池组1");
|
| | | binf.setFloatVolLevel(54f);
|
| | | binf.setOfflineVolLevel(42.9f ); |
| | | binf.setBattFloatCurrent(10f); |
| | | binf.setMonCount(24); |
| | | binf.setMonCapStd(300f); |
| | | binf.setMonVolStd(2f); |
| | | binf.setMonResStd(0.2f); |
| | | binf.setMonSerStd(5000f); |
| | | binf.setMonVolLowToAvg(0.05f ); |
| | | binf.setLoad_curr(15f); |
| | | binf.setDisCurrMax(39.5f);
|
| | | binf.setStation_phone("12345678912"); |
| | | binf.setBattProducer("");
|
| | | binf.setBattModel(""); |
| | | binf.setBattProductDate(ActionUtil.getSimpDate(date1));
|
| | | binf.setBattInUseDate(ActionUtil.getSimpDate(date2));
|
| | | binf.setInstall_user("");
|
| | |
|
| | | Page page=new Page();
|
| | | page.setPageCurr(1);
|
| | | page.setPageSize(10);
|
| | | binf.setPage(page);
|
| | | bapply.setBinf(binf);
|
| | | /*List list=bimpl.serchByCondition(bapply);
|
| | | System.out.println(list.size());*/
|
| | | /*List list=new ArrayList();
|
| | | list.add(bapply);
|
| | | boolean bl=bimpl.add(list);
|
| | | System.err.println(bl);*/
|
| | | int dev_id=BattinfGroupFactory.searchmaxdev_id();
|
| | | System.out.println(dev_id);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.fgkj.dto;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | public class Battinf_apply implements Serializable{
|
| | | private int num;
|
| | | private int apply_uid;
|
| | | private int confrim_uid;
|
| | | private Date apply_date;
|
| | | private int apply_en;
|
| | | private String apply_note;
|
| | | private BattInf binf;
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | | public void setNum(int num) {
|
| | | this.num = num;
|
| | | }
|
| | | public int getApply_uid() {
|
| | | return apply_uid;
|
| | | }
|
| | | public void setApply_uid(int apply_uid) {
|
| | | this.apply_uid = apply_uid;
|
| | | }
|
| | | public int getConfrim_uid() {
|
| | | return confrim_uid;
|
| | | }
|
| | | public void setConfrim_uid(int confrim_uid) {
|
| | | this.confrim_uid = confrim_uid;
|
| | | }
|
| | | public Date getApply_date() {
|
| | | return apply_date;
|
| | | }
|
| | | public void setApply_date(Date apply_date) {
|
| | | this.apply_date = apply_date;
|
| | | }
|
| | | public int getApply_en() {
|
| | | return apply_en;
|
| | | }
|
| | | public void setApply_en(int apply_en) {
|
| | | this.apply_en = apply_en;
|
| | | }
|
| | | public String getApply_note() {
|
| | | return apply_note;
|
| | | }
|
| | | public void setApply_note(String apply_note) {
|
| | | this.apply_note = apply_note;
|
| | | }
|
| | | public BattInf getBinf() {
|
| | | return binf;
|
| | | }
|
| | | public void setBinf(BattInf binf) {
|
| | | this.binf = binf;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Battinf_apply [num=" + num + ", apply_uid=" + apply_uid
|
| | | + ", confrim_uid=" + confrim_uid + ", apply_date=" + apply_date
|
| | | + ", apply_en=" + apply_en + ", apply_note=" + apply_note
|
| | | + ", binf=" + binf + "]";
|
| | | }
|
| | | |
| | | }
|
| | |
| | | model.setMsg("查询成功!");
|
| | | return model;
|
| | | }
|
| | | public static void main(String[] args) {
|
| | | |
| | | //添加操作时查询出设备id
|
| | | public ServiceModel searchmaxdev_id(){
|
| | | int dev_id=BattinfGroupFactory.searchmaxdev_id();
|
| | | model.setData(dev_id);
|
| | | return model;
|
| | | }
|
| | | |
| | | public static void main(String[] args) {
|
| | | //new BattInfServices().findMenu();
|
| | | BattInf b=new BattInf();
|
| | | //b.setBattGroupId(1000005);
|
New file |
| | |
| | | package com.fgkj.services;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
|
| | | public class Battinf_applyService {
|
| | |
|
| | | private ServiceModel model;
|
| | | private BaseDAO dao;
|
| | | public Battinf_applyService() {
|
| | | super();
|
| | | model=new ServiceModel();
|
| | | dao=BaseDAOFactory.getBaseDAO(BaseDAO.BATTINF_APPLY);
|
| | | }
|
| | | //确认申请(多条)
|
| | | public ServiceModel update(Object obj){
|
| | | boolean bl=dao.update(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("确认成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("确实失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | |
| | | //添加申请
|
| | | public ServiceModel add(Object obj){
|
| | | boolean bl=dao.add(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("确认成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("确实失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | }
|