Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
other-project
tjmdp
Commits
1243d2a0
Commit
1243d2a0
authored
Apr 27, 2019
by
liuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
489f6648
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
317 additions
and
20 deletions
+317
-20
pom.xml
pom.xml
+6
-0
RainbowPlanWebController.java
...nkun/controller/rainbowplan/RainbowPlanWebController.java
+200
-0
wishlist.jsp
src/main/webapp/WEB-INF/pages/rainbow/wishlist.jsp
+5
-0
saveuser.jsp
src/main/webapp/WEB-INF/pages/user/saveuser.jsp
+12
-12
wish.js
src/main/webapp/resources/js/rainbow/wish.js
+30
-0
user.js
src/main/webapp/resources/js/user/user.js
+64
-8
No files found.
pom.xml
View file @
1243d2a0
...
...
@@ -265,6 +265,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
3.15-beta2
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
src/main/java/com/qiankun/controller/rainbowplan/RainbowPlanWebController.java
View file @
1243d2a0
package
com
.
qiankun
.
controller
.
rainbowplan
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
java.util.ResourceBundle
;
...
...
@@ -9,6 +13,18 @@ import javax.servlet.http.HttpServletResponse;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFSheet
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.Font
;
import
org.apache.poi.ss.usermodel.PaperSize
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFCellStyle
;
import
org.apache.poi.xssf.usermodel.XSSFFont
;
import
org.apache.poi.xssf.usermodel.XSSFPrintSetup
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -183,4 +199,188 @@ public class RainbowPlanWebController extends BaseController<Object>{
return
view
;
}
@RequestMapping
(
"/rainbow/wish/export"
)
public
void
export
(
WishVo
wishVo
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
try
{
request
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/x-download"
);
String
fileName
=
"wish.xlsx"
;
fileName
=
URLEncoder
.
encode
(
fileName
,
"UTF-8"
);
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
XSSFWorkbook
wb
=
new
XSSFWorkbook
();
XSSFSheet
sheet
=
wb
.
createSheet
(
"心愿"
);
sheet
.
setMargin
(
HSSFSheet
.
TopMargin
,(
double
)
0.5
);
// 上边距
sheet
.
setMargin
(
HSSFSheet
.
BottomMargin
,(
double
)
0.5
);
// 下边距
sheet
.
setMargin
(
HSSFSheet
.
LeftMargin
,(
double
)
0.4
);
// 左边距
sheet
.
setMargin
(
HSSFSheet
.
RightMargin
,(
double
)
0.2
);
// 右边距
XSSFPrintSetup
print
=
sheet
.
getPrintSetup
();
print
.
setLandscape
(
true
);
print
.
setPaperSize
(
PaperSize
.
A4_PAPER
);
sheet
.
setDefaultRowHeight
((
short
)
(
2
*
256
));
//设置行高
sheet
.
setColumnWidth
(
0
,
2500
);
//设置列宽
sheet
.
setColumnWidth
(
1
,
2500
);
sheet
.
setColumnWidth
(
2
,
3500
);
sheet
.
setColumnWidth
(
3
,
1500
);
sheet
.
setColumnWidth
(
4
,
4000
);
sheet
.
setColumnWidth
(
5
,
4000
);
sheet
.
setColumnWidth
(
6
,
6000
);
sheet
.
setColumnWidth
(
7
,
3000
);
sheet
.
setColumnWidth
(
8
,
3000
);
sheet
.
setColumnWidth
(
9
,
6000
);
XSSFFont
font
=
wb
.
createFont
();
font
.
setFontName
(
"宋体"
);
font
.
setFontHeightInPoints
((
short
)
12
);
font
.
setBoldweight
(
Font
.
BOLDWEIGHT_BOLD
);
XSSFCellStyle
cellTopStyle
=
wb
.
createCellStyle
();
cellTopStyle
.
setFillPattern
(
CellStyle
.
SOLID_FOREGROUND
);
cellTopStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
//setBorderBottom(CellStyle.BORDER_THIN);
cellTopStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
//setBorderLeft(CellStyle.BORDER_THIN);
cellTopStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
//setBorderRight(CellStyle.BORDER_THIN);
cellTopStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
//setBorderTop(CellStyle.BORDER_THIN);
cellTopStyle
.
setVerticalAlignment
(
XSSFCellStyle
.
VERTICAL_CENTER
);
cellTopStyle
.
setFont
(
font
);
XSSFRow
row
=
sheet
.
createRow
(
0
);
row
.
setHeightInPoints
(
30
);
XSSFCell
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"编号 "
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"宝宝昵称 "
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"宝宝真实姓名"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
"性别"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
"年龄"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
5
);
cell
.
setCellValue
(
"楼层床号"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
6
);
cell
.
setCellValue
(
"心愿礼物"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
7
);
cell
.
setCellValue
(
"收件人姓名"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
8
);
cell
.
setCellValue
(
"联系方式"
);
cell
.
setCellStyle
(
cellTopStyle
);
cell
=
row
.
createCell
(
9
);
cell
.
setCellValue
(
"邮寄地址"
);
cell
.
setCellStyle
(
cellTopStyle
);
XSSFCellStyle
cellStyle
=
wb
.
createCellStyle
();
cellStyle
.
setWrapText
(
true
);
cellStyle
.
setFillPattern
(
CellStyle
.
SOLID_FOREGROUND
);
cellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
//setBorderBottom(CellStyle.BORDER_THIN);
cellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
//setBorderLeft(CellStyle.BORDER_THIN);
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
//setBorderRight(CellStyle.BORDER_THIN);
cellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
//setBorderTop(CellStyle.BORDER_THIN);
cellStyle
.
setVerticalAlignment
(
XSSFCellStyle
.
VERTICAL_CENTER
);
IPageList
<
Wish
>
wishPage
=
wishDao
.
findPages
(
wishVo
.
getSearchStr
(),
wishVo
.
getActivityId
(),
wishVo
.
getStatus
(),
wishVo
.
getOrder
(),
wishVo
.
getSort
(),
new
Hints
(
getStartRow
(
request
),
getPageCount
(
request
)));
List
<
Wish
>
wish
=
wishPage
.
getRecords
();
XSSFRow
rows
;
XSSFCell
cells
;
for
(
int
i
=
0
;
i
<
wish
.
size
();
i
++)
{
// 第三步:在这个sheet页里创建一行
rows
=
sheet
.
createRow
(
i
+
1
);
// 第四步:在该行创建一个单元格
Wish
data
=
wish
.
get
(
i
);
cells
=
rows
.
createCell
(
0
);
cells
.
setCellValue
(
data
.
getCode
());
cells
.
setCellStyle
(
cellStyle
);
// 第五步:在该单元格里设置值
cells
=
rows
.
createCell
(
1
);
cells
.
setCellValue
(
data
.
getChildren
().
getNickName
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
2
);
cells
.
setCellValue
(
data
.
getChildren
().
getName
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
3
);
String
gender
=
"男"
;
if
(
"2"
.
equals
(
data
.
getChildren
().
getGender
()))
gender
=
"女"
;
cells
.
setCellValue
(
gender
);
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
4
);
cells
.
setCellValue
(
data
.
getChildren
().
getBirthday
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
5
);
cells
.
setCellValue
(
data
.
getChildren
().
getBedNum
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
6
);
cells
.
setCellValue
(
data
.
getContent
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
7
);
cells
.
setCellValue
(
data
.
getChildren
().
getReceiveName
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
8
);
cells
.
setCellValue
(
data
.
getChildren
().
getConnectTel
());
cells
.
setCellStyle
(
cellStyle
);
cells
=
rows
.
createCell
(
9
);
cells
.
setCellValue
(
data
.
getChildren
().
getReceiveAddress
());
cells
.
setCellStyle
(
cellStyle
);
}
OutputStream
out
=
response
.
getOutputStream
();
wb
.
write
(
out
);
out
.
close
();
wb
.
close
();
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/webapp/WEB-INF/pages/rainbow/wishlist.jsp
View file @
1243d2a0
...
...
@@ -44,6 +44,11 @@
修改状态
</button>
<button class="btn btn-sm btn-success" onclick="wish.exportExcel()">
<i class="icon-share bigger-110"></i>
导出
</button>
</div>
<div class="pull-right">
...
...
src/main/webapp/WEB-INF/pages/user/saveuser.jsp
View file @
1243d2a0
...
...
@@ -69,7 +69,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
> 姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
> 姓名 </label>
<div class="col-sm-9">
<input type="text" id="name" name="name" value="${user.name}" class="col-xs-10 col-sm-10" />
...
...
@@ -99,7 +99,7 @@
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
font color="red">*</font
> 出生日期 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
!--font color="red">*</font--
> 出生日期 </label>
<div class="col-sm-9">
<input class="col-xs-10 col-sm-10" id="birthday" name="birthday" type="text" autocomplete="off" data-date-format="yyyy-mm-dd" value="${user.birthday}"/>
...
...
@@ -108,7 +108,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
font color="red">*</font
> 证件类型 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
!--font color="red">*</font--
> 证件类型 </label>
<div class="col-sm-9">
<select class="col-xs-10 col-sm-10" id="paperType" name="paperType">
...
...
@@ -125,7 +125,7 @@
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
font color="red">*</font
> 证件号码 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
!--font color="red">*</font--
> 证件号码 </label>
<div class="col-sm-9">
<input type="text" id="paperId" name="paperId" value="${user.paperId}" class="col-xs-10 col-sm-10" />
...
...
@@ -165,7 +165,7 @@
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
font color="red">*</font
> 籍贯 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> <
!--font color="red">*</font--
> 籍贯 </label>
<div class="col-sm-9">
<select class="col-xs-10 col-sm-10" id="nativePlace" name="nativePlace">
...
...
@@ -194,7 +194,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
> 经常居住地</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
> 经常居住地</label>
<div class="col-sm-9">
<input type="text" id="addr" name="addr" value="${user.addr}" class="col-xs-10 col-sm-10" />
...
...
@@ -262,7 +262,7 @@
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
> 本人手机 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
> 本人手机 </label>
<div class="col-sm-9">
<input type="text" id="mobile" name="mobile" value="${user.mobile}" class="col-xs-10 col-sm-10" />
...
...
@@ -292,7 +292,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
>QQ号码 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
>QQ号码 </label>
<div class="col-sm-9">
<input type="text" id="qq" name="qq" value="${user.qq}" class="col-xs-10 col-sm-10" />
...
...
@@ -378,7 +378,7 @@
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
>姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
>姓名 </label>
<div class="col-sm-9">
<input type="text" id="contactsName1" name="contactsName1" value="${user.contactsName1}" class="col-xs-10 col-sm-10" />
...
...
@@ -422,7 +422,7 @@
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
>手机</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
>手机</label>
<div class="col-sm-9">
<input type="text" id="contactsMobile1" name="contactsMobile1" value="${user.contactsMobile1}" class="col-xs-10 col-sm-10" />
...
...
@@ -449,7 +449,7 @@
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
>姓名 </label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
>姓名 </label>
<div class="col-sm-9">
<input type="text" id="contactsName2" name="contactsName2" value="${user.contactsName2}" class="col-xs-10 col-sm-10" />
...
...
@@ -492,7 +492,7 @@
<div class="col-xs-4">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
font color="red">*</font
>手机</label>
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <
!--font color="red">*</font--
>手机</label>
<div class="col-sm-9">
<input type="text" id="contactsMobile2" name="contactsMobile2" value="${user.contactsMobile2}" class="col-xs-10 col-sm-10" />
...
...
src/main/webapp/resources/js/rainbow/wish.js
View file @
1243d2a0
...
...
@@ -51,7 +51,37 @@ $(document).ready(function(){
var
wish
=
{
exportExcel
:
function
(){
var
activityId
=
$
(
"#activity"
).
val
();
var
searchStr
=
$
(
"#searchStr"
).
val
();
var
status
=
$
(
"#status"
).
val
();
var
url
=
webPath
+
"/rainbow/wish/export"
;
if
(
activityId
!=
""
||
searchStr
!=
""
||
status
!=
""
){
var
param
=
"?"
if
(
activityId
!=
""
){
param
=
param
+
"activityId="
+
activityId
;
}
if
(
status
!=
""
){
if
(
param
==
"?"
){
param
=
param
+
"status="
+
status
;
}
else
{
param
=
param
+
"&status="
+
status
;
}
}
if
(
searchStr
!=
""
){
if
(
param
==
"?"
){
param
=
param
+
"searchStr="
+
searchStr
;
}
else
{
param
=
param
+
"&searchStr="
+
searchStr
;
}
}
url
=
url
+
param
;
}
window
.
open
(
url
);
},
search
:
function
(){
var
activityId
=
$
(
"#activity"
).
val
();
var
searchStr
=
$
(
"#searchStr"
).
val
();
...
...
src/main/webapp/resources/js/user/user.js
View file @
1243d2a0
...
...
@@ -12,16 +12,37 @@ $(document).ready(function(){
required
:
true
},
"birthday"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"paperId"
:
{
required
:
true
},
"nativePlace"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"addr"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"mobile"
:
{
required
:
true
,
...
...
@@ -30,23 +51,58 @@ $(document).ready(function(){
minlength
:
11
},
"qq"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"contactsName1"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"contactsMobile1"
:
{
required
:
true
,
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
},
isMobile
:
true
,
maxlength
:
11
,
minlength
:
11
},
"contactsName2"
:
{
required
:
true
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
}
},
"contactsMobile2"
:
{
required
:
true
,
required
:
function
(){
var
role
=
$
(
"#role"
).
val
();
if
(
role
==
1
){
return
false
;
}
else
{
return
true
;
}
},
isMobile
:
true
,
maxlength
:
11
,
minlength
:
11
...
...
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