Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zbgl
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马超
zbgl
Commits
c0267c6e
Commit
c0267c6e
authored
Sep 07, 2022
by
马超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
值班管理
parent
89d961a8
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
876 additions
and
70 deletions
+876
-70
web/css/simple-calendar.css
web/css/simple-calendar.css
+1
-0
web/jsp/images/user.png
web/jsp/images/user.png
+0
-0
web/jsp/zbgl/pbgl/action.jsp
web/jsp/zbgl/pbgl/action.jsp
+22
-3
web/jsp/zbgl/pbgl/edit-t.jsp
web/jsp/zbgl/pbgl/edit-t.jsp
+16
-60
web/jsp/zbgl/pbgl/exportWeek.jsp
web/jsp/zbgl/pbgl/exportWeek.jsp
+155
-0
web/jsp/zbgl/pbgl/export_query.jsp
web/jsp/zbgl/pbgl/export_query.jsp
+139
-0
web/jsp/zbgl/pbgl/list-t.jsp
web/jsp/zbgl/pbgl/list-t.jsp
+31
-4
web/jsp/zbgl/pbgl/list_ajax.jsp
web/jsp/zbgl/pbgl/list_ajax.jsp
+67
-0
web/jsp/zbgl/pbgl/viewUser-t.jsp
web/jsp/zbgl/pbgl/viewUser-t.jsp
+156
-0
web/jsp/zbgl/pbgl/viewUserWeek-t.jsp
web/jsp/zbgl/pbgl/viewUserWeek-t.jsp
+287
-0
web/jsp/zbgl/pbgl/zd_view_list.jsp
web/jsp/zbgl/pbgl/zd_view_list.jsp
+1
-1
web/jsp/zbgl/pbmx/right_list.jsp
web/jsp/zbgl/pbmx/right_list.jsp
+1
-2
No files found.
web/css/simple-calendar.css
View file @
c0267c6e
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
.sc-item
.zb_user
{
.sc-item
.zb_user
{
font-size
:
13px
;
font-size
:
13px
;
font-weight
:
100
;
font-weight
:
100
;
cursor
:
pointer
;
}
}
.sc-today
.day
{
.sc-today
.day
{
color
:
white
!important
;
color
:
white
!important
;
...
...
web/jsp/images/user.png
0 → 100644
View file @
c0267c6e
1.3 KB
web/jsp/zbgl/pbgl/action.jsp
View file @
c0267c6e
...
@@ -97,8 +97,12 @@
...
@@ -97,8 +97,12 @@
String
mx_id
=
pub
.
trimNull
(
request
.
getParameter
(
"mx_id"
));
String
mx_id
=
pub
.
trimNull
(
request
.
getParameter
(
"mx_id"
));
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"
));
String
mx_day
=
mx_id
.
substring
(
mx_id
.
indexOf
(
"_"
)+
1
,
mx_id
.
length
());
String
mx_day
=
""
;
String
mxId
=
mx_id
.
substring
(
0
,
mx_id
.
indexOf
(
"_"
));;
String
mxId
=
""
;
if
(!
""
.
equals
(
mx_id
)){
mx_day
=
mx_id
.
substring
(
mx_id
.
indexOf
(
"_"
)+
1
,
mx_id
.
length
());
mxId
=
mx_id
.
substring
(
0
,
mx_id
.
indexOf
(
"_"
));;
}
int
mxDay
=
1
;
int
mxDay
=
1
;
if
(!
""
.
equals
(
mx_day
)){
if
(!
""
.
equals
(
mx_day
)){
mxDay
=
Integer
.
parseInt
(
mx_day
);
mxDay
=
Integer
.
parseInt
(
mx_day
);
...
@@ -117,7 +121,7 @@
...
@@ -117,7 +121,7 @@
List
list_add
=
new
ArrayList
();
List
list_add
=
new
ArrayList
();
list_add
.
add
(
b_time
);
list_add
.
add
(
b_time
);
list_add
.
add
(
e_time
);
list_add
.
add
(
e_time
);
list_add
.
add
(
mx
_i
d
);
list_add
.
add
(
mx
I
d
);
list_add
.
add
(
add_time
);
list_add
.
add
(
add_time
);
list_add
.
add
(
add_user
);
list_add
.
add
(
add_user
);
conn
.
setAutoCommit
(
false
);
conn
.
setAutoCommit
(
false
);
...
@@ -188,6 +192,21 @@
...
@@ -188,6 +192,21 @@
}
}
}
}
}
}
}
else
if
(
"delete"
.
equals
(
action
)){
is_oper
=
cf
.
executeUpdate
(
conn
,
"delete from zb_zdpb where b_time=? and e_time=?"
,
new
Object
[]{
b_time
,
e_time
});
if
(!
is_oper
)
{
System
.
out
.
println
(
"删除zb_zdpb表出错了"
+
cf
.
getMsg
());
conn
.
rollback
();
return
;
}
is_oper
=
cf
.
executeUpdate
(
conn
,
"
delete
from
zb_user_gl
where
year
>
=?
and
year
<=?
"
, new Object[]{b_time,e_time});
if (!is_oper) {
System.out.println("
删除
zb_user_gl
表出错了
" + cf.getMsg());
conn.rollback();
return;
}
}
}
if (!is_oper) {
if (!is_oper) {
conn.rollback();
conn.rollback();
...
...
web/jsp/zbgl/pbgl/edit-t.jsp
View file @
c0267c6e
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/9/11
Time: 12:54
To change this template use File | Settings | File Templates.
--%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@ page
import=
"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>
<style>
.input-three
{
width
:
22%
}
.input-two
{
width
:
32%
}
.col-sm-2
{
.col-sm-2
{
width
:
14%
;
width
:
14%
;
}
}
...
@@ -53,8 +8,6 @@
...
@@ -53,8 +8,6 @@
}
}
.btn-red
{
background-color
:
red
;
border
:
red
}
.btn-red
{
background-color
:
red
;
border
:
red
}
.btn-green
{
background-color
:
green
;
border
:
green
}
.btn-green
{
background-color
:
green
;
border
:
green
}
</style>
</style>
<div
class=
""
>
<div
class=
""
>
<form
class=
"form form-horizontal"
id=
"form-admin-add"
>
<form
class=
"form form-horizontal"
id=
"form-admin-add"
>
...
@@ -95,18 +48,19 @@
...
@@ -95,18 +48,19 @@
<div
class=
"cl mb-10 bk-gray "
style=
"height: 50px;"
>
<div
class=
"cl mb-10 bk-gray "
style=
"height: 50px;"
>
<div
class=
"col-sm-3 pd-10"
style=
"width:100%;text-align: center;"
>
<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=
" 保存 "
>
<input
class=
"btn btn-primary radius btn-green"
type=
"button"
onclick=
"javascript:saveForm();"
value=
" 保存 "
>
<input
class=
"btn btn-primary radius btn-red"
type=
"button"
onclick=
"javascript:deleteForm();"
value=
" 重置 "
>
</div>
</div>
</div>
</div>
<script
src=
"
<%=
request
.
getContextPath
()
%>
/js/Convert_Pinyin.js"
></script>
<script>
<script>
function
viewDeptOrUserInfo
(
title
,
url
,
w
,
h
)
{
location
.
href
=
url
;
}
function
saveForm
()
{
function
saveForm
()
{
if
(
$
(
"
#b_time
"
).
val
()
==
''
||
$
(
"
#e_time
"
).
val
()
==
''
){
if
(
$
(
"
#b_time
"
).
val
()
==
''
||
$
(
"
#e_time
"
).
val
()
==
''
){
layer
.
alert
(
"
时间不能为空
"
,{
icon
:
5
,
title
:
"
提示
"
});
layer
.
alert
(
"
时间不能为空
"
,{
icon
:
5
,
title
:
"
提示
"
});
return
false
;
return
false
;
}
}
if
(
$
(
"
#mx_id option:selected
"
).
val
()
==
''
){
layer
.
alert
(
"
请选择模型
"
,{
icon
:
5
,
title
:
"
提示
"
});
return
false
;
}
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
"
./action.jsp
"
,
url
:
"
./action.jsp
"
,
...
@@ -115,7 +69,7 @@
...
@@ -115,7 +69,7 @@
if
(
msg
.
indexOf
(
"
success
"
)
>=
0
)
{
if
(
msg
.
indexOf
(
"
success
"
)
>=
0
)
{
layer
.
msg
(
'
操作成功!
'
,
{
icon
:
1
,
time
:
1000
},
layer
.
msg
(
'
操作成功!
'
,
{
icon
:
1
,
time
:
1000
},
function
()
{
function
()
{
//parent.searchModel
();
window
.
parent
.
location
.
reload
();
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
parent
.
layer
.
close
(
index
);
parent
.
layer
.
close
(
index
);
});
});
...
@@ -130,20 +84,22 @@
...
@@ -130,20 +84,22 @@
}
}
});
});
}
}
function
deleteUser
(
user_id
,
p_user_id
){
function
deleteForm
(){
layer
.
confirm
(
'
确认要删除吗?
'
,
function
(
index
)
{
if
(
$
(
"
#b_time
"
).
val
()
==
''
||
$
(
"
#e_time
"
).
val
()
==
''
){
layer
.
alert
(
"
时间不能为空
"
,{
icon
:
5
,
title
:
"
提示
"
});
return
false
;
}
layer
.
confirm
(
'
确认要重置吗?
'
,
function
(
index
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"
POST
"
,
type
:
"
POST
"
,
url
:
"
./action.jsp?
&p_user_id=
"
+
p_user_id
+
"
&user_id=
"
+
user_id
+
"
&action=delete
"
,
url
:
"
./action.jsp?
b_time=
"
+
$
(
"
#b_time
"
).
val
()
+
"
&e_time=
"
+
$
(
"
#e_time
"
).
val
()
+
"
&action=delete
"
,
success
:
function
(
msg
)
{
success
:
function
(
msg
)
{
if
(
msg
.
indexOf
(
"
success
"
)
>=
0
)
{
if
(
msg
.
indexOf
(
"
success
"
)
>=
0
)
{
layer
.
msg
(
'
操作成功!
'
,
{
icon
:
1
,
time
:
1000
},
layer
.
msg
(
'
操作成功!
'
,
{
icon
:
1
,
time
:
1000
},
function
()
{
function
()
{
location
.
reload
();
window
.
parent
.
location
.
reload
();
if
(
rel_user_id
!=
''
){
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
window
.
parent
.
location
.
reload
();
parent
.
layer
.
close
(
index
);
}
parent
.
searchModel
();
});
});
}
else
{
}
else
{
layer
.
msg
(
'
操作失败
'
,
{
layer
.
msg
(
'
操作失败
'
,
{
...
...
web/jsp/zbgl/pbgl/exportWeek.jsp
0 → 100644
View file @
c0267c6e
<%--
Created by IntelliJ IDEA.
User: mc
Date: 2021/7/7
Time: 15:12
To change this template use File | Settings | File Templates.
--%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@ page
import=
" java.io.BufferedInputStream"
%>
<%@ page
import=
" java.io.BufferedOutputStream"
%>
<%@ page
import=
" java.io.File"
%>
<%@ page
import=
" java.io.FileInputStream"
%>
<%@ page
import=
" java.io.FileOutputStream"
%>
<%@ page
import=
" java.io.IOException"
%>
<%@ page
import=
" java.io.InputStream"
%>
<%@ page
import=
" java.io.OutputStream"
%>
<%@ page
import=
" java.text.SimpleDateFormat"
%>
<%@ page
import=
" javax.servlet.http.HttpServletResponse"
%>
<%@ page
import=
"com.censoft.common.base.Pub"
%>
<%@ page
import=
"com.censoft.common.db.ConnectionFactory"
%>
<%@ page
import=
"java.sql.Connection"
%>
<%@ page
import=
"java.util.*"
%>
<%@ page
import=
"org.apache.poi.xssf.usermodel.*"
%>
<%@ page
import=
"org.apache.poi.ss.util.CellRangeAddress"
%>
<%!
private
void
download
(
String
path
,
HttpServletResponse
response
)
{
try
{
// path是指欲下载的文件的路径。
File
file
=
new
File
(
path
);
// 取得文件名。
String
filename
=
file
.
getName
();
// 以流的形式下载文件。
InputStream
fis
=
new
BufferedInputStream
(
new
FileInputStream
(
path
));
byte
[]
buffer
=
new
byte
[
fis
.
available
()];
fis
.
read
(
buffer
);
fis
.
close
();
// 清空response
response
.
reset
();
// 设置response的Header
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
new
String
(
filename
.
getBytes
()));
response
.
addHeader
(
"Content-Length"
,
""
+
file
.
length
());
OutputStream
toClient
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
toClient
.
write
(
buffer
);
toClient
.
flush
();
toClient
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
public
static
String
getTel
(
ConnectionFactory
cf
,
Connection
conn
,
String
user_name
)
{
String
tel
=
""
;
Vector
userList
=
cf
.
doQuery
(
conn
,
"select tel from zb_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
;
}
%>
<%
request
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
ConnectionFactory
cf
=
new
ConnectionFactory
();
Pub
pub
=
new
Pub
();
Connection
conn
=
null
;
String
year
=
pub
.
trimNull
(
request
.
getParameter
(
"exportDate"
));
System
.
out
.
println
(
year
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
fileName
=
sdf
.
format
(
new
Date
())
+
".xlsx"
;
// 文件路径
String
filePath
=
fileName
;
try
{
conn
=
com
.
censoft
.
db
.
DBUtil
.
getConnection
();
if
(!
""
.
equals
(
year
)){
year
=
year
.
substring
(
0
,
year
.
length
()-
1
);
}
String
[]
years
=
year
.
split
(
","
);
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
"select * from zb_user_gl where 1=1 "
);
sb
.
append
(
" and year in ( "
);
if
(
years
!=
null
&&
years
.
length
>
0
){
for
(
int
m
=
0
;
m
<
years
.
length
;
m
++){
if
(
m
==
years
.
length
-
1
){
sb
.
append
(
"'"
+
years
[
m
]
+
"'"
);
}
else
{
sb
.
append
(
"'"
+
years
[
m
]
+
"',"
);
}
}
}
sb
.
append
(
" )"
);
sb
.
append
(
" order by year asc,id asc"
);
Vector
v_list
=
cf
.
doQuery
(
conn
,
sb
.
toString
(),
null
,
new
Object
[]{});
if
(
v_list
==
null
)
{
System
.
out
.
println
(
"查询出错"
+
cf
.
getMsg
());
return
;
}
// 输出流
OutputStream
os
=
new
FileOutputStream
(
filePath
);
// 工作区
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
// 工作区名
XSSFSheet
sheet
=
wb
.
createSheet
(
year
+
"值班统计"
);
XSSFCellStyle
style
=
wb
.
createCellStyle
();
style
.
setAlignment
(
XSSFCellStyle
.
ALIGN_CENTER
);
style
.
setVerticalAlignment
(
XSSFCellStyle
.
VERTICAL_CENTER
);
//水平垂直
XSSFCellStyle
cs
=
wb
.
createCellStyle
();
cs
.
setWrapText
(
true
);
// 创建表头
String
values
=
"日期,班种,姓名及电话"
;
XSSFRow
row
=
sheet
.
createRow
(
0
);
String
[]
value
=
values
.
split
(
","
);
for
(
int
i
=
0
;
i
<
3
;
i
++){
XSSFCell
row_0
=
row
.
createCell
(
i
);
row_0
.
setCellValue
(
value
[
i
]);
row_0
.
setCellStyle
(
style
);
}
// 遍历数据装进table
for
(
int
i
=
0
;
i
<
v_list
.
size
();
i
++)
{
// sheet.createRow(i+1) 因为表头是0
Hashtable
ht
=
(
Hashtable
)
v_list
.
get
(
i
);
String
user_name
=(
String
)
ht
.
get
(
"zb_user"
);
String
[]
user_names
=
user_name
.
split
(
","
);
XSSFRow
rows
=
sheet
.
createRow
(
i
+
1
);
String
id
=
pub
.
trimNull
((
String
)
ht
.
get
(
"id"
));
rows
.
createCell
(
0
).
setCellValue
((
String
)
ht
.
get
(
"year"
));
rows
.
createCell
(
1
).
setCellValue
((
String
)
ht
.
get
(
"zb_type"
));
String
userTel
=
""
;
for
(
int
n
=
0
;
n
<
user_names
.
length
;
n
++)
{
String
telphone
=
getTel
(
cf
,
conn
,
user_names
[
n
]);
userTel
=
userTel
+
user_names
[
n
]+
":"
+
telphone
+
"\n"
;
}
rows
.
createCell
(
2
).
setCellValue
(
userTel
);
}
for
(
int
i
=
1
;
i
<=
v_list
.
size
();
i
=
i
+
3
){
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
i
,
i
+
2
,
0
,
0
));
//合并单元格
}
wb
.
write
(
os
);
// 关闭输出流
os
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
conn
!=
null
)
{
try
{
conn
.
close
();
}
catch
(
Exception
e
)
{
}
}
}
download
(
filePath
,
response
);
%>
\ No newline at end of file
web/jsp/zbgl/pbgl/export_query.jsp
0 → 100644
View file @
c0267c6e
<%--
Created by IntelliJ IDEA.
User: mc
Date: 2021/7/7
Time: 15:12
To change this template use File | Settings | File Templates.
--%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@ page
import=
" java.io.BufferedInputStream"
%>
<%@ page
import=
" java.io.BufferedOutputStream"
%>
<%@ page
import=
" java.io.File"
%>
<%@ page
import=
" java.io.FileInputStream"
%>
<%@ page
import=
" java.io.FileOutputStream"
%>
<%@ page
import=
" java.io.IOException"
%>
<%@ page
import=
" java.io.InputStream"
%>
<%@ page
import=
" java.io.OutputStream"
%>
<%@ page
import=
" java.text.SimpleDateFormat"
%>
<%@ page
import=
" javax.servlet.http.HttpServletResponse"
%>
<%@ page
import=
"com.censoft.common.base.Pub"
%>
<%@ page
import=
"com.censoft.common.db.ConnectionFactory"
%>
<%@ page
import=
"java.sql.Connection"
%>
<%@ page
import=
"java.util.*"
%>
<%@ page
import=
"org.apache.poi.xssf.usermodel.*"
%>
<%@ page
import=
"org.apache.poi.ss.util.CellRangeAddress"
%>
<%!
private
void
download
(
String
path
,
HttpServletResponse
response
)
{
try
{
// path是指欲下载的文件的路径。
File
file
=
new
File
(
path
);
// 取得文件名。
String
filename
=
file
.
getName
();
// 以流的形式下载文件。
InputStream
fis
=
new
BufferedInputStream
(
new
FileInputStream
(
path
));
byte
[]
buffer
=
new
byte
[
fis
.
available
()];
fis
.
read
(
buffer
);
fis
.
close
();
// 清空response
response
.
reset
();
// 设置response的Header
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
new
String
(
filename
.
getBytes
()));
response
.
addHeader
(
"Content-Length"
,
""
+
file
.
length
());
OutputStream
toClient
=
new
BufferedOutputStream
(
response
.
getOutputStream
());
response
.
setContentType
(
"application/vnd.ms-excel;charset=utf-8"
);
toClient
.
write
(
buffer
);
toClient
.
flush
();
toClient
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
public
static
String
getTel
(
ConnectionFactory
cf
,
Connection
conn
,
String
user_name
)
{
String
tel
=
""
;
Vector
userList
=
cf
.
doQuery
(
conn
,
"select tel from zb_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
;
}
%>
<%
request
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
ConnectionFactory
cf
=
new
ConnectionFactory
();
Pub
pub
=
new
Pub
();
Connection
conn
=
null
;
String
year
=
pub
.
trimNull
(
request
.
getParameter
(
"exportDate"
));
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
fileName
=
sdf
.
format
(
new
Date
())
+
".xlsx"
;
// 文件路径
String
filePath
=
fileName
;
try
{
conn
=
com
.
censoft
.
db
.
DBUtil
.
getConnection
();
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
"select * from zb_user_gl where year=? "
);
sb
.
append
(
" order by order_num asc"
);
Vector
v_list
=
cf
.
doQuery
(
conn
,
sb
.
toString
(),
null
,
new
Object
[]{
year
});
if
(
v_list
==
null
)
{
System
.
out
.
println
(
"查询出错"
+
cf
.
getMsg
());
return
;
}
// 输出流
OutputStream
os
=
new
FileOutputStream
(
filePath
);
// 工作区
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
// 工作区名
XSSFSheet
sheet
=
wb
.
createSheet
(
year
+
"值班统计"
);
XSSFCellStyle
style
=
wb
.
createCellStyle
();
style
.
setAlignment
(
XSSFCellStyle
.
ALIGN_CENTER
);
style
.
setVerticalAlignment
(
XSSFCellStyle
.
VERTICAL_CENTER
);
//水平垂直
XSSFCellStyle
cs
=
wb
.
createCellStyle
();
cs
.
setWrapText
(
true
);
// 创建表头
String
values
=
"日期,班种,姓名及电话"
;
XSSFRow
row
=
sheet
.
createRow
(
0
);
String
[]
value
=
values
.
split
(
","
);
for
(
int
i
=
0
;
i
<
3
;
i
++){
XSSFCell
row_0
=
row
.
createCell
(
i
);
row_0
.
setCellValue
(
value
[
i
]);
row_0
.
setCellStyle
(
style
);
}
// 遍历数据装进table
for
(
int
i
=
0
;
i
<
v_list
.
size
();
i
++)
{
// sheet.createRow(i+1) 因为表头是0
Hashtable
ht
=
(
Hashtable
)
v_list
.
get
(
i
);
String
user_name
=(
String
)
ht
.
get
(
"zb_user"
);
String
[]
user_names
=
user_name
.
split
(
","
);
XSSFRow
rows
=
sheet
.
createRow
(
i
+
1
);
String
id
=
pub
.
trimNull
((
String
)
ht
.
get
(
"id"
));
rows
.
createCell
(
0
).
setCellValue
((
String
)
ht
.
get
(
"year"
));
rows
.
createCell
(
1
).
setCellValue
((
String
)
ht
.
get
(
"zb_type"
));
String
userTel
=
""
;
for
(
int
n
=
0
;
n
<
user_names
.
length
;
n
++)
{
String
telphone
=
getTel
(
cf
,
conn
,
user_names
[
n
]);
userTel
=
user_names
[
n
]+
":"
+
telphone
+
"\n"
+
userTel
;
}
rows
.
createCell
(
2
).
setCellValue
(
userTel
);
}
for
(
int
i
=
1
;
i
<=
v_list
.
size
();
i
=
i
+
3
){
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
i
,
i
+
2
,
0
,
0
));
//合并单元格
}
wb
.
write
(
os
);
// 关闭输出流
os
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
conn
!=
null
)
{
try
{
conn
.
close
();
}
catch
(
Exception
e
)
{
}
}
}
download
(
filePath
,
response
);
%>
\ No newline at end of file
web/jsp/zbgl/pbgl/list-t.jsp
View file @
c0267c6e
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<a
class=
"btn btn-primary radius"
onclick=
"zdPb();"
>
<a
class=
"btn btn-primary radius"
onclick=
"zdPb();"
>
自动排班
自动排班
</a>
</a>
<a
class=
"btn btn-primary radius"
onclick=
"
operList
();"
>
<a
class=
"btn btn-primary radius"
onclick=
"
viewUserWeek
();"
>
周排班表
周排班表
</a>
</a>
<a
class=
"btn btn-primary radius"
onclick=
"operList();"
>
<a
class=
"btn btn-primary radius"
onclick=
"operList();"
>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
daysElement
[
i
].
classList
.
add
(
'
sc-othermenth
'
);
daysElement
[
i
].
classList
.
add
(
'
sc-othermenth
'
);
}
}
daysElement
[
i
].
querySelector
(
'
.day
'
).
innerHTML
=
writeday
;
daysElement
[
i
].
querySelector
(
'
.day
'
).
innerHTML
=
writeday
;
daysElement
[
i
].
querySelector
(
'
.zb_user
'
).
innerHTML
=
'
张三</br>李四
'
;
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>
'
;
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
)
{
if
(
true
)
{
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
daysElement
[
i
].
querySelector
(
'
.lunar-day
'
).
innerHTML
=
''
;
daysElement
[
i
].
querySelector
(
'
.lunar-day
'
).
innerHTML
=
''
;
daysElement
[
i
].
classList
.
add
(
'
item-nolunar
'
);
daysElement
[
i
].
classList
.
add
(
'
item-nolunar
'
);
}
}
//console.log(writeyear+"
==="+writemonth+"===
"+writeday);
//console.log(writeyear+"
"+writemonth+"
"+writeday);
//添加today样式
//添加today样式
if
(
nowYear
==
writeyear
&&
nowDay
==
writeday
&&
nowMonth
==
writemonth
)
{
if
(
nowYear
==
writeyear
&&
nowDay
==
writeday
&&
nowMonth
==
writemonth
)
{
this
.
selectDay
=
daysElement
[
i
];
this
.
selectDay
=
daysElement
[
i
];
...
@@ -83,6 +83,17 @@
...
@@ -83,6 +83,17 @@
$
(
"
#nowMonth
"
).
val
(
month
);
$
(
"
#nowMonth
"
).
val
(
month
);
$
(
"
#nowDays
"
).
val
(
totalDays
.
substring
(
0
,
totalDays
.
length
-
1
));
$
(
"
#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
)
{
function
arrayfrom
(
nidelist
)
{
let
array
=
[];
let
array
=
[];
[].
forEach
.
call
(
nidelist
,
function
(
v
)
{
[].
forEach
.
call
(
nidelist
,
function
(
v
)
{
...
@@ -90,7 +101,23 @@
...
@@ -90,7 +101,23 @@
});
});
return
array
;
return
array
;
}
}
function
editUser
(
year
,
month
,
day
)
{
function
viewUser
(
year
,
month
,
day
)
{
var
url
=
'
./viewUser-t.jsp?year=
'
+
year
+
'
&month=
'
+
month
+
'
&day=
'
+
day
;
viewDeptOrUserInfo
(
year
+
'
年
'
+
month
+
'
月
'
+
day
+
'
日值班表
'
,
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
()
{
function
zdPb
()
{
var
url
=
'
./edit-t.jsp
'
;
var
url
=
'
./edit-t.jsp
'
;
...
...
web/jsp/zbgl/pbgl/list_ajax.jsp
0 → 100644
View file @
c0267c6e
<%@ 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"
%>
<%!
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
;
}
%>
<%
ConnectionFactory
cf
=
new
ConnectionFactory
();
Pub
pub
=
new
Pub
();
Connection
conn
=
null
;
Vector
v_list
=
null
;
String
year
=
pub
.
trimNull
(
request
.
getParameter
(
"year"
));
String
month
=
pub
.
trimNull
(
request
.
getParameter
(
"month"
));
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
;
List
list_s
=
new
ArrayList
();
String
result
=
""
;
try
{
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
"select t1.zb_user from zb_user_gl t1 where 1=1 "
);
sb
.
append
(
" and t1.year=? "
);
list_s
.
add
(
year
+
month
+
day
);
conn
=
com
.
censoft
.
db
.
DBUtil
.
getConnection
();
sb
.
append
(
" order by t1.id asc"
);
v_list
=
cf
.
doQuery
(
conn
,
sb
.
toString
(),
null
,
list_s
.
toArray
());
if
(
v_list
==
null
)
{
out
.
println
(
"查询出错"
+
cf
.
getMsg
());
return
;
}
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
zb_user
=
pub
.
trimNull
((
String
)
ht
.
get
(
"zb_user"
));
result
=
result
+
zb_user
+
"
</
br
>
";
}
}
out.println(result);
} catch (Exception e) {
out.println("
查询异常"
+
e
);
return
;
}
finally
{
if
(
conn
!=
null
)
{
try
{
conn
.
close
();
}
catch
(
Exception
e
)
{
}
}
}
%>
\ No newline at end of file
web/jsp/zbgl/pbgl/viewUser-t.jsp
0 → 100644
View file @
c0267c6e
<%--
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"
%>
<%!
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
;
}
public
static
String
getTel
(
ConnectionFactory
cf
,
Connection
conn
,
String
user_name
)
{
String
tel
=
""
;
Vector
userList
=
cf
.
doQuery
(
conn
,
"select tel from zb_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
;
String
year
=
pub
.
trimNull
(
request
.
getParameter
(
"year"
));
String
month
=
pub
.
trimNull
(
request
.
getParameter
(
"month"
));
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
();
StringBuffer
sb
=
new
StringBuffer
();
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
,
year
+
month
+
day
);
v_list
=
cf
.
doQuery
(
conn
,
sb
.
toString
(),
null
,
new
Object
[]{
year
+
month
+
day
});
if
(
v_list
==
null
){
System
.
out
.
println
(
"查询该日期值班人员出错"
+
cf
.
getMsg
());
}
%>
<style>
.col-sm-2
{
width
:
14%
;
}
.col-sm-3
{
width
:
19%
;
}
.btn-green
{
background-color
:
green
;
border
:
green
}
</style>
<div
>
<a
class=
"btn btn-primary radius"
onclick=
"operList();"
>
导出
</a>
</div>
<div
class=
""
>
<form
class=
"form form-horizontal"
method=
"post"
id=
"form1"
name=
"form1"
action=
"export_query.jsp"
>
<input
type=
"hidden"
value=
"
<%=
year
+
month
+
day
%>
"
name=
"exportDate"
id=
"exportDate"
>
<div
id=
"content"
class=
"cl pd-5 bk-gray divOverflow"
style=
"overflow:hidden;margin-bottom: 20px;"
>
<%
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:900px;height:120px;float:left;margin-left: 50px;border:0.5px solid #000;"
>
<div
style=
"width:140px;height:120px;float:left;border-right:0.5px solid #000;text-align: center;line-height: 80px;"
>
<p
style=
"height:30px;"
>
<%=
zb_type
%></p>
<p
style=
"height:30px;"
>
(
<%=
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:140px;height:120px;line-height:120px;float:left;position: relative"
>
<p
style=
"height:70px;line-height: 80px;margin:0px;"
>
<img
src=
"../../images/user.png"
/>
</p>
<div
style=
"height:50px;margin:0px;"
>
<div
style=
"height:30px;line-height: 20px;"
>
<%=
user_names
[
n
]
%>
</div>
<div
style=
"height:20px;line-height: 10px;"
>
<%=
telphone
%>
</div>
</div>
</div>
<%
}
%>
</div>
<%
}
}
%>
</div>
</form>
</div>
<script>
function
operList
()
{
document
.
form1
.
submit
();
}
</script>
<%
}
catch
(
Exception
e
)
{
out
.
println
(
"查询用户信息异常"
+
e
);
return
;
}
finally
{
if
(
conn
!=
null
)
{
try
{
conn
.
close
();
}
catch
(
Exception
e
)
{
}
}
}
%>
\ No newline at end of file
web/jsp/zbgl/pbgl/viewUserWeek-t.jsp
0 → 100644
View file @
c0267c6e
This diff is collapsed.
Click to expand it.
web/jsp/zbgl/pbgl/zd_view_list.jsp
View file @
c0267c6e
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
return
;
return
;
}
}
%>
%>
<select
class=
"input-text"
name=
"
<%=
name_id
%>
"
id=
"
<%=
name_id
%>
_id
"
>
<select
class=
"input-text"
name=
"
<%=
name_id
%>
"
id=
"
<%=
name_id
%>
"
>
<option
value=
""
><%=
first_name
%></option>
<option
value=
""
><%=
first_name
%></option>
<%
<%
if
(
v_list
!=
null
&&
v_list
.
size
()
>
0
){
if
(
v_list
!=
null
&&
v_list
.
size
()
>
0
){
...
...
web/jsp/zbgl/pbmx/right_list.jsp
View file @
c0267c6e
...
@@ -28,10 +28,9 @@
...
@@ -28,10 +28,9 @@
if
(!
""
.
equals
(
Mxday
)){
if
(!
""
.
equals
(
Mxday
)){
divCount
=
Integer
.
parseInt
(
Mxday
);
divCount
=
Integer
.
parseInt
(
Mxday
);
}
}
String
divWidth
=(
divCount
+
2
)*
140
+
"px"
;
String
divWidth
=(
divCount
+
2
)*
140
-
80
+
"px"
;
StringBuffer
sql
=
new
StringBuffer
();
StringBuffer
sql
=
new
StringBuffer
();
StringBuffer
sql_day
=
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
.
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 "
);
sql_day
.
append
(
"select * from zb_mx_day where mx_id=? and zb_type=? order by day asc "
);
try
{
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment