From 999a9f6af767932ebadcc552a59b37bff2666b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Mon, 9 Dec 2024 10:10:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A5=A8=E6=89=93=E5=8D=B0bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rabbit/PrintMechineConsumer.java | 18 +++++++++++++++--- .../rabbit/print/FeiPrinter.java | 13 +++++++++++-- .../rabbit/print/YxyPrinter.java | 7 ++++++- .../service/CloudPrinterService.java | 18 +++++++++++++++--- .../cashierservice/util/FeieyunPrintUtil.java | 12 ++++++------ .../cashierservice/util/PrinterUtils.java | 4 +++- .../resources/mapper/TbOrderInfoMapper.xml | 4 +++- 7 files changed, 59 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java index f8f77b0..7d5be56 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java @@ -259,12 +259,16 @@ public class PrintMechineConsumer { if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), - "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() != null ? orderInfo.getDiscountAmount().toPlainString() : null, + "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() != null ? orderInfo.getDiscountRatio().toPlainString() : null); // OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList); detailPO.setOutNumber(orderInfo.getOutNumber()); @@ -616,13 +620,17 @@ public class PrintMechineConsumer { if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { // OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList); BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", ObjectUtil.isEmpty(orderInfo.getMasterId()) || ObjectUtil.isNull(orderInfo.getMasterId()) ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, orderInfo.getPayType(), "0", - detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), + detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); String printType = "退款单"; @@ -680,7 +688,11 @@ public class PrintMechineConsumer { } if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); - OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); + OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); String printType = "结算单"; if ("return".equals(orderInfo.getOrderType())) { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java index 0f7a054..76c800a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/FeiPrinter.java @@ -1,6 +1,7 @@ package com.chaozhanggui.system.cashierservice.rabbit.print; import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; @@ -81,12 +82,16 @@ public class FeiPrinter extends PrinterHandler { protected void returnOrderPrint(TbOrderInfo orderInfo, TbPrintMachine machine, String balance, List detailList) { TbShopInfo shopInfo = mpShopInfoMapper.selectById(orderInfo.getShopId()); BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), - "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); + "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); String printType = "退款单"; log.error("打印数据3>>>>>>>>>>>>>>>>>>>>>>>>: {}", JSON.toJSONString(detailPO)); String printerNum = "1"; @@ -102,12 +107,16 @@ public class FeiPrinter extends PrinterHandler { protected void normalOrderPrint(TbOrderInfo orderInfo, TbPrintMachine machine, String balance, List detailList) { TbShopInfo shopInfo = mpShopInfoMapper.selectById(orderInfo.getShopId()); BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), - "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); + "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); String printType = "结算单"; log.error("打印数据1>>>>>>>>>>>>>>>>>>>>>>>>: {}", JSON.toJSONString(detailPO)); String printerNum = "1"; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java index 214ddf7..fca35e1 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/print/YxyPrinter.java @@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.rabbit.print; import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -110,12 +111,16 @@ public class YxyPrinter extends PrinterHandler { protected void normalOrderPrint(TbOrderInfo orderInfo, TbPrintMachine machine, String balance, List detailList) { TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId())); BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", getPickupNum(orderInfo), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), - "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() != null ? orderInfo.getDiscountAmount().toPlainString() : null, + "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() != null ? orderInfo.getDiscountRatio().toPlainString() : null); detailPO.setOutNumber(orderInfo.getOutNumber()); String printType = "结算单"; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java index ec123e0..5b91147 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java @@ -298,11 +298,15 @@ public class CloudPrinterService { if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { // OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList); BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", ObjectUtil.isEmpty(orderInfo.getMasterId()) || ObjectUtil.isNull(orderInfo.getMasterId()) ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, orderInfo.getPayType(), "0", - detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); + detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); detailPO.setOutNumber(orderInfo.getOutNumber()); String printType = "退款单"; @@ -371,12 +375,16 @@ public class CloudPrinterService { } if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), "0", - detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() != null ? orderInfo.getDiscountAmount().toPlainString() : null, orderInfo.getDiscountRatio() != null ? orderInfo.getDiscountRatio().toPlainString() : null); + detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() != null ? orderInfo.getDiscountRatio().toPlainString() : null); String printType = "结算单"; detailPO.setOutNumber(orderInfo.getOutNumber()); @@ -492,12 +500,16 @@ public class CloudPrinterService { } if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) { BigDecimal originAmount = detailList.stream().map(obj -> Convert.toBigDecimal(obj.getAmount())).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal discountAmount = NumberUtil.null2Zero(orderInfo.getDiscountAmount()); + BigDecimal fullCouponDiscountAmount = NumberUtil.null2Zero(orderInfo.getFullCouponDiscountAmount()); + BigDecimal pointsDiscountAmount = NumberUtil.null2Zero(orderInfo.getPointsDiscountAmount()); + String totalDiscountAmount = NumberUtil.add(discountAmount, fullCouponDiscountAmount, pointsDiscountAmount).toPlainString(); OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getOrderType().equals("miniapp") ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", originAmount.toPlainString(), balance, (ObjectUtil.isEmpty(orderInfo.getPayType()) || ObjectUtil.isNull(orderInfo.getPayType()) ? "" : orderInfo.getPayType()), - "0", detailList, orderInfo.getRemark(), orderInfo.getDiscountAmount() == null ? null : orderInfo.getDiscountAmount().toPlainString(), orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); + "0", detailList, orderInfo.getRemark(), totalDiscountAmount, orderInfo.getDiscountRatio() == null ? null : orderInfo.getDiscountRatio().toPlainString()); String printType = "结算单"; if (ispre) { printType = "预结算单"; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java index 5ebd8fe..ea989d6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java @@ -134,7 +134,7 @@ public class FeieyunPrintUtil { for (int i = 0; i < subItems.size(); i++) { String proName = subItems.getJSONObject(i).getStr("proName"); int qty = subItems.getJSONObject(i).getInt("number"); - builder.append("("+(i+1)+")"+proName + " x " + qty + "
"); + builder.append("(" + (i + 1) + ")" + proName + " x " + qty + "
"); } } @@ -258,7 +258,7 @@ public class FeieyunPrintUtil { for (int i = 0; i < subItems.size(); i++) { String proName = subItems.getJSONObject(i).getStr("proName"); int qty = subItems.getJSONObject(i).getInt("number"); - String subRow = FeieYunUtil.getRow(" - "+proName, "", qty+".00", "0.00", 20, 0, 3, 6); + String subRow = FeieYunUtil.getRow(" - " + proName, "", qty + ".00", "0.00", 20, 0, 3, 6); data.append(subRow); } } @@ -282,7 +282,7 @@ public class FeieyunPrintUtil { } data.append(StrUtil.format("余额:{}
", toPlainStr(detailPO.getBalance()))); data.append("--------------------------------
"); - if (ObjectUtil.isNotEmpty(detailPO.getRemark()) && ObjectUtil.isNotNull(detailPO.getRemark())) { + if (StrUtil.isNotBlank(detailPO.getRemark())) { data.append(StrUtil.format("备注:{}
", detailPO.getRemark())); } data.append("打印时间:" + DateUtils.getTime(new Date()) + "
"); @@ -525,7 +525,7 @@ public class FeieyunPrintUtil { public static void testPrint() { String STIME = String.valueOf(System.currentTimeMillis() / 1000); - String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽",""); + String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽", ""); Map paramMap = new HashMap<>(); // 参考文档:https://help.feieyun.com/home/doc/zh;nav=0-2 paramMap.put("user", USER); @@ -548,7 +548,7 @@ public class FeieyunPrintUtil { */ public static void testPrint2() { String STIME = String.valueOf(System.currentTimeMillis() / 1000); - String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽",""); + String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽", ""); Map paramMap = new HashMap<>(); // 参考文档:https://help.feieyun.com/home/doc/zh;nav=0-2 paramMap.put("user", USER); @@ -568,7 +568,7 @@ public class FeieyunPrintUtil { */ public static void testPrint3() { String STIME = String.valueOf(System.currentTimeMillis() / 1000); - String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽",""); + String content = buildPrintContent("123456789", "2024-10-10 18:11:11", "澳洲大龙虾", 1, "一只吃爽爽", ""); Map paramMap = new HashMap<>(); // 参考文档:https://help.feieyun.com/home/doc/zh;nav=0-2 paramMap.put("user", USER); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java index f0dd315..651d5b4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java @@ -178,7 +178,9 @@ public class PrinterUtils { } data.append(StrUtil.format("余额:{}
", toPlainStr(detailPO.getBalance()))); data.append("--------------------------------
"); - data.append(StrUtil.format("备注:{}
", detailPO.getRemark())); + if (StrUtil.isNotBlank(detailPO.getRemark())) { + data.append(StrUtil.format("备注:{}
", detailPO.getRemark())); + } if (Objects.nonNull(detailPO.getOutNumber())) { data.append("".concat(detailPO.getOutNumber()).concat("
")); } diff --git a/src/main/resources/mapper/TbOrderInfoMapper.xml b/src/main/resources/mapper/TbOrderInfoMapper.xml index 035d19b..11dc85e 100644 --- a/src/main/resources/mapper/TbOrderInfoMapper.xml +++ b/src/main/resources/mapper/TbOrderInfoMapper.xml @@ -48,6 +48,8 @@ + + @@ -57,7 +59,7 @@ discount_amount, table_id, small_change, send_type, order_type, product_type, status, billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score, user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group, - updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,remark,master_id,`table_name`,out_number, use_type + updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,remark,master_id,`table_name`,out_number, use_type, full_coupon_discount_amount, points_discount_amount