fix:修改默认图片渲染宽度高度

This commit is contained in:
石崇礼 2025-03-19 10:50:30 +08:00
parent d3e775b720
commit da5c10b632
4 changed files with 21 additions and 21 deletions

View File

@ -46,14 +46,14 @@ public class ReceiptPrintRequest implements Serializable {
private String templateFillData; private String templateFillData;
/** /**
* 小票渲染宽度默认为600 * 小票渲染宽度默认为690
*/ */
private Integer width = 600; private Integer width = 690;
/** /**
* 生成的模板的高度默认为950 * 生成的模板的高度默认为1200
*/ */
private Integer height = 950; private Integer height = 1200;
} }

View File

@ -78,7 +78,7 @@ public class MS439PrintServiceImpl implements MS439PrintService {
lexMarkDTO.setParam(param.toString()); lexMarkDTO.setParam(param.toString());
LexMarkResultDTO<LexMarkResultDTO.Param> paramLexMarkResultDTO = thirdService.callDevice(lexMarkDTO, LexMarkResultDTO.Param.class); LexMarkResultDTO<LexMarkResultDTO.Param> paramLexMarkResultDTO = thirdService.callDevice(lexMarkDTO, LexMarkResultDTO.Param.class);
thirdService.close("HtmPrinter"); // thirdService.close("HtmPrinter");
return paramLexMarkResultDTO; return paramLexMarkResultDTO;
} }

View File

@ -48,22 +48,22 @@ public class RegisterServiceImpl implements PrintService {
lexMarkDTO.setDevName("ReceiptPrinter"); lexMarkDTO.setDevName("ReceiptPrinter");
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("TimeOut", 30000); param.put("TimeOut", 30000);
param.put("formName", "ReceiptForm"); param.put("formName", "ReceiptForm"); // 表单名从
param.put("mediaName", "ReceiptMedia"); param.put("mediaName", "Blank"); // 媒介类型
param.put("alignment", 0); param.put("alignment", 0); // 对齐方式
param.put("offsetX", 0); param.put("offsetX", 0); // x
param.put("offsetY", 0); param.put("offsetY", 0); // y
param.put("resolution", 1); param.put("resolution", 1); //
param.put("mediaCtrl", 1); param.put("mediaCtrl", 1);
param.put("fields", "LOGO=" + filePath); param.put("fields", "LOGO=" + filePath);
lexMarkDTO.setParam(param.toJSONString()); lexMarkDTO.setParam(param.toJSONString());
LexMarkResultDTO<LexMarkResultDTO.Param> paramLexMarkResultDTO = thirdService.callDevice(lexMarkDTO, LexMarkResultDTO.Param.class); LexMarkResultDTO<LexMarkResultDTO.Param> paramLexMarkResultDTO = thirdService.callDevice(lexMarkDTO, LexMarkResultDTO.Param.class);
// 切纸 // 切纸
// this.thirdService.cutPaper("ReceiptPrinter", "ControlMedia", 4); //this.thirdService.cutPaper("ReceiptPrinter", "ControlMedia", 4);
File file = new File(filePath.toString()); File file = new File(filePath.toString());
// 检查文件是否存在 // 检查文件是否存在
if (file.exists() ) { if (file.exists()) {
// 尝试删除文件 // 尝试删除文件
if (file.delete()) { if (file.delete()) {
log.info("文件删除成功: " + filePath); log.info("文件删除成功: " + filePath);
@ -74,7 +74,7 @@ public class RegisterServiceImpl implements PrintService {
log.info("文件不存在: " + filePath); log.info("文件不存在: " + filePath);
} }
this.thirdService.close("ReceiptPrinter"); // this.thirdService.close("ReceiptPrinter");
return paramLexMarkResultDTO; return paramLexMarkResultDTO;
} }

View File

@ -4,7 +4,7 @@
<title>挂号单</title> <title>挂号单</title>
</head> </head>
<body> <body>
<div style="font-size: 32px; margin-top: 30px;"> <div style="font-size: 32px; margin-top: 5px;">
<div style=""> <div style="">
<div style="text-align: center; font-size: 40px; font-weight: 700;"><span th:text="${hospitalName}"></span></div> <div style="text-align: center; font-size: 40px; font-weight: 700;"><span th:text="${hospitalName}"></span></div>
<div style="text-align: center; font-weight: 700; font-size: 28px;">****<span th:text="${registeTerminalName}"></span></span>****</div> <div style="text-align: center; font-weight: 700; font-size: 28px;">****<span th:text="${registeTerminalName}"></span></span>****</div>
@ -28,15 +28,15 @@
<div style="margin-left: 59px;">支付方式:<span th:text="${paymentMethod}"></span></div> <div style="margin-left: 59px;">支付方式:<span th:text="${paymentMethod}"></span></div>
<div style="margin-left: 59px;">&ensp;&ensp;号:<span th:text="${orderNumber}"></span></div> <div style="margin-left: 59px;">&ensp;&ensp;号:<span th:text="${orderNumber}"></span></div>
<div style="margin-left: 59px; ">交易流水:<span th:text="${transactionNumber}"></span></div> <div style="margin-left: 59px; ">交易流水:<span th:text="${transactionNumber}"></span></div>
<div style="width: 100%; text-align: center"> <div style="width: 100%; text-align: center; margin-bottom: -20px;">
<img style="display: inline-block; " th:src="${qrCodeBase64}" alt="QR Code"/> <img style="display: inline-block; " th:src="${qrCodeBase64}" alt="QR Code"/>
</div> </div>
</div> </div>
<div> <div style="font-weight: 700; margin-top: -20px;">
<div style="margin-top: -20px; text-align: center; font-weight: 700;">-----------------------------------------------------------------------------</div> <div style="margin-top: -40px; text-align: center; ">-----------------------------------------------------------------------------</div>
<div style="font-size: 28px;margin-left: 59px; font-weight: 700;">备注(REFERENCE):凭此条退费,请妥善保管!</div> <div style="font-size: 32px;margin-left: 59px; ">备注:凭此条退费,请妥善保管!</div>
<div style="font-size: 28px;margin-left: 59px;">&ensp;&ensp;号:<span th:text="${terminalNumber}"></span></div> <div style="font-size: 32px;margin-left: 59px;">&ensp;&ensp;号:<span th:text="${terminalNumber}"></span></div>
<div style="font-size: 28px;margin-left: 59px;">打印时间:<span th:text="${printTime}"></span></div> <div style="font-size: 32px;margin-left: 59px;">打印时间:<span th:text="${printTime}"></span></div>
</div> </div>
</div> </div>
</body> </body>