Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
31a0671c
提交
31a0671c
authored
1月 26, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[清退] 代码提交
上级
a9ed218d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
1157 行增加
和
0 行删除
+1157
-0
pom.xml
dev-file/pom.xml
+29
-0
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+17
-0
DocumentDevice.java
.../java/com/tykj/dev/device/file/entity/DocumentDevice.java
+48
-0
Documents.java
.../main/java/com/tykj/dev/device/file/entity/Documents.java
+36
-0
JavaToPdfHtmlFreeMarker.java
...om/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
+204
-0
application.properties
dev-file/src/main/resources/application.properties
+9
-0
bill.html
dev-file/src/main/resources/bill.html
+406
-0
template_freemarker.html
dev-file/src/main/resources/template_freemarker.html
+28
-0
test.html
dev-file/src/main/resources/test.html
+380
-0
没有可用的文件名
+0
-0
没有找到文件。
dev-file/pom.xml
浏览文件 @
31a0671c
...
@@ -36,6 +36,35 @@
...
@@ -36,6 +36,35 @@
<artifactId>
config
</artifactId>
<artifactId>
config
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.pdfbox
</groupId>
<artifactId>
pdfbox
</artifactId>
<version>
2.0.21
</version>
</dependency>
<dependency>
<groupId>
com.itextpdf
</groupId>
<artifactId>
itext-asian
</artifactId>
<version>
5.2.0
</version>
</dependency>
<dependency>
<groupId>
org.freemarker
</groupId>
<artifactId>
freemarker
</artifactId>
<version>
2.3.19
</version>
</dependency>
<dependency>
<groupId>
org.xhtmlrenderer
</groupId>
<artifactId>
flying-saucer-pdf-itext5
</artifactId>
<version>
9.1.6
</version>
</dependency>
<dependency>
<groupId>
com.itextpdf.tool
</groupId>
<artifactId>
xmlworker
</artifactId>
<version>
5.5.8
</version>
</dependency>
</dependencies>
</dependencies>
...
...
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
31a0671c
...
@@ -6,8 +6,10 @@ import com.itextpdf.text.Image;
...
@@ -6,8 +6,10 @@ import com.itextpdf.text.Image;
import
com.itextpdf.text.PageSize
;
import
com.itextpdf.text.PageSize
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.entity.Documents
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.UseReportFIleService
;
import
com.tykj.dev.device.file.service.UseReportFIleService
;
import
com.tykj.dev.device.file.util.JavaToPdfHtmlFreeMarker
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -50,6 +52,19 @@ public class FileController {
...
@@ -50,6 +52,19 @@ public class FileController {
@Autowired
@Autowired
UseReportFIleService
useReportFIleService
;
UseReportFIleService
useReportFIleService
;
/**
* 生成单据
* @return
*/
@ApiOperation
(
value
=
"生成单据"
)
@PostMapping
(
"/printDocuments"
)
public
ResponseEntity
printDocuments
(
@RequestBody
Documents
documents
)
throws
IOException
,
DocumentException
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
));
}
/**
/**
* 文件上传
* 文件上传
*/
*/
...
@@ -270,4 +285,6 @@ public class FileController {
...
@@ -270,4 +285,6 @@ public class FileController {
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
}
}
}
}
dev-file/src/main/java/com/tykj/dev/device/file/entity/DocumentDevice.java
0 → 100644
浏览文件 @
31a0671c
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zjm
* @version 1.0.0
* @ClassName DocumentDevice.java
* @Description 单据涉及装备实体
* @createTime 2021年01月25日 10:19:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel
(
value
=
"单据涉及装备实体"
,
description
=
"单据涉及装备实体"
)
public
class
DocumentDevice
{
@ApiModelProperty
(
name
=
"型号"
)
private
String
model
;
@ApiModelProperty
(
name
=
"部件"
)
private
String
parts
;
@ApiModelProperty
(
name
=
"类型"
)
private
String
category
;
@ApiModelProperty
(
name
=
"密级"
)
private
String
securityClassification
;
@ApiModelProperty
(
name
=
"应用领域"
)
private
String
applicationField
;
@ApiModelProperty
(
name
=
"数量"
)
private
Integer
count
;
@ApiModelProperty
(
name
=
"装备序列号"
)
private
String
deviceSerialNumber
;
@ApiModelProperty
(
name
=
"生产序列号"
)
private
String
productionSerialNumber
;
@ApiModelProperty
(
name
=
"备注"
)
private
String
remark
;
}
dev-file/src/main/java/com/tykj/dev/device/file/entity/Documents.java
0 → 100644
浏览文件 @
31a0671c
package
com
.
tykj
.
dev
.
device
.
file
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName Documents.java
* @Description 出库入库单据样式
* @createTime 2021年01月25日 10:16:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel
(
value
=
"出库入库单据样式"
,
description
=
"出库入库单据属性实体"
)
public
class
Documents
{
@ApiModelProperty
(
name
=
"单据号"
)
private
String
number
;
@ApiModelProperty
(
name
=
"单据标题"
)
private
String
title
;
@ApiModelProperty
(
name
=
"接收单位"
)
private
String
receiveUnit
;
@ApiModelProperty
(
name
=
"批复文号"
)
private
String
replyNum
;
@ApiModelProperty
(
name
=
"相关装备"
)
private
List
<
DocumentDevice
>
documentDevices
;
@ApiModelProperty
(
name
=
"发件单位"
)
private
String
senderUnit
;
}
dev-file/src/main/java/com/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
0 → 100644
浏览文件 @
31a0671c
package
com
.
tykj
.
dev
.
device
.
file
.
util
;
import
com.itextpdf.text.Document
;
import
com.itextpdf.text.DocumentException
;
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
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.xhtmlrenderer.pdf.ITextFontResolver
;
import
org.xhtmlrenderer.pdf.ITextRenderer
;
import
java.io.*
;
import
java.util.*
;
/**
* @author zjm
* @version 1.0.0
* @ClassName html.java
* @Description TODO
* @createTime 2021年01月23日 15:04:00
*/
public
class
JavaToPdfHtmlFreeMarker
{
@Value
(
"${file.path}"
)
public
String
url
;
@Value
(
"${preview.path}"
)
public
String
preview
;
private
static
final
Map
<
Integer
,
String
>
MAP
=
new
HashMap
<
Integer
,
String
>()
{
{
put
(
1
,
"第一联发机单位"
);
put
(
2
,
"第二联发机单位"
);
put
(
3
,
"第三联发机单位"
);
}
};
private
static
final
String
DEST
=
"/Users/zjm/code/Template/HelloWorld_CN_HTML_FREEMARKER.pdf"
;
private
static
final
String
HTML
=
"bill.html"
;
//template_freemarker
private
static
final
String
FONT
=
"/Users/zjm/code/Template/simhei.ttf"
;
private
static
Configuration
freemarkerCfg
=
null
;
static
{
freemarkerCfg
=
new
Configuration
();
//freemarker的模板目录
try
{
freemarkerCfg
.
setDirectoryForTemplateLoading
(
new
File
(
"/Users/zjm/Downloads/equip/dev-file/src/main/resources/"
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
throws
IOException
,
DocumentException
{
// List<user> userList=new ArrayList<>();
// userList.add(new user("占金名",19,1));
// userList.add(new user("占金名1",19,1));
// userList.add(new user("占金名2",19,1));
Documents
documents
=
new
Documents
();
documents
.
setNumber
(
"NO:第221321134号"
);
documents
.
setReceiveUnit
(
"杭州机要"
);
documents
.
setReplyNum
(
"123123123131"
);
documents
.
setSenderUnit
(
"浙江省"
);
documents
.
setTitle
(
"密码装备清退单"
);
List
<
DocumentDevice
>
documentDevices
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
20
;
i
++){
DocumentDevice
documentDevice
=
new
DocumentDevice
();
documentDevice
.
setCount
(
i
);
documentDevice
.
setModel
(
"MM001"
);
documentDevice
.
setRemark
(
"备注"
);
documentDevice
.
setApplicationField
(
"省一级"
);
documentDevice
.
setDeviceSerialNumber
(
"asdq1231232"
);
documentDevice
.
setProductionSerialNumber
(
"12312312312"
);
documentDevice
.
setParts
(
"密码机"
);
documentDevice
.
setCategory
(
"装备"
);
documentDevice
.
setSecurityClassification
(
"机密"
);
documentDevices
.
add
(
documentDevice
);
}
documents
.
setDocumentDevices
(
documentDevices
);
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
);
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
"/Users/zjm/code/test-tu/"
,
"12313"
);
}
public
static
FileRet
createPdf
(
String
[]
htmlFiles
,
String
path
,
String
preview
)
throws
IOException
,
DocumentException
{
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
path
+
name
));
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
(
url
);
// 解决中文不显示问题
ITextFontResolver
fontResolver
=
renderer
.
getFontResolver
();
fontResolver
.
addFont
(
FONT
,
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 Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
path
+
"print/"
+
name
,
preview
+
"print/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
}
return
new
FileRet
();
}
/**
* freemarker渲染html
*/
public
static
String
[]
freeMarkerRender
(
Documents
documents
)
{
Writer
out
=
new
StringWriter
();
String
[]
strings
=
new
String
[
100000
];
Integer
index
=
0
;
try
{
// 获取模板,并设置编码方式
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill.html"
);
template
.
setEncoding
(
"UTF-8"
);
List
<
DocumentDevice
>
list
=
documents
.
getDocumentDevices
();
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
=
"/Users/zjm/code/Template/"
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
template
.
process
(
toMap
(
documents
,
list
.
subList
(
startPoint
,
endPoint
),
MAP
.
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
;
}
private
static
Map
<
String
,
Object
>
toMap
(
Documents
documents
,
List
<
DocumentDevice
>
list
,
String
test
){
Map
<
String
,
Object
>
data
=
new
HashMap
();
data
.
put
(
"ul"
,
test
);
data
.
put
(
"number"
,
documents
.
getNumber
());
data
.
put
(
"title"
,
documents
.
getTitle
());
data
.
put
(
"receiveUnit"
,
documents
.
getReceiveUnit
());
data
.
put
(
"replyNum"
,
documents
.
getReplyNum
());
data
.
put
(
"senderUnit"
,
documents
.
getSenderUnit
());
data
.
put
(
"documentDevices"
,
list
);
return
data
;
}
}
dev-file/src/main/resources/application.properties
0 → 100644
浏览文件 @
31a0671c
# 应用名称
spring.application.name
=
demo
# 应用服务 WEB 访问端口
server.port
=
8080
spring.datasource.url
=
jdbc:mysql://localhost:3306/worksite_new?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
dev-file/src/main/resources/bill.html
0 → 100755
浏览文件 @
31a0671c
<!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
;
//纸张大小A4
/*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
:
49%
;
text-indent
:
20px
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
}
.returnTablePrint
.line1
.sendNum
{
display
:
inline-block
;
width
:
49%
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
}
.returnTablePrint
.line1
.sendTo
{
border-right
:
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
:
49%
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
position
:
relative
;
}
.returnTablePrint
.line3
.right
{
display
:
inline-block
;
width
:
50%
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
position
:
relative
;
}
.returnTablePrint
.line3
.left
{
border-right
:
1px
solid
#7f7f7f
;
/*padding-bottom: 40px;*/
}
.returnTablePrint
.line3
.left
>
span
{
text-indent
:
10px
;
}
.returnTablePrint
.line3
.left
>
span
,
.returnTablePrint
.line3
.right
>
span
{
display
:
block
;
margin
:
15px
0px
;
}
.returnTablePrint
.line3
.right
{
height
:
100%
;
}
.returnTablePrint
.line3
.left
>
span
>
span
:nth-child
(
2
),
.returnTablePrint
.line3
.right
>
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
.right
i
{
font-style
:
normal
;
/* right: -10px;
bottom: -60px; */
}
.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
;
}
</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>
密码装备清退单
</span>
</div>
<div
style=
"width:100%;text-align:left"
>
<div
style=
"text-align:left;display: inline-block; width: 33%"
class=
"number"
>
<span
class=
"number"
>
No:第37463473647号
</span>
</div>
<div
style=
"text-align:center;display: inline-block; width: 29%"
class=
"number"
>
<span
>
(第一联XXX单位)
</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></span>
</span>
<span
class=
"sendNum"
>
<span>
批复文号:
</span>
<span></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><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>
</tr>
</
#
list>
</table>
</div>
<div
class=
"line3"
>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
发件单位:
</span>
<span
class=
"value"
></span>
</span>
<span>
<span
class=
"label"
>
签发人:
</span>
<span
class=
"value"
></span>
</span>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
></span>
</span>
<i>
<span
style=
"position: relative;color: #646464"
>
<span
style=
"margin-bottom: 20px;"
>
(公章)
</span>
<span><span
style=
"color: #fff;"
>
1234
</span>
年
<span
style=
"color: #fff;"
>
0121
</span>
月
<span
style=
"color: #fff;"
>
0232
</span>
日
</span>
<div
style=
"position: absolute"
>
<div
id=
"pos0"
></div>
</div>
</span>
</i>
</span>
<span
class=
"right"
>
<span>
<span
class=
"label"
>
收件单位:
</span>
<span
class=
"value"
></span>
</span>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
>
xxxxxx
</span>
</span>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
></span>
</span>
<i>
<span
style=
"color: #646464"
>
<span
style=
"margin-bottom: 20px;"
>
(公章)
</span>
<span><span
style=
"color: #fff;"
>
1234
</span>
年
<span
style=
"color: #fff;"
>
0121
</span>
月
<span
style=
"color: #fff;"
>
0232
</span>
日
</span>
</span>
</i>
</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/template_freemarker.html
0 → 100644
浏览文件 @
31a0671c
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<title>
Title
</title>
<style>
body
{
font-family
:
SimHei
;
}
.blue
{
color
:
blue
;
}
</style>
</head>
<body>
<div
class=
"blue"
>
你好,${name}
</div>
<div>
<
#
list
userList
as
user
>
用户名:${user.name}
密 码:${user.code}
年 龄: ${user.age}
</
#
list>
</div>
</body>
</html>
\ No newline at end of file
dev-file/src/main/resources/test.html
0 → 100644
浏览文件 @
31a0671c
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<title>
Document
</title>
<style>
body
{
font-family
:
SimHei
;
}
.returnTablePrint
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
color
:
#000
;
cursor
:
default
;
}
.returnTablePrint
.content
{
height
:
calc
(
100%
-
70px
);
width
:
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
:
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
:
15px
0
;
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
:
50%
;
box-sizing
:
border-box
;
padding-left
:
20px
;
}
.returnTablePrint
.line1
.sendNum
{
display
:
inline-block
;
width
:
49%
;
box-sizing
:
border-box
;
padding-left
:
20px
;
}
.returnTablePrint
.line1
.sendTo
{
border-right
:
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
,
.returnTablePrint
.line3
.right
{
display
:
inline-block
;
width
:
50%
;
box-sizing
:
border-box
;
padding-left
:
20px
;
position
:
relative
;
}
.returnTablePrint
.line3
.left
{
border-right
:
1px
solid
#7f7f7f
;
padding-bottom
:
40px
;
}
.returnTablePrint
.line3
.left
>
span
,
.returnTablePrint
.line3
.right
>
span
{
display
:
block
;
margin
:
15px
0px
;
}
.returnTablePrint
.line3
.right
{
height
:
100%
;
}
.returnTablePrint
.line3
.left
>
span
>
span
:nth-child
(
2
),
.returnTablePrint
.line3
.right
>
span
>
span
:nth-child
(
2
)
{
display
:
inline-block
;
margin-left
:
20px
;
}
.returnTablePrint
.line3
i
{
display
:
block
;
text-align
:
right
;
position
:
absolute
;
right
:
20px
;
bottom
:
20px
;
}
.returnTablePrint
.line3
.right
i
{
/* right: -10px;
bottom: -60px; */
}
.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
.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
;
}
.oddrowcolor
{
background-color
:
#fff
;
}
.evenrowcolor
{
background-color
:
#fafafa
;
}
</style>
</head>
<body>
<div>
阿苏妲己卡迪拉克家啊顺利到家啦睡觉啦
</div>
<div
class=
"returnTablePrint"
>
<div
class=
"content"
>
<div>
<div
class=
"listWrapper"
>
<div
class=
"list"
>
<p
class=
"title"
>
<div
class=
"main-title"
>
<span>
密码装备清退单
</span>
</div>
<div
style=
"width:100%;align-items: center;display: flex;"
>
<div
style=
"text-align:left;flex: 1;"
class=
"number"
>
<span
class=
"number"
>
No:第37463473647号
</span>
</div>
<div
style=
"text-align:center;flex: 1;"
class=
"number"
>
<span
>
(第一联XXX单位)
</span>
</div>
<div
style=
"text-align:right;flex: 1;"
class=
"number"
>
<span>
机密
</span>
</div>
</div>
</p>
<div
class=
"listCon"
>
<div
class=
"line1"
>
<span
class=
"sendTo"
>
<span>
发往:
</span>
<span>
XXXXXXX
</span>
</span>
<span
class=
"sendNum"
>
<span>
批复文号:
</span>
<span>
XXXXXXX
</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><th>
备注
</th>
</tr>
<tr>
<td>
占金名
</td><td>
占金名
</td><td>
占金名
</td><td>
占金名
</td><td>
占金名
</td><td>
1
</td><td>
占金名
</td><td>
占金名
</td><td>
占金名
</td>
</tr>
<tr>
<td>
占金名1
</td><td>
占金名1
</td><td>
占金名1
</td><td>
占金名1
</td><td>
占金名1
</td><td>
1
</td><td>
占金名1
</td><td>
占金名1
</td><td>
占金名1
</td>
</tr>
<tr>
<td>
占金名2
</td><td>
占金名2
</td><td>
占金名2
</td><td>
占金名2
</td><td>
占金名2
</td><td>
1
</td><td>
占金名2
</td><td>
占金名2
</td><td>
占金名2
</td>
</tr>
用户名:占金名
密 码:1
年 龄: 19
用户名:占金名1
密 码:1
年 龄: 19
用户名:占金名2
密 码:1
年 龄: 19
</table>
</div>
<div
class=
"line3"
>
<span
class=
"left"
>
<span>
<span
class=
"label"
>
发件单位:
</span>
<span
class=
"value"
>
xxx
</span>
</span>
<span>
<span
class=
"label"
>
签发人:
</span>
<span
class=
"value"
>
xxxxx
</span>
</span>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
>
xxxxx
</span>
</span>
<i>
<span
style=
"position: relative;color: #646464"
>
<span>
(公章)
</span>
<span>
1221年01月02
</span>
<div
style=
"position: absolute"
>
<div
id=
"pos0"
></div>
</div>
</span>
</i>
</span>
<span
class=
"right"
>
<span>
<span
class=
"label"
>
收件单位:
</span>
<span
class=
"value"
>
xxxxxxxxxx
</span>
</span>
<span>
<span
class=
"label"
>
经办人:
</span>
<span
class=
"value"
></span>
</span>
<i>
<span
style=
"color: #646464"
>
<span>
(公章)
</span>
<span>
1221年01月02
</span>
</span>
</i>
</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
浏览文件 @
31a0671c
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论