Commit cf3d69c2 authored by 马超's avatar 马超

值班管理

parent 0ec9be32
...@@ -178,9 +178,9 @@ ...@@ -178,9 +178,9 @@
int startIndex=startIndexBefore; int startIndex=startIndexBefore;
StringBuffer sql1=new StringBuffer("insert into zb_user_gl (year,zb_type,zb_user,order_num,add_user,add_time) values (?,?,?,?,?,?)"); StringBuffer sql1=new StringBuffer("insert into zb_user_gl (year,zb_type,zb_user,order_num,add_user,add_time) values (?,?,?,?,?,?)");
Vector zb_type_list = cf.doQuery(conn,"select * from zb_type where mx_id=? order by order_num asc",null,new Object[]{mxId}); Vector zb_type_list = cf.doQuery(conn,"select * from zb_type where mx_id=? order by order_num asc",null,new Object[]{mxId});
for(int a=0;a<selectDay;a++){ if(zb_type_list!=null && zb_type_list.size()>0) {
if(zb_type_list!=null && zb_type_list.size()>0) { for (int i = 0; i < zb_type_list.size(); i++) {
for (int i = 0; i < zb_type_list.size(); i++) { for(int a=0;a<selectDay;a++){
Hashtable ht = (Hashtable) zb_type_list.get(i); Hashtable ht = (Hashtable) zb_type_list.get(i);
String ren_num = pub.trimNull((String) ht.get("ren_num")); String ren_num = pub.trimNull((String) ht.get("ren_num"));
String zb_type = pub.trimNull((String) ht.get("zb_type")); String zb_type = pub.trimNull((String) ht.get("zb_type"));
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
} }
function viewUser(year,month,day) { function viewUser(year,month,day) {
var url = './viewUser-t.jsp?year='+year+'&month='+month+'&day='+day; var url = './viewUser-t.jsp?year='+year+'&month='+month+'&day='+day;
viewDeptOrUserInfo(year+''+month+''+day+'日值班表', url, '1000', '500'); viewDeptOrUserInfo(year+''+month+''+day+'日值班表', url, '1100', '550');
} }
function changeZb() { function changeZb() {
var url = './changeZb-t.jsp'; var url = './changeZb-t.jsp';
......
<%--
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 contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %> <%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %> <%@ page import="java.util.*" %>
...@@ -24,13 +15,9 @@ ...@@ -24,13 +15,9 @@
if ("".equals(login_id)) { if ("".equals(login_id)) {
System.out.println("当前没有用户信息"); System.out.println("当前没有用户信息");
} }
String page_number = pub.trimNull(request.getParameter("page_number"));
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String zb_type = pub.trimNull(request.getParameter("zb_type")); String zb_type = pub.trimNull(request.getParameter("zb_type"));
String action = pub.trimNull(request.getParameter("action")); String action = pub.trimNull(request.getParameter("action"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "10";
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
List list = new ArrayList(); List list = new ArrayList();
sql.append("select * from zb_user order by id asc"); sql.append("select * from zb_user order by id asc");
...@@ -59,7 +46,7 @@ ...@@ -59,7 +46,7 @@
} }
conn.commit(); conn.commit();
} }
v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray()); v_list = cf.doQuery(conn, sql.toString(), null, list.toArray());
if (v_list == null) { if (v_list == null) {
out.println("查询用户出错"); out.println("查询用户出错");
return; return;
...@@ -77,60 +64,55 @@ ...@@ -77,60 +64,55 @@
确定 确定
</a> </a>
</div> </div>
<form action="selectUser-t.jsp" method="post" id="groupUser" name="groupUser"> <div style="width:100%;height:90%;overflow-y: auto">
<input type="hidden" name="action" id="action" value="update"> <form action="selectUser-t.jsp" method="post" id="groupUser" name="groupUser">
<input type="hidden" name="year" id="year" value="<%=year%>"> <input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="zb_type" id="zb_type" value="<%=zb_type%>"> <input type="hidden" name="year" id="year" value="<%=year%>">
<table class="table table-border table-bordered table-hover table-bg table-sort"> <input type="hidden" name="zb_type" id="zb_type" value="<%=zb_type%>">
<thead> <table class="table table-border table-bordered table-hover table-bg table-sort">
<tr class="text-c"> <thead>
<th width="30">序号</th> <tr class="text-c">
<th width="30"> <th width="30">序号</th>
<input id="checkboxAll" type="checkbox" onclick="checkAll(this);"></input> <th width="30">
</th> <input id="checkboxAll" type="checkbox" onclick="checkAll(this);"></input>
<th width="100">人员姓名</th> </th>
<th width="100">联系电话</th> <th width="100">人员姓名</th>
<th width="100">工号</th> <th width="100">联系电话</th>
</tr> <th width="100">工号</th>
</thead> </tr>
<tbody id="groupUserInfo"> </thead>
<% <tbody id="groupUserInfo">
Hashtable ht_1 =null; <%
if (v_list != null && v_list.size() > 0) { Hashtable ht_1 =null;
for (int i = 1; i < v_list.size(); i++) { if (v_list != null && v_list.size() > 0) {
Hashtable ht = (Hashtable) v_list.get(i); for (int i = 0; i < v_list.size(); i++) {
String user_name = pub.trimNull((String) ht.get("user_name")); Hashtable ht = (Hashtable) v_list.get(i);
String tel = pub.trimNull((String) ht.get("tel")); String user_name = pub.trimNull((String) ht.get("user_name"));
String gh = pub.trimNull((String) ht.get("gh")); String tel = pub.trimNull((String) ht.get("tel"));
%> String gh = pub.trimNull((String) ht.get("gh"));
<tr class="text-c"> %>
<td><%=i%> <tr class="text-c">
</td> <td><%=i+1%>
<td > </td>
<input type="checkbox" class="info" id="userids" name="userids" value="<%=user_name%>" <td >
<%if(user_names.indexOf(user_name)>=0){%>checked="checked"<%}%>/> <input type="checkbox" class="info" id="userids" name="userids" value="<%=user_name%>"
</td> <%if(user_names.indexOf(user_name)>=0){%>checked="checked"<%}%>/>
<td><%=user_name%> </td>
</td> <td><%=user_name%>
<td><%=tel%> </td>
</td> <td><%=tel%>
<td><%=gh%> </td>
</td> <td><%=gh%>
</tr> </td>
<% </tr>
<%
}
} }
} %>
%> </tbody>
</tbody> </table>
</table> </form>
</form> </div>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<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>
<script type="text/javascript"> <script type="text/javascript">
var checkAll = function (checkbox) { var checkAll = function (checkbox) {
$(".info").prop("checked", checkbox.checked); $(".info").prop("checked", checkbox.checked);
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<div class=""> <div class="">
<form class="form form-horizontal" method="post" id="form1" name="form1" action="export_query.jsp" > <form class="form form-horizontal" method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="<%=year+month+day%>" name="exportDate" id="exportDate"> <input type="hidden" value="<%=year+month+day%>" name="exportDate" id="exportDate">
<div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;"> <div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;height: 400px;">
<% <%
if(v_list.size()>0){ if(v_list.size()>0){
for(int i=0;i<v_list.size();i++){ for(int i=0;i<v_list.size();i++){
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
String time=getZbTyTime(cf,conn,mxId,zb_type); String time=getZbTyTime(cf,conn,mxId,zb_type);
%> %>
<div style="width:900px;height:120px;float:left;margin-left: 50px;border:0.5px solid #000;position:relative;"> <div style="width:1000px;height:120px;float:left;margin-left: 50px;border:0.5px solid #000;position:relative;">
<div style="width:140px;height:120px;float:left;border-right:0.5px solid #000;text-align: center;line-height: 80px;"> <div style="width:140px;height:120px;float:left;border-right:0.5px solid #000;text-align: center;line-height: 80px;">
<p style="height:30px;"> <%=zb_type%></p> <p style="height:30px;"> <%=zb_type%></p>
<p style="height:30px;">(<%=time%>)</p> <p style="height:30px;">(<%=time%>)</p>
......
...@@ -122,30 +122,9 @@ ...@@ -122,30 +122,9 @@
conn.rollback(); conn.rollback();
return; return;
} }
for(int n=0;n<mxDay;n++){
userNames=getUserNames(cf,conn,startIndex,Integer.parseInt(ren_num));
if(!"".equals(userNames)){
startIndex = Integer.parseInt(userNames.substring(0,userNames.indexOf("_")));
userNames = userNames.substring(userNames.indexOf("_")+1,userNames.length()-1);
}
is_oper = cf.executeUpdate(conn, "insert into zb_mx_day(mx_id,zb_type,user_name,day,add_user,add_time) values (?,?,?,?,?,?)"
, new Object[]{mx_id,zb_type_id,userNames,n+1,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_mx_day表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
} }
}else if("delete".equals(action)){ }else if("delete".equals(action)){
action_msg="删除"; action_msg="删除";
is_oper = cf.executeUpdate(conn, "delete from zb_mx_day where mx_id=?",new Object[]{mx_id});
if (!is_oper) {
conn.rollback();
System.out.println("删除zb_mx_day表出错了" + cf.getMsg());
return;
}
is_oper = cf.executeUpdate(conn, "delete from zb_type where mx_id=?",new Object[]{mx_id}); is_oper = cf.executeUpdate(conn, "delete from zb_type where mx_id=?",new Object[]{mx_id});
if (!is_oper) { if (!is_oper) {
conn.rollback(); conn.rollback();
...@@ -185,21 +164,6 @@ ...@@ -185,21 +164,6 @@
conn.rollback(); conn.rollback();
return; return;
} }
for(int n=0;n<mxDay;n++){
userNames=getUserNames(cf,conn,startIndex,Integer.parseInt(ren_num));
if(!"".equals(userNames)){
startIndex = Integer.parseInt(userNames.substring(0,userNames.indexOf("_")));
userNames = userNames.substring(userNames.indexOf("_")+1,userNames.length()-1);
}
is_oper = cf.executeUpdate(conn, "update zb_mx_day set user_name=?,update_user=?,update_time=? where mx_id=? and zb_type=? and day=?"
, new Object[]{userNames,add_user,add_time,mx_id,zb_type_id,n+1});
if (!is_oper) {
System.out.println("修改b_mx_day表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
}else{ }else{
String new_id=UUID.randomUUID().toString().trim().replaceAll("-", ""); String new_id=UUID.randomUUID().toString().trim().replaceAll("-", "");
is_oper = cf.executeUpdate(conn, "insert into zb_type(id,mx_id,zb_type,b_time,e_time,ren_num,add_user,add_time) values (?,?,?,?,?,?,?,?)" is_oper = cf.executeUpdate(conn, "insert into zb_type(id,mx_id,zb_type,b_time,e_time,ren_num,add_user,add_time) values (?,?,?,?,?,?,?,?)"
...@@ -209,20 +173,6 @@ ...@@ -209,20 +173,6 @@
conn.rollback(); conn.rollback();
return; return;
} }
for(int n=0;n<mxDay;n++){
userNames=getUserNames(cf,conn,startIndex,Integer.parseInt(ren_num));
if(!"".equals(userNames)){
startIndex = Integer.parseInt(userNames.substring(0,userNames.indexOf("_")));
userNames = userNames.substring(userNames.indexOf("_")+1,userNames.length()-1);
}
is_oper = cf.executeUpdate(conn, "insert into zb_mx_day(mx_id,zb_type,user_name,day,add_user,add_time) values (?,?,?,?,?,?)"
, new Object[]{mx_id,new_id,userNames,n+1,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_mx_day表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
} }
if (!is_oper) { if (!is_oper) {
System.out.println("修改zb_type表出错了" + cf.getMsg()); System.out.println("修改zb_type表出错了" + cf.getMsg());
...@@ -255,7 +205,6 @@ ...@@ -255,7 +205,6 @@
return; return;
} }
}*/ }*/
is_oper = cf.executeUpdate(conn, "update zb_mx set name=? where id=?", new Object[]{mx_name,mx_id}); is_oper = cf.executeUpdate(conn, "update zb_mx set name=? where id=?", new Object[]{mx_name,mx_id});
if (!is_oper) { if (!is_oper) {
conn.rollback(); conn.rollback();
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
<input type="hidden" value="<%=action%>" name="action" id="action"> <input type="hidden" value="<%=action%>" name="action" id="action">
<input type="hidden" value="<%=mx_id%>" name="mx_id" id="mx_id"> <input type="hidden" value="<%=mx_id%>" name="mx_id" id="mx_id">
<input type="hidden" id="input_count" name="input_count" value="<%=listSize%>"/> <input type="hidden" id="input_count" name="input_count" value="<%=listSize%>"/>
<input type="hidden" name="mx_day" id="mx_day" value="30" >
<div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;"> <div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;">
<div class="row cl"> <div class="row cl">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
...@@ -83,14 +84,6 @@ ...@@ -83,14 +84,6 @@
<input type="text" class="input-text" name="mx_name" id="mx_name" value="<%=pub.trimNull((String)ht.get("name"))%>" > <input type="text" class="input-text" name="mx_name" id="mx_name" value="<%=pub.trimNull((String)ht.get("name"))%>" >
</div> </div>
</div> </div>
<div class="row cl" >
<label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>天数&nbsp;
</label>
<div class="formControls col-xs-8 col-sm-10">
<input <%if("update".equals(action)){%>readonly="readonly" <%}%>type="text" class="input-text" name="mx_day" id="mx_day" value="<%=pub.trimNull((String)ht.get("day"))%>" >
</div>
</div>
<div class="row cl" id="zb_type_div"> <div class="row cl" id="zb_type_div">
<label class="form-label col-xs-4 col-sm-2"> <label class="form-label col-xs-4 col-sm-2">
<span class="c-red">*</span>时间段&nbsp; <span class="c-red">*</span>时间段&nbsp;
...@@ -231,7 +224,7 @@ ...@@ -231,7 +224,7 @@
layer.msg('操作成功!', {icon: 1, time: 1000}, layer.msg('操作成功!', {icon: 1, time: 1000},
function () { function () {
//parent.searchModel(); //parent.searchModel();
$("#check_mx_id").val(mx_id); parent.document.getElementById("check_mx_id").value=mx_id;
var index = parent.layer.getFrameIndex(window.name); var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index); parent.layer.close(index);
}); });
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
maxmin: true, maxmin: true,
end:function () { end:function () {
searchModel(); searchModel();
searchModel1($("#check_mx_id").val()); openLi($("#check_mx_id").val(),$("#check_mx_day").val());
} }
}); });
//layer.full(abc); //layer.full(abc);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
String mx_id = pub.trimNull(request.getParameter("mx_id")); String mx_id = pub.trimNull(request.getParameter("mx_id"));
String Mxday = pub.trimNull(request.getParameter("day")); String Mxday = pub.trimNull(request.getParameter("day"));
int divCount=8; int divCount=30;
if(!"".equals(Mxday)){ if(!"".equals(Mxday)){
divCount=Integer.parseInt(Mxday); divCount=Integer.parseInt(Mxday);
} }
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
String zb_type=pub.trimNull((String)ht.get("zb_type")); String zb_type=pub.trimNull((String)ht.get("zb_type"));
String b_time=pub.trimNull((String)ht.get("b_time")); String b_time=pub.trimNull((String)ht.get("b_time"));
String e_time=pub.trimNull((String)ht.get("e_time")); String e_time=pub.trimNull((String)ht.get("e_time"));
v_list_day = cf.doQuery(conn, sql_day.toString(), null, new Object[]{mx_id,id});
%> %>
<% <%
if(i==0){%> if(i==0){%>
...@@ -56,16 +55,12 @@ ...@@ -56,16 +55,12 @@
<div style="width:140px;height:40px;float:left;border:0.5px solid #000;"> <div style="width:140px;height:40px;float:left;border:0.5px solid #000;">
</div> </div>
<% <%
if(v_list_day!=null && v_list_day.size()>0){ for(int n=0;n<30;n++){
for(int n=0;n<v_list_day.size();n++){
Hashtable ht1 = (Hashtable) v_list_day.get(n);
String day=pub.trimNull((String)ht1.get("day"));
%> %>
<div style="width:140px;height:40px;line-height:40px;text-align:center;color:#fff;float:left;border:0.5px solid #000;background-color: #00b7ee"> <div style="width:140px;height:40px;line-height:40px;text-align:center;color:#fff;float:left;border:0.5px solid #000;background-color: #00b7ee">
<%=day%> <%=n+1%>
</div> </div>
<% }}%> <% }%>
</div> </div>
<%}%> <%}%>
...@@ -75,21 +70,16 @@ ...@@ -75,21 +70,16 @@
<p style="height:30px;">(<%=b_time%>-<%=e_time%>)</p> <p style="height:30px;">(<%=b_time%>-<%=e_time%>)</p>
</div> </div>
<% <%
if(v_list_day!=null && v_list_day.size()>0){ for(int n=0;n<30;n++){
for(int n=0;n<v_list_day.size();n++){
Hashtable ht1 = (Hashtable) v_list_day.get(n);
String day_id=pub.trimNull((String)ht1.get("id"));
String user_name=pub.trimNull((String)ht1.get("user_name"));
user_name=user_name.replace(",","</br>");
%> %>
<div style="text-align:center;width:140px;height:160px;float:left;border:0.5px solid #000;position: relative"> <div style="text-align:center;width:140px;height:160px;float:left;border:0.5px solid #000;position: relative">
<p style="height:10px;display:none;"> <p style="height:10px;display:none;">
<%=user_name%>
</p> </p>
<button class="btn btn-success" onclick="editUser('<%=day_id%>','<%=mx_id%>');" style="display:none;text-align:center;position:absolute; right:0; bottom:0;"> <button class="btn btn-success" style="display:none;text-align:center;position:absolute; right:0; bottom:0;">
修改</button> 修改</button>
</div> </div>
<%}}%> <%}%>
</div> </div>
<%}%> <%}%>
</div> </div>
......
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