提交 6782d06e authored 作者: 133's avatar 133

[添加] zjm

上级 6cdb21c5
...@@ -74,7 +74,6 @@ public class FileController { ...@@ -74,7 +74,6 @@ public class FileController {
documents.forEach( documents.forEach(
documents1 -> list.addAll(Objects.requireNonNull(JavaToPdfHtmlFreeMarker.freeMarkerRenderList(documents1, url + "htmlModel/"))) documents1 -> list.addAll(Objects.requireNonNull(JavaToPdfHtmlFreeMarker.freeMarkerRenderList(documents1, url + "htmlModel/")))
); );
log.info("[file] 调用了生成出入单据对接口 documents"); log.info("[file] 调用了生成出入单据对接口 documents");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(list.toArray(new String[0]),url,preview,"documents/")); return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(list.toArray(new String[0]),url,preview,"documents/"));
} }
...@@ -114,6 +113,32 @@ public class FileController { ...@@ -114,6 +113,32 @@ public class FileController {
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf90(content,url,preview,"confirm/")); return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf90(content,url,preview,"confirm/"));
} }
/**
* 生成单据 核查确认单
* @return
*/
@ApiOperation(value = "生成单据 核查确认单")
@PostMapping("/printCheck")
public ResponseEntity printCheck(@RequestBody Confirm confirm) {
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderVerification2(confirm,url+"htmlModel/");
log.info("[file] 调用了生成确认单据对接口 confirm");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf90(content,url,preview,"confirm/"));
}
/**
* 生成单据 确认单据合并
* @return
*/
@ApiOperation(value = "生成单据 确认单据合并")
@PostMapping("/printConfirmMerge")
public ResponseEntity printConfirmMerge(@RequestBody Confirm confirm) {
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderConfirmMerge(confirm,url+"htmlModel/");
log.info("[file] 调用了生成确认单据对接口 confirm");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf90(content,url,preview,"confirm/"));
}
/** /**
* 生成单据 核查确认单据 * 生成单据 核查确认单据
* @return * @return
......
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 Check.java
* @Description TODO
* @createTime 2021年07月22日 12:29:00
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Check {
private String model;
private String name;
private List<String> strings;
private Integer count;
private String seqStirng;
}
...@@ -22,6 +22,9 @@ public class Confirm { ...@@ -22,6 +22,9 @@ public class Confirm {
@ApiModelProperty(name = "抬头") @ApiModelProperty(name = "抬头")
private String title; private String title;
@ApiModelProperty(name = "单位")
private String unit;
@ApiModelProperty(name = "装备信息") @ApiModelProperty(name = "装备信息")
private List<DocumentDevice> confirmDevices; private List<DocumentDevice> confirmDevices;
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style>
body {
margin: 0;
padding: 0;
font-family: SimHei;
}
.bottomTxt {
text-align: center;
font-size: 10px;
color: #646464;
height: 10px;
line-height: 10px;
}
/*@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;*/
}
.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: 17px;
color: #000000;
text-align: center;
}
table.altrowstable {
width: 100%;
font-size: 14px;
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: 1px;
padding: 8px;
border-style: solid;
border-color: #ccc;
background-color: #dedede;
height: 20px;
line-height: 20px;
font-size: 10px;
}
table.altrowstable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #ccc;
word-break: break-all;
word-wrap: break-word;
height: 20px;
line-height: 20px;
font-size: 14px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.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>
${title}
</span>
</div>
</p>
<div style="height: 900px;">
<#list checks as dev>
<table class="altrowstable" id="alternatecolor">
<tr>
<td>${dev.model}</td>
<td>${dev.name}</td>
<td>${dev.count}</td>
</tr>
<tr>
<td colspan="3">${dev.seqStirng}</td>
</tr>
</table>
</#list>
</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;">经办人:</span>
<span style="width: 200px;text-align: center;width: 49%;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
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论