Commit 70955f4c authored by 马超's avatar 马超

值班管理

parent 683b0569
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
table{border-collapse: collapse;background-color:#fff6d9;} table{border-collapse: collapse;background-color:#fff6d9;}
td,th{border: 1px solid #F1EBE4;width:100px;} td,th{border: 1px solid #F1EBE4;width:100px;}
table th {height:50px;line-height: 50px;text-align: center;font-size: 20px;} table th {height:50px;line-height: 50px;text-align: center;font-size: 20px;}
td{height:90px;text-align:center;vertical-align:middle;} td{height:95px;text-align:center;vertical-align:middle;}
td {vertical-align:top;position:relative;font-size: 15px;cursor: pointer;} td {vertical-align:top;position:relative;font-size: 15px;cursor: pointer;}
td div{position:absolute; left:0; top:0;font-size: 13px;} td div{position:absolute; left:0; top:0;font-size: 13px;}
.title {width:100%;height:60px;line-height:60px;background-color: #00B83F;color:#fff;text-align: center;font-size: 20px;} .title {width:100%;height:60px;line-height:60px;background-color: #00B83F;color:#fff;text-align: center;font-size: 20px;}
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
换班 换班
</a> </a>
</div> </div>
<div id="calendar" class="calendar" style="height:580px;overflow-y:auto; "></div> <div id="calendar" class="calendar" style="height:600px;overflow-y:auto; "></div>
<form method="post" id="form1" name="form1" action="export_query.jsp" > <form method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="" id="nowDays" name="nowDays"> <input type="hidden" value="" id="nowDays" name="nowDays">
<input type="hidden" value="" id="nowYear" name="nowYear"> <input type="hidden" value="" id="nowYear" name="nowYear">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
"<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" + "<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" +
"</td>" ; "</td>" ;
start++; start++;
}else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数 }else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
"<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" + "<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" +
"</td>" ; "</td>" ;
curIndex++; curIndex++;
}else{ //渲染当月的天数 }else{ //渲染当月的天数
...@@ -107,14 +107,14 @@ ...@@ -107,14 +107,14 @@
"<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
}else{ }else{
str += "<td id='divId_"+month+'_'+curIndex+"_td'>" + str += "<td id='divId_"+month+'_'+curIndex+"_td'>" +
"<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
} }
totalDays+=curIndex+","; totalDays+=curIndex+",";
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
按月 按月
</a> </a>
</div> </div>
<div id="calendar" class="calendar" style="height:580px;overflow-y:auto; "></div> <div id="calendar" class="calendar" style="height:600px;overflow-y:auto; "></div>
<form method="post" id="form1" name="form1" action="export_query.jsp" > <form method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="" id="nowDays" name="nowDays"> <input type="hidden" value="" id="nowDays" name="nowDays">
<input type="hidden" value="" id="nowYear" name="nowYear"> <input type="hidden" value="" id="nowYear" name="nowYear">
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
"<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" + "<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" +
"</td>" ; "</td>" ;
start++; start++;
}else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数 }else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
"<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" + "<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" +
"</td>" ; "</td>" ;
curIndex++; curIndex++;
}else{ //渲染当月的天数 }else{ //渲染当月的天数
...@@ -108,14 +108,14 @@ ...@@ -108,14 +108,14 @@
"<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
}else{ }else{
str += "<td id='divId_"+month+'_'+curIndex+"_td'>" + str += "<td id='divId_"+month+'_'+curIndex+"_td'>" +
"<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
} }
totalDays+=curIndex+","; totalDays+=curIndex+",";
......
<%@ 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.util.Hashtable" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%!
public static String getMxId(ConnectionFactory cf,Connection conn,String date) {
String mx_id="";
Vector userList = cf.doQuery(conn,"select mx_id from zb_zdpb_bgs where b_time<=? and e_time>=? order by add_time desc limit 1",null,new Object[]{date,date});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
mx_id = (String) ht1.get("mx_id");
}
return mx_id;
}
public static String getZbTyTime(ConnectionFactory cf,Connection conn,String mx_id,String zb_type) {
String time="";
Vector userList = cf.doQuery(conn,"select b_time,e_time from zb_type_bgs where mx_id=? and zb_type=?"
,null,new Object[]{mx_id,zb_type});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
time = (String) ht1.get("b_time")+"-"+(String) ht1.get("e_time");
}
return time;
}
public static String getTel(ConnectionFactory cf,Connection conn,String user_name) {
String tel="";
Vector userList = cf.doQuery(conn,"select tel from zb_bgs_user where user_name=? "
,null,new Object[]{user_name});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
tel = (String) ht1.get("tel");
}
return tel;
}
%>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
Date date = new Date();
SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd");
String today=sd.format(date);
String year=today.substring(0,4);
String month=today.substring(5,7);
String day=today.substring(8,10);
Hashtable ht = new Hashtable();
StringBuffer sb = new StringBuffer();
try {
conn = com.censoft.db.DBUtil.getConnection();
sb.append("select t1.zb_user,t1.zb_type from zb_user_gl_bgs t1 where 1=1 ");
sb.append(" and t1.year=? ");
sb.append(" order by t1.id asc");
String mxId=getMxId(cf,conn,today);
v_list=cf.doQuery(conn,sb.toString(),null,new Object[]{today});
if(v_list==null){
System.out.println("查询该日期值班人员出错"+cf.getMsg());
}
%>
<div class="">
<form class="form form-horizontal" method="post" id="form1" name="form1" action="export_query.jsp" >
<div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;">
<div style="height:40px;line-height: 40px;background-color: #d7d7d7;font-size: 18px;padding-left: 20px;">值班日期:<%=year%><%=month%><%=day%></div>
<%
if(v_list.size()>0){
for(int i=0;i<v_list.size();i++){
ht = (Hashtable)v_list.get(i);
String zb_type= pub.trimNull((String) ht.get("zb_type"));
String user_name= pub.trimNull((String) ht.get("zb_user"));
String time=getZbTyTime(cf,conn,mxId,zb_type);
%>
<div style="width:1280px;height:190px;float:left;margin-left: 50px;
border:0.5px solid #000;position:relative;<%if(i==0){%>margin-top:5px;<%}%>">
<div style="font-size: 16px;width:200px;height:190px;float:left;border-right:0.5px solid #000;text-align: center;line-height: 150px;">
<p style="height:30px;"> <%=zb_type%></p>
<p style="height:30px;">(<%=time%>)</p>
</div>
<%
String[] user_names=user_name.split(",");
for(int n=0;n<user_names.length;n++){
String telphone=getTel(cf,conn,user_names[n]);
%>
<div style="text-align:center;width:160px;height:190px;line-height:190px;float:left;position: relative">
<p style="height:100px;line-height: 150px;margin:0px;">
<img src="../../images/user.png"/>
</p>
<div style="height:70px;margin:0px;font-size: 16px;">
<div style="height:40px;line-height: 50px;">
<%=user_names[n]%>
</div>
<div style="height:30px;line-height: 20px;">
<%=telphone%>
</div>
</div>
</div>
<%
}
%>
</div>
<%
}
}
%>
</div>
</form>
</div>
<%
} catch (Exception e) {
out.println("查询用户信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
换班 换班
</a> </a>
</div> </div>
<div id="calendar" class="calendar" style="height:580px;overflow-y:auto; "></div> <div id="calendar" class="calendar" style="height:600px;overflow-y:auto; "></div>
<form method="post" id="form1" name="form1" action="export_query.jsp" > <form method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="" id="nowDays" name="nowDays"> <input type="hidden" value="" id="nowDays" name="nowDays">
<input type="hidden" value="" id="nowYear" name="nowYear"> <input type="hidden" value="" id="nowYear" name="nowYear">
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
"<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" + "<div style='color:#989898;' id='divId_"+(month-1)+'_'+start+"'>" + start + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month-1)+'_'+start+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month-1)+'_'+start+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month-1)+'_'+start+"_usrlist'></div>" +
"</td>" ; "</td>" ;
start++; start++;
}else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数 }else if(curIndex > days || flag == true){ //当月天数渲染完之后,剩余的位置用于渲染下个月的天数
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
"<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" + "<div style='color:#989898;' id='divId_"+(month+1)+'_'+(curIndex - days)+"'>" + (curIndex - days) + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;cursor: pointer;' id='divId_"+(month+1)+'_'+(curIndex - days)+"_usrlist'></div>" +
"</td>" ; "</td>" ;
curIndex++; curIndex++;
}else{ //渲染当月的天数 }else{ //渲染当月的天数
...@@ -121,14 +121,14 @@ ...@@ -121,14 +121,14 @@
"<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='color: #fff;' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;font-size: 13px;top:10px;cursor: pointer;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
}else{ }else{
str += "<td id='divId_"+month+'_'+curIndex+"_td'>" + str += "<td id='divId_"+month+'_'+curIndex+"_td'>" +
"<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" + "<div style='"+backGroundColor+"'' id='divId_"+month+'_'+curIndex+"'>" + curIndex + "</div>" +
"<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" + "<div style='left:20px;font-size: 12px;color:deepskyblue;' id='divId_"+month+'_'+curIndex+"_xiuxi'></div>" +
"<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" + "<div style='color:red;top:22px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_holiday'></div>" +
"<div style='left:40px;top:10px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" + "<div style='left:45px;top:10px;font-size: 13px;' id='divId_"+month+'_'+curIndex+"_usrlist'></div>" +
"</td>" ; "</td>" ;
} }
totalDays+=curIndex+","; totalDays+=curIndex+",";
......
<%@ 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.util.Hashtable" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%!
public static String getMxId(ConnectionFactory cf,Connection conn,String date) {
String mx_id="";
Vector userList = cf.doQuery(conn,"select mx_id from zb_zdpb where b_time<=? and e_time>=? order by add_time desc limit 1",null,new Object[]{date,date});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
mx_id = (String) ht1.get("mx_id");
}
return mx_id;
}
public static String getZbTyTime(ConnectionFactory cf,Connection conn,String mx_id,String zb_type) {
String time="";
Vector userList = cf.doQuery(conn,"select b_time,e_time from zb_type where mx_id=? and zb_type=?"
,null,new Object[]{mx_id,zb_type});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
time = (String) ht1.get("b_time")+"-"+(String) ht1.get("e_time");
}
return time;
}
%>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
Date date = new Date();
SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd");
String today=sd.format(date);
Hashtable ht = new Hashtable();
StringBuffer sb = new StringBuffer();
String login_name = pub.trimNull((String) session.getAttribute("session_login_name"));
if ("".equals(login_name)) {
System.out.println("当前没有用户信息");
}
String times="";
try {
conn = com.censoft.db.DBUtil.getConnection();
sb.append("select t1.zb_user,t1.zb_type from zb_user_gl t1 where 1=1 ");
sb.append(" and t1.year=? ");
sb.append(" order by t1.id asc");
String mxId=getMxId(cf,conn,today);
v_list=cf.doQuery(conn,sb.toString(),null,new Object[]{today});
if(v_list==null){
System.out.println("查询该日期值班人员出错"+cf.getMsg());
}
if(v_list.size()>0) {
for (int i = 0; i < v_list.size(); i++) {
ht = (Hashtable) v_list.get(i);
String zb_type = pub.trimNull((String) ht.get("zb_type"));
String zb_user = pub.trimNull((String) ht.get("zb_user"));
if(zb_user.indexOf(login_name)>=0){
String time = getZbTyTime(cf, conn, mxId, zb_type);
times=times+time+"&nbsp;&nbsp;&nbsp;&nbsp;";
}else{
continue;
}
}
}
if("".equals(times)){
times="无";
}
out.println(times);
} 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.
<%@ 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" %>
<%@ page import="com.censoft.db.LunarCalendarFestivalUtils" %>
<%!
public static String getMxId(ConnectionFactory cf,Connection conn,String date) {
String mx_id="";
Vector userList = cf.doQuery(conn,"select mx_id from zb_zdpb_bgs where b_time<=? and e_time>=? order by add_time desc limit 1",null,new Object[]{date,date});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
mx_id = (String) ht1.get("mx_id");
}
return mx_id;
}
public static String getZbTyTime(ConnectionFactory cf,Connection conn,String mx_id,String zb_type) {
String time="";
Vector userList = cf.doQuery(conn,"select b_time,e_time from zb_type_bgs where mx_id=? and zb_type=?"
,null,new Object[]{mx_id,zb_type});
if(userList!=null && userList.size()>0){
Hashtable ht1 = (Hashtable) userList.get(0);
time = (String) ht1.get("b_time")+"-"+(String) ht1.get("e_time");
}
return time;
}
%>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
Vector v_list_h = null;
Vector v_list_xiu = null;
String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month"));
if("13".equals(month)){
year=String.valueOf(Integer.parseInt(year)+1);
month="01";
}
if("0".equals(month)){
year=String.valueOf(Integer.parseInt(year)-1);
month="12";
}
String day = pub.trimNull(request.getParameter("day"));
if(month.length()==1){
month="0"+month;
}
month="-"+month;
if(day.length()==1){
day="0"+day;
}
day="-"+day;
Hashtable ht = new Hashtable();
String login_name = pub.trimNull((String) session.getAttribute("session_login_name"));
if ("".equals(login_name)) {
System.out.println("当前没有用户信息");
}
String times="";
List list_s = new ArrayList();
String result="";
String name ="";
String xiuxi ="";
try {
LunarCalendarFestivalUtils nl = new LunarCalendarFestivalUtils();
nl.initLunarCalendarInfo(year+month+day);
conn = com.censoft.db.DBUtil.getConnection();
StringBuffer sb = new StringBuffer();
sb.append("select t1.zb_user,t1.zb_type from zb_user_gl_bgs t1 where 1=1 ");
sb.append(" and t1.year=? ");
list_s.add(year+month+day);
sb.append(" order by t1.id asc");
String mxId=getMxId(cf,conn,year+month+day);
v_list = cf.doQuery(conn, sb.toString(), null, list_s.toArray());
StringBuffer sql = new StringBuffer();
sql.append("select name from zb_holiday where h_day=? ");
v_list_h= cf.doQuery(conn, sql.toString(), null, list_s.toArray());
StringBuffer sql_xiu = new StringBuffer();
sql_xiu.append("select name from zb_holiday where day=? ");
v_list_xiu= cf.doQuery(conn, sql_xiu.toString(), null, list_s.toArray());
if (v_list == null) {
out.println("查询出错1" + cf.getMsg());
return;
}
if (v_list_h == null) {
out.println("查询出错2" + cf.getMsg());
return;
}
if (v_list_xiu == null) {
out.println("查询出错3" + cf.getMsg());
return;
}
if(v_list.size()>0) {
for (int i = 0; i < v_list.size(); i++) {
ht = (Hashtable) v_list.get(i);
String zb_type = pub.trimNull((String) ht.get("zb_type"));
String zb_user = pub.trimNull((String) ht.get("zb_user"));
if(zb_user.indexOf(login_name)>=0){
String time = getZbTyTime(cf, conn, mxId, zb_type);
times=times+time+"</br>";
}else{
continue;
}
}
}
if (v_list_h != null && v_list_h.size() > 0) {
ht = (Hashtable) v_list_h.get(0);
name = pub.trimNull((String) ht.get("name"));
}
if("".equals(name)){
String nongli =nl.getLunarDay();
name=nongli;
}
if (v_list_xiu != null && v_list_xiu.size() > 0) {
ht = (Hashtable) v_list_xiu.get(0);
xiuxi = pub.trimNull((String) ht.get("name"));
xiuxi="休";
}
if("".equals(times)){
times="无";
}
out.println(times+"_"+name+"="+xiuxi);
} catch (Exception e) {
out.println("查询异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
\ No newline at end of file
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