提交 058aeafc authored 作者: zjm's avatar zjm

fix(PDF模块): 修改了销毁任务的PDf模版以及优化了出入库单据 字段超出的问题bug

修改了销毁任务的PDf模版以及优化了出入库单据 字段超出的问题bug
上级 5328272c
......@@ -325,6 +325,9 @@ public class JavaToPdfHtmlFreeMarker {
if (i+max==14){
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
documentDevice.setOneCount(max);
documentDevice.setModel(String.join("",toListString(documentDevice.getModel(),13)));
documentDevice.setParts(String.join("",toListString(documentDevice.getParts(),13)));
documentDevice.setRemark(String.join("",toListString(documentDevice.getRemark(),12)));
documentDevice.setDeviceSerialNumber(s);
code++;
documentDevice.setCode(code);
......@@ -338,18 +341,33 @@ public class JavaToPdfHtmlFreeMarker {
List<String> modelList= toListString(documentDevice.getModel(),13);
List<String> seqList=toListString(documentDevice.getDeviceSerialNumber(),56);
List<String> pasList=toListString(documentDevice.getParts(),13);
List<String> remarkList=toListString(documentDevice.getRemark(),12);
DocumentDevice documentDevice1=new DocumentDevice();
if (modelList.size()>differ){
documentDevice.setModel(String.join("",modelList.subList(0,differ)));
documentDevice1.setModel(String.join("",modelList.subList(differ,modelList.size())));
}else {
documentDevice.setModel(String.join("",modelList.subList(0,differ)));
}
if (seqList.size()>differ){
documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,differ)));
documentDevice1.setDeviceSerialNumber(String.join("",seqList.subList(differ,seqList.size())));
}else {
documentDevice.setDeviceSerialNumber(String.join("",seqList.subList(0,seqList.size())));
}
if (pasList.size()>differ){
documentDevice.setParts(String.join("",pasList.subList(0,differ)));
documentDevice1.setParts(String.join("",pasList.subList(differ,pasList.size())));
}else {
documentDevice.setParts(String.join("",pasList.subList(0,pasList.size())));
}
if (remarkList.size()>differ){
documentDevice.setRemark(String.join("",remarkList.subList(0,differ)));
documentDevice1.setRemark(String.join("",remarkList.subList(differ,remarkList.size())));
}else {
documentDevice.setRemark(String.join("",remarkList));
}
code++;
documentDevice.setCode(code);
......@@ -366,6 +384,9 @@ public class JavaToPdfHtmlFreeMarker {
String s=String.join("",toListString(documentDevice.getDeviceSerialNumber(),56));
code++;
documentDevice.setCode(code);
documentDevice.setModel(String.join("",toListString(documentDevice.getModel(),13)));
documentDevice.setParts(String.join("",toListString(documentDevice.getParts(),13)));
documentDevice.setRemark(String.join("",toListString(documentDevice.getRemark(),12)));
documentDevice.setOneCount(max);
documentDevice.setDeviceSerialNumber(s);
documentDevices.add(documentDevice);
......@@ -384,9 +405,11 @@ public class JavaToPdfHtmlFreeMarker {
int partsCount=String_length(documentDevice.getParts());
int deviceSerialNumberCount=String_length(documentDevice.getDeviceSerialNumber());
int modelCount=String_length(documentDevice.getModel());
int parts = (partsCount%13>0) ? partsCount/20 + 1 : partsCount/13;
int remarkCount=String_length(documentDevice.getRemark());
int parts = (partsCount%13>0) ? partsCount/13 + 1 : partsCount/13;
int deviceSerialNumber=(deviceSerialNumberCount%56>0) ? deviceSerialNumberCount/56 + 1 : deviceSerialNumberCount/56;
int model=(modelCount%13>0) ? modelCount/13 + 1 : modelCount/13;
int remark=(remarkCount%12>0) ? remarkCount/12 + 1 : remarkCount/12;
int max=parts;
//求最大
if(max<deviceSerialNumber){
......@@ -396,10 +419,14 @@ public class JavaToPdfHtmlFreeMarker {
if(max<model) {
max = model;
}
if (max<remark){
max=remark;
}
return max;
}
private static int toMaxList(List<String> strings){
Integer count=strings.size();
return (count%6>0) ? count/6 + 1 : count/6;
......@@ -1072,7 +1099,7 @@ public class JavaToPdfHtmlFreeMarker {
Template template = freemarkerCfg.getTemplate("bill1.html");
template.setEncoding("UTF-8");
List<DocumentDevice> list=destruction.getConfirmDevices();
List<List<DocumentDevice>> listList=toList(list);
List<List<DocumentDevice>> listList=toDocList(list);
Integer count=listList.size();
for (int i=1; i<=3; i++){
Integer page=1;
......
......@@ -7,28 +7,29 @@
<style>
body,span,p,tr,td {
font-size: 15px;
font-family: SimHei;
font-family: FangSong_GB2312;
margin: 0;
padding: 0;
}
/*@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;*/
}
.erwei{
width: 43px;
height: 43px;
position: fixed;
left: 150px;
top: 0px;
}
.bottomTxt {
text-align: center;
font-size: 15px;
height: 10px;
color: #000;
margin-top: 4px;
height: 10px;
line-height: 10px;
margin-top: 4px;
}
.returnTablePrint {
......@@ -42,10 +43,6 @@
.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 {
......@@ -65,19 +62,13 @@
} */
.returnTablePrint .listWrapper {
/* width: 92%; */
/* margin: 0 auto; */
/* padding: 0px 20px 20px 20px; */
/* height: calc(100% - 70px); */
/*padding: 10px 30px;*/
/*margin: 0 auto;*/
/* height: calc(100% - 40px); */
box-sizing: border-box;
}
.returnTablePrint .list {
/* width: 92%; */
/* margin: 0 auto; */
/* padding: 0px 20px 20px 20px; */
/* height: calc(100% - 75px); */
/*margin: 0 auto;*/
height: calc(100% - 12px)
}
......@@ -87,9 +78,8 @@
text-align: center;
position: relative;
/* margin: 0 0 15px; */
padding: 0;
box-sizing: border-box;
margin-top: 9px;
margin-bottom: 4px;
}
/* .returnTablePrint .title span:nth-child(2){
......@@ -127,18 +117,20 @@
.returnTablePrint .line1 {
width: 100%;
font-size: 10px;
font-size: 15px;
box-sizing: border-box;
border-bottom: 1px solid #7f7f7f;
color: #000;
color: #333;
line-height: 20px;
height: 24px;
line-height: 24px;
}
.returnTablePrint .line1 .sendTo {
display: inline-block;
width: 49%;
text-indent: 5px;
height: 24px;
color: #000;
line-height: 24px;
box-sizing: border-box;
/*padding-left: 20px;*/
}
......@@ -146,14 +138,20 @@
.returnTablePrint .line1 .sendNum {
display: inline-block;
width: 49%;
font-size: 15px;
height: 24px;
line-height: 24px;
color: #000;
box-sizing: border-box;
text-indent: 5px;
border-left: 1px solid #7f7f7f;
/*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: #000;
display: inline-block;
margin-left: 5px;
}
......@@ -165,7 +163,8 @@
}
.returnTablePrint .tableList {
height: 492px;
height: 375px;
overflow:hidden;
}
.returnTablePrint .line2>>>.el-table tbody tr:nth-child(odd) {
......@@ -240,7 +239,6 @@
.returnTablePrint .checkName span:nth-child(2) {
color: #000;
display: inline-block;
margin-left: 20px;
}
.returnTablePrint>>>.el-table tbody .cell {
......@@ -250,13 +248,11 @@
.returnTablePrint .label {
color: #000;
font-size: 15px;
;
}
.returnTablePrint .value {
color: #000;
font-size: 15px;
;
}
.returnTablePrint .main-title span{
font-size: 22px;
......@@ -264,10 +260,11 @@
font-weight: bold;
}
.returnTablePrint .main-title {
font-size: 17px;
color: #000000;
/* margin-bottom: 20px; */
font-size: 22px;
color: #333;
line-height: 20px;
text-align: center;
margin-bottom: 4px;
}
.returnTablePrint .footer {
......@@ -281,10 +278,10 @@
margin-left: 50px;
}
table.altrowstable {
table.altrowstable2 {
width: 100%;
font-size: 15px;
color: #141414;
font-size: 16px;
color: #000;
border-width: 0px;
border-color: #a9c6c9;
border-collapse: collapse;
......@@ -293,29 +290,112 @@
word-break: break-all;
}
table.altrowstable th {
table.altrowstable2 th {
height: 25px;
line-height:25px;
font-size: 15px;
background-color: #fff;
border:1px solid #bebebe;
padding-top: 0;
}
table.altrowstable2 td {
height: 25px;
line-height:25px;
font-size: 15px;
word-break: break-all;
word-wrap: break-word;
border:1px solid #bebebe;
width: 100%;
}
.td2{
height: 50px !important;
}
.td3{
height: 75px !important;
}
.td4{
height: 100px !important;
}
.td5{
height: 125px !important;
}
.td6{
height: 150px !important;
}
.td7{
height: 175px !important;
}
.td8{
height: 200px !important;
}
.td9{
height: 225px !important;
}
.td10{
height: 250px !important;
}
.td11{
height: 275px !important;
}
.td12{
height: 300px !important;
}
.td13{
height: 325px !important;
}
table.altrowstable {
width: 100%;
font-size: 16px;
color: #000;
border-width: 0px;
border-style: solid;
border-color: #a9c6c9;
background-color: #dedede;
border-collapse: collapse;
text-align: center;
table-layout: fixed;
word-break: break-all;
}
table.altrowstable th {
height: 24px;
line-height: 24px;
line-height:24px;
font-size: 15px;
background-color: #ebebeb;
marign-top:none;
border:1px solid #bebebe;
padding-top: 0;
padding-bottom: 0;
}
table.altrowstable td {
border-width: 0px;
height: 24px;
line-height: 24px;
line-height:24px;
font-size: 15px;
/*border-style: solid;*/
/*border-color: #a9c6c9;*/
/*border: 1px solid #bebebe;*/
word-break: normal;
word-wrap: normal;
border:1px solid #bebebe;
width: 100%;
}
/*table.altrowstable .altrowstableTr:nth-child(odd) {
height: 18px;
word-break: break-all;
word-wrap: break-word;
width: 100%;
background-color: #f2f2f2;
} */
.leftImg {
position: absolute;
bottom: 0px;
right: 150px;
}
.rightImg {
position: absolute;
bottom: 0px;
right: 150px;
.oddrowcolor {
background-color: #fff;
}
......@@ -324,118 +404,315 @@
background-color: #fafafa;
}
tr:nth-child(odd) {
background: #fafafa;
}
/*tr:nth-child(odd) {*/
/* background: #fafafa;*/
/*}*/
</style>
</head>
<body>
<div class="returnTablePrint">
<div class="content">
<div>
<div class="listWrapper">
<div class="list">
<div class="title">
<div class="main-title">
<div class="returnTablePrint">
<img class="erwei" src=${QRCode} />
<div class="content">
<div>
<div class="listWrapper">
<div class="list">
<div class="title">
<div class="main-title">
<span>
${title!}
</span>
</div>
<div style="width:100%;font-size: 1px;">
<div style="display:inline-block;text-align:left; width: 33%; font-size: 10px;"
class="number">
<span>${number!}</span>
</div>
<div style="width:100%;text-align:left;font-size: 1px;margin-bottom: 2px;">
<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: 33%" class="number">
<span>(${ul!})</span>
</div>
<div style="text-align:right;display: inline-block; width: 33%" class="number">
<span>机密</span>
</div>
<div style="display:inline-block;text-align:center; width: 33%; font-size: 10px;"
class="number">
<span>(${ul!})</span>
</div>
<div style="display:inline-block;text-align:right; width: 33%; font-size: 10px;"
class="number">
<span>机密</span>
</div>
</div>
<div class="listCon">
<div class="line1">
</div>
<div class="listCon">
<div class="line1">
<span class="sendTo">
<span>销毁单位:</span>
<span>${unitName!}</span>
<span style="text-indent: 5px; display: inline-block;">发往:</span>
<span>${receiveUnit!}</span>
</span>
<span class="sendNum">
<span>销毁时间:</span>
<span>${time!}</span>
<span class="sendNum">
<span style="text-indent: 5px; display: inline-block;">批复文号:</span>
<span>${replyNum!}</span>
</span>
</div>
<div class="line2 tableList">
<table class="altrowstable" id="alternatecolor">
<tr>
<th width="70px">序号</th>
<th>型号</th>
<th>部件</th>
<th width="50px">密级</th>
<th width="120px">应用领域</th>
<th>数量</th>
<th width="420px">装备序列号</th>
<th>备注</th>
</tr>
<#list documentDevices as dev>
<tr>
<td>
<!--<#if dev.code !=0>-->
${dev.code!}
<!--</#if>-->
</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.remark!}</td>
</tr>
</#list>
</table>
</div>
<div class="line3">
</div>
<div class="line2 tableList">
<table class="altrowstable" id="alternatecolor">
<tr style="border-bottom: 1px solid #dedede; border-top: 1px solid #dedede;">
<!-- <th>序号</th><th>型号</th><th>形态</th><th>密级</th><th>应用领域</th><th>数量</th><th style="width: 420px;">装备序列号</th><th>备注</th> -->
<th width="70px">序号</th>
<th width="96px">型号</th>
<th width="96px">部件</th>
<th width="50px">密级</th>
<th width="100px">应用领域</th>
<th width="72px">数量</th>
<th width="420px">装备序列号</th>
<th>备注</th>
</tr>
<#list documentDevices as dev>
<tr class="altrowstableTr">
<td>
${dev.code!}
</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>-->
<#if dev.oneCount == 1>
<td>${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 2>
<td class="td2">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 3>
<td class="td3">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 4>
<td class="td4">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 5>
<td class="td5">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 6>
<td class="td6">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 7>
<td class="td7">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 8>
<td class="td8">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 9>
<td class="td9">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 10>
<td class="td10">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 11>
<td class="td11">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 12>
<td class="td12">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 13>
<td class="td13">${dev.deviceSerialNumber!}</td>
<#elseif dev.oneCount == 14>
<td class="td14">${dev.deviceSerialNumber!}</td>
</#if>
<td>${dev.remark!}</td>
</tr>
</#list>
</table>
<table class="altrowstable2" id="alternatecolor">
<tr style="border-bottom: 1px solid #dedede;">
<th width="70px"></th>
<th width="96px"></th>
<th width="96px"></th>
<th width="50px"></th>
<th width="100px"></th>
<th width="72px"></th>
<th width="420px"></th>
<th></th>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="altrowstableTr">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="line3">
<span class="left">
<span>
<span class="label">监销人:</span>
<span class="value"></span>
</span>
</span>
<span class="left">
<span class="left">
<span>
<span class="label">主管领导:</span>
<span class="value"></span>
</span>
</span>
<span class="left" style="width: 23%;">
<span class="left" style="width: 23%;">
<span>
<span class="label">经办人:</span>
<span class="value"></span>
</span>
</span>
<span class="left" style="width: 23%;">
<span class="left" style="width: 23%;">
<span>
<span class="label">承办人:</span>
<span class="value"></span>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="bottomTxt" style="float: left;">注:编号连续使用"-"省略</p>
<p class="bottomTxt" style="float: right;">第${page}页/共${count}页</p>
</div>
</div>
<div>
<p class="bottomTxt" style="float: left;">注:编号连续使用"-"省略</p>
<p class="bottomTxt" style="float: right;">第${page}页/共${count}页</p>
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论