From 0a1c95a276695d09e14a8acf22e8b6520d18ad75 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 2 Apr 2026 17:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/order/print/PrinterHandler.java | 4 +- .../czg/service/order/print/PrinterImpl.java | 41 +++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterHandler.java b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterHandler.java index dca6528b3..7a858a20e 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterHandler.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterHandler.java @@ -705,8 +705,10 @@ public abstract class PrinterHandler { .subtract(orderInfo.getDiscountAllAmount()).setScale(2, RoundingMode.HALF_UP).toPlainString()); if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) { - printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString()); + printInfoDTO.setSeatNum(orderInfo.getSeatNum()+"人"); printInfoDTO.setSeatAmount(orderInfo.getSeatAmount().divide(BigDecimal.valueOf(orderInfo.getSeatNum()), 2, RoundingMode.DOWN).toPlainString()); + }else { + printInfoDTO.setSeatNum(""); } if (orderInfo.getPackFee().compareTo(BigDecimal.ZERO) > 0) { printInfoDTO.setPackFee(orderInfo.getPackFee().toPlainString()); diff --git a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterImpl.java b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterImpl.java index f0e1a6e4d..5efc1894d 100644 --- a/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterImpl.java +++ b/cash-service/order-service/src/main/java/com/czg/service/order/print/PrinterImpl.java @@ -234,17 +234,17 @@ public interface PrinterImpl { data.append(getFormatLabel(printInfoDTO.getShopName(), signLabelInfo.s, signLabelInfo.center)).append(signLabelInfo.br); data.append(getFormatLabel(printInfoDTO.getPrintTitle(), signLabelInfo.s, signLabelInfo.center)).append(signLabelInfo.br); data.append(getFormatLabel(StrUtil.format("桌台号: {}", printInfoDTO.getPickupNum()), signLabelInfo.f)).append(signLabelInfo.br); - data.append(getFormatLabel(getFormatLabel(StrUtil.format("{} {}人", printInfoDTO.getPrintType(), printInfoDTO.getSeatNum())), signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel(getFormatLabel(StrUtil.format("{} {}", printInfoDTO.getPrintType(), printInfoDTO.getSeatNum())), signLabelInfo.s)).append(signLabelInfo.br); if (StrUtil.isNotBlank(printInfoDTO.getTradeDate())) { data.append(getFormatLabel(StrUtil.format("结账时间:{}", printInfoDTO.getTradeDate()), signLabelInfo.s)).append(signLabelInfo.br); } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel("品名 单价 数量 ", signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel("品名 单价 数量 ", signLabelInfo.s)).append(signLabelInfo.br); for (OrderDetail detail : detailList) { String number = detail.getNum().stripTrailingZeros().toPlainString(); String row = getRow(detail.getProductName(), toPlainStr(detail.getUnitPrice().toPlainString()), number, toPlainStr(detail.getPayAmount().toPlainString()) - , 21, 0, 5, 6); + , 18, 0, 5, 6); data.append(row); if (StrUtil.isNotBlank(detail.getSkuName())) { data.append(getFormatLabel(StrUtil.format("规格:{}", detail.getSkuName()), signLabelInfo.s)) @@ -280,28 +280,27 @@ public interface PrinterImpl { } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) .append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("原价: {}", toPlainStr(printInfoDTO.getOriginalAmount())), signLabelInfo.s)) + data.append(getFormatLabel(StrUtil.format("原价: {}", toPlainStr(printInfoDTO.getOriginalAmount())), signLabelInfo.s)) .append(signLabelInfo.br); if (ObjectUtil.isNotNull(printInfoDTO.getDiscountAmount())) { - data.append(getFormatLabel(StrUtil.format("优惠金额: -{}", toPlainStr(printInfoDTO.getDiscountAmount())), signLabelInfo.s)) + data.append(getFormatLabel(StrUtil.format("优惠金额: -{}", toPlainStr(printInfoDTO.getDiscountAmount())), signLabelInfo.s)) .append(signLabelInfo.br); } if (StrUtil.isNotBlank(printInfoDTO.getRemark())) { - data.append(getFormatLabel(StrUtil.format("备注:{}", printInfoDTO.getRemark()), signLabelInfo.l, signLabelInfo.bold)) - .append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("备注:{}", printInfoDTO.getRemark()), signLabelInfo.l, signLabelInfo.bold)).append(signLabelInfo.br); } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("应付金额: {}", printInfoDTO.getPayAmount()), signLabelInfo.f, signLabelInfo.bold)).append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("应付金额: {}", printInfoDTO.getPayAmount()), signLabelInfo.s, signLabelInfo.bold)).append(signLabelInfo.br); if (StrUtil.isNotBlank(printInfoDTO.getPrintTitle())) { data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("已付金额: {}", printInfoDTO.getPayAmount()), signLabelInfo.f, signLabelInfo.bold)).append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("支付方式: {}", printInfoDTO.getPayType()), signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("已付金额: {}", printInfoDTO.getPayAmount()), signLabelInfo.s, signLabelInfo.bold)).append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("支付方式: {}", printInfoDTO.getPayType()), signLabelInfo.s)).append(signLabelInfo.br); } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) .append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("操作员:{}", printInfoDTO.getOperator()), signLabelInfo.s)); - data.append(getFormatLabel(StrUtil.format("打印时间:{}", DateUtil.date().toString()), signLabelInfo.s)); + data.append(getFormatLabel(StrUtil.format("操作员:{}", printInfoDTO.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("打印时间:{}", DateUtil.date().toString()), signLabelInfo.s)).append(signLabelInfo.br); data.append(getFormatLabel(StrUtil.format("订单号:{}", printInfoDTO.getOrderNo()), signLabelInfo.s)).append(signLabelInfo.br); data.append(signLabelInfo.getOut(180)); data.append(signLabelInfo.cut); @@ -321,14 +320,14 @@ public interface PrinterImpl { data.append(getFormatLabel(printInfoDTO.getShopName(), signLabelInfo.s, signLabelInfo.center)).append(signLabelInfo.br); data.append(getFormatLabel("客看单", signLabelInfo.s, signLabelInfo.center)).append(signLabelInfo.br); data.append(getFormatLabel(StrUtil.format("桌台号: {}", printInfoDTO.getPickupNum()), signLabelInfo.f)).append(signLabelInfo.br); - data.append(getFormatLabel(getFormatLabel(StrUtil.format("{} {}人", printInfoDTO.getPrintType(), printInfoDTO.getSeatNum())), signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel(getFormatLabel(StrUtil.format("{} {}", printInfoDTO.getPrintType(), printInfoDTO.getSeatNum())), signLabelInfo.s)).append(signLabelInfo.br); data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel("品名 单价 数量 ", signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel("品名 单价 数量 ", signLabelInfo.s)).append(signLabelInfo.br); for (OrderDetail detail : detailList) { String number = detail.getNum().stripTrailingZeros().toPlainString(); String row = getRow(detail.getProductName(), toPlainStr(detail.getUnitPrice().toPlainString()), number, toPlainStr(detail.getPayAmount().toPlainString()) - , 21, 0, 5, 6); + , 18, 0, 5, 6); data.append(row); if (StrUtil.isNotBlank(detail.getSkuName())) { data.append(getFormatLabel(StrUtil.format("规格:{}", detail.getSkuName()), signLabelInfo.s)) @@ -364,10 +363,10 @@ public interface PrinterImpl { } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) .append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("原价: {}", toPlainStr(printInfoDTO.getOriginalAmount())), signLabelInfo.s)) + data.append(getFormatLabel(StrUtil.format("原价: {}", toPlainStr(printInfoDTO.getOriginalAmount())), signLabelInfo.s)) .append(signLabelInfo.br); if (ObjectUtil.isNotNull(printInfoDTO.getDiscountAmount())) { - data.append(getFormatLabel(StrUtil.format("优惠金额: -{}", toPlainStr(printInfoDTO.getDiscountAmount())), signLabelInfo.s)) + data.append(getFormatLabel(StrUtil.format("优惠金额: -{}", toPlainStr(printInfoDTO.getDiscountAmount())), signLabelInfo.s)) .append(signLabelInfo.br); } if (StrUtil.isNotBlank(printInfoDTO.getRemark())) { @@ -375,7 +374,7 @@ public interface PrinterImpl { .append(signLabelInfo.br); } data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel(StrUtil.format("应付金额:{}", printInfoDTO.getPayAmount()), signLabelInfo.f, signLabelInfo.bold)).append(signLabelInfo.br); + data.append(getFormatLabel(StrUtil.format("应付金额:{}", printInfoDTO.getPayAmount()), signLabelInfo.s, signLabelInfo.bold)).append(signLabelInfo.br); data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) .append(signLabelInfo.br); data.append(getFormatLabel(StrUtil.format("操作员:{}", printInfoDTO.getOperator()), signLabelInfo.s)); @@ -401,7 +400,7 @@ public interface PrinterImpl { data.append(getFormatLabel(StrUtil.format("桌台号: {}", printInfoDTO.getPickupNum()), signLabelInfo.f)).append(signLabelInfo.br); data.append(getFormatLabel(getFormatLabel(StrUtil.format("{} {}人", printInfoDTO.getPrintType(), printInfoDTO.getSeatNum())), signLabelInfo.s)).append(signLabelInfo.br); data.append(getFormatLabel("--------------------------------", signLabelInfo.s)).append(signLabelInfo.br); - data.append(getFormatLabel("退款明细 数量 小计 ", signLabelInfo.s)).append(signLabelInfo.br); + data.append(getFormatLabel("退款明细 数量 小计 ", signLabelInfo.s)).append(signLabelInfo.br); for (OrderDetail detail : detailList) { String number = detail.getNum().stripTrailingZeros().toPlainString(); @@ -410,7 +409,7 @@ public interface PrinterImpl { amount = detail.getReturnAmount().stripTrailingZeros().toPlainString(); } String row = getRow(detail.getProductName(), "", number, amount - , 21, 0, 5, 6); + , 18, 0, 5, 6); data.append(row); if (StrUtil.isNotBlank(detail.getSkuName())) { data.append(getFormatLabel(StrUtil.format("规格:{}", detail.getSkuName()), signLabelInfo.s)) @@ -437,7 +436,7 @@ public interface PrinterImpl { data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) .append(signLabelInfo.br); if ("退款单".equals(printInfoDTO.getPrintTitle())) { - data.append(getFormatLabel(StrUtil.format("退款总计 {}", toPlainStr(printInfoDTO.getRefundAmount())), signLabelInfo.f, signLabelInfo.bold)) + data.append(getFormatLabel(StrUtil.format("退款总计 {}", toPlainStr(printInfoDTO.getRefundAmount())), signLabelInfo.s, signLabelInfo.bold)) .append(signLabelInfo.br); data.append(getFormatLabel(StrUtil.format("退款方式:{}", toPlainStr(printInfoDTO.getRefundType())), signLabelInfo.s)) .append(signLabelInfo.br);