提交 3768ceb6 authored 作者: zjm's avatar zjm

feat(FILE模块): 优化了存放位置,按照文件夹分开放置

优化了存放位置,按照文件夹分开放置 html 放置 htmlTem中 doc 放置 docTem中
上级 91b1b75d
......@@ -76,7 +76,7 @@ public class UseReportFIleServiceImpl implements UseReportFIleService {
params.put("TitleTimeStart",wrodParameter.getTitleTimeStart());
params.put("TitleUnitName",wrodParameter.getTitleUnitName());
String fileName = wrodParameter.getTitleTimeStart()+"至"+wrodParameter.getTitleTimeEnd()+"使用报告" + ".doc";
String templatePath = ResourceUtils.getURL( "classpath:").getPath()+docModel;
String templatePath = ResourceUtils.getURL( "classpath:").getPath()+"docTemplate/"+docModel;
url=url+"report/";
String uuidName=UUID.randomUUID().toString().replace("-", "") + ".doc";
String fileUrl= WordUtil.createWord(templatePath,url,uuidName,params);
......
......@@ -63,7 +63,7 @@ public class JavaToPdfHtmlFreeMarker {
freemarkerCfg =new Configuration();
//freemarker的模板目录
try {
freemarkerCfg.setDirectoryForTemplateLoading(new File(ResourceUtils.getURL("classpath:").getPath()));
freemarkerCfg.setDirectoryForTemplateLoading(new File(ResourceUtils.getURL("classpath:").getPath()+"htmlTemplate/"));
} catch (IOException e) {
e.printStackTrace();
}
......@@ -118,8 +118,8 @@ public class JavaToPdfHtmlFreeMarker {
renderer.setDocument(htmlFile);
// 解决中文不显示问题
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"simhei2.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei2.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
renderer.layout();
renderer.createPDF(os);
PdfReader pdfReader = new PdfReader(os.toByteArray());
......@@ -162,8 +162,8 @@ public class JavaToPdfHtmlFreeMarker {
renderer.setDocument(htmlFile);
// 解决中文不显示问题
ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"simhei2.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei2.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
renderer.layout();
renderer.createPDF(os);
PdfReader pdfReader = new PdfReader(os.toByteArray());
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style>
body {
margin: 0;
padding: 0;
font-family: FangSong_GB2312;
}
.bottomTxt {
text-align: center;
font-size: 10px;
color: #646464;
height: 10px;
line-height: 10px;
}
/*@page{size:297mm 210mm;}<!-- 设置PDF页面大小,此配置只对生成PDF文件有效,不会对页面显示生效 -->*/
@page {
/*size: 210mm 297mm;*/
size: 297mm 210mm;
/*margin: 0.25in;*/
/*-fs-flow-bottom: "footer";*/
/*-fs-flow-left: "left";*/
/*-fs-flow-right: "right";*/
/*border: thin solid black;*/
/*padding: 1em;*/
}
.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;
padding: 0;
box-sizing: border-box;
margin-top: 9px;
}
.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: 24px;
color: #000000;
text-align: center;
}
table.altrowstable {
width: 100%;
font-size: 14px;
color: #141414;
border-width: 0px;
border-color: #000;
border-collapse: collapse;
text-align: center;
table-layout: fixed;
word-break: break-all;
}
table.altrowstable th {
border-width: 1px;
padding: 0px;
border-style: solid;
border-color: #ccc;
background-color: #dedede;
height: 25px;
line-height: 25px;
font-size: 15px;
}
table.altrowstable td {
height: 23px;
line-height:23px;
font-size: 15px;
word-break: break-all;
word-wrap: break-word;
border:1px solid #bebebe;
width: 100%;
}
.td2{
height: 50px !important;
line-height:24px;
}
.td3{
height: 75px !important;
line-height:24px;
}
.td4{
line-height:24px;
height: 100px !important;
}
.td5{
line-height:24px;
height: 125px !important;
}
.td6{
line-height:24px;
height: 150px !important;
}
.td7{
line-height:24px;
height: 175px !important;
}
.td8{
line-height:24px;
height: 200px !important;
}
.td9{
line-height:24px;
height: 225px !important;
}
.td10{
line-height:24px;
height: 250px !important;
}
.td11{
line-height:24px;
height: 275px !important;
}
.td12{
line-height:24px;
height: 300px !important;
}
.td13{
line-height:24px;
height: 325px !important;
}
.td14{
line-height:24px;
height: 350px !important;
}
.td15{
line-height:24px;
height: 375px !important;
}
.td16{
line-height:24px;
height: 400px !important;
}
.td17{
height: 425px !important;
line-height:24px;
}
.td18{
line-height:24px;
height: 450px !important;
}
.td19{
line-height:24px;
height: 475px !important;
}
.td20{
line-height:24px;
height: 500px !important;
}
.td21{
line-height:24px;
height: 525px !important;
}
.td22{
line-height:24px;
height: 550px !important;
}
.td23{
line-height:24px;
height: 575px !important;
}
.td24{
line-height:24px;
height: 600px !important;
}
.td25{
line-height:24px;
height: 625px !important;
}
.td25{
line-height:24px;
height: 650px !important;
}
.oddrowcolor {
background-color: #fff;
}
.evenrowcolor {
background-color: #fafafa;
}
.person {
color: #4a475b;
text-align: right;
font-size: 16px;
}
.person>span {
display: inline-block;
margin-right: 30pt;
}
/* tr:nth-child(odd) {
background: #fafafa;
} */
</style>
</head>
<body>
<div class="returnTablePrint">
<div class="content">
<div>
<div class="listWrapper">
<div class="list">
<p class="title" style="margin-bottom:20px;">
<div class="main-title">
<span>
核心密码装备库存统计表
</span>
</div>
</p>
<div style="height: 530px;border:2px solid #000">
<table class="altrowstable" id="alternatecolor">
<tr>
<th width="190px">型号</th>
<th width="190px">名称</th>
<th width="190px">形态</th>
<th width="190px">所属单位</th>
<th width="190px">存放位置</th>
<th>数量</th>
</tr>
<#list checks as dev>
<!--<table class="altrowstable" id="alternatecolor">-->
<!--<tr>-->
<!--<th>型号</th>-->
<!--<th>名称</th>-->
<!--<th>所属单位</th>-->
<!--<th>存放位置</th>-->
<!--<th>数量</th>-->
<!--</tr>-->
<#if (dev.model)?? || (dev.name)?? || (dev.ownUnit)?? || (dev.store)??>
<tr>
<td>${dev.model!}</td>
<td>${dev.name!}</td>
<td>${dev.type!}</td>
<td>${dev.ownUnit!}</td>
<#if dev.titleCount == 1 || (dev.titleCount)==0>
<td style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 2>
<td class="td2" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 3>
<td class="td3" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 4>
<td class="td4" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 5>
<td class="td5" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 6>
<td class="td6" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 7>
<td class="td7" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 8>
<td class="td8" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 9>
<td class="td9" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 10>
<td class="td10" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 11>
<td class="td11" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 12>
<td class="td12" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 13>
<td class="td13" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 14>
<td class="td14" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 15>
<td class="td15" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 16>
<td class="td16" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 17>
<td class="td17" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 18>
<td class="td18" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 19>
<td class="td19" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 20>
<td class="td20" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 21>
<td class="td21" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 22>
<td class="td22" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 23>
<td class="td23" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 24>
<td class="td24" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 25>
<td class="td25" style="text-align: center;color: #555;">${dev.store!}</td>
<#elseif dev.titleCount == 26>
<td class="td26" style="text-align: center;color: #555;">${dev.store!}</td>
</#if>
<!--<td>${dev.store!}</td>-->
<td>${dev.count!}</td>
</tr>
</#if>
<tr>
<#if dev.oneCount == 1>
<td colspan="6" style="text-align: left;padding: 0 2em;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 2>
<td colspan="6" class="td2" style="text-align: left;padding: 0 2em;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 3>
<td colspan="6" class="td3" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 4>
<td colspan="6" class="td4" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 5>
<td colspan="6" class="td5" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 6>
<td colspan="6" class="td6" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 7>
<td colspan="6" class="td7" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 8>
<td colspan="6" class="td8" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 9>
<td colspan="6" class="td9" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 10>
<td colspan="6" class="td10" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 11>
<td colspan="6" class="td11" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 12>
<td colspan="6" class="td12" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 13>
<td colspan="6" class="td13" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 14>
<td colspan="6" class="td14" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 15>
<td colspan="6" class="td15" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 16>
<td colspan="6" class="td16" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 17>
<td colspan="6" class="td17" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 18>
<td colspan="6" class="td18" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 19>
<td colspan="6" class="td19" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 20>
<td colspan="6" class="td20" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 21>
<td colspan="6" class="td21" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 22>
<td colspan="6" class="td22" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 23>
<td colspan="6" class="td23" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 24>
<td colspan="6" class="td24" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 25>
<td colspan="6" class="td25" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
<#elseif dev.oneCount == 26>
<td colspan="6" class="td26" style="text-align: left;padding: 0 2em;;color: #555;">${dev.seqStirng!}</td>
</#if>
</tr>
</#list>
</table>
</div>
</div>
<p class="person" style="margin-top: 20px;font-size: 10px;width: 100%;text-align: left;">
<span style="width: 200px;text-align: center;width: 49%;margin: 0;">制表单位:${unit!}</span>
<span style="width: 200px;text-align: center;width: 49%;margin: 0;">制表时间:${time!}</span>
<!--<span style="width: 200px;text-align: center;width: 24%;margin: 0;">经办人:</span>-->
<!--<span style="width: 200px;text-align: center;width: 24%;margin: 0;">审核人:</span>-->
</p>
</div>
</div>
</div>
<div>
<!--<p class="bottomTxt" style="float: left;">注:编号连续使用"-"省略</p>-->
<p class="bottomTxt" style="float: right;">第${page}页/共${count}页</p>
</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
spring.datasource.driver-class-name=com.oscar.Driver
spring.datasource.url=jdbc:oscar://10.153.4.10:2003/OSRDB
#spring.datasource.url=jdbc:oscar://192.168.0.80:2003/OSRDB
#spring.datasource.url=jdbc:oscar://10.153.4.10:2003/OSRDB
spring.datasource.url=jdbc:oscar://192.168.0.80:2003/OSRDB?useSSL=false&rewriteBatchedStatements=TRUE
spring.datasource.username=SYSDBA
spring.datasource.password=szoscar55
spring.jpa.database-platform=org.hibernate.dialect.OscarDialect
file.path=/opt/zb/
preview.path=http://10.153.4.11:8088/equip/file/
#file.path=/opt/zb/
#preview.path=http://10.153.4.11:8088/equip/file/
#preview.path=http://192.168.0.80:8088/equip/file/
\ No newline at end of file
......@@ -469,7 +469,7 @@
<th width="100px">应用领域</th>
<th width="72px">数量</th>
<th width="120px">装备序列号</th>
<th>维修原因</th>
<th >维修原因</th>
</tr>
<#list documentDevices as dev>
<tr class="altrowstableTr">
......@@ -521,7 +521,6 @@
<#elseif dev.oneCount == 14>
<td class="td14">${dev.deviceSerialNumber!}</td>
</#if>
<td>${dev.remark!}</td>
</tr>
</#list>
......@@ -536,6 +535,7 @@
<th width="72px"></th>
<th width="420px"></th>
<th></th>
<th></th>
</tr>
<tr class="altrowstableTr">
<td></td>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论