Commit 89d961a8 authored by 马超's avatar 马超

值班管理

parent 6b02685e
#calendar {width:98%;margin: 0 auto;margin-top: 1px;}
table{border-collapse: collapse;background-color:#fff6d9;}
td,th{border: 1px solid red;width:100px;}
table th {height:50px;line-height: 50px;text-align: center;font-size: 20px;}
td{height:100px;text-align:center;vertical-align:middle;}
td {vertical-align:top;position:relative;font-size: 15px;}
td div{position:absolute; left:0; top:0;font-size: 18px;}
.title {width:100%;height:60px;line-height:60px;background-color: #00B83F;color:#fff;text-align: center;font-size: 20px;}
.title label {font-size: 20px;}
#calendar-pre {
border:1px solid #fff;cursor: pointer;border-radius:50px;
width: 160px;
height: 30px;
line-height: 30px;
float: left;
margin-top: 15px;
margin-left:20%;
}
#calendar-next {border:1px solid #fff;cursor: pointer;border-radius:50px;
width: 160px;
height: 30px;
line-height: 30px;
float: right;
margin-top: 15px;
margin-right:20%;
}
\ No newline at end of file
.sc-calendar {
width: 500px;
height: 500px;
text-align: center;
font-family: "Microsoft Yahei";
color: #4A4A4A;
box-shadow: 2px 4px 5px #bdbdbd;
border-width: 1px 0 0 1px;
border-color: #E6E4E0;
border-style: solid;
float: left;
margin-right: 20px;
-moz-user-select: none;
/*火狐*/
-webkit-user-select: none;
/*webkit浏览器*/
-ms-user-select: none;
/*IE10*/
user-select: none;
-webkit-text-size-adjust: none;
font-size: 16px;
}
.sc-header {
height: 45px;
border-bottom: 0;
background-color: #00B83F;
font-size: 18px;
}
.sc-body {
height: 93%;
clear: both;
box-shadow: 2px 4px 5px #bdbdbd;
}
.sc-week {
height: 10%;
font-weight: 400;
font-size: 20px;
color: #4A4A4A;
}
.sc-days {
height: 88%;
}
.sc-item {
height: 20%;
float: left;
font-weight: 600;
color: #565555;
width: 14.285%;
padding-top: 10px;
background-color: #ffffff;
border-width: 0 0 1px 1px;
border-color: #F1EBE4;
border-style: solid;
box-sizing: border-box;
position:relative;
}
.item-nolunar {
padding-top: 20px;
}
.sc-item:nth-child(7n) .day, .sc-item:nth-child(7n+1) .day {
color: rgba(224, 8, 8, 0.74);
}
.sc-vocation {
background-color: #FFEBEC;
}
.sc-mark{
background-color: #E5FBFA;
}
.sc-vocation:before {
content: '休';
display: block;
position: absolute;
font-size: 0.7em;
width: 1.2em;
font-weight: 100;
color: white;
background-color: #E00808;
margin-top: -10px;
}
.sc-othermenth {
color: #C1C0C0 !important;
}
.sc-othermenth .day, .sc-othermenth .lunar-day {
color: #C1C0C0 !important;
}
.sc-active-day, .sc-selected {
border: 1px solid orange;
}
.sc-today {
background-color: orange;
color: white;
border: 1px solid orange;
}
.sc-item .day {
position:absolute;
left:10px;
top:0px;
}
.sc-item .zb_user {
font-size:13px;
font-weight:100;
}
.sc-today .day {
color: white !important;
}
.sc-item .lunar-day {
font-size: 10px;
font-weight: normal;
overflow: hidden;
text-overflow: ellipsis;
position:absolute;
left:10px;
top:20px;
}
.sc-festival .lunar-day {
color: #E00808;
}
/*.sc-item:last-child, .sc-item:nth-child(7n) {
border-width: 0 1px 1px 1px;
}*/
.sc-week-item {
height: 100%;
padding-top: 1%;
float: left;
width: 14.285%;
background-color: #FBEC9C;
border-width: 1px 0 1px 1px;
border-color: #ECE3B1;
border-style: solid;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
}
.sc-item-small{
font-size: 10px !important;
}
.sc-week-item:last-child {
border-width: 1px 1px 1px 1px;
}
.sc-week-item:nth-child(7n), .sc-week-item:nth-child(7n+1) {
color: rgba(224, 8, 8, 0.74)!important;
}
.sc-actions {
float: left;
width: 25%;
padding: 5px;
height: 100%;
box-sizing: border-box;
}
.sc-actions:last-child {
float: right;
}
.sc-actions-big{
width: 50%;
}
@media screen and (max-width : 500px){
.sc-actions{
width: 50%;
}
}
.sc-header select {
border-color: rgba(0, 0, 0, 0);
padding: 0.2em;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-family: "Microsoft Yahei";
color: #606060;
font-size: 16px ;
background-color: #00B83F;
color:#fff;
}
.sc-header input {
border-color: rgba(0, 0, 0, 0);
padding: 0.2em;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-family: "Microsoft Yahei";
color: #606060;
}
.sc-actions div {
color:#fff;
display: inline-block;
/*border: 1px solid #ccc;*/
vertical-align: bottom;
width: 20px;
padding-bottom: 5px;
font-size: 30px;
line-height: 0.9em;
}
.sc-return-today {
display: block;
background-color: #00B83F;
color:#fff;
border-radius: 2px;
/* border: 1px solid #ccc; */
width: 80px;
font-size: 16px;
padding: 0.3em;
margin: auto;
}
.sc-time {
display: block;
margin-top: 3px;
font-size: 16px;
color:#fff;
}
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.Logger" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Enumeration enu = request.getParameterNames();
String action = pub.trimNull(request.getParameter("action"));
String action_msg="";
String mx_id = pub.trimNull(request.getParameter("mx_id"));
if("".equals(mx_id)){
mx_id=UUID.randomUUID().toString().trim().replaceAll("-", "");
}
String day_id = pub.trimNull(request.getParameter("day_id"));
String[] userids = request.getParameterValues("userids");
String user_names="";
if(userids!=null && userids.length>0) {
for (int i = 0; i < userids.length; i++) {
user_names+=userids[i]+",";
}
}
if(!"".equals(user_names)){
user_names=user_names.substring(0,user_names.length()-1);
}
String input_count = pub.trimNull(request.getParameter("input_count"));
if("".equals(input_count)){
input_count="1";
}
int inputSize=Integer.parseInt(input_count);
String mx_name = pub.trimNull(request.getParameter("mx_name"));
String mx_day = pub.trimNull(request.getParameter("mx_day"));
int mxDay=1;
if(!"".equals(mx_day)){
mxDay=Integer.parseInt(mx_day);
}
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String add_time = pub.getCurrentServerTime();
StringBuffer sql_add=new StringBuffer("insert into zb_mx (id,name,day,add_time,add_user) values (?,?,?,?,?)");
StringBuffer sql_update=new StringBuffer("update t_user_phone set update_user=?,update_time=?,");
try {
conn = com.censoft.db.DBUtil.getConnection();
List list_add= new ArrayList();
list_add.add(mx_id);
list_add.add(mx_name);
list_add.add(mx_day);
list_add.add(add_time);
list_add.add(add_user);
List list_update = new ArrayList();
conn.setAutoCommit(false);
boolean is_oper = false;
if("add".equals(action)){
action_msg="新增";
is_oper = cf.executeUpdate(conn, sql_add.toString(),list_add.toArray());
if (!is_oper) {
conn.rollback();
System.out.println("新增zb_mx表出错了" + cf.getMsg());
return;
}
for (int i = 0; i < inputSize; i++) {
String b_time = pub.trimNull(request.getParameter("b_time_"+(i+1)));
String e_time = pub.trimNull(request.getParameter("e_time_"+(i+1)));
String zb_type = pub.trimNull(request.getParameter("zb_type_"+(i+1)));
String zb_type_id=UUID.randomUUID().toString().trim().replaceAll("-", "");
is_oper = cf.executeUpdate(conn, "insert into zb_type(id,mx_id,zb_type,b_time,e_time,add_user,add_time) values (?,?,?,?,?,?,?)"
, new Object[]{zb_type_id,mx_id,zb_type,b_time,e_time,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_type表出错了" + cf.getMsg());
conn.rollback();
return;
}
for(int n=0;n<mxDay;n++){
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,"",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)){
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});
if (!is_oper) {
conn.rollback();
System.out.println("删除zb_type表出错了" + cf.getMsg());
return;
}
is_oper = cf.executeUpdate(conn, "delete from zb_mx where id=?",new Object[]{mx_id});
if (!is_oper) {
conn.rollback();
System.out.println("删除zb_mx表出错了" + cf.getMsg());
return;
}
}else if("addUser".equals(action)){
action_msg="选择人员";
is_oper = cf.executeUpdate(conn, "update zb_mx_day set user_name=? where id=?",new Object[]{user_names,day_id});
if (!is_oper) {
conn.rollback();
System.out.println("插入人员zb_mx_day表出错了" + cf.getMsg());
return;
}
}else{
action_msg="修改";
String zb_type_ids="";
for (int i = 0; i < inputSize; i++) {
String b_time = pub.trimNull(request.getParameter("b_time_"+(i+1)));
String e_time = pub.trimNull(request.getParameter("e_time_"+(i+1)));
String zb_type = pub.trimNull(request.getParameter("zb_type_"+(i+1)));
String zb_type_id=pub.trimNull(request.getParameter("zb_type_id_"+(i+1)));
if(!"".equals(zb_type_id)){
zb_type_ids=zb_type_id+","+zb_type_ids;
is_oper = cf.executeUpdate(conn, "update zb_type set zb_type=?,b_time=?,e_time=?,update_time=?,update_user=? where id=?"
, new Object[]{zb_type,b_time,e_time,add_time,add_user,zb_type_id});
}else{
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,add_user,add_time) values (?,?,?,?,?,?,?)"
, new Object[]{new_id,mx_id,zb_type,b_time,e_time,add_user,add_time});
if (!is_oper) {
System.out.println("修改zb_type表出错了" + cf.getMsg());
conn.rollback();
return;
}
for(int n=0;n<mxDay;n++){
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,"",n+1,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_mx_day表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
}
if (!is_oper) {
System.out.println("修改zb_type表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
//修改页面,删除已有行
/*if(!"".equals(zb_type_ids)){
zb_type_ids=zb_type_ids.substring(0,zb_type_ids.length()-1);
String[] field=zb_type_ids.split(",");
StringBuffer sb = new StringBuffer();
sb.append("delete from zb_type where 1=1 ");
sb.append(" and id not in (");
if(field!=null&&field.length>0){
for(int i=0;i<field.length;i++){
if(i==field.length-1){
sb.append("'" + field[i] + "'");
}else{
sb.append("'" + field[i] + "',");
}
}
}
sb.append(" )");
//System.out.println(sb.toString());
is_oper = cf.executeUpdate(conn, sb.toString(), new Object[]{});
if (!is_oper) {
conn.rollback();
System.out.println("删除多余的时间段出错了" + cf.getMsg());
return;
}
}*/
is_oper = cf.executeUpdate(conn, "update zb_mx set name=? where id=?", new Object[]{mx_name,mx_id});
if (!is_oper) {
conn.rollback();
System.out.println("修改zb_mx表出错了" + cf.getMsg());
return;
}
}
if (!is_oper) {
conn.rollback();
System.out.println("操作出错了" + cf.getMsg());
return;
}
Logger.log(conn, "值班模型",action_msg, add_user, "", request);
conn.commit();
if (!is_oper) {
conn.rollback();
out.println(cf.getMsg());
} else {
out.println("success");
}
} catch (Exception e) {
conn.rollback();
System.out.println("有异常" + e);
return;
} finally {
if (conn != null) {
conn.setAutoCommit(true);
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
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="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 login_id = (String) session.getAttribute("session_login_id");
if ("".equals(login_id)) {
System.out.println("当前没有用户信息");
}
String page_number = pub.trimNull(request.getParameter("page_number"));
String opt = pub.trimNull(request.getParameter("opt"));
if ("".equals(page_number)) page_number = "1";
String page_size = pub.trimNull(request.getParameter("page_size"));
if ("".equals(page_size)) page_size = "20";
StringBuffer sql = new StringBuffer();
List list = new ArrayList();
sql.append("select * from zb_mx");
sql.append(" order by add_time desc");
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray());
if (v_list == null) {
out.println("查询用户出错");
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 style="margin-top: 10px;" id="leftMx">
<ul>
<%
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 name = pub.trimNull((String) ht.get("name"));
String day = pub.trimNull((String) ht.get("day"));
%>
<li id="li_<%=id%>" style="padding-left: 30px;height:30px;line-height: 30px;cursor: pointer;" onclick="openLi('<%=id%>','<%=day%>');">
<%=name%>
</li>
<%}}%>
</ul>
</div>
<%@ 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();
%>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/js/zTree/v3/css/zTreeStyle/zTreeStyle.css"
type="text/css">
<div class="page-container">
<div class="left-tree">
<button class="btn btn-success" onclick="optMx('add');" style="text-align:center;float:left;">
新建</button>
<button class="btn btn-success" onclick="updateMx();" style="text-align:center;float:left;margin-left: 20px;">
修改</button>
<button class="btn btn-success" onclick="delMx();" style="text-align:center;float:right;">
删除</button>
<input type="hidden" name="check_mx_id" id="check_mx_id">
<input type="hidden" name="check_mx_day" id="check_mx_day">
<div id="deptinfo" class="deptinfo" style="width:100%;">
</div>
</div>
<div class="right-contant" >
<div id="datalist">
</div>
</div>
</div>
</div>
<script type="text/javascript">
searchModel();
function searchModel() {
$.ajax({
type: "post",
url: "left_list.jsp",
//data: $('#data_form_search').serialize(),
success: function (msg) {
$("#deptinfo").html(msg);
}
});
}
function searchModel1(mx_id) {
$.ajax({
type: "post",
url: "right_list.jsp?number="+Math.random()+"&mx_id="+mx_id+"&day="+$("#check_mx_day").val(),
success: function (msg) {
$("#datalist").html(msg);
$("#li_"+mx_id).css("backgroundColor","#cccccc");
}
});
}
$(document).keyup(function (event) {
if (event.keyCode == 13) {
searchModel();
}
});
function addUser() {
var url = './editUser-t.jsp?action=add&dept_id=';
var dept_id = document.getElementById("dept_id").value;
if (dept_id == '') {
layer.alert("请选择机构", {icon: 5, title: "提示"});
return false;
}
url += dept_id;
viewDeptOrUserInfo('人员信息', url, '1000', '500');
}
function optMx(type) {
var url = './edit-t.jsp?action='+type;
viewDeptOrUserInfo('新建模型', url, '1000', '500');
}
function updateMx(){
var mx_id=$("#check_mx_id").val();
if(mx_id==''){
layer.alert("请选择模型", {icon: 5, title: "提示"});
return false;
}
var url = './edit-t.jsp?action=update&mx_id='+mx_id;
viewDeptOrUserInfo('修改模型', url, '1000', '500');
}
function delMx(){
var mx_id=$("#check_mx_id").val();
if(mx_id==''){
layer.alert("请选择模型", {icon: 5, title: "提示"});
return false;
}
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp?mx_id="+mx_id+"&action=delete",
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
window.location.reload();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
// console.log("********************8")
});
}
}
});
});
}
function viewDeptOrUserInfo(title, url, w, h) {
var abc = layer.open({
title: title,
type: 2,
content: url,
area: [w+'px', h+'px'],
maxmin: true,
end:function () {
searchModel();
searchModel1($("#check_mx_id").val());
}
});
//layer.full(abc);
}
function openLi(mx_id,day) {
$("#check_mx_id").val(mx_id);
$("#check_mx_day").val(day);
$("#leftMx ul li").each(function(){
$(this).css("backgroundColor","#e0e4f6");
})
$("#li_"+mx_id).css("backgroundColor","#cccccc");
searchModel1(mx_id);
}
function editUser(day_id,mx_id) {
var url = './selectUser-t.jsp?day_id='+day_id+"&mx_id="+mx_id;
var abc = layer.open({
title: '选择人员',
type: 2,
content: url,
area: ['1000px', '500px'],
maxmin: true,
end:function () {
searchModel1($("#check_mx_id").val());
}
});
}
</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;
Vector v_list_day = null;
String login_id = (String) session.getAttribute("session_login_id");
if ("".equals(login_id)) {
System.out.println("当前没有用户信息");
}
String mx_id = pub.trimNull(request.getParameter("mx_id"));
String Mxday = pub.trimNull(request.getParameter("day"));
int divCount=8;
if(!"".equals(Mxday)){
divCount=Integer.parseInt(Mxday);
}
String divWidth=(divCount+2)*140+"px";
StringBuffer sql = new StringBuffer();
StringBuffer sql_day = new StringBuffer();
int listSize=1;
sql.append("select * from zb_type where mx_id=? order by order_num asc ");
sql_day.append("select * from zb_mx_day where mx_id=? and zb_type=? order by day asc ");
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{mx_id});
if (v_list != null && v_list.size()>0) {
}
%>
<div style="border: solid 1px #eee;margin-top: 20px;height:550px;width:1100px;overflow: auto;">
<%
for(int i=0;i<v_list.size();i++){
Hashtable ht = (Hashtable) v_list.get(i);
String id=pub.trimNull((String)ht.get("id"));
String zb_type=pub.trimNull((String)ht.get("zb_type"));
String b_time=pub.trimNull((String)ht.get("b_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){%>
<div style="width:<%=divWidth%>;height:40px;float:left;white-space: nowrap;">
<div style="width:140px;height:40px;float:left;border:0.5px solid #000;">
</div>
<%
if(v_list_day!=null && v_list_day.size()>0){
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">
<%=day%>
</div>
<% }}%>
</div>
<%}%>
<div style="width:<%=divWidth%>;height:160px;float:left;">
<div style="width:140px;height:160px;float:left;border:0.5px solid #000;text-align: center;line-height: 120px;">
<p style="height:30px;"> <%=zb_type%></p>
<p style="height:30px;">(<%=b_time%>-<%=e_time%>)</p>
</div>
<%
if(v_list_day!=null && v_list_day.size()>0){
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">
<p style="height:10px;"></p>
<%=user_name%>
<button class="btn btn-success" onclick="editUser('<%=day_id%>','<%=mx_id%>');" style="text-align:center;position:absolute; right:0; bottom:0;">
修改</button>
</div>
<%}}%>
</div>
<%}%>
</div>
<script type="text/javascript">
function deleteUser(user_id){
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp?user_id="+user_id+"&action=delete",
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 () {
// console.log("********************8")
});
}
}
});
})
}
function optOrder(opt,user_id){
$.ajax({
type: "post",
url: "opt_order.jsp",
data:{"user_id":user_id,"opt":opt},
success: function (data) {
if (data.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
searchModel();
});
} else {
layer.msg('操作失败,'+data, {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
// console.log("********************8")
});
}
}
});
}
</script>
<%
} catch (Exception e) {
out.println("查询用户信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
\ 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.Logger" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
Vector v_list_day = null;
String user_names ="";
String login_id = (String) session.getAttribute("session_login_id");
if ("".equals(login_id)) {
System.out.println("当前没有用户信息");
}
String page_number = pub.trimNull(request.getParameter("page_number"));
String day_id = pub.trimNull(request.getParameter("day_id"));
String mx_id = pub.trimNull(request.getParameter("mx_id"));
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();
List list = new ArrayList();
sql.append("select * from zb_user order by id desc");
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray());
if (v_list == null) {
out.println("查询用户出错");
return;
}
v_list_day = cf.doQuery(conn, "select user_name from zb_mx_day where id=?", null, new Object[]{day_id});
if (v_list_day != null && v_list_day.size()>0) {
Hashtable ht1= (Hashtable) v_list_day.get(0);
user_names = pub.trimNull((String) ht1.get("user_name"));
}
Hashtable ht_row = (Hashtable) v_list.get(0);
String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
%>
<div style="margin-top: 10px;">
<a class="btn btn-primary radius" onclick="saveGroupForm('<%=mx_id%>');" >
确定
</a>
</div>
<form action="selectUser-t.jsp" method="post" id="groupUser" name="groupUser">
<input type="hidden" name="day_id" id="day_id" value="<%=day_id%>">
<table class="table table-border table-bordered table-hover table-bg table-sort">
<thead>
<tr class="text-c">
<th width="30">序号</th>
<th width="30">
<input id="checkboxAll" type="checkbox" onclick="checkAll(this);"></input>
</th>
<th width="100">人员姓名</th>
<th width="100">联系电话</th>
<th width="100">工号</th>
</tr>
</thead>
<tbody id="groupUserInfo">
<%
Hashtable ht_1 =null;
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 user_id = pub.trimNull((String) ht.get("id"));
String user_name = pub.trimNull((String) ht.get("user_name"));
String tel = pub.trimNull((String) ht.get("tel"));
String gh = pub.trimNull((String) ht.get("gh"));
%>
<tr class="text-c">
<td><%=i%>
</td>
<td >
<input type="checkbox" class="info" id="userids" name="userids" value="<%=user_name%>"
<%if(user_names.indexOf(user_name)>=0){%>checked="checked"<%}%>/>
</td>
<td><%=user_name%>
</td>
<td><%=tel%>
</td>
<td><%=gh%>
</td>
</tr>
<%
}
}
%>
</tbody>
</table>
</form>
<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">
var checkAll = function (checkbox) {
$(".info").prop("checked", checkbox.checked);
}
function saveGroupForm(mx_id){
var isChecked=false;
var us = document.getElementsByName("userids");
for(var i=0;i<us.length;i++){
if(us[i].checked){
isChecked = true;
}
}
if(!isChecked){
layer.alert("请勾选用户",{icon:5,title:"提示"});
return false;
}
$.ajax({
type: "POST",
url: "./action.jsp?action=addUser",
data: $('#groupUser').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
// console.log("********************8")
});
}
}
});
}
</script>
<%
} catch (Exception e) {
out.println("查询用户信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
\ No newline at end of file
<%@ 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.Logger" %>
<%@ page import="java.text.DateFormat" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.text.ParseException" %>
<%!
public static String getUserNames(ConnectionFactory cf,Connection conn,int startIndex,int n){
Vector userListSize = cf.doQuery(conn,"select id from zb_user",null,new Object[]{});
StringBuffer sql=new StringBuffer("select user_name from zb_user where 1=1 and order_num in(");
List list= new ArrayList();
String user_names="";
int startIndex_2=startIndex;
for(int i=0;i<n;i++){
startIndex=startIndex+1;
if(startIndex==userListSize.size()+1){
startIndex=1;
}
if(i==n-1){
sql.append(startIndex );
}else{
sql.append(startIndex + ",");
}
}
sql.append(") order by field (order_num,");
for(int i=0;i<n;i++){
startIndex_2=startIndex_2+1;
if(startIndex_2==userListSize.size()+1){
startIndex_2=1;
}
if(i==n-1){
sql.append(startIndex_2 );
}else{
sql.append(startIndex_2 + ",");
}
}
sql.append(") ");
Vector userList = cf.doQuery(conn,sql.toString(),null,list.toArray());
if(userList!=null && userList.size()>0){
for(int i=0;i<userList.size();i++) {
Hashtable ht1 = (Hashtable) userList.get(i);
String user_name = (String) ht1.get("user_name");
user_names=user_names+user_name+",";
}
}else{
System.out.println("方法查询出错"+cf.getMsg());
}
return startIndex+"_"+user_names;
}
public static List<String> getDays(String startTime, String endTime) {
// 返回的日期集合
List<String> days = new ArrayList<String>();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
Date start = dateFormat.parse(startTime);
Date end = dateFormat.parse(endTime);
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start);
Calendar tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
tempEnd.add(Calendar.DATE, +1);// 日期加1(包含结束)
while (tempStart.before(tempEnd)) {
days.add(dateFormat.format(tempStart.getTime()));
tempStart.add(Calendar.DAY_OF_YEAR, 1);
}
} catch (ParseException e) {
e.printStackTrace();
}
return days;
}
public static int getUserOrder(ConnectionFactory cf,Connection conn,String username) {
int order_num =1;
if(username.indexOf(",")>0){
username=username.substring(username.lastIndexOf(",")+1,username.length());
}
Vector userList = cf.doQuery(conn,"select order_num from zb_user where user_name=?",null,new Object[]{username});
if(userList!=null && userList.size()>0){
for(int i=0;i<userList.size();i++) {
Hashtable ht1 = (Hashtable) userList.get(i);
order_num = Integer.parseInt((String) ht1.get("order_num"));
}
}
return order_num;
}
%>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
String action = pub.trimNull(request.getParameter("action"));
String action_msg="";
String mx_id = pub.trimNull(request.getParameter("mx_id"));
String b_time = pub.trimNull(request.getParameter("b_time"));
String e_time = pub.trimNull(request.getParameter("e_time"));
String mx_day = mx_id.substring(mx_id.indexOf("_")+1,mx_id.length());
String mxId=mx_id.substring(0,mx_id.indexOf("_"));;
int mxDay=1;
if(!"".equals(mx_day)){
mxDay=Integer.parseInt(mx_day);
}
String userNames="";
List<String> list= getDays(b_time,e_time);
int selectDay=list.size();
String add_user = pub.trimNull((String) session.getAttribute("session_login_id"));
if ("".equals(add_user)) {
System.out.println("当前没有用户信息");
}
String add_time = pub.getCurrentServerTime();
StringBuffer sql_add=new StringBuffer("insert into zb_zdpb (b_time,e_time,mx_id,add_time,add_user) values (?,?,?,?,?)");
try {
conn = com.censoft.db.DBUtil.getConnection();
List list_add= new ArrayList();
list_add.add(b_time);
list_add.add(e_time);
list_add.add(mx_id);
list_add.add(add_time);
list_add.add(add_user);
conn.setAutoCommit(false);
boolean is_oper = false;
if("add".equals(action)){
action_msg="新增";
is_oper = cf.executeUpdate(conn, sql_add.toString(),list_add.toArray());
if (!is_oper) {
conn.rollback();
System.out.println("新增zb_zdpb表出错了" + cf.getMsg());
return;
}
int startIndex=0;
int index=0;
int count=1;
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});
if(selectDay/mxDay>0){
for(int a=0;a<selectDay/mxDay;a++){
if(zb_type_list!=null && zb_type_list.size()>0) {
for (int i = 0; i < zb_type_list.size(); i++) {
Hashtable ht = (Hashtable) zb_type_list.get(i);
String ren_num = pub.trimNull((String) ht.get("ren_num"));
String zb_type = pub.trimNull((String) ht.get("zb_type"));
for(int n=0;n<mxDay;n++){
index=a*mxDay+n;
if(n==mxDay){
index=0;
}
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, sql1.toString()
, new Object[]{list.get(index),zb_type, userNames,index+1,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_user_gl表出错了" + cf.getMsg());
conn.rollback();
return;
}
}
count++;
}
}
}
}
if(selectDay%mxDay>0) {
for (int i = 0; i < zb_type_list.size(); i++) {
Hashtable ht = (Hashtable) zb_type_list.get(i);
String ren_num = pub.trimNull((String) ht.get("ren_num"));
String zb_type = pub.trimNull((String) ht.get("zb_type"));
index=selectDay-(selectDay%mxDay);
for(int n=0;n<selectDay%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, sql1.toString()
, new Object[]{list.get(index),zb_type, userNames,index+1,add_user,add_time});
if (!is_oper) {
System.out.println("新增zb_user_gl表出错了" + cf.getMsg());
conn.rollback();
return;
}
index++;
}
}
}
}
if (!is_oper) {
conn.rollback();
System.out.println("操作出错了" + cf.getMsg());
return;
}
Logger.log(conn, "值班管理",action_msg, add_user, "", request);
conn.commit();
if (!is_oper) {
conn.rollback();
out.println(cf.getMsg());
} else {
out.println("success,"+mx_id);
}
} catch (Exception e) {
conn.rollback();
System.out.println("有异常" + e);
return;
} finally {
if (conn != null) {
conn.setAutoCommit(true);
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
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="java.sql.Connection" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.Vector" %>
<%
ConnectionFactory cf = new ConnectionFactory();
Pub pub = new Pub();
Connection conn = null;
Vector v_list = null;
Vector v_type_list = null;
String mx_id = pub.trimNull(request.getParameter("mx_id"));
String action = pub.trimNull(request.getParameter("action"));
Hashtable ht = new Hashtable();
StringBuffer sql = new StringBuffer();
StringBuffer group_sql = new StringBuffer();
int listSize=1;
try {
conn = com.censoft.db.DBUtil.getConnection();
} catch (Exception e) {
out.println("查询用户信息异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
<style>
.input-three {
width: 22%
}
.input-two {
width: 32%
}
.col-sm-2{
width:14%;
}
.col-sm-3{
width:19%;
}
.btn-red{ background-color:red;border: red}
.btn-green{ background-color:green;border: green}
</style>
<div class="">
<form class="form form-horizontal" id="form-admin-add">
<input type="hidden" value="add" name="action" id="action">
<div id="content" class="cl pd-5 bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;">
<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 type="text" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="b_time" id="b_time" value="" >
</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 type="text" class="input-text Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="e_time" id="e_time" value="" >
</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" id="mx_id">
<script>
$.post("./zd_view_list.jsp?name_id=mx_id&math="+Math.random(),function(data){
document.getElementById("mx_id").innerHTML=data;
}
);
</script>
</div>
</div>
</div>
</form>
</div>
<div class="cl mb-10 bk-gray " style="height: 50px;">
<div class="col-sm-3 pd-10" style="width:100%;text-align: center;">
<input class="btn btn-primary radius btn-green" type="button" onclick="javascript:saveForm();" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
</div>
</div>
<script src="<%=request.getContextPath()%>/js/Convert_Pinyin.js"></script>
<script>
function viewDeptOrUserInfo(title, url, w, h) {
location.href=url;
}
function saveForm() {
if($("#b_time").val()==''||$("#e_time").val()==''){
layer.alert("时间不能为空",{icon:5,title:"提示"});
return false;
}
$.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 () {
// console.log("********************8")
});
}
}
});
}
function deleteUser(user_id,p_user_id){
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: "POST",
url: "./action.jsp?&p_user_id="+p_user_id+"&user_id="+user_id+"&action=delete",
success: function (msg) {
if (msg.indexOf("success") >= 0) {
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
location.reload();
if(rel_user_id!=''){
window.parent.location.reload();
}
parent.searchModel();
});
} else {
layer.msg('操作失败', {
icon: 5,
time: 2000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
// console.log("********************8")
});
}
}
});
});
}
</script>
\ No newline at end of file
<%@ 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="operList();" >
周排班表
</a>
<a class="btn btn-primary radius" onclick="operList();" >
换班
</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, 1);
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;
daysElement[i].querySelector('.zb_user').innerHTML = '张三</br>李四';
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 arrayfrom(nidelist) {
let array = [];
[].forEach.call(nidelist, function(v) {
array.push(v);
});
return array;
}
function editUser(year,month,day) {
}
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>
<%--
Created by IntelliJ IDEA.
User: mc
Date: 2021/1/15
Time: 10:48
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;
Vector v_list_1 = null;
String zd_e_name = pub.trimNull(request.getParameter("zd_e_name"));
String value = pub.trimNull(request.getParameter("value"));
value=java.net.URLDecoder.decode(value,"UTF-8");
String name_id = pub.trimNull(request.getParameter("name_id"));
String reg_id = pub.trimNull(request.getParameter("reg_id"));
List list_s = new ArrayList();
Hashtable ht=null;
String first_name="请选择";
String col_name_all="";
try {
StringBuffer sb = new StringBuffer();
sb.append("select * from zb_mx order by add_time desc");
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doQuery(conn, sb.toString(),null, list_s.toArray());
if (v_list == null) {
out.println("查询出错" + cf.getMsg());
return;
}
%>
<select class="input-text" name="<%=name_id%>" id="<%=name_id%>_id" >
<option value=""><%=first_name%></option>
<%
if(v_list!=null && v_list.size()>0){
for(int i=0;i<v_list.size();i++){
ht=(Hashtable)v_list.get(i);
String col_name=pub.trimNull((String)ht.get("name"));
String day=pub.trimNull((String)ht.get("day"));
String id=pub.trimNull((String)ht.get("id"));
%>
<option value="<%=id%>_<%=day%>"><%=col_name%></option>
<%
}
}
%>
</select>
<%
} catch (Exception e) {
out.println("查询异常" + e);
return;
} finally {
if (conn != null) {
try {
conn.close();
} catch (Exception e) {
}
}
}
%>
This diff is collapsed.
......@@ -109,17 +109,19 @@
<input type="text" style="width:30%;" autocomplete="off" class="input-text" value="<%=pub.trimNull((String)ht1.get("zb_type"))%>" placeholder="" id = "zb_type_<%=i+1%>" name="zb_type_<%=i+1%>" >
</label>
<div class="formControls col-xs-4">
<input type="text" style="width:30%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("b_time"))%>" placeholder="" id = "b_time_<%=i+1%>" name="b_time_<%=i+1%>" >
<div class="formControls col-xs-6">
<input type="text" style="width:25%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("b_time"))%>" placeholder="" id = "b_time_<%=i+1%>" name="b_time_<%=i+1%>" >
&nbsp;&nbsp;
<input type="text" style="width:30%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("e_time"))%>" placeholder="" id = "e_time_<%=i+1%>" name="e_time_<%=i+1%>" >
<input type="text" style="width:25%;" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="<%=pub.trimNull((String)ht1.get("e_time"))%>" placeholder="" id = "e_time_<%=i+1%>" name="e_time_<%=i+1%>" >
&nbsp;&nbsp;默认人数
<input type="text" style="width:20%;" class="input-text " value="<%=pub.trimNull((String)ht1.get("ren_num"))%>" placeholder="" id = "ren_num_<%=i+1%>" name="ren_num_<%=i+1%>" >
</div>
<%
if(i==0){
%>
<a href="javascript:void (0);" onclick="addDiv();" style="font-size: 25px;">+</a>
<%}else{%>
<a href="javascript:void (0);" onclick="deleteDiv('<%=pub.trimNull((String)ht.get("id"))%>');" style="font-size: 25px;">-</a>
<a href="javascript:void (0);" onclick="deleteDiv('<%=pub.trimNull((String)ht.get("id"))%>');" style="font-size: 25px;display:none;">-</a>
<%}
%>
</div>
......@@ -132,10 +134,12 @@
<input type="text" style="width:30%;" autocomplete="off" class="input-text" value="" placeholder="" id = "zb_type_1" name="zb_type_1" >
</label>
<div class="formControls col-xs-4">
<input type="text" style="width:30%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "b_time_1" name="b_time_1" >
<div class="formControls col-xs-6">
<input type="text" style="width:25%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "b_time_1" name="b_time_1" >
&nbsp;&nbsp;
<input type="text" style="width:30%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "e_time_1" name="e_time_1" >
<input type="text" style="width:25%;" autocomplete="off" class="input-text Wdate" onclick="WdatePicker({dateFmt:'HH-mm'})" value="" placeholder="" id = "e_time_1" name="e_time_1" >
&nbsp;&nbsp;默认人数
<input type="text" style="width:20%;" class="input-text " value="" placeholder="" id = "ren_num_1" name="ren_num_1" >
</div>
<a href="javascript:void (0);" onclick="addDiv();" style="font-size: 25px;">+</a>
</div>
......@@ -165,11 +169,13 @@
$("#content").append("<div class=\"zbType row cl\" name=\""+(count+1)+"\" id=\"div_"+(count+1)+"\">\n" +
" <label class=\"form-label col-xs-4\" > " +
" <input type=\"text\" style=\"width:30%;\" autocomplete=\"off\" class=\"input-text\" value=\"\" placeholder=\"\" id = \"zb_type_"+(name_count+1)+"\" name=\"zb_type_"+(name_count+1)+"\" > :</label>\n" +
" <div class=\"formControls col-xs-4\">\n" +
" <input type=\"text\" style=\"width:30%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"b_time_"+(name_count+1)+"\" name=\"b_time_"+(name_count+1)+"\" >\n" +
" <div class=\"formControls col-xs-6\">\n" +
" <input type=\"text\" style=\"width:25%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"b_time_"+(name_count+1)+"\" name=\"b_time_"+(name_count+1)+"\" >\n" +
" &nbsp;至&nbsp;\n" +
" <input type=\"text\" style=\"width:30%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"e_time_"+(name_count+1)+"\" name=\"e_time_"+(name_count+1)+"\" >\n" +
" </div>\n" +
" <input type=\"text\" style=\"width:25%;\" autocomplete=\"off\" class=\"input-text Wdate\" onclick=\"WdatePicker({dateFmt:'HH-mm'})\" value=\"\" placeholder=\"\" id = \"e_time_"+(name_count+1)+"\" name=\"e_time_"+(name_count+1)+"\" >\n" +
" &nbsp;&nbsp;默认人数\n" +
" <input type=\"text\" style=\"width:20%;\" class=\"input-text \" value=\"\" placeholder=\"\" id = \"ren_num_"+(name_count+1)+"\" name=\"ren_num_"+(name_count+1)+"\" >" +
" </div>\n" +
" <a href=\"javascript:void (0);\" onclick=\"deleteDiv("+(count+1)+");\" style=\"font-size: 25px;\">-</a>"+
" </div>");
count++;
......@@ -221,9 +227,11 @@
data: $('#form-admin-add').serialize(),
success: function (msg) {
if (msg.indexOf("success") >= 0) {
var mx_id = msg.substring(msg.indexOf(",")+1,msg.length);
layer.msg('操作成功!', {icon: 1, time: 1000},
function () {
//parent.searchModel();
$("#check_mx_id").val(mx_id);
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
......
<%--
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" %>
......@@ -20,14 +14,20 @@
String user_id = pub.trimNull(request.getParameter("user_id"));
Hashtable ht = new Hashtable();
StringBuffer sql = new StringBuffer();
int order_num=1;
try {
conn = com.censoft.db.DBUtil.getConnection();
Vector maxOrder = cf.doQuery(conn, "select max(order_num) as order_num from zb_user", null, new Object[]{});
if("update".equals(action)){
sql.append("select * from zb_user where id=?");
v_list = cf.doQuery(conn, sql.toString(), null, new Object[]{user_id});
}
if (v_list!=null&&v_list.size() > 0) {
ht = (Hashtable) v_list.get(0);
order_num = Integer.parseInt(pub.trimNull((String)ht.get("order_num")));
}else{
Hashtable ht_order = (Hashtable) maxOrder.get(0);
order_num = Integer.parseInt(pub.trimNull((String)ht_order.get("order_num")))+1;
}
} catch (Exception e) {
out.println("查询用户信息异常" + e);
......@@ -92,6 +92,12 @@
<input type="text" name="pwd" value="<%=pub.trimNull((String)ht.get("pwd"))%>" class="input-text ">
</div>
</div>
<div class="row cl">
<label class="form-label col-xs-4 col-sm-2">序号:</label>
<div class="formControls col-xs-8 col-sm-3">
<input type="text" name="order_num" value="<%=order_num%>" class="input-text ">
</div>
</div>
</div>
</form>
</div>
......
......@@ -18,7 +18,7 @@
if ("".equals(page_size)) page_size = "10";
StringBuffer sql = new StringBuffer();
List list = new ArrayList();
sql.append("select * from zb_user order by add_time desc ");
sql.append("select * from zb_user order by order_num asc ");
try {
conn = com.censoft.db.DBUtil.getConnection();
v_list = cf.doPageQueryWithCount(conn, sql.toString(), page_number, page_size, null, list.toArray());
......@@ -64,10 +64,11 @@
String user_name = pub.trimNull((String) ht.get("user_name"));
String tel = pub.trimNull((String) ht.get("tel"));
String gh = pub.trimNull((String) ht.get("gh"));
String order_num = pub.trimNull((String) ht.get("order_num"));
String edit_url="./editUser-t.jsp?action=update&user_id="+user_id;
%>
<tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
<td><%=i%>
<td><%=order_num%>
</td>
<td><%=user_name%>
</td>
......
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