fix(pdf): 调整钢构件老鼠图分页和样式优化
- 将分页数量从9或6调整为15,优化PDF分页显示 - 修正数据库查询回显结构,确保材料列表正确转换 - 缩小字体和内边距,提升页面布局紧凑度 - 调整图片尺寸及表格单元格样式,使显示更美观与统一 - 修改部分文本样式和位置,提高信息呈现清晰度
This commit is contained in:
parent
54d3bcd2f0
commit
bed84fcc5f
|
|
@ -581,7 +581,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
).collect(Collectors.toList());
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("info", vo);
|
||||
variables.put("pages", PdfPageDTO.create(items, 9, new PackageMaterialDTO()));
|
||||
variables.put("pages", PdfPageDTO.create(items, 15, new PackageMaterialDTO()));
|
||||
String html = ThymeleafUtil.generator("/template/", "钢构件老鼠图", ".html", variables);
|
||||
// PdfGeneratorUtil.generatePdf(vo.getExternalOrderNo() + "-" + vo.getWorkbenchCode() + "老鼠图", html, response);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
|
@ -2121,7 +2121,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
).collect(Collectors.toList());
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("info", vo);
|
||||
variables.put("pages", PdfPageDTO.create(items, 9, new PackageMaterialDTO()));
|
||||
variables.put("pages", PdfPageDTO.create(items, 15, new PackageMaterialDTO()));
|
||||
String html = ThymeleafUtil.generator("/template/", "钢构件老鼠图", ".html", variables);
|
||||
URL baseUrl = new ClassPathResource("template/").getURL();
|
||||
PdfGeneratorUtil.generatePdf("钢构件老鼠图", html, baseUrl.toString(), response);
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ public class StructuralPackageControllerService {
|
|||
vo.setQrCode(QRCodeUtil.generateQRCodeBase64(vo.getNo(), 100, 100));
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("info", vo);
|
||||
variables.put("pages", PdfPageDTO.create(vo.getMaterialList(), 6, new PackageMaterialDTO()));
|
||||
variables.put("pages", PdfPageDTO.create(vo.getMaterialList(), 15, new PackageMaterialDTO()));
|
||||
String html = ThymeleafUtil.generator("/template/", "钢构件老鼠图", ".html", variables);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
PdfGeneratorUtil.generatePdf(vo.getNo() + "老鼠图", html, outputStream);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
body {
|
||||
font-family: SimSun, serif;
|
||||
font-size: 9pt;
|
||||
font-size: 8pt;
|
||||
padding: 10px;
|
||||
margin: 0 auto;
|
||||
max-width: 100%;
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
.logo img {
|
||||
height: 40px;
|
||||
padding: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
table {
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
td {
|
||||
border: 1px solid #000;
|
||||
padding: 7px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
tr:first-child td {
|
||||
|
|
@ -67,10 +67,9 @@
|
|||
}
|
||||
|
||||
.cell-img {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
padding: 5px;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
@ -82,7 +81,7 @@
|
|||
|
||||
.cell {
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 7px;
|
||||
padding: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
|
@ -107,19 +106,19 @@
|
|||
<div class="logo"><img alt="" src="../img/logo1.png"/></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>订单号:<span th:text="${info.externalOrderNo}">12255665451615</span></td>
|
||||
<td>行号:<span th:text="${info.rowNo}">1111</span></td>
|
||||
<td style="width: 120px;height: 35px;">订单号:<span th:text="${info.externalOrderNo}">7500381665</span></td>
|
||||
<td style="width: 80px;">行号:<span th:text="${info.rowNo}">10</span></td>
|
||||
<!-- 托盘号已移除,保留空单元格 -->
|
||||
<td></td>
|
||||
<td colspan="2">供应商:<span th:text="${info.supplierName}">1111</span></td>
|
||||
<td rowspan="3" class="cell-img" style="width: 130px;">
|
||||
<td style="width: 120px;"></td>
|
||||
<td colspan="2">供应商:<span th:text="${info.supplierName}">首钢凯西钢铁有限公司</span></td>
|
||||
<td rowspan="3" class="cell-img" style="width: 110px;">
|
||||
<img alt="" style="width: 100px;" th:src="${info.qrCode}" src="../img/logo1.png"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>机型:<span th:text="${info.modelNos}">12255665451615</span></td>
|
||||
<td style="height: 35px;">机型:<span th:text="${info.modelNos}">12255665451615</span></td>
|
||||
<td>版本:<span th:text="${info.version}">1</span></td>
|
||||
<td>机台号:<span th:text="${info.workbenchCode}">1</span></td>
|
||||
<td>机台号:<span th:text="${info.workbenchCode}">NFJ1280EB5</span></td>
|
||||
<td>种类:<span th:text="${info.cate}">1</span></td>
|
||||
<td style="width: 80px;">总重:<span th:text="${info.weight}">348.41</span></td>
|
||||
</tr>
|
||||
|
|
@ -132,21 +131,15 @@
|
|||
</table>
|
||||
<div class="data-item" th:each="item,itemStat : ${page.datas}"
|
||||
th:classappend="${itemStat.index % 3 == 0} ? 'data-item-row-first'">
|
||||
<div class="cell" style="height: 150px;">
|
||||
<div class="cell" style="height: 110px;">
|
||||
<div class="cell-img">
|
||||
<img style="width: 200px;height: 130px;" alt=""
|
||||
<img style="width: 220px;height: 100px;" alt=""
|
||||
th:src="${!#strings.isEmpty(item.image)} ? ${item.image} : (${#strings.isEmpty(item.no)} ? '' : 'http://192.168.163.83:9090/nflg-wms/template/none.png')"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell">SAP编码:<span th:text="${item.no}">2222222222</span></div>
|
||||
<div class="cell1">图号:<span
|
||||
th:text="${item.drawingNo}">图号图号图号图号图号图号图号图号图号图号图号图号图号图号图号图号</span>
|
||||
</div>
|
||||
<div class="cell1">名称:<span
|
||||
th:text="${item.name}">名称名称名称名称名称名称名称名称名称名名称名名称名称名称称名称名称名称称名称名称名称</span>
|
||||
</div>
|
||||
<div class="cell">数量:<span th:text="${item.num}">1</span> 重量:<span
|
||||
th:text="${item.weight}">348.41</span></div>
|
||||
<div class="cell">SAP编码:<span th:text="${item.no}">2222222222</span> 图号:<span th:text="${item.drawingNo}">1280-008-006-WF</span></div>
|
||||
<div class="cell">名称:<span th:text="${item.name}">受料斗前支腿</span></div>
|
||||
<div class="cell">数量:<span th:text="${item.num}">1</span> 重量:<span th:text="${item.weight}">348.41</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -97,7 +97,9 @@ public class WmsStructuralPackageServiceImpl extends ServiceImpl<WmsStructuralPa
|
|||
|
||||
@Override
|
||||
public PackageVO getInfo(Long id) {
|
||||
return baseMapper.getInfo(id);
|
||||
PackageVO vo = baseMapper.getInfo(id);
|
||||
vo.setMaterialList(JSONUtil.toList(vo.getMaterials(), PackageMaterialDTO.class));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue