Commit 5c5c31b0 authored by 马超's avatar 马超

ES6>ES5

parent 34e48017
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#driver=dm.jdbc.driver.DmDriver #driver=dm.jdbc.driver.DmDriver
driver=com.mysql.jdbc.Driver driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/zbgl?useSSL=true&serverTimezone=UTC&characterEncoding=UTF8 url=jdbc:mysql://localhost:3306/zbgl?useSSL=false&serverTimezone=UTC&characterEncoding=UTF8
user=root user=root
password=mysql password=123321
excel_model=E://files//model.xlsx excel_model=E://files//model.xlsx
fileuploadPath=E://files/ fileuploadPath=E://files/
\ No newline at end of file
...@@ -137,7 +137,7 @@ function creatIframe(href,titleName){ ...@@ -137,7 +137,7 @@ function creatIframe(href,titleName){
$tabNav.css({left:0}) $tabNav.css({left:0})
} }
iframeBox.hide(); iframeBox.hide();
iframe_box.append('<div class="show_iframe"><div class="loading"></div><iframe frameborder="0" src='+href+'></iframe></div>'); iframe_box.append('<div class="show_iframe"><div class="loading"></div><iframe scrolling="no" frameborder="0" src='+href+'></iframe></div>');
var showBox=iframe_box.find('.show_iframe:visible'); var showBox=iframe_box.find('.show_iframe:visible');
showBox.find('iframe').load(function(){ showBox.find('iframe').load(function(){
showBox.find('.loading').hide(); showBox.find('.loading').hide();
......
#calendar {width:98%;margin: 0 auto;margin-top: 1px;} #calendar {width:98%;margin: 0 auto;margin-top: 1px;}
table{border-collapse: collapse;background-color:#fff6d9;} table{border-collapse: collapse;background-color:#fff6d9;}
td,th{border: 1px solid red;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:100px;text-align:center;vertical-align:middle;} td{height:90px;text-align:center;vertical-align:middle;}
td {vertical-align:top;position:relative;font-size: 15px;} td {vertical-align:top;position:relative;font-size: 15px;cursor: pointer;}
td div{position:absolute; left:0; top:0;font-size: 18px;} 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;}
.title label {font-size: 20px;} .title label {font-size: 20px;}
#calendar-pre { #calendar-pre {
...@@ -16,7 +16,8 @@ td div{position:absolute; left:0; top:0;font-size: 18px;} ...@@ -16,7 +16,8 @@ td div{position:absolute; left:0; top:0;font-size: 18px;}
margin-top: 15px; margin-top: 15px;
margin-left:20%; margin-left:20%;
} }
#calendar-next {border:1px solid #fff;cursor: pointer;border-radius:50px; #calendar-next {
border:1px solid #fff;cursor: pointer;border-radius:50px;
width: 160px; width: 160px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
......
<%--
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" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="com.censoft.db.Logger" %>
<%
Pub pub = new Pub();
String s_id = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(s_id)) {
response.sendRedirect(request.getContextPath());
return;
}
ConnectionFactory cf = new ConnectionFactory();
Connection conn = null;
Vector v_list_temp = null;
String id_1 = "";
String menu_name_1 = "";
String menu_url_1 = "";
try {
conn = com.censoft.db.DBUtil.getConnection();
StringBuffer sb = new StringBuffer();
sb.append(" select distinct menu.* from t_book_role_menu_rel rel ");
sb.append(" join t_book_role role on role.id=rel.role_id ");
sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id ");
sb.append(" join zb_bgs_user ad on ad.id=ur.login_id ");
sb.append(" join t_book_menu menu on menu.id=rel.menu_id ");
sb.append(" where ad.id=? and (menu.p_id ='' or menu.p_id is null) and (menu.sys_id='3' or menu.sys_id is null or menu.sys_id ='') order by menu.menu_order asc");
v_list_temp = cf.doQuery(conn, sb.toString(), null, new Object[]{s_id});
if ("admin1".equals(s_id)) {
sb = new StringBuffer("select * from t_book_menu menu where (menu.p_id ='' or menu.p_id is null) and (menu.sys_id='2' or menu.sys_id is null) order by menu_order asc");
v_list_temp = cf.doQuery(conn, sb.toString(), null, new Object[]{});
}
if (v_list_temp == null) {
out.println("查询策略出错");
return;
}
if (v_list_temp.size() > 0) {
Hashtable ht = (Hashtable) v_list_temp.get(0);
id_1 = pub.trimNull((String) ht.get("id"));
menu_name_1 = pub.trimNull((String) ht.get("menu_name"));
menu_url_1 = pub.trimNull((String) ht.get("menu_url"));
}
} catch (Exception e) {
out.println("查询用户信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<style>
.dislpayArrow {
top: 50px;
left: 15%;
width:1%;
}
.big-page .Hui-aside{
left: -16%;
}
.dislpayArrow a {
top: 40%;
width:100%;
}
.Hui-article-box {
top: 50px;
left: 15%;
width: 85%;
}
.navbar-wrapper {
height: 50px;
}
.Hui-tabNav {
background-color: #f4f7fe;
}
.Hui-aside {
top: 50px;
height: 94%;
width: 15%;
background-color: #3492c6;
}
.Hui-article {
top: 34px;
}
.big-page .Hui-article-box {
width: 100%;
}
.navbar .logo {
height: 50px;
line-height: 50px;
}
body {
background-color: #d9e4f6;
overflow: hidden;
}
.navbar-fixed-top {
background: #269ddf
}
.Hui-aside .menu_dropdown dt{
border-bottom: 0;
padding-left: 20px;
}
.Hui-aside .menu_dropdown dt a,.Hui-aside .menu_dropdown dd li a,.Hui-aside .menu_dropdown dt{
color:#d8e4f6;
font-weight: bold;
}
.Hui-aside .menu_dropdown dt.selected a,.Hui-aside .menu_dropdown dt.selected,.Hui-aside .menu_dropdown dd li.selected a,.Hui-aside .menu_dropdown dt:hover,.Hui-aside .menu_dropdown dd li a:hover,.Hui-aside .menu_dropdown dt a:hover{
color:#fff;
background-color:#70e3de;
}
.Hui-aside .menu_dropdown dt .Hui-iconfont{
color:#d8e4f6;
}
.acrossTab li.active{
color: #5dafe4;
}
.Hui-aside .menu_dropdown dd ul{
padding:0;
}
</style>
<header class="navbar-wrapper">
<div class="navbar navbar-fixed-top">
<div class="container-fluid cl">
<a class="logo navbar-logo f-l mr-10 hidden-xs" style="font-size:15px;">
<%--<i class="Hui-iconfont">&#xe625;</i>--%>&nbsp;值班管理系统
</a>
<nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
<ul class="cl">
<li class="dropDown dropDown_hover">
<a href="#" class="dropDown_A">
<i class="Hui-iconfont">&#xe60d;</i>
&nbsp;<%=pub.trimNull((String) session.getAttribute("session_login_name"))%>
<i class="Hui-iconfont">&#xe6d5;</i></a>
<ul class="dropDown-menu menu radius box-shadow">
<li>
<a href="<%=request.getContextPath()%>/login_ztj.jsp">
<i class="Hui-iconfont">&#xe644;</i>
&nbsp;退出
</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</header>
<%@include file="./leftMenu_bgs.jsp" %>
<div class="dislpayArrow hidden-xs">
<a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
</div>
<section class="Hui-article-box">
<div id="Hui-tabNav" class="Hui-tabNav hidden-xs" >
<div class="Hui-tabNav-wp" >
<ul id="min_title_list" class="acrossTab cl">
<li class="active" >
<span title="<%=menu_name_1%>" data-href="<%=menu_url_1%>?menu_id=<%=id_1%>"><%=menu_name_1%></span>
<em></em>
</li>
</ul>
</div>
<div class="Hui-tabNav-more btn-group">
<a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:void(0);">
<i class="Hui-iconfont">&#xe6d4;</i>
</a>
<a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:void(0);">
<i class="Hui-iconfont">&#xe6d7;</i>
</a>
</div>
</div>
<div id="iframe_box" class="Hui-article">
<div class="show_iframe">
<div style="display:none" class="loading"></div>
<%if("#".equals(menu_url_1)){%>
<iframe scrolling="no" frameborder="0" src=""></iframe>
<%}else{%>
<iframe scrolling="no" frameborder="0" src="<%=menu_url_1%>?menu_id=<%=id_1%>"></iframe>
<%}%>
</div>
</div>
</section>
<script>
$(".Hui-aside").on("click","dd li",function(){
$(".Hui-aside dd li").removeClass("selected");
$(this).addClass("selected");
});
</script>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<p style="height:30px;"> <%=zb_type%></p> <p style="height:30px;"> <%=zb_type%></p>
</div> </div>
<div style="text-align:center;width:180px;height:110px;line-height:30px;float:left;position: relative"> <div style="text-align:left;padding-left:30px;width:180px;height:110px;line-height:30px;float:left;position: relative">
<% <%
String[] user_names=user_name.split(","); String[] user_names=user_name.split(",");
for(int n=0;n<user_names.length;n++){ for(int n=0;n<user_names.length;n++){
......
This diff is collapsed.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/simple-calendar.css">
<script src="<%=request.getContextPath()%>/js/simple-calendar-es.js"></script>
<style>
#container{
margin: 0 auto;
float: none;
width: 95%;
height: 600px;
}
</style>
<div style="margin-top: 10px;display: none;">
<a class="btn btn-primary radius" onclick="operList();" >
导出
</a>
</div>
<div style="margin-top: 10px;text-align: right;margin-right: 40px;">
<a class="btn btn-primary radius" onclick="zdPb();" >
自动排班
</a>
<a class="btn btn-primary radius" onclick="viewUserWeek();" >
周排班表
</a>
<a class="btn btn-primary radius" onclick="changeZb();" >
换班
</a>
</div>
<div id="container"></div>
<form method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="" id="nowDays" name="nowDays">
<input type="hidden" value="" id="nowYear" name="nowYear">
<input type="hidden" value="" id="nowMonth" name="nowMonth">
</form>
<script>
let myCalendar = new SimpleCalendar('#container');
//刷新日历
function addData(year, month) {
var totalDays="";
var now = new Date();//当前日期
var nowDay = now.getDate();// 当天
var nowYear = now.getFullYear();// 年份
var nowMonth = now.getMonth() + 1;// 月份
let daysElement = arrayfrom(this.container.querySelectorAll('.sc-item'));
let day = new Date(year, month - 1, 0);
let week = day.getDay();
if (week == 0) week = 7;
if (week == 7) week = 0;
//计算得到第一个格子的日期
let thispageStart = new Date(Date.parse(day) - (week - 1) * 24 * 3600 * 1000);
//对每一个格子遍历
for (let i = 0; i < 35; i++) {
daysElement[i].className = 'sc-item';
let theday = new Date(Date.parse(thispageStart) + (i-1) * 24 * 3600 * 1000);
let writeyear = theday.getFullYear();
let writeday = theday.getDate();
let writemonth = theday.getMonth() + 1;
if (writemonth != month) {
daysElement[i].classList.add('sc-othermenth');
}
daysElement[i].querySelector('.day').innerHTML = writeday;
getZbUser(writeyear,writemonth,writeday,i);
//daysElement[i].querySelector('.zb_user_button').innerHTML = '<span onclick="editUser('+writeyear+','+writemonth+','+writeday+');" style="text-align:center;position:absolute; right:0; bottom:0;"><img src="../../images/edit.png" width="20" height="15" /></span>';
//判断是否添加阴历
if (true) {
daysElement[i].querySelector('.lunar-day').innerHTML = (new LunarHelp(writeyear, writemonth, writeday)).getLunarDayName();
} else {
daysElement[i].querySelector('.lunar-day').innerHTML = '';
daysElement[i].classList.add('item-nolunar');
}
//console.log(writeyear+""+writemonth+""+writeday);
//添加today样式
if (nowYear == writeyear && nowDay == writeday && nowMonth == writemonth) {
this.selectDay = daysElement[i];
daysElement[i].classList.add("sc-today");
}
if (year == writeyear && month == writemonth) {
totalDays+=writeday+",";
}
}
$("#nowYear").val(year);
$("#nowMonth").val(month);
$("#nowDays").val(totalDays.substring(0,totalDays.length-1));
}
function getZbUser(year,month,day,index) {
let daysElement = arrayfrom(this.container.querySelectorAll('.sc-item'));
$.ajax({
type: "post",
url: "list_ajax.jsp?year="+year+"&month="+month+"&day="+day,
success: function (msg) {
daysElement[index].querySelector('.zb_user').innerHTML = msg;
daysElement[index].querySelector('.zb_user').setAttribute("onclick","viewUser("+year+","+month+","+day+")");
}
});
}
function arrayfrom(nidelist) {
let array = [];
[].forEach.call(nidelist, function(v) {
array.push(v);
});
return array;
}
function viewUser(year,month,day) {
var url = './viewUser-t.jsp?year='+year+'&month='+month+'&day='+day;
viewDeptOrUserInfo(year+''+month+''+day+'日值班表', url, '1100', '550');
}
function changeZb() {
var url = './changeZb-t.jsp';
viewDeptOrUserInfo('换班', url, '1000', '500');
}
function viewUserWeek() {
var url = './viewUserWeek-t.jsp';
viewUserWeekFull('周值班表', url, '1000', '500');
}
function viewUserWeekFull(title, url, w, h) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: [w, h],
maxmin: true
});
layer.full(abc);
}
function zdPb() {
var url = './edit-t.jsp';
viewDeptOrUserInfo('自动排班', url, '1000', '500');
}
function viewDeptOrUserInfo(title, url, w, h) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: [w+'px', h+'px'],
maxmin: true
});
//layer.full(abc);
}
</script>
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
Pub pub = new Pub(); Pub pub = new Pub();
Connection conn = null; Connection conn = null;
Vector v_list = null; Vector v_list = null;
Vector v_list_h = null;
Vector v_list_xiu = null;
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month")); String month = pub.trimNull(request.getParameter("month"));
String day = pub.trimNull(request.getParameter("day")); String day = pub.trimNull(request.getParameter("day"));
...@@ -33,6 +35,8 @@ ...@@ -33,6 +35,8 @@
day="-"+day; day="-"+day;
List list_s = new ArrayList(); List list_s = new ArrayList();
String result=""; String result="";
String name ="";
String xiuxi ="";
try { try {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select t1.zb_user from zb_user_gl t1 where 1=1 "); sb.append("select t1.zb_user from zb_user_gl t1 where 1=1 ");
...@@ -41,10 +45,24 @@ ...@@ -41,10 +45,24 @@
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
sb.append(" order by t1.id asc"); sb.append(" order by t1.id asc");
v_list = cf.doQuery(conn, sb.toString(), null, list_s.toArray()); 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) { if (v_list == null) {
out.println("查询出错" + cf.getMsg()); out.println("查询出错" + cf.getMsg());
return; return;
} }
if (v_list_h == null) {
out.println("查询出错" + cf.getMsg());
return;
}
if (v_list_xiu == null) {
out.println("查询出错" + cf.getMsg());
return;
}
if (v_list != null && v_list.size() > 0) { if (v_list != null && v_list.size() > 0) {
for (int i = 0; i < v_list.size(); i++) { for (int i = 0; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i); Hashtable ht = (Hashtable) v_list.get(i);
...@@ -52,7 +70,16 @@ ...@@ -52,7 +70,16 @@
result=result+zb_user+"</br>"; result=result+zb_user+"</br>";
} }
} }
out.println(result); if (v_list_h != null && v_list_h.size() > 0) {
Hashtable ht = (Hashtable) v_list_h.get(0);
name = pub.trimNull((String) ht.get("name"));
}
if (v_list_xiu != null && v_list_xiu.size() > 0) {
Hashtable ht = (Hashtable) v_list_xiu.get(0);
xiuxi = pub.trimNull((String) ht.get("name"));
xiuxi="休";
}
out.println(result+"_"+name+"="+xiuxi);
} catch (Exception e) { } catch (Exception e) {
out.println("查询异常" + e); out.println("查询异常" + e);
return; return;
......
This diff is collapsed.
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
Pub pub = new Pub(); Pub pub = new Pub();
Connection conn = null; Connection conn = null;
Vector v_list = null; Vector v_list = null;
Vector v_list_h = null;
Vector v_list_xiu = null;
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month")); String month = pub.trimNull(request.getParameter("month"));
String day = pub.trimNull(request.getParameter("day")); String day = pub.trimNull(request.getParameter("day"));
...@@ -41,22 +43,42 @@ ...@@ -41,22 +43,42 @@
day="0"+day; day="0"+day;
} }
day="-"+day; day="-"+day;
StringBuffer sb = new StringBuffer();
Hashtable ht = new Hashtable(); Hashtable ht = new Hashtable();
String login_name = pub.trimNull((String) session.getAttribute("session_login_name")); String login_name = pub.trimNull((String) session.getAttribute("session_login_name"));
if ("".equals(login_name)) { if ("".equals(login_name)) {
System.out.println("当前没有用户信息"); System.out.println("当前没有用户信息");
} }
String times=""; String times="";
List list_s = new ArrayList();
String result="";
String name ="";
String xiuxi ="";
try { try {
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
StringBuffer sb = new StringBuffer();
sb.append("select t1.zb_user,t1.zb_type from zb_user_gl t1 where 1=1 "); sb.append("select t1.zb_user,t1.zb_type from zb_user_gl t1 where 1=1 ");
sb.append(" and t1.year=? "); sb.append(" and t1.year=? ");
list_s.add(year+month+day);
sb.append(" order by t1.id asc"); sb.append(" order by t1.id asc");
String mxId=getMxId(cf,conn,year+month+day); String mxId=getMxId(cf,conn,year+month+day);
v_list=cf.doQuery(conn,sb.toString(),null,new Object[]{year+month+day}); v_list = cf.doQuery(conn, sb.toString(), null, list_s.toArray());
if(v_list==null){ StringBuffer sql = new StringBuffer();
System.out.println("查询该日期值班人员出错"+cf.getMsg()); 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) { if(v_list.size()>0) {
for (int i = 0; i < v_list.size(); i++) { for (int i = 0; i < v_list.size(); i++) {
...@@ -71,10 +93,19 @@ ...@@ -71,10 +93,19 @@
} }
} }
} }
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 (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)){ if("".equals(times)){
times="无"; times="无";
} }
out.println(times); out.println(times+"_"+name+"="+xiuxi);
} catch (Exception e) { } catch (Exception e) {
out.println("查询异常" + e); out.println("查询异常" + e);
return; return;
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
h_id=UUID.randomUUID().toString().trim().replaceAll("-", ""); h_id=UUID.randomUUID().toString().trim().replaceAll("-", "");
} }
String name = pub.trimNull(request.getParameter("name")); String name = pub.trimNull(request.getParameter("name"));
String h_day = pub.trimNull(request.getParameter("h_day"));
String b_time = pub.trimNull(request.getParameter("b_time")); String b_time = pub.trimNull(request.getParameter("b_time"));
String e_time = pub.trimNull(request.getParameter("e_time")); String e_time = pub.trimNull(request.getParameter("e_time"));
List<String> list=null; List<String> list=null;
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
System.out.println("当前没有用户信息"); System.out.println("当前没有用户信息");
} }
String add_time = pub.getCurrentServerTime(); String add_time = pub.getCurrentServerTime();
StringBuffer sql_add=new StringBuffer("insert into zb_holiday (h_id,name,day,add_user,add_time) values (?,?,?,?,?)"); StringBuffer sql_add=new StringBuffer("insert into zb_holiday (h_id,name,h_day,day,add_user,add_time) values (?,?,?,?,?,?)");
StringBuffer sql_update=new StringBuffer("update zb_holiday set update_user=?,update_time=?,name=?,day=? where id=?"); StringBuffer sql_update=new StringBuffer("update zb_holiday set update_user=?,update_time=?,name=?,day=? where id=?");
try { try {
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
action_msg="新增"; action_msg="新增";
if(list!=null){ if(list!=null){
for(int i=0;i<list.size();i++){ for(int i=0;i<list.size();i++){
is_oper = cf.executeUpdate(conn, sql_add.toString(), new Object[]{h_id,name,list.get(i),add_user,add_time}); is_oper = cf.executeUpdate(conn, sql_add.toString(), new Object[]{h_id,name,h_day,list.get(i),add_user,add_time});
if (!is_oper) { if (!is_oper) {
conn.rollback(); conn.rollback();
System.out.println("新增节假日表出错了" + cf.getMsg()); System.out.println("新增节假日表出错了" + cf.getMsg());
...@@ -111,7 +112,7 @@ ...@@ -111,7 +112,7 @@
} }
if(list!=null){ if(list!=null){
for(int i=0;i<list.size();i++){ for(int i=0;i<list.size();i++){
is_oper = cf.executeUpdate(conn, sql_add.toString(), new Object[]{h_id,name,list.get(i),add_user,add_time}); is_oper = cf.executeUpdate(conn, sql_add.toString(), new Object[]{h_id,name,h_day,list.get(i),add_user,add_time});
if (!is_oper) { if (!is_oper) {
conn.rollback(); conn.rollback();
System.out.println("新增节假日表出错了" + cf.getMsg()); System.out.println("新增节假日表出错了" + cf.getMsg());
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
try { try {
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
if("update".equals(action)){ if("update".equals(action)){
sql.append("select h_id,name,min(day) as b_time,max(day) as e_time from zb_holiday where h_id=?"); sql.append("select h_id,name,h_day,min(day) as b_time,max(day) as e_time from zb_holiday where h_id=?");
v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{id}); v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{id});
} }
if (v_list!=null&&v_list.size() > 0) { if (v_list!=null&&v_list.size() > 0) {
...@@ -74,18 +74,19 @@ ...@@ -74,18 +74,19 @@
</div> </div>
<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">
<span class="c-red">*</span>开始时间&nbsp; <span class="c-red">*</span>日期&nbsp;
</label> </label>
<div class="formControls col-xs-8 col-sm-4"> <div class="formControls col-xs-8 col-sm-4">
<input type="text" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="b_time" id="b_time" value="<%=pub.trimNull((String)ht.get("b_time"))%>" > <input type="text" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="h_day" id="h_day" value="<%=pub.trimNull((String)ht.get("h_day"))%>" >
</div> </div>
</div> </div>
<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">
<span class="c-red">*</span>结束时间&nbsp; <span class="c-red">*</span>休息日&nbsp;
</label> </label>
<div class="formControls col-xs-8 col-sm-4"> <div class="formControls col-xs-8 col-sm-4">
<input type="text" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="e_time" id="e_time" value="<%=pub.trimNull((String)ht.get("e_time"))%>" > <input type="text" style="width: 45%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="b_time" id="b_time" value="<%=pub.trimNull((String)ht.get("b_time"))%>" >
- <input type="text" style="width: 45%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="e_time" id="e_time" value="<%=pub.trimNull((String)ht.get("e_time"))%>" >
</div> </div>
</div> </div>
</div> </div>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
if ("".equals(page_size)) page_size = "10"; 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 h_id,name from zb_holiday group by name,h_id order by id asc "); sql.append("select h_id,name from zb_holiday group by name,h_id order by h_day asc ");
try { try {
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray()); v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray());
......
This diff is collapsed.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/simple-calendar.css">
<script src="<%=request.getContextPath()%>/js/simple-calendar-es6.js"></script>
<style>
#container{
margin: 0 auto;
float: none;
width: 95%;
height: 600px;
}
</style>
<div style="margin-top: 10px;display: none;">
<a class="btn btn-primary radius" onclick="operList();" >
导出
</a>
</div>
<div style="margin-top: 10px;text-align: right;margin-right: 40px;">
<a class="btn btn-primary radius" onclick="zdPb();" >
自动排班
</a>
<a class="btn btn-primary radius" onclick="viewUserWeek();" >
周排班表
</a>
<a class="btn btn-primary radius" onclick="changeZb();" >
换班
</a>
</div>
<div id="container"></div>
<form method="post" id="form1" name="form1" action="export_query.jsp" >
<input type="hidden" value="" id="nowDays" name="nowDays">
<input type="hidden" value="" id="nowYear" name="nowYear">
<input type="hidden" value="" id="nowMonth" name="nowMonth">
</form>
<script>
let myCalendar = new SimpleCalendar('#container');
//刷新日历
function addData(year, month) {
var totalDays="";
var now = new Date();//当前日期
var nowDay = now.getDate();// 当天
var nowYear = now.getFullYear();// 年份
var nowMonth = now.getMonth() + 1;// 月份
let daysElement = arrayfrom(this.container.querySelectorAll('.sc-item'));
let day = new Date(year, month - 1, 0);
let week = day.getDay();
if (week == 0) week = 7;
if (week == 7) week = 0;
//计算得到第一个格子的日期
let thispageStart = new Date(Date.parse(day) - (week - 1) * 24 * 3600 * 1000);
//对每一个格子遍历
for (let i = 0; i < 35; i++) {
daysElement[i].className = 'sc-item';
let theday = new Date(Date.parse(thispageStart) + (i-1) * 24 * 3600 * 1000);
let writeyear = theday.getFullYear();
let writeday = theday.getDate();
let writemonth = theday.getMonth() + 1;
if (writemonth != month) {
daysElement[i].classList.add('sc-othermenth');
}
daysElement[i].querySelector('.day').innerHTML = writeday;
getZbUser(writeyear,writemonth,writeday,i);
//daysElement[i].querySelector('.zb_user_button').innerHTML = '<span onclick="editUser('+writeyear+','+writemonth+','+writeday+');" style="text-align:center;position:absolute; right:0; bottom:0;"><img src="../../images/edit.png" width="20" height="15" /></span>';
//判断是否添加阴历
if (true) {
daysElement[i].querySelector('.lunar-day').innerHTML = (new LunarHelp(writeyear, writemonth, writeday)).getLunarDayName();
} else {
daysElement[i].querySelector('.lunar-day').innerHTML = '';
daysElement[i].classList.add('item-nolunar');
}
//console.log(writeyear+""+writemonth+""+writeday);
//添加today样式
if (nowYear == writeyear && nowDay == writeday && nowMonth == writemonth) {
this.selectDay = daysElement[i];
daysElement[i].classList.add("sc-today");
}
if (year == writeyear && month == writemonth) {
totalDays+=writeday+",";
}
}
$("#nowYear").val(year);
$("#nowMonth").val(month);
$("#nowDays").val(totalDays.substring(0,totalDays.length-1));
}
function getZbUser(year,month,day,index) {
let daysElement = arrayfrom(this.container.querySelectorAll('.sc-item'));
$.ajax({
type: "post",
url: "list_ajax.jsp?year="+year+"&month="+month+"&day="+day,
success: function (msg) {
daysElement[index].querySelector('.zb_user').innerHTML = msg;
daysElement[index].querySelector('.zb_user').setAttribute("onclick","viewUser("+year+","+month+","+day+")");
}
});
}
function arrayfrom(nidelist) {
let array = [];
[].forEach.call(nidelist, function(v) {
array.push(v);
});
return array;
}
function viewUser(year,month,day) {
var url = './viewUser-t.jsp?year='+year+'&month='+month+'&day='+day;
viewDeptOrUserInfo(year+''+month+''+day+'日值班表', url, '1100', '550');
}
function changeZb() {
var url = './changeZb-t.jsp';
viewDeptOrUserInfo('换班', url, '1000', '500');
}
function viewUserWeek() {
var url = './viewUserWeek-t.jsp';
viewUserWeekFull('周值班表', url, '1000', '500');
}
function viewUserWeekFull(title, url, w, h) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: [w, h],
maxmin: true
});
layer.full(abc);
}
function zdPb() {
var url = './edit-t.jsp';
viewDeptOrUserInfo('自动排班', url, '1000', '500');
}
function viewDeptOrUserInfo(title, url, w, h) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: [w+'px', h+'px'],
maxmin: true
});
//layer.full(abc);
}
</script>
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
Pub pub = new Pub(); Pub pub = new Pub();
Connection conn = null; Connection conn = null;
Vector v_list = null; Vector v_list = null;
Vector v_list_h = null;
Vector v_list_xiu = null;
String year = pub.trimNull(request.getParameter("year")); String year = pub.trimNull(request.getParameter("year"));
String month = pub.trimNull(request.getParameter("month")); String month = pub.trimNull(request.getParameter("month"));
String day = pub.trimNull(request.getParameter("day")); String day = pub.trimNull(request.getParameter("day"));
...@@ -33,6 +35,8 @@ ...@@ -33,6 +35,8 @@
day="-"+day; day="-"+day;
List list_s = new ArrayList(); List list_s = new ArrayList();
String result=""; String result="";
String name ="";
String xiuxi ="";
try { try {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select t1.zb_user from zb_user_gl_bgs t1 where 1=1 "); sb.append("select t1.zb_user from zb_user_gl_bgs t1 where 1=1 ");
...@@ -41,10 +45,24 @@ ...@@ -41,10 +45,24 @@
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
sb.append(" order by t1.id asc"); sb.append(" order by t1.id asc");
v_list = cf.doQuery(conn, sb.toString(), null, list_s.toArray()); 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) { if (v_list == null) {
out.println("查询出错" + cf.getMsg()); out.println("查询出错" + cf.getMsg());
return; return;
} }
if (v_list_h == null) {
out.println("查询出错" + cf.getMsg());
return;
}
if (v_list_xiu == null) {
out.println("查询出错" + cf.getMsg());
return;
}
if (v_list != null && v_list.size() > 0) { if (v_list != null && v_list.size() > 0) {
for (int i = 0; i < v_list.size(); i++) { for (int i = 0; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i); Hashtable ht = (Hashtable) v_list.get(i);
...@@ -52,10 +70,16 @@ ...@@ -52,10 +70,16 @@
result=result+zb_user+"</br>"; result=result+zb_user+"</br>";
} }
} }
if("".equals(result)){ if (v_list_h != null && v_list_h.size() > 0) {
result=""; Hashtable ht = (Hashtable) v_list_h.get(0);
name = pub.trimNull((String) ht.get("name"));
}
if (v_list_xiu != null && v_list_xiu.size() > 0) {
Hashtable ht = (Hashtable) v_list_xiu.get(0);
xiuxi = pub.trimNull((String) ht.get("name"));
xiuxi="休";
} }
out.println(result); out.println(result+"_"+name+"="+xiuxi);
} catch (Exception e) { } catch (Exception e) {
out.println("查询异常" + e); out.println("查询异常" + e);
return; return;
......
<%--
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" %>
<%
Vector v_list = null;
try {
conn = com.censoft.db.DBUtil.getConnection();
StringBuffer sb = new StringBuffer();
sb.append(" select distinct menu.* from t_book_role_menu_rel rel ");
sb.append(" join t_book_role role on role.id=rel.role_id ");
sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id ");
sb.append(" join zb_bgs_user ad on ad.id=ur.login_id ");
sb.append(" join t_book_menu menu on menu.id=rel.menu_id ");
sb.append(" where ad.id=? and (menu.p_id ='' or menu.p_id is null) and (menu.sys_id='3' or menu.sys_id is null or menu.sys_id ='') order by menu.menu_order asc");
//System.out.println(sb.toString());
v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{s_id});
if("admin".equals(s_id)){
// sb = new StringBuffer("select * from t_book_menu menu where (menu.p_id ='' or menu.p_id is null) order by menu_order asc");
// v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{});
}
if (v_list == null) {
out.println("查询角色出错");
return;
}
} catch (Exception e) {
out.println("查询角色信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<aside class="Hui-aside">
<div class="menu_dropdown bk_2">
<%
String menu_ids = "";
if (v_list != null && v_list.size() > 0) {
for (int i = 0; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String menu_name = pub.trimNull((String) ht.get("menu_name"));
String menu_url = pub.trimNull((String) ht.get("menu_url"));
String id = pub.trimNull((String) ht.get("id"));
menu_ids+=id+",";
if (!"#".equals(menu_url)) {
if (menu_url.indexOf("?") > 0) {
menu_url += "&menu_id=" + id;
} else {
menu_url += "?menu_id=" + id;
}
}
String menu_pic = pub.trimNull((String) ht.get("menu_pic"))+";";
if ("".equals(menu_pic)) menu_pic = "&#xe620;";
%>
<dl id="menu-<%=id%>">
<%if (!"#".equals(menu_url)) {%>
<dt style="font-size: 18px;"><i class="Hui-iconfont"><%=menu_pic%></i>
<a data-href="<%=menu_url%>" data-title="<%=menu_name%>" href="javascript:void(0)"><%=menu_name%>
</a>
</dt>
<%} else {%>
<dt style="font-size: 18px;" onclick="getChildMenu('<%=id%>');"><i class="Hui-iconfont"><%=menu_pic%></i> <%=menu_name%><i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
<dd id="menu-child-<%=id%>">
</dd>
<%}%>
</dl>
<%
}
}
session.setAttribute("menu_ids",menu_ids);
%>
</div>
</aside>
<script>
function getChildMenu(id) {
$.ajax({
type: "post",
url: "leftMenu_child_bgs.jsp?menu_id=" + id,
success: function (msg) {
$("#menu-child-" + id).html(msg);
}
});
}
</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" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="com.censoft.db.Logger" %>
<%
Pub pub = new Pub();
String s_id = pub.trimNull((String) session.getAttribute("session_login_id"));
String menu_id = pub.trimNull(request.getParameter("menu_id"));
if ("".equals(s_id) || "".equals(menu_id)) {
return;
}
ConnectionFactory cf = new ConnectionFactory();
Connection conn = null;
Vector v_list = null;
try {
conn = com.censoft.db.DBUtil.getConnection();
StringBuffer sb = new StringBuffer();
sb.append(" select distinct menu.* from t_book_role_menu_rel rel ");
sb.append(" join t_book_role role on role.id=rel.role_id ");
sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id ");
sb.append(" join zb_bgs_user ad on ad.id=ur.login_id ");
sb.append(" join t_book_menu menu on menu.id=rel.menu_id ");
sb.append(" where ad.id=? and menu.p_id =? and (menu.sys_id='3' or menu.sys_id is null) order by menu.menu_order asc");
v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{s_id, menu_id});
if(false){
sb = new StringBuffer("select * from t_book_menu menu where menu.p_id=? order by menu_order asc");
v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{menu_id});
}
if (v_list == null) {
out.println("查询角色出错");
return;
}
} catch (Exception e) {
out.println("查询角色信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<ul>
<%
if (v_list != null && v_list.size() > 0) {
for (int i = 0; i < v_list.size(); i++) {
Hashtable ht = (Hashtable) v_list.get(i);
String menu_name = pub.trimNull((String) ht.get("menu_name"));
String menu_url = pub.trimNull((String) ht.get("menu_url"));
String id = pub.trimNull((String) ht.get("id"));
if (!"#".equals(menu_url)) {
if (menu_url.indexOf("?") > 0) {
menu_url += "&menu_id=" + id;
} else {
menu_url += "?menu_id=" + id;
}
}
String menu_pic = pub.trimNull((String) ht.get("menu_pic"))+";";
if ("".equals(menu_pic)) menu_pic = "&#xe620;";
%>
<li><a data-href="<%=menu_url%>" data-title="<%=menu_name%>" href="javascript:void(0)"><i class="Hui-iconfont"><%=menu_pic%></i>&nbsp;<%=menu_name%>
</a></li>
<%
}
}
%>
</ul>
\ No newline at end of file
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
String s_id = pub.trimNull(request.getParameter("s_id")); String s_id = pub.trimNull(request.getParameter("s_id"));
Map s_btn = (Map) session.getAttribute("s_btn"); Map s_btn = (Map) session.getAttribute("s_btn");
Map s_have_btn = (Map) session.getAttribute("s_have_btn"); Map s_have_btn = (Map) session.getAttribute("s_have_btn");
String tablename="zb_user";
if ("login".equals(action)) { if ("login".equals(action)) {
try { try {
conn = com.censoft.db.DBUtil.getConnection(); conn = com.censoft.db.DBUtil.getConnection();
...@@ -36,7 +37,17 @@ ...@@ -36,7 +37,17 @@
} }
//passwd = DBUtil.stringToMD5(passwd); //passwd = DBUtil.stringToMD5(passwd);
Vector v_check = cf.doQuery(conn, "select * from zb_user where gh=? and pwd=?", null, new Object[]{login_id, passwd}); Vector v_check = cf.doQuery(conn, "select * from zb_user where gh=? and pwd=?", null, new Object[]{login_id, passwd});
if (v_check == null || v_check.size() <= 0) { Vector v_check_other = cf.doQuery(conn, "select * from zb_bgs_user where gh=? and pwd=?", null, new Object[]{login_id, passwd});
System.out.println("v_check="+v_check+"v_check_other="+v_check_other);
if(v_check == null || v_check_other==null){
Logger.log("登录", "登录", login_id, "登录失败", request);
out.println("用户名或密码不正确或用户不存在");
return;
}
if(v_check_other.size()>0){
tablename="zb_bgs_user";
}
if ( v_check.size() <= 0 &&v_check_other.size()<= 0) {
Logger.log("登录", "登录", login_id, "登录失败", request); Logger.log("登录", "登录", login_id, "登录失败", request);
out.println("用户名或密码不正确或用户不存在"); out.println("用户名或密码不正确或用户不存在");
return; return;
...@@ -63,12 +74,12 @@ ...@@ -63,12 +74,12 @@
sb.append(" select distinct btn.* from t_book_role_menu_rel rel "); sb.append(" select distinct btn.* from t_book_role_menu_rel rel ");
sb.append(" join t_book_role role on role.id=rel.role_id "); sb.append(" join t_book_role role on role.id=rel.role_id ");
sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id "); sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id ");
sb.append(" join zb_user ad on ad.id=ur.login_id "); sb.append(" join "+tablename+" ad on ad.id=ur.login_id ");
sb.append(" join t_book_menu menu on menu.id=rel.menu_id "); sb.append(" join t_book_menu menu on menu.id=rel.menu_id ");
sb.append(" join t_book_role_menu_btn btn on menu.id=btn.menu_id and btn.role_id=role.id "); sb.append(" join t_book_role_menu_btn btn on menu.id=btn.menu_id and btn.role_id=role.id ");
sb.append(" where ad.gh=? order by menu.menu_order asc"); sb.append(" where ad.gh=? order by menu.menu_order asc");
System.out.println(sb.toString());
Vector v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{login_id}); Vector v_list = cf.doQuery(conn, sb.toString(), null, new Object[]{login_id});
//System.out.println(sb.toString());
Map map_btn = new HashMap(); Map map_btn = new HashMap();
if (v_list != null && v_list.size() > 0) { if (v_list != null && v_list.size() > 0) {
for (int i = 0; i < v_list.size(); i++) { for (int i = 0; i < v_list.size(); i++) {
...@@ -84,7 +95,12 @@ ...@@ -84,7 +95,12 @@
session.setAttribute("s_have_btn", map_btn); session.setAttribute("s_have_btn", map_btn);
} }
} }
Hashtable ht = (Hashtable) v_check.get(0); Hashtable ht =new Hashtable();
if(v_check.size()>0){
ht = (Hashtable) v_check.get(0);
}else if(v_check_other.size()>0){
ht = (Hashtable) v_check_other.get(0);
}
String login_name = pub.trimNull((String) ht.get("user_name")); String login_name = pub.trimNull((String) ht.get("user_name"));
String new_login_id = pub.trimNull((String) ht.get("id")); String new_login_id = pub.trimNull((String) ht.get("id"));
String gh = pub.trimNull((String) ht.get("gh")); String gh = pub.trimNull((String) ht.get("gh"));
...@@ -92,7 +108,7 @@ ...@@ -92,7 +108,7 @@
session.setAttribute("session_gh", gh); session.setAttribute("session_gh", gh);
session.setAttribute("session_login_name", login_name); session.setAttribute("session_login_name", login_name);
Logger.log("登录", "登录", login_id, "登录成功", request); Logger.log("登录", "登录", login_id, "登录成功", request);
out.println("success"); out.println("success"+","+tablename);
} }
return; return;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -86,7 +86,13 @@ ...@@ -86,7 +86,13 @@
success: function (msg) { success: function (msg) {
msg = iGetInnerText(msg); msg = iGetInnerText(msg);
if (msg.indexOf("success") >= 0) { if (msg.indexOf("success") >= 0) {
window.location.href = "./home_ztj-t.jsp"; var tablename=msg.substring(msg.indexOf(",")+1);
if(tablename=='zb_bgs_user'){
window.location.href = "./home_bgs-t.jsp";
}else{
window.location.href = "./home_ztj-t.jsp";
}
} else { } else {
layer.msg('登录失败,' + msg, { layer.msg('登录失败,' + msg, {
icon: 5, icon: 5,
......
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