Commit 02054979 authored by 马超's avatar 马超

线路资源

parent 6784675e
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String action = pub.trimNull(request.getParameter("action"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String build_number = pub.trimNull(request.getParameter("build_number"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String floor = pub.trimNull(request.getParameter("floor"));
String room_number = pub.trimNull(request.getParameter("room_number"));
String quxian = pub.trimNull(request.getParameter("quxian"));
String describes = pub.trimNull(request.getParameter("describes"));
String address = pub.trimNull(request.getParameter("address"));
String delete_id = pub.trimNull(request.getParameter("delete_id"));
String update_id = pub.trimNull(request.getParameter("update_id"));
String id = DBUtil.getUUID();
String add_user = (String) session.getAttribute("session_login_id");
String add_time = pub.getCurrentServerTime();
try {
conn = com.censoft.db.DBUtil.getConnection();
conn.setAutoCommit(false);
if ("add".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "insert into xlzy_dw (id,info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user) values (?,?,?,?,?,?,?,?,?,?,?)"
, new Object[]{id,info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user});
if (!is_up) {
out.println("点位数据新增报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"点位数据", "添加", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}if ("update".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "update xlzy_dw set info_name=?,bianhao=?,floor=?,quxian=?,address=?,describes=?,build_number=?,room_number=?,update_time=?,update_user=? where id=? "
, new Object[]{info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user,update_id});
if (!is_up) {
out.println("点位数据" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"点位数据", "修改", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}else if("delete".equals(action)){
boolean is_up = cf.executeUpdate(conn, "delete from xlzy_dw where id=?"
, new Object[]{delete_id});
if (!is_up) {
out.println("点位数据删除报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"点位数据", "删除", delete_id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
Connection conn = null;
Vector v_list;
Hashtable ht = new Hashtable();
Pub pub = new Pub();
ConnectionFactory cf = new ConnectionFactory();
String update_id = pub.trimNull(request.getParameter("update_id"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String action="add";
if(!"".equals(update_id)){
action="update";
}
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list=cf.doQuery(conn,"select * from xlzy_dw where id=? ",null,new Object[]{update_id});
if (v_list == null) {
out.println("查询用户出错");
return;
}
if (v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<article class="page-container" style="overflow: hidden;">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" name="action" value="<%=action%>">
<input type="hidden" name="update_id" value="<%=update_id%>">
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name" id="info_name" value="<%=pub.trimNull((String) ht.get("info_name"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">编号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="bianhao" id="bianhao" value="<%=pub.trimNull((String) ht.get("bianhao"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">楼号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="build_number" id="build_number" value="<%=pub.trimNull((String) ht.get("build_number"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">楼层:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="floor" id="floor" value="<%=pub.trimNull((String) ht.get("floor"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">房间号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="room_number" id="room_number" value="<%=pub.trimNull((String) ht.get("room_number"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">地址:</label>
<div class="formControls col-xs-8 col-sm-9">
<select name="quxian" id="quxian" style="height:30px;">
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("朝阳区")){%>selected<%}%> value="朝阳区">朝阳区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("密云区")){%>selected<%}%> value="密云区">密云区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("延庆区")){%>selected<%}%> value="延庆区">延庆区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("丰台区")){%>selected<%}%> value="丰台区">丰台区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("海淀区")){%>selected<%}%> value="海淀区">海淀区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("石景山区")){%>selected<%}%> value="石景山区">石景山区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("门头沟区")){%>selected<%}%> value="门头沟区">门头沟区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("房山区")){%>selected<%}%> value="房山区">房山区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("通州区")){%>selected<%}%> value="通州区">通州区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("顺义区")){%>selected<%}%> value="顺义区">顺义区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("昌平区")){%>selected<%}%> value="昌平区">昌平区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("大兴区")){%>selected<%}%> value="大兴区">大兴区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("怀柔区")){%>selected<%}%> value="怀柔区">怀柔区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("平谷区")){%>selected<%}%> value="平谷区">平谷区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("东城区")){%>selected<%}%> value="东城区">东城区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("西城区")){%>selected<%}%> value="西城区">西城区</option>
<option <%if((pub.trimNull((String)ht.get("quxian"))).equals("副中心")){%>selected<%}%> value="副中心">副中心</option>
</select>
<input style="width:92%;height:35px;line-height: 35px;" type="text" class="input-text" name="address" id="address" value="<%=pub.trimNull((String) ht.get("address"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">备注:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea type="text" class="input-text" name="describes" id="describes"
style="height:120px;" ><%=pub.trimNull((String) ht.get("describes"))%></textarea>
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<input class="btn btn-primary radius" type="button" onclick="javascript:saveForm();"
value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
</div>
</div>
</form>
</article>
<script>
function saveForm() {
var seg=$("#info_name").val();
if(seg === ""){
layer.msg('输入的名称为空', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
return false;
}
saveSeg();
}
function saveSeg(){
$.ajax({
type: "POST",
url: "./action.jsp",
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
parent.searchModel();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String build_number = pub.trimNull(request.getParameter("build_number"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_dw where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and bianhao like ?");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(build_number)){
sb.append(" and build_number like ?");
list_s.add("%"+build_number+"%");
}
if(!"".equals(room_number)){
sb.append(" and room_number like ?");
list_s.add("%"+room_number+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./dw_add-t.jsp?info_type="+info_type;
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">点位名称</th>
<th width="150px">点位编号</th>
<th width="150px">楼号</th>
<th width="150px">楼层</th>
<th width="150px">房间号</th>
<th width="150px">地址</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String floor_view = pub.trimNull((String) ht.get("floor"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String build_number_view = pub.trimNull((String) ht.get("build_number"));
String room_number_view = pub.trimNull((String) ht.get("room_number"));
String quxian_view = pub.trimNull((String) ht.get("quxian"));
String address_view = pub.trimNull((String) ht.get("address"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=info_name_view%>
</td>
<td><%=bianhao_view%>
</td>
<td><%=build_number_view%>
</td>
<td><%=floor_view%>
</td>
<td><%=room_number_view%>
</td>
<td><%=quxian_view%><%=address_view%>
</td>
<td>
<a title="修改" href="javascript:void(0);" onclick="updateById('./dw_add-t.jsp?update_id=<%=id%>','<%=id%>')" class="ml-5" >
<i class="Hui-iconfont">修改</i>
</a>
<a title="删除" href="javascript:void(0);" onclick="deleteById('<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<%
String info_type = request.getParameter("info_type");
String tiaozhuan_url="";
if("peixianjia".equals(info_type)||"yuyin".equals(info_type)){
tiaozhuan_url="other";
}
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="info_type" id="info_type" value="<%=info_type%>"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " >
<tr class="">
<td class="search-label" >
点位名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入点位名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
点位编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入点位编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td class="search-label" >
</td>
<td class="search-input" >
</td>
</tr>
<tr>
<td class="search-label" >
楼号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入楼号" class="input-text" name="build_number" id="build_number" value=""
placeholder="" >
</td>
<td class="search-label" >
房间号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入房间号" class="input-text" name="room_number" id="room_number" value=""
placeholder="" >
</td>
<td colspan="3">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
var url_1="list_ajax_dw.jsp";
$.ajax({
type: "post",
url: url_1,
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
/*用户-编辑*/
function addRules(title, url) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function updateById(url,id){
var abc = layer.open({
title: "编辑",
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function deleteById(id) {
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp",
data: {"action":"delete","delete_id":id},
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
})
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String action = pub.trimNull(request.getParameter("action"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String build_number = pub.trimNull(request.getParameter("build_number"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String floor = pub.trimNull(request.getParameter("floor"));
String room_number = pub.trimNull(request.getParameter("room_number"));
String quxian = pub.trimNull(request.getParameter("quxian"));
String describes = pub.trimNull(request.getParameter("describes"));
String address = pub.trimNull(request.getParameter("address"));
String delete_id = pub.trimNull(request.getParameter("delete_id"));
String update_id = pub.trimNull(request.getParameter("update_id"));
String id = DBUtil.getUUID();
String info_type=pub.trimNull(request.getParameter("info_type"));
String add_user = (String) session.getAttribute("session_login_id");
String add_time = pub.getCurrentServerTime();
try {
conn = com.censoft.db.DBUtil.getConnection();
conn.setAutoCommit(false);
if ("add".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "insert into xlzy_jf (id,info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user,info_type) values (?,?,?,?,?,?,?,?,?,?,?,?)"
, new Object[]{id,info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user,info_type});
if (!is_up) {
out.println("机房信息数据新增报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机房信息数据", "添加", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}if ("update".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "update xlzy_jf set info_name=?,bianhao=?,floor=?,quxian=?,address=?,describes=?,build_number=?,room_number=?,update_time=?,update_user=? where id=? "
, new Object[]{info_name,bianhao,floor,quxian,address,describes,build_number,room_number,add_time,add_user,update_id});
if (!is_up) {
out.println("机房信息数据" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机房信息数据", "修改", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}else if("delete".equals(action)){
boolean is_up = cf.executeUpdate(conn, "delete from xlzy_jf where id=?"
, new Object[]{delete_id});
if (!is_up) {
out.println("机房信息数据删除报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机房信息数据", "删除", delete_id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
Connection conn = null;
Vector v_list;
Hashtable ht = new Hashtable();
Pub pub = new Pub();
ConnectionFactory cf = new ConnectionFactory();
String update_id = pub.trimNull(request.getParameter("update_id"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String action="add";
if(!"".equals(update_id)){
action="update";
}
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list=cf.doQuery(conn,"select * from basic_info_data where id=? ",null,new Object[]{update_id});
if (v_list == null) {
out.println("查询用户出错");
return;
}
if (v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<article class="page-container" style="overflow: hidden;">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" name="action" value="<%=action%>">
<input type="hidden" name="update_id" value="<%=update_id%>">
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name" id="info_name" value="<%=pub.trimNull((String) ht.get("info_name"))%>"
placeholder="" >
</div>
</div>
<div class="row cl" >
<label class="form-label col-xs-2 col-sm-2">属性:</label>
<div class="formControls col-xs-2 col-sm-9" id="info_type" name="info_type">
<script>
var value='<%=pub.trimNull((String)ht.get("info_type"))%>';
value=encodeURI(encodeURI(value));
$.post("../../zd/zd_view_list.jsp?value="+value+"&name_id=info_type&zd_e_name=jf_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">编号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="bianhao" id="bianhao" value="<%=pub.trimNull((String) ht.get("bianhao"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">楼号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="build_number" id="build_number" value="<%=pub.trimNull((String) ht.get("build_number"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">楼层:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="floor" id="floor" value="<%=pub.trimNull((String) ht.get("floor"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">房间号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="room_number" id="room_number" value="<%=pub.trimNull((String) ht.get("room_number"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">地址:</label>
<div class="formControls col-xs-8 col-sm-9">
<select name="quxian" id="quxian" style="height:30px;">
<script>
var value='<%=pub.trimNull((String)ht.get("quxian"))%>';
value=encodeURI(encodeURI(value));
$.post("../../zd/zd_view_list.jsp?value="+value+"&name_id=quxian&zd_e_name=quxian&math="+Math.random(),function(data){
document.getElementById("quxian").innerHTML=data;
}
);
</script>
</select>
<input style="width:92%;height:35px;line-height: 35px;" type="text" class="input-text" name="address" id="address" value="<%=pub.trimNull((String) ht.get("address"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">备注:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea type="text" class="input-text" name="describes" id="describes"
style="height:120px;" ><%=pub.trimNull((String) ht.get("describes"))%></textarea>
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<input class="btn btn-primary radius" type="button" onclick="javascript:saveForm();"
value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
</div>
</div>
</form>
</article>
<script>
function saveForm() {
var seg=$("#info_name").val();
if(seg === ""){
layer.msg('输入的名称为空', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
return false;
}
saveSeg();
}
function saveSeg(){
$.ajax({
type: "POST",
url: "./action.jsp",
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
parent.searchModel();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String build_number = pub.trimNull(request.getParameter("build_number"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_jf where 1=1 ");
if(!"".equals(info_type)){
sb.append(" and info_type=? ");
list_s.add(info_type);
}
if(!"".equals(info_name)){
sb.append(" and info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and bianhao like ?");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(build_number)){
sb.append(" and build_number like ?");
list_s.add("%"+build_number+"%");
}
if(!"".equals(room_number)){
sb.append(" and room_number like ?");
list_s.add("%"+room_number+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./jf_add-t.jsp?info_type="+info_type;
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="40px">序号</th>
<th width="150px">机房名称</th>
<th width="150px">机房编号</th>
<th width="150px">机房属性</th>
<th width="150px">楼号</th>
<th width="150px">楼层</th>
<th width="150px">房间号</th>
<th width="150px">地址</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String floor_view = pub.trimNull((String) ht.get("floor"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String build_number_view = pub.trimNull((String) ht.get("build_number"));
String room_number_view = pub.trimNull((String) ht.get("room_number"));
String quxian_view = pub.trimNull((String) ht.get("quxian"));
String address_view = pub.trimNull((String) ht.get("address"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=info_name_view%>
</td>
<td><%=bianhao_view%>
</td>
<td><%=info_type_view%>
</td>
<td><%=build_number_view%>
</td>
<td><%=floor_view%>
</td>
<td><%=room_number_view%>
</td>
<td><%=quxian_view%>-<%=address_view%>
</td>
<td>
<a title="修改" href="javascript:void(0);" onclick="updateById('./jf_add-t.jsp?update_id=<%=id%>','<%=id%>')" class="ml-5" >
<i class="Hui-iconfont">修改</i>
</a>
<a title="删除" href="javascript:void(0);" onclick="deleteById('<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " >
<tr class="">
<td class="search-label" >
机房名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机房名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机房编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td class="search-label" >
机房属性:
</td>
<td class="search-input" id="info_type">
<script>
$.post("../../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=jf_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</td>
</tr>
<tr>
<td class="search-label" >
楼号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入楼号" class="input-text" name="build_number" id="build_number" value=""
placeholder="" >
</td>
<td class="search-label" >
房间号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入房间号" class="input-text" name="room_number" id="room_number" value=""
placeholder="" >
</td>
<td colspan="3">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript">
function searchModel() {
var url_1="list_ajax_jf.jsp";
$.ajax({
type: "post",
url: url_1,
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
/*用户-编辑*/
function addRules(title, url) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function updateById(url,id){
var abc = layer.open({
title: "编辑",
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function deleteById(id) {
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp",
data: {"action":"delete","delete_id":id},
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
})
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String action = pub.trimNull(request.getParameter("action"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String describes = pub.trimNull(request.getParameter("describes"));
String address = pub.trimNull(request.getParameter("address"));
String delete_id = pub.trimNull(request.getParameter("delete_id"));
String update_id = pub.trimNull(request.getParameter("update_id"));
String id = DBUtil.getUUID();
String info_type=pub.trimNull(request.getParameter("info_type"));
String add_user = (String) session.getAttribute("session_login_id");
String add_time = pub.getCurrentServerTime();
try {
conn = com.censoft.db.DBUtil.getConnection();
conn.setAutoCommit(false);
if ("add".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "insert into xlzy_jg (id,jf_id,info_name,bianhao,describes,add_time,add_user) values (?,?,?,?,?,?,?)"
, new Object[]{id,jf_id,info_name,bianhao,describes,add_time,add_user});
if (!is_up) {
out.println("机柜信息数据新增报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机柜信息数据", "添加", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}if ("update".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "update xlzy_jg set info_name=?,bianhao=?,describes=?,jf_id=?,update_time=?,update_user=? where id=? "
, new Object[]{info_name,bianhao,describes,jf_id,add_time,add_user,update_id});
if (!is_up) {
out.println("机柜信息数据" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机柜信息数据", "修改", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}else if("delete".equals(action)){
boolean is_up = cf.executeUpdate(conn, "delete from xlzy_jg where id=?"
, new Object[]{delete_id});
if (!is_up) {
out.println("机柜信息数据删除报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"机柜信息数据", "删除", delete_id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " style="margin-left: 10%;">
<tr class="">
<td class="search-label" >
机房属性:
</td>
<td class="search-input" id="info_type">
<script>
$.post("../../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=jf_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</td>
<td class="search-label" >
机房名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机房名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机房编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td colspan="2">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
$.ajax({
type: "post",
url: "jf_list_ajax.jsp",
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function change_list(type) {
$("#info_type").val(type);
searchModel();
}
function select_jf(id,name) {
parent.document.getElementById("jf_id").value=id;
parent.document.getElementById("jf_name").value=name;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_jf where 1=1 ");
if(!"".equals(info_type)){
sb.append(" and info_type=? ");
list_s.add(info_type);
}
if(!"".equals(info_name)){
sb.append(" and info_name like ? ");
list_s.add("%"+info_name+"%");
}
if(!"".equals(info_name)){
sb.append(" and bianhao like ? ");
list_s.add("%"+bianhao+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">机房名称</th>
<th width="150px">机房编号</th>
<th width="150px">机房属性</th>
<th width="150px">楼号</th>
<th width="150px">楼层</th>
<th width="150px">房间号</th>
<th width="150px">地址</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String floor_view = pub.trimNull((String) ht.get("floor"));
String build_number_view = pub.trimNull((String) ht.get("build_number"));
String room_number_view = pub.trimNull((String) ht.get("room_number"));
String quxian_view = pub.trimNull((String) ht.get("quxian"));
String address_view = pub.trimNull((String) ht.get("address"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td>
<a style="color:blue;" onclick="select_jf('<%=id%>','<%=info_name_view%>')" href="javascript:void(0)"><%=info_name_view%></a>
</td>
<td><%=bianhao_view%>
</td>
<td><%=info_type_view%>
</td>
<td><%=build_number_view%>
</td>
<td><%=floor_view%>
</td>
<td><%=room_number_view%>
</td>
<td><%=quxian_view%>-<%=address_view%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String jf_id = pub.trimNull(request.getParameter("jf_id"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select t1.*,t2.info_name as jf_name from xlzy_jg t1 join xlzy_jf t2 on t1.jf_id=t2.id where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and t1.info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and t1.bianhao like ?");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(jf_id)){
sb.append(" and t2.info_name like ?");
list_s.add("%"+jf_id+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./rdj_add-t.jsp";
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">机柜名称</th>
<th width="150px">机柜编号</th>
<th width="150px">所属机房</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String jf_name_view = pub.trimNull((String) ht.get("jf_name"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=info_name_view%>
</td>
<td><%=bianhao_view%>
</td>
<td><%=jf_name_view%>
</td>
<td>
<a title="修改" href="javascript:void(0);" onclick="updateById('./rdj_add-t.jsp?update_id=<%=id%>','<%=id%>')" class="ml-5" >
<i class="Hui-iconfont">修改</i>
</a>
<a title="删除" href="javascript:void(0);" onclick="deleteById('<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<%
String info_type = request.getParameter("info_type");
String tiaozhuan_url="";
if("peixianjia".equals(info_type)||"yuyin".equals(info_type)){
tiaozhuan_url="other";
}
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="info_type" id="info_type" value="<%=info_type%>"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " >
<tr class="">
<td class="search-label" >
机柜名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机柜编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td class="search-label" >
</td>
<td class="search-input" >
</td>
</tr>
<tr>
<td class="search-label" >
所属机房:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机房" class="input-text" name="jf_id" id="jf_id" value=""
placeholder="" >
</td>
<td colspan="3">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript">
function searchModel() {
var url_1="list_ajax_rdj.jsp";
$.ajax({
type: "post",
url: url_1,
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
/*用户-编辑*/
function addRules(title, url) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function updateById(url,id){
var abc = layer.open({
title: "编辑",
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function deleteById(id) {
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp",
data: {"action":"delete","delete_id":id},
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
})
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
Connection conn = null;
Vector v_list;
Hashtable ht = new Hashtable();
Pub pub = new Pub();
ConnectionFactory cf = new ConnectionFactory();
String update_id = pub.trimNull(request.getParameter("update_id"));
String action="add";
if(!"".equals(update_id)){
action="update";
}
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list=cf.doQuery(conn,"select t1.*,t2.info_name as jf_name from xlzy_jg t1 join xlzy_jf t2 on t1.jf_id=t2.id where t1.id=? ",null,new Object[]{update_id});
if (v_list == null) {
out.println("查询用户出错");
return;
}
if (v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<article class="page-container" style="overflow: hidden;">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" name="action" value="<%=action%>">
<input type="hidden" name="update_id" value="<%=update_id%>">
<input type="hidden" name="jf_id" id="jf_id" value="<%=pub.trimNull((String) ht.get("jf_id"))%>">
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">所属机房:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" autocomplete="off"
name="jf_name" id="jf_name" value="<%=pub.trimNull((String) ht.get("jf_name"))%>"
onclick="select_jf();" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">机柜(分电箱)名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name" id="info_name" value="<%=pub.trimNull((String) ht.get("info_name"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">机柜编号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="bianhao" id="bianhao" value="<%=pub.trimNull((String) ht.get("bianhao"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">备注:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea type="text" class="input-text" name="describes" id="describes"
style="height:120px;" ><%=pub.trimNull((String) ht.get("describes"))%></textarea>
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<input class="btn btn-primary radius" type="button" onclick="javascript:saveForm();"
value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
</div>
</div>
</form>
</article>
<script>
function select_jf() {
var abc = layer.open({
title: "选择机房",
type: 2,
content: "jf_list-t.jsp",
area: ['100%', '100%'],
maxmin: true
});
}
function saveForm() {
var seg=$("#info_name").val();
if(seg === ""){
layer.msg('输入的名称为空', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
return false;
}
saveSeg();
}
function saveSeg(){
$.ajax({
type: "POST",
url: "./action.jsp",
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
parent.searchModel();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
}
</script>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="info_type" id="info_type" value="hexin"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " style="margin-left: 10%;">
<tr class="">
<td class="search-label" >
机柜名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机柜编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td class="search-label" >
所属机房:
</td>
<td class="search-input" >
<input type="text" placeholder="输入所属机房" class="input-text" name="jf_id" id="jf_id" value=""
placeholder="" >
</td>
<td colspan="2">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
$.ajax({
type: "post",
url: "jf_list_ajax.jsp",
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function change_list(type) {
$("#info_type").val(type);
searchModel();
}
function select_jf(id,name) {
parent.document.getElementById("jf_id").value=id;
parent.document.getElementById("jf_name").value=name;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select t1.*,t2.info_name as jf_name from xlzy_jg t1 join xlzy_jf t2 on t1.jf_id=t2.id where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and t1.info_name like ? ");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and t1.bianhao like ? ");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(jf_id)){
sb.append(" and t2.info_name like ? ");
list_s.add("%"+jf_id+"%");
}
sb.append(" order by t1.add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">机柜名称</th>
<th width="150px">机柜编号</th>
<th width="150px">所属机房</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String jf_name_view = pub.trimNull((String) ht.get("jf_name"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td>
<a style="color:blue;" onclick="select_jf('<%=id%>','<%=info_name_view%>')" href="javascript:void(0)"><%=info_name_view%></a>
</td>
<td><%=bianhao_view%>
</td>
<td><%=jf_name_view%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " >
<tr class="">
<td class="search-label" >
配线架名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入配线架名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
所属机柜:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜" class="input-text" name="jg_id" id="jg_id" value=""
placeholder="" >
</td>
</tr>
<tr>
<td class="search-label" >
配线架类型:
</td>
<td class="search-input">
<select class="input-text" name="info_type" id="info_type">
<script>
$.post("../../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=pxj_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</select>
</td>
<td colspan="3">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
var url_1="pxj_list_ajax.jsp";
$.ajax({
type: "post",
url: url_1,
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
/*用户-编辑*/
function addRules(title, url) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function updateById(url,id){
var abc = layer.open({
title: "编辑",
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function deleteById(id) {
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./pxj_action.jsp",
data: {"action":"delete","delete_id":id},
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
})
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String action = pub.trimNull(request.getParameter("action"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String jg_id = pub.trimNull(request.getParameter("jg_id"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String describes = pub.trimNull(request.getParameter("describes"));
String delete_id = pub.trimNull(request.getParameter("delete_id"));
String update_id = pub.trimNull(request.getParameter("update_id"));
String id = DBUtil.getUUID();
String info_type=pub.trimNull(request.getParameter("info_type"));
String add_user = (String) session.getAttribute("session_login_id");
String add_time = pub.getCurrentServerTime();
try {
conn = com.censoft.db.DBUtil.getConnection();
conn.setAutoCommit(false);
if ("add".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "insert into xlzy_pxj (id,info_name,info_type,jg_id,describes,add_time,add_user) values (?,?,?,?,?,?,?)"
, new Object[]{id,info_name,info_type,jg_id,describes,add_time,add_user});
if (!is_up) {
out.println("基础信息配线架新增报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"基础信息配线架", "添加", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}if ("update".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "update xlzy_pxj set info_name=?,info_type=?,jg_id=?,describes=?,update_time=?,update_user=? where id=? "
, new Object[]{info_name,info_type,jg_id,describes,add_time,add_user,update_id});
if (!is_up) {
out.println("基础信息配线架" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"基础信息配线架", "修改", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}else if("delete".equals(action)){
boolean is_up = cf.executeUpdate(conn, "delete from xlzy_pxj where id=?"
, new Object[]{delete_id});
if (!is_up) {
out.println("基础信息配线架删除报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"基础信息配线架", "删除", delete_id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
Connection conn = null;
Vector v_list;
Hashtable ht = new Hashtable();
Pub pub = new Pub();
ConnectionFactory cf = new ConnectionFactory();
String update_id = pub.trimNull(request.getParameter("update_id"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String action="add";
if(!"".equals(update_id)){
action="update";
}
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list=cf.doQuery(conn,"select t1.*,t2.info_name as jf_name from xlzy_pxj t1 left join xlzy_jg t2 on t1.jg_id=t2.id where t1.id=? ",null,new Object[]{update_id});
if (v_list == null) {
out.println("查询用户出错");
return;
}
if (v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<article class="page-container" style="overflow: hidden;">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" name="action" value="<%=action%>">
<input type="hidden" name="update_id" value="<%=update_id%>">
<input type="hidden" name="jg_id" id="jf_id" value="<%=pub.trimNull((String) ht.get("jg_id"))%>">
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">类型:</label>
<div class="formControls col-xs-8 col-sm-9">
<select class="input-text" name="info_type" id="info_type">
<script>
var value='<%=pub.trimNull((String)ht.get("info_type"))%>';
value=encodeURI(encodeURI(value));
$.post("../../zd/zd_view_list.jsp?value="+value+"&name_id=info_type&zd_e_name=pxj_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</select>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">所属机柜:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text"
name="jg_name" id="jf_name" value="<%=pub.trimNull((String) ht.get("jf_name"))%>"
onclick="select_jf();" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name" id="info_name" value="<%=pub.trimNull((String) ht.get("info_name"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">备注:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea type="text" class="input-text" name="describes" id="describes"
style="height:120px;" ><%=pub.trimNull((String) ht.get("describes"))%></textarea>
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<input class="btn btn-primary radius" type="button" onclick="javascript:saveForm();"
value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
</div>
</div>
</form>
</article>
<script>
function saveForm() {
var seg=$("#info_name").val();
if(seg === ""){
layer.msg('输入的名称为空', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
return false;
}
saveSeg();
}
function saveSeg(){
$.ajax({
type: "POST",
url: "./pxj_action.jsp",
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
parent.searchModel();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
}
function select_jf() {
var abc = layer.open({
title: "选择机房",
type: 2,
content: "jf_list-t.jsp",
area: ['100%', '100%'],
maxmin: true
});
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String shebei_type = pub.trimNull(request.getParameter("shebei_type"));
String jg_id = pub.trimNull(request.getParameter("jg_id"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select t1.*,t2.info_name as jg_name from xlzy_pxj t1 join xlzy_jg t2 on t1.jg_id=t2.id where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and t1.info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(info_type)){
sb.append(" and t1.info_type = ?");
list_s.add(info_type);
}
if(!"".equals(jg_id)){
sb.append(" and t2.info_name like ?");
list_s.add("%"+jg_id+"%");
}
sb.append(" order by t1.add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./pxj_add-t.jsp?info_type="+info_type;
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">配线架名称</th>
<th width="150px">配线架类型</th>
<th width="150px">所属机柜</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String jg_name_view = pub.trimNull((String) ht.get("jg_name"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=info_name_view%>
</td>
<td><%=info_type_view%>
</td>
<td><%=jg_name_view%>
</td>
<td>
<a title="修改" href="javascript:void(0);" onclick="updateById('./pxj_add-t.jsp?update_id=<%=id%>','<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">修改</i>
</a>
<a title="删除" href="javascript:void(0);" onclick="deleteById('<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String action = pub.trimNull(request.getParameter("action"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_name_jc = pub.trimNull(request.getParameter("info_name_jc"));
String xuhao = pub.trimNull(request.getParameter("xuhao"));
String describes = pub.trimNull(request.getParameter("describes"));
String delete_id = pub.trimNull(request.getParameter("delete_id"));
String update_id = pub.trimNull(request.getParameter("update_id"));
String id = DBUtil.getUUID();
String info_type=pub.trimNull(request.getParameter("info_type"));
String add_user = (String) session.getAttribute("session_login_id");
String add_time = pub.getCurrentServerTime();
try {
conn = com.censoft.db.DBUtil.getConnection();
conn.setAutoCommit(false);
if ("add".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "insert into xlzy_shebei (id,info_name,info_name_jc,info_type,xuhao,describes,add_time,add_user) values (?,?,?,?,?,?,?,?)"
, new Object[]{id,info_name,info_name_jc,info_type,xuhao,describes,add_time,add_user});
if (!is_up) {
out.println("设备信息数据新增报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"设备信息数据", "添加", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}if ("update".equals(action)) {
boolean is_up = cf.executeUpdate(conn, "update xlzy_shebei set info_name=?,info_name_jc=?,info_type=?,xuhao=?,describes=?,update_time=?,update_user=? where id=? "
, new Object[]{info_name,info_name_jc,info_type,xuhao,describes,add_time,add_user,update_id});
if (!is_up) {
out.println("设备信息数据" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"设备信息数据", "修改", id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}else if("delete".equals(action)){
boolean is_up = cf.executeUpdate(conn, "delete from xlzy_shebei where id=?"
, new Object[]{delete_id});
if (!is_up) {
out.println("设备信息数据删除报错" + cf.getMsg());
conn.rollback();
return;
}
Logger.log(conn,"设备信息数据", "删除", delete_id, "", request);
out.println("success");
conn.commit();
conn.setAutoCommit(true);
return;
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
Connection conn = null;
Vector v_list;
Hashtable ht = new Hashtable();
Pub pub = new Pub();
ConnectionFactory cf = new ConnectionFactory();
String update_id = pub.trimNull(request.getParameter("update_id"));
String action="add";
if(!"".equals(update_id)){
action="update";
}
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list=cf.doQuery(conn,"select * from xlzy_shebei where id=? ",null,new Object[]{update_id});
if (v_list == null) {
out.println("查询用户出错");
return;
}
if (v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
}
} catch (Exception e) {
try {
if(conn != null){
conn.rollback();
}
} catch (SQLException e1) {
e1.printStackTrace();
}
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<article class="page-container" style="overflow: hidden;">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" name="action" value="<%=action%>">
<input type="hidden" name="update_id" value="<%=update_id%>">
<div class="row cl" >
<label class="form-label col-xs-2 col-sm-2">系统类型:</label>
<div class="formControls col-xs-2 col-sm-9">
<select name="info_type" class="input-text" id="info_type" >
<script>
var value='<%=pub.trimNull((String)ht.get("info_type"))%>';
value=encodeURI(encodeURI(value));
$.post("../../zd/zd_view_list.jsp?value="+value+"&name_id=info_type&zd_e_name=xt_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</select>
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">设备名称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name" id="info_name" value="<%=pub.trimNull((String) ht.get("info_name"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">设备简称:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="info_name_jc" id="info_name_jc" value="<%=pub.trimNull((String) ht.get("info_name_jc"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">序号:</label>
<div class="formControls col-xs-8 col-sm-9">
<input type="text" class="input-text" name="xuhao" id="xuhao" value="<%=pub.trimNull((String) ht.get("xuhao"))%>"
placeholder="" >
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-2 col-sm-2">备注:</label>
<div class="formControls col-xs-8 col-sm-9">
<textarea type="text" class="input-text" name="describes" id="describes"
style="height:120px;" ><%=pub.trimNull((String) ht.get("describes"))%></textarea>
</div>
</div>
<div class="row cl">
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
<input class="btn btn-primary radius" type="button" onclick="javascript:saveForm();"
value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
</div>
</div>
</form>
</article>
<script>
function saveForm() {
var seg=$("#info_name").val();
if(seg === ""){
layer.msg('输入的名称为空', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
return false;
}
saveSeg();
}
function saveSeg(){
$.ajax({
type: "POST",
url: "./action.jsp",
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
parent.searchModel();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String info_name_jc = pub.trimNull(request.getParameter("info_name_jc"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_shebei where 1=1 ");
if(!"".equals(info_type)){
sb.append(" and info_type=? ");
list_s.add(info_type);
}
if(!"".equals(info_name)){
sb.append(" and info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(info_name_jc)){
sb.append(" and info_name_jc like ?");
list_s.add("%"+info_name_jc+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./jf_add-t.jsp?info_type="+info_type;
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="40px">序号</th>
<th width="150px">系统类型</th>
<th width="150px">设备名称</th>
<th width="150px">设备简称</th>
<th width="150px">序号</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String info_name_jc_view = pub.trimNull((String) ht.get("info_name_jc"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String xuhao_view = pub.trimNull((String) ht.get("xuhao"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=info_type_view%>
</td>
<td><%=info_name_view%>
</td>
<td><%=info_name_jc_view%>
</td>
<td><%=xuhao_view%>
</td>
<td>
<a title="修改" href="javascript:void(0);" onclick="updateById('./jf_add-t.jsp?update_id=<%=id%>','<%=id%>')" class="ml-5" >
<i class="Hui-iconfont">修改</i>
</a>
<a title="删除" href="javascript:void(0);" onclick="deleteById('<%=id%>');" class="ml-5" >
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " >
<tr class="">
<td class="search-label" >
系统类型:
</td>
<td class="search-input" id="xt_type">
<script>
$.post("../../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=xt_type&math="+Math.random(),function(data){
document.getElementById("xt_type").innerHTML=data;
}
);
</script>
</td>
<td class="search-label" >
设备名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入设备名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
</tr>
<tr>
<td class="search-label" >
设备简称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入设备简称" class="input-text" name="info_name_jc" id="info_name_jc" value=""
placeholder="" >
</td>
<td colspan="3">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript">
function searchModel() {
var url_1="list_ajax_jf.jsp";
$.ajax({
type: "post",
url: url_1,
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
/*用户-编辑*/
function addRules(title, url) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function updateById(url,id){
var abc = layer.open({
title: "编辑",
type: 2,
content: url,
area: ['100%', '100%'],
maxmin: true
});
}
function deleteById(id) {
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp",
data: {"action":"delete","delete_id":id},
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
});
}
}
});
})
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%!
Pub pub = new Pub();
public String getName(ConnectionFactory cf,Connection conn,String id){
String sql="select info_name from basic_info_data where id=?";
Vector list =cf.doQuery(conn,sql,null,
new Object[]{id});
String info_name="";
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
info_name=pub.trimNull((String)ht.get("info_name"));
}
return info_name;
}
public String getPId(ConnectionFactory cf,Connection conn,String id){
String sql="select jf_id from basic_info_data where id=?";
Vector list =cf.doQuery(conn,sql,null,
new Object[]{id});
String jf_id="";
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
jf_id=pub.trimNull((String)ht.get("jf_id"));
}
return jf_id;
}
public String getChildId(ConnectionFactory cf,Connection conn,String id){
String sql="select id from basic_info_data where jf_id=?";
Vector list =cf.doQuery(conn,sql,null,
new Object[]{id});
String jf_id="";
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
jf_id=pub.trimNull((String)ht.get("id"));
}
return jf_id;
}
%>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String begin_jf = pub.trimNull(request.getParameter("begin_jf"));
String end_jf = pub.trimNull(request.getParameter("end_jf"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
if(!"".equals(begin_jf)||!"".equals(end_jf) ){
sb.append("select * from xlzy_info where 1=1 ");
if(!"".equals(begin_jf) ){
sb.append(" and (begin_jf_name like ? or begin_rdj_name like ?)");
list_s.add("%"+begin_jf+"%");
list_s.add("%"+begin_jf+"%");
//String sql="select ";
}
if(!"".equals(end_jf)){
sb.append(" and (end_jf_name like ? or end_rdj_name like ? or dianwei like ?)");
list_s.add("%"+end_jf+"%");
list_s.add("%"+end_jf+"%");
list_s.add("%"+end_jf+"%");
}
sb.append(" union select * from xlzy_info where 1=1 ");
if(!"".equals(begin_jf) ){
sb.append(" and (end_jf_name like ? or end_rdj_name like ?)");
list_s.add("%"+begin_jf+"%");
list_s.add("%"+begin_jf+"%");
}
if(!"".equals(end_jf)){
sb.append(" and (begin_jf_name like ? or begin_rdj_name like ? )");
list_s.add("%"+end_jf+"%");
list_s.add("%"+end_jf+"%");
}
}else{
sb.append("select * from xlzy_info where 1=1 ");
if(!"".equals(begin_jf) ){
sb.append(" and (begin_jf_name like ? or begin_rdj_name like ?)");
list_s.add("%"+begin_jf+"%");
list_s.add("%"+begin_jf+"%");
//String sql="select ";
}
if(!"".equals(end_jf)){
sb.append(" and (end_jf_name like ? or end_rdj_name like ? or dianwei like ?)");
list_s.add("%"+end_jf+"%");
list_s.add("%"+end_jf+"%");
list_s.add("%"+end_jf+"%");
}
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./add-t.jsp?info_type=";
%>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="100px">线缆编号</th>
<th width="150px">起点位置</th>
<th width="150px">终点位置</th>
<th width="80px">线缆芯数</th>
<th width="80px">已用芯数</th>
<th width="150px">线缆生产厂商</th>
<th width="120px">铺设完成日期</th>
<th width="150px">操作</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String property_view = pub.trimNull((String) ht.get("property"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String xinghao_view = pub.trimNull((String) ht.get("xinghao"));
String begin_jf_view = pub.trimNull((String) ht.get("begin_jf_name"));
String qd_address="";
String begin_rdj_view = pub.trimNull((String) ht.get("begin_rdj_name"));
if("".equals(begin_rdj_view)){
qd_address=begin_jf_view;
}else{
qd_address=begin_jf_view+"-"+begin_rdj_view;
}
String zd_address="";
String end_jf_view = pub.trimNull((String) ht.get("end_jf_name"));
String end_rdj_view = pub.trimNull((String) ht.get("end_rdj_name"));
if("".equals(end_rdj_view)){
zd_address=end_jf_view;
}else{
zd_address=end_jf_view+"-"+end_rdj_view;
}
String dianwei_view = pub.trimNull((String) ht.get("dianwei_name"));
if(!"".equals(dianwei_view)){
zd_address=dianwei_view;
}
String xin_number_view = pub.trimNull((String) ht.get("xin_number"));
String use_xin_number_view = pub.trimNull((String) ht.get("use_xin_number"));
String shengchanshang = pub.trimNull((String) ht.get("shengchanshang"));
String end_time_view = pub.trimNull((String) ht.get("end_time"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><%=bianhao_view%>
</td>
<td><%=qd_address%>
</td>
<td><%=zd_address%>
</td>
<td><%=xin_number_view%>
</td>
<td><%=use_xin_number_view%>
</td>
<td><%=shengchanshang%>
</td>
<td><%=end_time_view%>
</td>
<td>
<a title="查看" href="javascript:void(0);" onclick="updateById('./add-t.jsp?update_id=<%=id%>','<%=id%>')" class="ml-5" >
<i class="Hui-iconfont">查看</i>
</a>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
<%
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String jg_id = pub.trimNull(request.getParameter("jg_id"));
String xin_number ="";
String xin_number1 ="";
int number=99999;
try {
conn = com.censoft.db.DBUtil.getConnection();
//只能是以B为终点的一条线,以B为起点的多条线
String sql1="select sum(xin_number) as xin_number from xlzy_info " +
"where id in(select xlzy_id" +
" from xlzy_begin_end where begin_jf=? and begin_jg=?)" ;
String sql2="select xin_number as xin_number1 from xlzy_info " +
" where id in(select xlzy_id" +
" from xlzy_begin_end where end_jf=? and end_jg=?)";
Vector list = cf.doQuery(conn,sql1,null,new Object[]{jf_id,jf_id});
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
xin_number = pub.trimNull((String)ht.get("xin_number"));
}
Vector list2 = cf.doQuery(conn,sql2,null,new Object[]{jf_id,jf_id});
if(list2!=null && list2.size()>0){
Hashtable ht = (Hashtable)list2.get(0);
xin_number1 = pub.trimNull((String)ht.get("xin_number1"));
}
if(xin_number.indexOf(".")>0){
xin_number = xin_number.substring(0,xin_number.indexOf("."));
}
if(xin_number1.indexOf(".")>0){
xin_number1 = xin_number1.substring(0,xin_number1.indexOf("."));
}
if(!"".equals(xin_number1)&&!"".equals(xin_number)){
number=Integer.parseInt(xin_number1)-Integer.parseInt(xin_number);
}if("".equals(xin_number1)&&!"".equals(xin_number)){
//自己本身,且没有上级线,随便写
number=Integer.parseInt(xin_number);
}
out.println(number);
} catch (Exception e) {
e.printStackTrace();
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%
String div_id = request.getParameter("div_id");
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="div_id" id="div_id" value="<%=div_id%>"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " style="margin-left: 10%;">
<tr class="">
<td class="search-label" >
机房属性:
</td>
<td class="search-input" id="info_type">
<script>
$.post("../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=jf_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</td>
<td class="search-label" >
机房名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机房名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机房编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td colspan="2">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
$.ajax({
type: "post",
url: "dw_list_ajax.jsp",
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function change_list(type) {
$("#info_type").val(type);
searchModel();
}
function select_jf(div_id,id,name) {
parent.document.getElementById(div_id+"_id").value=id;
parent.document.getElementById(div_id).value=name;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String div_id = pub.trimNull(request.getParameter("div_id"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String build_number = pub.trimNull(request.getParameter("build_number"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_dw where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and info_name like ?");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and bianhao like ?");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(build_number)){
sb.append(" and build_number like ?");
list_s.add("%"+build_number+"%");
}
if(!"".equals(room_number)){
sb.append(" and room_number like ?");
list_s.add("%"+room_number+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
String telSegmentUrl="./dw_add-t.jsp?info_type="+info_type;
%>
<div>
<a class="btn btn-primary radius" onclick="addRules('新增信息','<%=telSegmentUrl%>');" >
新增
</a>
</div>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">点位名称</th>
<th width="150px">点位编号</th>
<th width="150px">楼号</th>
<th width="150px">楼层</th>
<th width="150px">房间号</th>
<th width="150px">地址</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String floor_view = pub.trimNull((String) ht.get("floor"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String build_number_view = pub.trimNull((String) ht.get("build_number"));
String room_number_view = pub.trimNull((String) ht.get("room_number"));
String quxian_view = pub.trimNull((String) ht.get("quxian"));
String address_view = pub.trimNull((String) ht.get("address"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td><a style="color:blue;" onclick="select_jf('<%=div_id%>','<%=id%>','<%=info_name_view%>')" href="javascript:void(0)"><%=info_name_view%></a>
</td>
<td><%=bianhao_view%>
</td>
<td><%=build_number_view%>
</td>
<td><%=floor_view%>
</td>
<td><%=room_number_view%>
</td>
<td><%=quxian_view%><%=address_view%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String jg_id = pub.trimNull(request.getParameter("jg_id"));
String xin_number ="0";
try {
conn = com.censoft.db.DBUtil.getConnection();
String sql="select sum(xin_number) as xin_number from xlzy_info where id in(select xlzy_id" +
" from xlzy_begin_end where begin_jf=? and begin_jg=?)";
Vector list = cf.doQuery(conn,sql,null,new Object[]{jf_id,jg_id});
if(list==null){
System.out.println("error"+cf.getMsg());
}
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
xin_number = pub.trimNull((String)ht.get("xin_number"));
}
if("".equals(xin_number)){
xin_number="0";
}
if(xin_number.indexOf(".")>0){
xin_number = xin_number.substring(0,xin_number.indexOf("."));
}
out.println(xin_number);
} catch (Exception e) {
e.printStackTrace();
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%
String div_id = request.getParameter("div_id");
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="div_id" id="div_id" value="<%=div_id%>"/>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " style="margin-left: 10%;">
<tr class="">
<td class="search-label" >
机房属性:
</td>
<td class="search-input" id="info_type">
<script>
$.post("../zd/zd_view_list.jsp?name_id=info_type&zd_e_name=jf_type&math="+Math.random(),function(data){
document.getElementById("info_type").innerHTML=data;
}
);
</script>
</td>
<td class="search-label" >
机房名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机房名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机房编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td colspan="2">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
$.ajax({
type: "post",
url: "jf_list_ajax.jsp",
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function change_list(type) {
$("#info_type").val(type);
searchModel();
}
function select_jf(div_id,id,name) {
parent.document.getElementById(div_id).value=name;
if(div_id=='end_jf'||div_id=='dianwei'){
parent.xinNumber(id);
}
if(div_id=='begin_jf'){
parent.checkXinNumber(id);
}
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String div_id = pub.trimNull(request.getParameter("div_id"));
String info_name = pub.trimNull(request.getParameter("info_name"));
String info_type = pub.trimNull(request.getParameter("info_type"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from xlzy_jf where 1=1 ");
if(!"".equals(info_type)){
sb.append(" and info_type=? ");
list_s.add(info_type);
}
if(!"".equals(info_name)){
sb.append(" and info_name like ? ");
list_s.add("%"+info_name+"%");
}
if(!"".equals(info_name)){
sb.append(" and bianhao like ? ");
list_s.add("%"+bianhao+"%");
}
sb.append(" order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">机房名称</th>
<th width="150px">机房编号</th>
<th width="150px">机房属性</th>
<th width="150px">楼号</th>
<th width="150px">楼层</th>
<th width="150px">房间号</th>
<th width="150px">地址</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String info_type_view = pub.trimNull((String) ht.get("info_type"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String floor_view = pub.trimNull((String) ht.get("floor"));
String build_number_view = pub.trimNull((String) ht.get("build_number"));
String room_number_view = pub.trimNull((String) ht.get("room_number"));
String quxian_view = pub.trimNull((String) ht.get("quxian"));
String address_view = pub.trimNull((String) ht.get("address"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td>
<a style="color:blue;" onclick="select_jf('<%=div_id%>','<%=id%>','<%=bianhao_view%>')" href="javascript:void(0)"><%=info_name_view%></a>
</td>
<td><%=bianhao_view%>
</td>
<td><%=info_type_view%>
</td>
<td><%=build_number_view%>
</td>
<td><%=floor_view%>
</td>
<td><%=room_number_view%>
</td>
<td><%=quxian_view%>-<%=address_view%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<%
String div_id = request.getParameter("div_id");
String jf_id = request.getParameter("jf_id");
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<div class="page-container">
<div class="content" >
<div class="search-form">
<form method="post" id="data_form_search" name="data_form_search">
<input type="hidden" name="page_number" id="page_number" value="1"/>
<input type="hidden" name="div_id" id="div_id" value="<%=div_id%>"/>
<%--<input type="hidden" name="jf_id" value="<%=jf_id%>"/>--%>
<input type="hidden" name="page_size" id="page_size" value="10"/>
<div class="text-l">
<table class="search-table " style="margin-left: 10%;">
<tr class="">
<td class="search-label" >
机柜名称:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜名称" class="input-text" name="info_name" id="info_name" value=""
placeholder="" >
</td>
<td class="search-label" >
机柜编号:
</td>
<td class="search-input" >
<input type="text" placeholder="输入机柜编号" class="input-text" name="bianhao" id="bianhao" value=""
placeholder="" >
</td>
<td class="search-label" >
所属机房:
</td>
<td class="search-input" >
<input type="text" placeholder="输入所属机房" class="input-text" name="jf_id" id="jf_id" value=""
placeholder="" >
</td>
<td colspan="2">
<a class="btn btn-primary radius" id="searchA" onclick="searchUserModel();" style="margin-left:19%;">
查询
</a>
<a class="btn btn-info radius" onclick="chongzhi();" style="margin-left:5px;">
重置
</a>
</td>
</tr>
</table>
</div>
</form>
</div>
<div style="height:10px;background-color: #d9e4f6">
</div>
<div class="datalist " id="datalist">
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript">
function searchModel() {
$.ajax({
type: "post",
url: "jg_list_ajax.jsp",
data: $('#data_form_search').serialize(),
success: function (msg) {
//data_form_search.reset();
$("#datalist").html(msg);
}
});
}
function change_list(type) {
$("#info_type").val(type);
searchModel();
}
function select_jf(div_id,id,name) {
//parent.document.getElementById(div_id+"_id").value=id;
parent.document.getElementById(div_id).value=name;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
function searchUserModel() {
$("#page_number").val("1");
searchModel();
}
$(function(){
searchModel();
});
function chongzhi(){
$("#page_size").val("10");
data_form_search.reset();
searchUserModel();
}
</script>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
String page_number = pub.trimNull(request.getParameter("page_number"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
String info_name = pub.trimNull(request.getParameter("info_name"));
String div_id = pub.trimNull(request.getParameter("div_id"));
String bianhao = pub.trimNull(request.getParameter("bianhao"));
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String room_number = pub.trimNull(request.getParameter("room_number"));
List list_s = new ArrayList();
try {
StringBuffer sb = new StringBuffer();
sb.append("select t1.*,t2.info_name as jf_name from xlzy_jg t1 join xlzy_jf t2 on t1.jf_id=t2.id where 1=1 ");
if(!"".equals(info_name)){
sb.append(" and t1.info_name like ? ");
list_s.add("%"+info_name+"%");
}
if(!"".equals(bianhao)){
sb.append(" and t1.bianhao like ? ");
list_s.add("%"+bianhao+"%");
}
if(!"".equals(jf_id)){
sb.append(" and t2.id = ? ");
list_s.add(jf_id);
}
sb.append(" order by t1.add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
if (v_list == null) {
out.println("查询基础信息出错" + cf.getMsg());
return;
}
} catch (Exception e) {
out.println("查询基础信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<div class="table-list">
<table class="table table-hover table-bg">
<thead>
<tr class="text-c">
<th width="30px">序号</th>
<th width="150px">机柜名称</th>
<th width="150px">机柜编号</th>
<th width="150px">所属机房</th>
</tr>
</thead>
<tbody>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 1; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String id = pub.trimNull((String) ht.get("id"));
String info_name_view = pub.trimNull((String) ht.get("info_name"));
String bianhao_view = pub.trimNull((String) ht.get("bianhao"));
String jf_name_view = pub.trimNull((String) ht.get("jf_name"));
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
</td>
<td>
<a style="color:blue;" onclick="select_jf('<%=div_id%>','<%=id%>','<%=bianhao_view%>')" href="javascript:void(0)"><%=info_name_view%></a>
</td>
<td><%=bianhao_view%>
</td>
<td><%=jf_name_view%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</div>
<jsp:include page="/common/page_ajax.jsp" >
<jsp:param name="page_number" value="<%=page_number%>" />
<jsp:param name="rowCnt" value="<%=rowCnt%>" />
<jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.db.Logger" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list;
String jf_id = pub.trimNull(request.getParameter("jf_id"));
String xin_number ="";
String xin_number1 ="";
int number=99999;
try {
conn = com.censoft.db.DBUtil.getConnection();
String sql="select t1.*,t2.* from (select sum(xin_number) as xin_number from xlzy_info where begin_jf=?)t1," +
"(select xin_number as xin_number1 from xlzy_info where end_jf=?)t2";
Vector list = cf.doQuery(conn,sql,null,new Object[]{jf_id,jf_id});
if(list!=null && list.size()>0){
Hashtable ht = (Hashtable)list.get(0);
xin_number = pub.trimNull((String)ht.get("xin_number"));
xin_number1 = pub.trimNull((String)ht.get("xin_number1"));
}
if(xin_number.indexOf(".")>0){
xin_number = xin_number.substring(0,xin_number.indexOf("."));
}
if(xin_number1.indexOf(".")>0){
xin_number1 = xin_number1.substring(0,xin_number1.indexOf("."));
}
if(!"".equals(xin_number)&&!"".equals(xin_number1)){
number=Integer.parseInt(xin_number1)-Integer.parseInt(xin_number);
}
out.println(number);
} catch (Exception e) {
e.printStackTrace();
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment