Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
54e38804
提交
54e38804
authored
2月 03, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[单据] 单据接口添加
上级
6187d9cd
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
929 行增加
和
11 行删除
+929
-11
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+25
-3
Confirm.java
...rc/main/java/com/tykj/dev/device/file/entity/Confirm.java
+25
-0
ConfirmDevice.java
...n/java/com/tykj/dev/device/file/entity/ConfirmDevice.java
+29
-0
Destruction.java
...ain/java/com/tykj/dev/device/file/entity/Destruction.java
+27
-0
JavaToPdfHtmlFreeMarker.java
...om/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
+239
-6
bill.html
dev-file/src/main/resources/bill.html
+2
-2
bill1.html
dev-file/src/main/resources/bill1.html
+381
-0
bill2.html
dev-file/src/main/resources/bill2.html
+201
-0
没有找到文件。
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
54e38804
...
...
@@ -6,9 +6,7 @@ import com.itextpdf.text.Image;
import
com.itextpdf.text.PageSize
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.entity.DocumentDevice
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.entity.*
;
import
com.tykj.dev.device.file.service.UseReportFIleService
;
import
com.tykj.dev.device.file.util.JavaToPdfHtmlFreeMarker
;
import
io.swagger.annotations.Api
;
...
...
@@ -62,6 +60,30 @@ public class FileController {
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
));
}
/**
* 生成单据 确认单据
* @return
*/
@ApiOperation
(
value
=
"生成单据 确认单据"
)
@PostMapping
(
"/printConfirm"
)
public
ResponseEntity
printConfirm
(
@RequestBody
Confirm
confirm
)
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderConfirm
(
confirm
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成确认单据对接口"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdfConfirm
(
content
,
url
,
preview
));
}
/**
* 生成单据 销毁单据
* @return
*/
@ApiOperation
(
value
=
"生成单据 销毁单据"
)
@PostMapping
(
"/printDestruction"
)
public
ResponseEntity
printDestruction
(
@RequestBody
Destruction
destruction
){
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderDestruction
(
destruction
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成销毁单据对接口"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdfDestruction
(
content
,
url
,
preview
));
}
/**
* 生成单据
* @return
...
...
dev-file/src/main/java/com/tykj/dev/device/file/entity/Confirm.java
0 → 100644
浏览文件 @
54e38804
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DocumentDevice.java
* @Description 确认单据对象
* @createTime 2021年01月25日 10:19:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
Confirm
{
private
String
title
;
private
List
<
ConfirmDevice
>
confirmDevices
;
}
dev-file/src/main/java/com/tykj/dev/device/file/entity/ConfirmDevice.java
0 → 100644
浏览文件 @
54e38804
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName ConfirmDevice.java
* @Description TODO
* @createTime 2021年02月03日 16:06:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
ConfirmDevice
{
private
String
model
;
private
String
parts
;
private
String
category
;
private
String
securityClassification
;
private
String
applicationField
;
}
dev-file/src/main/java/com/tykj/dev/device/file/entity/Destruction.java
0 → 100644
浏览文件 @
54e38804
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName Destruction.java
* @Description 销毁单据属性对象
* @createTime 2021年02月03日 15:36:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
Destruction
{
private
String
title
;
private
String
disposeUnitName
;
private
List
<
DestructionDevice
>
confirmDevices
;
}
dev-file/src/main/java/com/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
浏览文件 @
54e38804
...
...
@@ -6,9 +6,7 @@ import com.itextpdf.text.pdf.BaseFont;
import
com.itextpdf.text.pdf.PdfCopy
;
import
com.itextpdf.text.pdf.PdfImportedPage
;
import
com.itextpdf.text.pdf.PdfReader
;
import
com.tykj.dev.device.file.entity.DocumentDevice
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.entity.*
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -34,9 +32,18 @@ public class JavaToPdfHtmlFreeMarker {
public
String
preview
;
private
static
final
Map
<
Integer
,
String
>
MAP
=
new
HashMap
<
Integer
,
String
>()
{
{
put
(
1
,
"第一联发机单位"
);
put
(
2
,
"第二联发机单位"
);
put
(
3
,
"第三联发机单位"
);
put
(
1
,
"第一联发机单位存"
);
put
(
2
,
"第二联收机单位存"
);
put
(
3
,
"第三联退发机单位存"
);
}
};
private
static
final
Map
<
Integer
,
String
>
MAP1
=
new
HashMap
<
Integer
,
String
>()
{
{
put
(
1
,
"第一联上级1单位存"
);
put
(
2
,
"第二联上级2单位存"
);
put
(
3
,
"第三联本级单位存"
);
}
};
...
...
@@ -204,4 +211,230 @@ public class JavaToPdfHtmlFreeMarker {
return
data
;
}
private
static
Map
<
String
,
Object
>
toConfirmMap
(
Confirm
confirm
,
List
<
ConfirmDevice
>
list
){
Map
<
String
,
Object
>
data
=
new
HashMap
();
data
.
put
(
"title"
,
confirm
.
getTitle
());
data
.
put
(
"documentDevices"
,
list
);
return
data
;
}
private
static
Map
<
String
,
Object
>
toDestructionMap
(
Destruction
destruction
,
List
<
DestructionDevice
>
list
,
String
test
){
Map
<
String
,
Object
>
data
=
new
HashMap
();
data
.
put
(
"title"
,
destruction
.
getTitle
());
data
.
put
(
"ul"
,
test
);
data
.
put
(
"unitName"
,
destruction
.
getDisposeUnitName
());
data
.
put
(
"documentDevices"
,
list
);
return
data
;
}
/**
* freemarker渲染html 确认单据
*/
public
static
String
[]
freeMarkerRenderConfirm
(
Confirm
confirm
,
String
htmlPath
)
{
Writer
out
=
new
StringWriter
();
String
[]
strings
=
new
String
[
100000
];
int
index
=
0
;
try
{
// 获取模板,并设置编码方式
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill2.html"
);
template
.
setEncoding
(
"UTF-8"
);
List
<
ConfirmDevice
>
list
=
confirm
.
getConfirmDevices
();
boolean
falg
=
true
;
Integer
page
=
0
;
int
pageNum
=
page
+
1
;
int
pageSize
=
22
;
Integer
totalNum
=
list
.
size
();
//默认从零分页,这里要考虑这种情况,下面要计算。
Integer
totalPage
=
0
;
while
(
falg
){
if
(
totalNum
>
0
)
{
totalPage
=
totalNum
%
pageSize
==
0
?
totalNum
/
pageSize
:
totalNum
/
pageSize
+
1
;
}
if
(
pageNum
>=
totalPage
)
{
pageNum
=
totalPage
;
falg
=
false
;
}
int
startPoint
=
(
pageNum
-
1
)
*
pageSize
;
int
endPoint
=
startPoint
+
pageSize
;
if
(
totalNum
<=
endPoint
)
{
endPoint
=
totalNum
;
}
String
htmlname
=
htmlPath
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
template
.
process
(
toConfirmMap
(
confirm
,
list
.
subList
(
startPoint
,
endPoint
)),
fileWriter
);
out
.
flush
();
strings
[
index
]=
htmlname
;
index
++;
pageNum
++;
}
return
strings
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
out
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
return
null
;
}
/**
* 确认单据页面调用接口
*/
public
static
FileRet
createPdfConfirm
(
String
[]
htmlFiles
,
String
path
,
String
preview
){
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
String
pdfPath
=
path
+
"confirm/"
+
name
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
pdfPath
));
document
.
open
();
for
(
String
htmlFile
:
htmlFiles
)
{
if
(
htmlFile
!=
null
)
{
String
url
=
new
File
(
htmlFile
).
toURI
().
toURL
().
toString
();
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ITextRenderer
renderer
=
new
ITextRenderer
();
renderer
.
setDocument
(
htmlFile
);
// 解决中文不显示问题
ITextFontResolver
fontResolver
=
renderer
.
getFontResolver
();
fontResolver
.
addFont
(
path
+
"fond/"
+
"simhei.ttf"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
renderer
.
layout
();
renderer
.
createPDF
(
os
);
PdfReader
pdfReader
=
new
PdfReader
(
os
.
toByteArray
());
for
(
int
i
=
1
;
i
<=
pdfReader
.
getNumberOfPages
();
i
++)
{
PdfImportedPage
importedPage
=
pdfCopy
.
getImportedPage
(
pdfReader
,
i
);
pdfCopy
.
addPage
(
importedPage
);
}
os
.
close
();
}
}
Long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
print
(
"Itext parse Html to Confirm Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
pdfPath
,
preview
+
"documents/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
}
return
new
FileRet
();
}
/**
* freemarker渲染html 销毁
*/
public
static
String
[]
freeMarkerRenderDestruction
(
Destruction
destruction
,
String
htmlPath
)
{
Writer
out
=
new
StringWriter
();
String
[]
strings
=
new
String
[
100000
];
int
index
=
0
;
try
{
// 获取模板,并设置编码方式
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill1.html"
);
template
.
setEncoding
(
"UTF-8"
);
List
<
DestructionDevice
>
list
=
destruction
.
getConfirmDevices
();
for
(
int
i
=
1
;
i
<=
3
;
i
++){
boolean
falg
=
true
;
Integer
page
=
0
;
int
pageNum
=
page
+
1
;
int
pageSize
=
7
;
Integer
totalNum
=
list
.
size
();
//默认从零分页,这里要考虑这种情况,下面要计算。
Integer
totalPage
=
0
;
while
(
falg
){
if
(
totalNum
>
0
)
{
totalPage
=
totalNum
%
pageSize
==
0
?
totalNum
/
pageSize
:
totalNum
/
pageSize
+
1
;
}
if
(
pageNum
>=
totalPage
)
{
pageNum
=
totalPage
;
falg
=
false
;
}
int
startPoint
=
(
pageNum
-
1
)
*
pageSize
;
int
endPoint
=
startPoint
+
pageSize
;
if
(
totalNum
<=
endPoint
)
{
endPoint
=
totalNum
;
}
String
htmlname
=
htmlPath
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
template
.
process
(
toDestructionMap
(
destruction
,
list
.
subList
(
startPoint
,
endPoint
),
MAP1
.
get
(
i
)),
fileWriter
);
out
.
flush
();
strings
[
index
]=
htmlname
;
index
++;
pageNum
++;
}
}
return
strings
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
out
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
return
null
;
}
public
static
FileRet
createPdfDestruction
(
String
[]
htmlFiles
,
String
path
,
String
preview
){
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
String
pdfPath
=
path
+
"destruction/"
+
name
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
pdfPath
));
document
.
open
();
for
(
String
htmlFile
:
htmlFiles
)
{
if
(
htmlFile
!=
null
)
{
String
url
=
new
File
(
htmlFile
).
toURI
().
toURL
().
toString
();
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ITextRenderer
renderer
=
new
ITextRenderer
();
renderer
.
setDocument
(
htmlFile
);
// 解决中文不显示问题
ITextFontResolver
fontResolver
=
renderer
.
getFontResolver
();
fontResolver
.
addFont
(
path
+
"fond/"
+
"simhei.ttf"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
renderer
.
layout
();
renderer
.
createPDF
(
os
);
PdfReader
pdfReader
=
new
PdfReader
(
os
.
toByteArray
());
for
(
int
i
=
1
;
i
<=
pdfReader
.
getNumberOfPages
();
i
++)
{
PdfImportedPage
importedPage
=
pdfCopy
.
getImportedPage
(
pdfReader
,
i
);
pdfCopy
.
addPage
(
importedPage
);
}
os
.
close
();
}
}
Long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
print
(
"Itext parse Html to Destruction Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
pdfPath
,
preview
+
"documents/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
}
return
new
FileRet
();
}
}
dev-file/src/main/resources/bill.html
浏览文件 @
54e38804
...
...
@@ -320,11 +320,11 @@
<div
class=
"line2 tableList"
>
<table
class=
"altrowstable"
id=
"alternatecolor"
>
<tr>
<th>
型号
</th><th>
部件
</th><th>
类型
</th><th>
密级
</th><th>
应用领域
</th><th>
数量
</th><th>
装备序列号
</th><th>
生产序列号
</th><th>
备注
</th>
<th>
型号
</th><th>
形态
</th><th>
密级
</th><th>
应用领域
</th><th>
数量
</th><th>
装备序列号
</th><th>
生产序列号
</th><th>
备注
</th>
</tr>
<
#
list
documentDevices
as
dev
>
<tr>
<td>
${dev.model}
</td><td>
${dev.parts}
</td><td>
${dev.
category}
</td><td>
${dev.
securityClassification}
</td><td>
${dev.applicationField}
</td><td>
${dev.count}
</td><td>
${dev.deviceSerialNumber}
</td><td>
${dev.productionSerialNumber}
</td><td>
${dev.remark}
</td>
<td>
${dev.model}
</td><td>
${dev.parts}
</td><td>
${dev.securityClassification}
</td><td>
${dev.applicationField}
</td><td>
${dev.count}
</td><td>
${dev.deviceSerialNumber}
</td><td>
${dev.productionSerialNumber}
</td><td>
${dev.remark}
</td>
</tr>
</
#
list>
</table>
...
...
dev-file/src/main/resources/bill1.html
0 → 100755
浏览文件 @
54e38804
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<title>
Document
</title>
<style>
body
{
font-family
:
SimHei
;
}
/*
@page
{
size
:
297mm
210mm
;}
<!
--
设置
PDF
页面大小,此配置只对生成
PDF
文件有效,不会对页面显示生效
--
>*/
@page
{
size
:
297mm
210mm
;
/*margin: 0.25in;*/
/*-fs-flow-bottom: "footer";*/
/*-fs-flow-left: "left";*/
/*-fs-flow-right: "right";*/
/*border: thin solid black;*/
/*padding: 1em;*/
}
#footer
{
font-size
:
90%
;
font-style
:
italic
;
position
:
absolute
;
top
:
0
;
left
:
0
;
-fs-move-to-flow
:
"footer"
;
}
#pagenumber
:before
{
content
:
counter
(
page
);
}
#pagecount
:before
{
content
:
counter
(
pages
);
}
.returnTablePrint
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
color
:
#000
;
cursor
:
default
;
}
.returnTablePrint
.content
{
width
:
100%
;
height
:
100%
;
/* background: url("../../../assets/img/detailsBg.png") no-repeat; */
/*background-size: 100% 100%;*/
/*padding: 30px;*/
/*box-sizing: border-box;*/
}
.returnTablePrint
.content
>
div
{
width
:
100%
;
height
:
100%
;
background
:
#fff
;
/* padding: 30px; */
box-sizing
:
border-box
;
}
.returnTablePrint
.content
>
p
{
width
:
100%
;
text-align
:
center
;
font-size
:
22px
;
font-weight
:
bold
;
color
:
#4a475d
;
}
.returnTablePrint
.listWrapper
{
/* width: 92%; */
margin
:
0
auto
;
/* padding: 0px 20px 20px 20px; */
height
:
calc
(
100%
-
70px
);
/*padding: 10px 30px;*/
box-sizing
:
border-box
;
}
.returnTablePrint
.list
{
/* width: 92%; */
margin
:
0
auto
;
/* padding: 0px 20px 20px 20px; */
/* height: calc(100% - 75px); */
height
:
calc
(
100%
-
12px
)
}
.returnTablePrint
.title
{
width
:
100%
;
font-size
:
20px
;
text-align
:
center
;
position
:
relative
;
margin
:
0
0
15px
;
padding
:
0
20px
;
box-sizing
:
border-box
;
}
.returnTablePrint
.title
span
:nth-child
(
2
)
{
font-size
:
28px
;
color
:
#000000
;
}
.returnTablePrint
.title
span
:nth-child
(
2
)
span
{
font-size
:
20px
;
color
:
#141414
;
}
.returnTablePrint
.title
.number
{
font-size
:
20px
;
color
:
#646464
;
}
.returnTablePrint
.other
{
width
:
100%
;
color
:
#141414
;
font-size
:
20px
;
margin-top
:
20px
;
padding-left
:
50px
;
position
:
relative
;
box-sizing
:
border-box
;
margin-bottom
:
20px
;
}
.returnTablePrint
.other
>
span
span
:nth-child
(
2
)
{
display
:
inline-block
;
margin
:
0
40px
0
10px
;
}
.returnTablePrint
.listCon
{
height
:
calc
(
100%
-
90px
);
border
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.line1
{
width
:
100%
;
font-size
:
20px
;
box-sizing
:
border-box
;
border-bottom
:
1px
solid
#7f7f7f
;
color
:
#000
;
line-height
:
60px
;
}
.returnTablePrint
.line1
.sendTo
{
display
:
inline-block
;
width
:
33%
;
text-indent
:
20px
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
}
.returnTablePrint
.line1
.sendNum
{
display
:
inline-block
;
width
:
33%
;
box-sizing
:
border-box
;
text-indent
:
20px
;
border-left
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.line1
.sendTo
span
:nth-child
(
2
),
.returnTablePrint
.line1
.sendNum
span
:nth-child
(
2
)
{
color
:
#4a475d
;
display
:
inline-block
;
margin-left
:
20px
;
}
.returnTablePrint
.line2
{
height
:
100%
;
/* padding: 20px; */
border-bottom
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.tableList
{
height
:
300px
;
}
.returnTablePrint
.line2
>>>
.el-table
tbody
tr
:nth-child
(
odd
)
{
background-color
:
#fff
;
}
.returnTablePrint
.line2
>>>
.el-table
tbody
tr
:nth-child
(
even
)
{
background-color
:
#fff
;
}
.returnTablePrint
.line3
{
width
:
100%
;
/* box-sizing: border-box; */
/*height:150px;*/
/*display: flex;*/
/* height:170px; */
/* padding:20px 0 20px 0; */
}
.returnTablePrint
.line3
.left
{
display
:
inline-block
;
width
:
calc
(
25%
-
3px
);
box-sizing
:
border-box
;
/*padding-left: 20px;*/
position
:
relative
;
}
.returnTablePrint
.line3
.left
{
border-right
:
1px
solid
#7f7f7f
;
/*padding-bottom: 40px;*/
}
.returnTablePrint
.line3
.left
:last-child
{
border-right
:
none
;
/*padding-bottom: 40px;*/
}
.returnTablePrint
.line3
.left
>
span
{
text-indent
:
10px
;
}
.returnTablePrint
.line3
.left
>
span
{
display
:
block
;
margin
:
15px
0px
;
}
.returnTablePrint
.line3
.left
>
span
>
span
:nth-child
(
2
)
{
display
:
inline-block
;
margin-left
:
20px
;
}
.returnTablePrint
.line3
i
{
display
:
block
;
text-align
:
right
;
position
:
absolute
;
right
:
5px
;
bottom
:
5px
;
font-style
:
normal
;
}
.returnTablePrint
.line3
i
>
span
>
span
{
display
:
block
;
}
.returnTablePrint
>>>
.el-scrollbar__wrap
{
overflow-x
:
hidden
;
margin-bottom
:
0
;
}
.returnTablePrint
.checkName
span
:nth-child
(
2
)
{
color
:
#4a475d
;
display
:
inline-block
;
margin-left
:
20px
;
}
.returnTablePrint
>>>
.el-table
tbody
.cell
{
color
:
#141414
;
}
.returnTablePrint
.label
{
color
:
#646464
;
font-size
:
20px
;
;
}
.returnTablePrint
.value
{
color
:
#000
;
font-size
:
20px
;
;
}
.returnTablePrint
.main-title
{
font-size
:
28px
;
color
:
#000000
;
margin-bottom
:
20px
;
text-align
:
center
;
}
.returnTablePrint
.footer
{
display
:
flex
;
justify-content
:
flex-end
;
padding
:
0
40px
;
box-sizing
:
border-box
;
}
.button-submit
{
margin-left
:
50px
;
}
table
.altrowstable
{
width
:
100%
;
font-size
:
20px
;
color
:
#141414
;
border-width
:
0px
;
border-color
:
#a9c6c9
;
border-collapse
:
collapse
;
text-align
:
center
;
/*table-layout: fixed;*/
/*word-break:break-all;*/
}
table
.altrowstable
th
{
border-width
:
0px
;
padding
:
8px
;
border-style
:
solid
;
border-color
:
#a9c6c9
;
}
table
.altrowstable
td
{
border-width
:
0px
;
padding
:
8px
;
border-style
:
solid
;
border-color
:
#a9c6c9
;
/*word-break:break-all;*/
/*word-wrap : break-word;*/
}
.oddrowcolor
{
background-color
:
#fff
;
}
.evenrowcolor
{
background-color
:
#fafafa
;
}
tr
:nth-child
(
odd
)
{
background
:
#fafafa
;
}
</style>
</head>
<body>
<!--<div id="footer" style=""> Page <span id="pagenumber"/> of <span id="pagecount"/> </div>-->
<div
class=
"returnTablePrint"
>
<div
class=
"content"
>
<div>
<div
class=
"listWrapper"
>
<div
class=
"list"
>
<p
class=
"title"
>
<div
class=
"main-title"
>
<span>
${title}
</span>
</div>
<div
style=
"width:100%;text-align:left"
>
<div
style=
"text-align:left;display: inline-block; width: 33%"
class=
"number"
>
<span
class=
"number"
>
${number}
</span>
</div>
<div
style=
"text-align:center;display: inline-block; width: 29%"
class=
"number"
>
<span
>
${ul}
</span>
</div>
<div
style=
"text-align:right;display: inline-block; width: 33%"
class=
"number"
>
<span>
机密
</span>
</div>
</div>
</p>
<div
class=
"listCon"
>
<div
class=
"line1"
>
<span
class=
"sendTo"
>
<span>
销毁单位:
</span>
<span>
${receiveUnit}
</span>
</span>
<span
class=
"sendNum"
>
<span>
型号:
</span>
<span>
${replyNum}
</span>
</span>
<span
class=
"sendNum"
>
<span>
名称:
</span>
<span>
${replyNum}
</span>
</span>
</div>
<div
class=
"line2 tableList"
>
<table
class=
"altrowstable"
id=
"alternatecolor"
>
<tr>
<th>
型号
</th><th>
形态
</th>
>
<th>
密级
</th><th>
应用领域
</th><th>
数量
</th><th>
装备序列号
</th><th>
生产序列号
</th><th>
备注
</th>
</tr>
<
#
list
documentDevices
as
dev
>
<tr>
<td>
${dev.model}
</td><td>
${dev.parts}
</td><td>
${dev.securityClassification}
</td><td>
${dev.applicationField}
</td><td>
${dev.count}
</td><td>
${dev.deviceSerialNumber}
</td><td>
${dev.productionSerialNumber}
</td><td>
${dev.remark}
</td>
</tr>
</
#
list>
</table>
</div>
<div
class=
"line3"
>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
监销人:
</span>
<span
class=
"value"
>
${senderUnit}
</span>
</span>
</span>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
主管领导:
</span>
<span
class=
"value"
>
${senderUnit}
</span>
</span>
</span>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
>
${senderUnit}
</span>
</span>
</span>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
承办人:
</span>
<span
class=
"value"
>
${senderUnit}
</span>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
>
function
altRows
(
id
){
if
(
document
.
getElementsByTagName
){
var
table
=
document
.
getElementById
(
id
);
var
rows
=
table
.
getElementsByTagName
(
"tr"
);
for
(
i
=
0
;
i
<
rows
.
length
;
i
++
){
if
(
i
%
2
==
0
){
rows
[
i
].
className
=
"evenrowcolor"
;
}
else
{
rows
[
i
].
className
=
"oddrowcolor"
;
}
}
}
}
window
.
onload
=
function
(){
altRows
(
'alternatecolor'
);
}
</script>
</body>
</html>
\ No newline at end of file
dev-file/src/main/resources/bill2.html
0 → 100755
浏览文件 @
54e38804
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<title>
Document
</title>
<style>
body
{
font-family
:
SimHei
;
}
/*
@page
{
size
:
297mm
210mm
;}
<!
--
设置
PDF
页面大小,此配置只对生成
PDF
文件有效,不会对页面显示生效
--
>*/
@page
{
size
:
210mm
297mm
;
/*margin: 0.25in;*/
/*-fs-flow-bottom: "footer";*/
/*-fs-flow-left: "left";*/
/*-fs-flow-right: "right";*/
/*border: thin solid black;*/
/*padding: 1em;*/
}
#footer
{
font-size
:
90%
;
font-style
:
italic
;
position
:
absolute
;
top
:
0
;
left
:
0
;
-fs-move-to-flow
:
"footer"
;
}
#pagenumber
:before
{
content
:
counter
(
page
);
}
#pagecount
:before
{
content
:
counter
(
pages
);
}
.returnTablePrint
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
color
:
#000
;
cursor
:
default
;
}
.returnTablePrint
.content
{
width
:
100%
;
height
:
100%
;
/* background: url("../../../assets/img/detailsBg.png") no-repeat; */
/*background-size: 100% 100%;*/
/*padding: 30px;*/
/*box-sizing: border-box;*/
}
.returnTablePrint
.content
>
div
{
width
:
100%
;
height
:
100%
;
background
:
#fff
;
/* padding: 30px; */
box-sizing
:
border-box
;
}
.returnTablePrint
.content
>
p
{
width
:
100%
;
text-align
:
center
;
font-size
:
22px
;
font-weight
:
bold
;
color
:
#4a475d
;
}
.returnTablePrint
.listWrapper
{
/* width: 92%; */
margin
:
0
auto
;
/* padding: 0px 20px 20px 20px; */
height
:
calc
(
100%
-
70px
);
/*padding: 10px 30px;*/
box-sizing
:
border-box
;
}
.returnTablePrint
.list
{
/* width: 92%; */
margin
:
0
auto
;
/* padding: 0px 20px 20px 20px; */
/* height: calc(100% - 75px); */
height
:
calc
(
100%
-
12px
)
}
.returnTablePrint
.title
{
width
:
100%
;
font-size
:
20px
;
text-align
:
center
;
position
:
relative
;
margin
:
0
0
15px
;
padding
:
0
20px
;
box-sizing
:
border-box
;
}
.returnTablePrint
.title
span
:nth-child
(
2
)
{
font-size
:
28px
;
color
:
#000000
;
}
.returnTablePrint
.title
span
:nth-child
(
2
)
span
{
font-size
:
20px
;
color
:
#141414
;
}
.returnTablePrint
.main-title
{
font-size
:
28px
;
color
:
#000000
;
margin-bottom
:
20px
;
text-align
:
center
;
}
table
.altrowstable
{
width
:
100%
;
font-size
:
20px
;
color
:
#141414
;
border-width
:
0px
;
border-color
:
#a9c6c9
;
border-collapse
:
collapse
;
text-align
:
center
;
/*table-layout: fixed;*/
/*word-break:break-all;*/
}
table
.altrowstable
th
{
border-width
:
0px
;
padding
:
8px
;
border-style
:
solid
;
border-color
:
#a9c6c9
;
}
table
.altrowstable
td
{
border-width
:
0px
;
padding
:
8px
;
border-style
:
solid
;
border-color
:
#a9c6c9
;
/*word-break:break-all;*/
/*word-wrap : break-word;*/
}
.oddrowcolor
{
background-color
:
#fff
;
}
.evenrowcolor
{
background-color
:
#fafafa
;
}
.person
{
color
:
#4a475b
;
text-align
:
right
;
font-size
:
18pt
;
}
.person
>
span
{
display
:
inline-block
;
margin-right
:
30pt
;
}
tr
:nth-child
(
odd
)
{
background
:
#fafafa
;
}
</style>
</head>
<body>
<!--<div id="footer" style=""> Page <span id="pagenumber"/> of <span id="pagecount"/> </div>-->
<div
class=
"returnTablePrint"
>
<div
class=
"content"
>
<div>
<div
class=
"listWrapper"
>
<div
class=
"list"
>
<p
class=
"title"
>
<div
class=
"main-title"
>
<span>
${title}
</span>
</div>
</p>
<table
class=
"altrowstable"
id=
"alternatecolor"
>
<tr>
<th>
序号
</th><th>
型号
</th><th>
形态
</th><th>
密级
</th><th>
应用领域
</th><th>
装备序列号
</th>
</tr>
<
#
list
documentDevices
as
dev
>
<tr>
<td>
${dev.model}
</td><td>
${dev.model}
</td><td>
${dev.parts}
</td><td>
${dev.category}
</td><td>
${dev.securityClassification}
</td><td>
${dev.applicationField}
</td>
</tr>
</
#
list>
</table>
</div>
<p
class=
"person"
style=
"margin-top: 50px"
>
<span
style=
"width: 200px;text-align: left"
>
经办人:
</span>
<span
style=
"width: 200px;text-align: left"
>
审核人:
</span>
</p>
</div>
</div>
</div>
</div>
<!--<script type="text/javascript">-->
<!--function altRows(id){-->
<!--if(document.getElementsByTagName){-->
<!--var table = document.getElementById(id);-->
<!--var rows = table.getElementsByTagName("tr");-->
<!--for(i = 0; i < rows.length; i++){-->
<!--if(i % 2 == 0){-->
<!--rows[i].className = "evenrowcolor";-->
<!--}else{-->
<!--rows[i].className = "oddrowcolor";-->
<!--}-->
<!--}-->
<!--}-->
<!--}-->
<!--window.onload=function(){-->
<!--altRows('alternatecolor');-->
<!--}-->
<!--</script>-->
</body>
</html>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论