Merge remote-tracking branch 'origin/1.0' into 1.0

# Conflicts:
#	pom.xml
This commit is contained in:
萧道子 2025-03-26 14:39:54 +08:00
commit 58c1975b05
4 changed files with 247 additions and 162 deletions

View File

@ -60,7 +60,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(value = NullPointerException.class)
public Result<String> nullPointException(NullPointerException nullPointerException) {
log.error("空指针异常类型: {},信息: {}", nullPointerException.getClass(),nullPointerException.getMessage());
log.error("空指针异常类型: {},信息: {}", nullPointerException.getClass(), nullPointerException);
return Result.error(ErrorEnum.NULL_POINTER_EXCEPTION);
}
@ -86,7 +86,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(value = HttpMessageNotReadableException.class)
public Result<String> httpMessageNotReadAbleException(HttpMessageNotReadableException e){
log.warn("异常类型: {} 无可读信息: {}", e.getClass(), e.getMessage());
log.warn("异常类型: {} 无可读信息: ", e.getClass(), e);
return Result.error(ErrorEnum.HTTP_MESSAGE_NOT_READABLE_EXCEPTION);
}
@ -97,7 +97,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(value = RuntimeException.class)
public Result<String> runtimeException(RuntimeException e){
log.error("运行时异常:{}", e.getMessage());
log.error("运行时异常:", e);
if (e instanceof RRException){
RRException rrException = (RRException) e;
return Result.error(rrException.getCode(), rrException.getMsg());
@ -111,7 +111,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
public Result<String> httpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e){
log.warn("暂不支持该请求: {}", e.getMessage());
log.warn("暂不支持该请求: ", e);
return Result.error("暂不支持此请求方式");
}
@ -121,7 +121,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
public Result<String> methodArgument(MethodArgumentTypeMismatchException e){
log.warn("参数发生错误: {}", e.getMessage());
log.warn("参数发生错误: ", e);
return Result.error("参数发生错误");
}
@ -132,7 +132,7 @@ public class ControllerAdvice {
*/
@ExceptionHandler(MissingServletRequestParameterException.class)
public Result<String> exception(MissingServletRequestParameterException e){
log.warn("缺少请求参数: {}", e.getMessage());
log.warn("缺少请求参数: ", e);
return Result.error("缺少请求参数");
}

View File

@ -51,6 +51,13 @@ public class RegisterServiceImpl implements PrintService {
width = FIXED_WIDTH;
}
if ( StringUtils.isEmpty(printerConfig.getTimeType())){
throw new RRException("获取打印时间格式出错:" + printerConfig.getTimeType());
}
if ( StringUtils.isEmpty(printerConfig.getTerminalNumber())){
throw new RRException("获取终端号出错:" + printerConfig.getTerminalNumber());
}
// 强行设置终端号
data.put("terminalNumber", printerConfig.getTerminalNumber());
@ -129,8 +136,8 @@ public class RegisterServiceImpl implements PrintService {
int pieceHeight = Math.min(MAX_HEIGHT, height - startY);
// 创建一个新的 BufferedImage 对象用于存储切割的部分
BufferedImage piece = new BufferedImage(FIXED_WIDTH, pieceHeight, BufferedImage.TYPE_INT_RGB);
piece.getGraphics().drawImage(originalImage, 0, 0, FIXED_WIDTH, pieceHeight, 0, startY, FIXED_WIDTH, startY + pieceHeight, null);
BufferedImage piece = new BufferedImage(width, pieceHeight, BufferedImage.TYPE_INT_RGB);
piece.getGraphics().drawImage(originalImage, 0, 0, width, pieceHeight, 0, startY, width, startY + pieceHeight, null);
// 保存切割的图片块
File outputFile = new File(saveDir + "/output_" + (i + 1) + ".jpg");

View File

@ -3,183 +3,73 @@
<head>
<meta charset="UTF-8">
<title>门诊缴费凭证</title>
<style>
.bold-text {
font-weight: 700;
}
.text-35 {
font-size: 35px;
}
.text-30 {
font-size: 30px;
}
.center-text {
text-align: center;
}
.margin-top-10 {
margin-top: 10px;
}
.margin-top-40 {
margin-top: 40px;
}
.header-title {
font-size: 28px;
}
.header-terminal {
font-size: 38px;
margin-top: 20px;
}
.header-receipt {
font-size: 38px;
margin-top: 10px;
}
.divider {
text-align: center;
font-weight: 700;
font-size: 32px;
}
.patient-info {
font-size: 35px;
margin: 10px 20px;
}
.patient-info .info-item {
flex: 1;
}
.patient-info .info-row {
display: flex;
}
.payment-info {
font-size: 35px;
margin: 10px 20px;
}
.payment-info .info-item {
flex: 1;
}
.payment-info .info-row {
display: flex;
}
.table-container {
margin: 10px 20px;
}
.table-container table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.table-container .first-th {
width: 300px;
text-align: left;
}
.table-container .df-th {
width: calc(25% - 5px);
text-align: center;
}
.table-container .first-td {
text-align: left;
width: 300px;
word-break: break-all;
}
.table-container .df-td {
text-align: center;
}
.terminal-info {
margin-left: 20px;
font-weight: 700;
font-size: 35px;
}
.tips {
margin-left: 20px;
font-size: 35px;
font-weight: 700;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="bold-text">
<div class="center-text margin-top-40">
<div><span class="header-title">******<span th:text="${hospitalName}"></span>******</span></div>
<div class="header-terminal"><span th:text="${registeTerminalName}"></span></div>
<div class="header-receipt"><span th:text="${registeType}"></span></div>
<div style="font-weight: 700;">
<div style="text-align: center;margin-top: 40px;">
<div><span style="font-size: 28px;">******<span th:text="${hospitalName}"></span>******</span></div>
<div style="font-size: 38px; margin-top: 20px;"><span th:text="${registeTerminalName}"></span></div>
<div style="font-size: 38px; margin-top: 10px;"><span th:text="${registeType}"></span></div>
</div>
<div class="divider">
<div style="text-align: center; font-size: 32px;">
-----------------------------------------------------------------------------
</div>
<div class="patient-info">
<div class="info-row">
<div class="info-item">姓名:<span th:text="${name}"></span></div>
<div class="info-item">性别:<span th:text="${gender}"></span></div>
<div class="info-item">年龄:<span th:text="${age}"></span></div>
<div style="font-size: 35px; margin: 10px 20px">
<div style="display: flex">
<div style="width: 38.3%;word-break: break-all;">
<span>姓名:</span><span th:text="${name}"></span>
</div>
<div style="width: 28.3%;word-break: break-all;"><span>性别:</span><span th:text="${gender}"></span></div>
<div style="width: 33.3%;word-break: break-all;"><span>年龄:</span><span th:text="${age}"></span></div>
</div>
<div class="info-row margin-top-10">
<div class="info-item" th:if="${outpatientNumber}">门诊号:<span th:text="${outpatientNumber}"></span></div>
<div class="info-item" th:if="${doctor}">就诊医生:<span th:text="${doctor}"></span></div>
<div style="display: flex;margin-top: 10px;">
<div style="width: 50%;word-break: break-all;" th:if="${outpatientNumber}">
<span>门诊号:</span><span th:text="${outpatientNumber}"></span></div>
<div style="width: 50%;word-break: break-all;" th:if="${doctor}">
<span>就诊医生:</span><span th:text="${doctor}"></span>
</div>
</div>
<div class="margin-top-10" th:if="${department}">就诊科室:<span th:text="${department}"></span></div>
<div style="margin-top: 10px;" th:if="${department}"><span>就诊科室:</span><span th:text="${department}"></span></div>
</div>
<div class="divider">
<div style="text-align: center; font-size: 32px;">
-----------------------------------------------------------------------------
</div>
<div class="payment-info">
<div class="info-row">
<div class="info-item">费用总额:<span th:text="${totalFee}"></span></div>
<div class="info-item">个人支付:<span th:text="${personalPayment}"></span></div>
<div style="font-size: 35px; margin: 10px 20px">
<div style="display: flex;">
<div style="flex: 1;"><span>费用总额:</span><span th:text="${totalFee}"></span></div>
<div style="flex: 1;"><span>个人支付:</span><span th:text="${personalPayment}"></span></div>
</div>
<div class="margin-top-10">实收金额:<span th:text="${actualReceiptAmount}"></span></div>
<div class="margin-top-10">实收金额:<span th:text="${actualReceiptAmountChinese}"></span></div>
<div style="margin-top: 10px;"><span>实收金额:</span><span th:text="${actualReceiptAmount}"></span></div>
<div style="margin-top: 10px;"><span>实收金额:</span><span th:text="${actualReceiptAmountChinese}"></span></div>
</div>
<div class="divider">
<div style="text-align: center; font-size: 32px;">
-----------------------------------------------------------------------------
</div>
<div class="table-container">
<table>
<tr class="text-35">
<th class="first-th">项目名称</th>
<th class="df-th">数量</th>
<th class="df-th">单价</th>
<th class="df-th">小计</th>
<div style="margin: 10px 20px">
<table style="width: 100%; table-layout: fixed; border-collapse: collapse;">
<tr style="font-size: 35px;">
<th style="width: 300px;text-align: left;">项目名称</th>
<th style="width: calc(25% - 5px);text-align: center;">数量</th>
<th style="width: calc(25% - 5px);text-align: center;">单价</th>
<th style="width: calc(25% - 5px);text-align: center;">小计</th>
</tr>
<tr class="text-30" th:each="item : ${items}">
<td class="first-td" th:text="${item.name}"></td>
<td class="df-td" th:text="${item.quantity}"></td>
<td class="df-td" th:text="${item.unitPrice}"></td>
<td class="df-td" th:text="${item.subtotal}"></td>
<tr style="font-size: 30px;" th:each="item : ${items}">
<td style="text-align: left;width: 300px;word-break: break-all;" th:text="${item.name}"></td>
<td style="text-align: center;" th:text="${item.quantity}"></td>
<td style="text-align: center;" th:text="${item.unitPrice}"></td>
<td style="text-align: center;" th:text="${item.subtotal}"></td>
</tr>
</table>
</div>
<div class="divider">
<div style="text-align: center; font-weight: 700; font-size: 32px;">
-----------------------------------------------------------------------------
</div>
<div class="terminal-info">
<div style="margin-left: 20px; font-weight: 700; font-size: 35px;">
<div>终端编号:<span th:text="${terminalNumber}"></span></div>
<div>打印时间:<span th:text="${printTime}"></span></div>
</div>
<div class="tips">
<span>温馨提示</span><br>
<div style="margin-left: 20px; font-size: 35px; font-weight: 700; margin-top: 20px;">
<span style="margin-top: 20px;">温馨提示</span><br>
<span>1.请取走全部凭条、并妥善保管</span><br>
<span>2.如果对缴费结算存在疑问,请到人工窗口咨询</span>
</div>

View File

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<meta charset="UTF-8">
<title>门诊缴费凭证</title>
<style>
.bold-text {
font-weight: 700;
}
.text-35 {
font-size: 35px;
}
.text-30 {
font-size: 30px;
}
.center-text {
text-align: center;
}
.margin-top-10 {
margin-top: 10px;
}
.margin-top-40 {
margin-top: 40px;
}
.header-title {
font-size: 28px;
}
.header-terminal {
font-size: 38px;
margin-top: 20px;
}
.header-receipt {
font-size: 38px;
margin-top: 10px;
}
.divider {
text-align: center;
font-weight: 700;
font-size: 32px;
}
.patient-info {
font-size: 35px;
margin: 10px 20px;
}
.patient-info .info-item {
flex: 1;
}
.patient-info .info-row {
display: flex;
}
.payment-info {
font-size: 35px;
margin: 10px 20px;
}
.payment-info .info-item {
flex: 1;
}
.payment-info .info-row {
display: flex;
}
.table-container {
margin: 10px 20px;
}
.table-container table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.table-container .first-th {
width: 300px;
text-align: left;
}
.table-container .df-th {
width: calc(25% - 5px);
text-align: center;
}
.table-container .first-td {
text-align: left;
width: 300px;
word-break: break-all;
}
.table-container .df-td {
text-align: center;
}
.terminal-info {
margin-left: 20px;
font-weight: 700;
font-size: 35px;
}
.tips {
margin-left: 20px;
font-size: 35px;
font-weight: 700;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="bold-text">
<div class="center-text margin-top-40">
<div><span class="header-title">******<span th:text="${hospitalName}"></span>******</span></div>
<div class="header-terminal"><span th:text="${registeTerminalName}"></span></div>
<div class="header-receipt"><span th:text="${registeType}"></span></div>
</div>
<div class="divider">
-----------------------------------------------------------------------------
</div>
<div class="patient-info">
<div class="info-row">
<div class="info-item">姓名:<span th:text="${name}"></span></div>
<div class="info-item">性别:<span th:text="${gender}"></span></div>
<div class="info-item">年龄:<span th:text="${age}"></span></div>
</div>
<div class="info-row margin-top-10">
<div class="info-item" th:if="${outpatientNumber}">门诊号:<span th:text="${outpatientNumber}"></span></div>
<div class="info-item" th:if="${doctor}">就诊医生:<span th:text="${doctor}"></span></div>
</div>
<div class="margin-top-10" th:if="${department}">就诊科室:<span th:text="${department}"></span></div>
</div>
<div class="divider">
-----------------------------------------------------------------------------
</div>
<div class="payment-info">
<div class="info-row">
<div class="info-item">费用总额:<span th:text="${totalFee}"></span></div>
<div class="info-item">个人支付:<span th:text="${personalPayment}"></span></div>
</div>
<div class="margin-top-10">实收金额:<span th:text="${actualReceiptAmount}"></span></div>
<div class="margin-top-10">实收金额:<span th:text="${actualReceiptAmountChinese}"></span></div>
</div>
<div class="divider">
-----------------------------------------------------------------------------
</div>
<div class="table-container">
<table>
<tr class="text-35">
<th class="first-th">项目名称</th>
<th class="df-th">数量</th>
<th class="df-th">单价</th>
<th class="df-th">小计</th>
</tr>
<tr class="text-30" th:each="item : ${items}">
<td class="first-td" th:text="${item.name}"></td>
<td class="df-td" th:text="${item.quantity}"></td>
<td class="df-td" th:text="${item.unitPrice}"></td>
<td class="df-td" th:text="${item.subtotal}"></td>
</tr>
</table>
</div>
<div class="divider">
-----------------------------------------------------------------------------
</div>
<div class="terminal-info">
<div>终端编号:<span th:text="${terminalNumber}"></span></div>
<div>打印时间:<span th:text="${printTime}"></span></div>
</div>
<div class="tips">
<span>温馨提示</span><br>
<span>1.请取走全部凭条、并妥善保管</span><br>
<span>2.如果对缴费结算存在疑问,请到人工窗口咨询</span>
</div>
</div>
</body>
</html>