餐位费问题

This commit is contained in:
2026-04-03 15:33:36 +08:00
parent 9ddfeaf1b9
commit c09e600857
2 changed files with 11 additions and 11 deletions

View File

@@ -761,15 +761,20 @@ public abstract class PrinterHandler {
? orderInfo.getDiscountAllAmount().toPlainString() ? orderInfo.getDiscountAllAmount().toPlainString()
: "0.00"); : "0.00");
printInfoDTO.setSeatNum(orderInfo.getSeatNum() == null ? "" : orderInfo.getSeatNum().toString());
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
printInfoDTO.setSeatAmount(orderInfo.getSeatAmount().divide(BigDecimal.valueOf(orderInfo.getSeatNum()), 2, RoundingMode.DOWN).toPlainString());
}
if (StrUtil.isNotBlank(orderInfo.getDineMode())) { if (StrUtil.isNotBlank(orderInfo.getDineMode())) {
switch (orderInfo.getDineMode()) { switch (orderInfo.getDineMode()) {
case "dine-in" -> printInfoDTO.setPrintType("收银-堂食"); case "dine-in" -> printInfoDTO.setPrintType("收银-堂食");
case "take-out" -> printInfoDTO.setPrintType("收银-外带"); case "take-out" -> printInfoDTO.setPrintType("收银-外带");
case "take-away" -> printInfoDTO.setPrintType("收银-外卖"); case "take-away" -> printInfoDTO.setPrintType("收银-外卖");
} }
if ("dine-in".equals(orderInfo.getDineMode())) {
orderInfo.setSeatAmount(BigDecimal.ZERO);
}
} }
if (orderInfo.getStaffId() != null) { if (orderInfo.getStaffId() != null) {
ShopStaff detail = shopStaffService.getOne(new QueryWrapper().eq(ShopStaff::getId, orderInfo.getStaffId()).eq(ShopStaff::getShopId, orderInfo.getShopId())); ShopStaff detail = shopStaffService.getOne(new QueryWrapper().eq(ShopStaff::getId, orderInfo.getStaffId()).eq(ShopStaff::getShopId, orderInfo.getShopId()));
if (detail != null) { if (detail != null) {
@@ -780,10 +785,6 @@ public abstract class PrinterHandler {
} else { } else {
printInfoDTO.setOperator(""); printInfoDTO.setOperator("");
} }
printInfoDTO.setSeatNum(orderInfo.getSeatNum() == null ? "" : orderInfo.getSeatNum().toString());
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
printInfoDTO.setSeatAmount(orderInfo.getSeatAmount().divide(BigDecimal.valueOf(orderInfo.getSeatNum()), 2, RoundingMode.DOWN).toPlainString());
}
if ("结算单".equals(printTitle)) { if ("结算单".equals(printTitle)) {
if (StrUtil.isNotBlank(orderInfo.getPayType())) { if (StrUtil.isNotBlank(orderInfo.getPayType())) {
switch (orderInfo.getPayType()) { switch (orderInfo.getPayType()) {

View File

@@ -222,8 +222,7 @@ public interface PrinterImpl {
builder builder
.append(getFormatLabel("打印时间: " + DateUtil.format(DateUtil.date(), "yyyy/MM/dd HH:mm:ss"), signLabelInfo.s)).append(signLabelInfo.br) .append(getFormatLabel("打印时间: " + DateUtil.format(DateUtil.date(), "yyyy/MM/dd HH:mm:ss"), signLabelInfo.s)).append(signLabelInfo.br)
.append(signLabelInfo.getOut(180)) .append(signLabelInfo.getOut(180))
.append(signLabelInfo.cut) .append(signLabelInfo.cut);
;
return builder.toString(); return builder.toString();
} }