From fc611e2b22cd0c8906b3a487c03cae761972852e Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 20 Nov 2023 10:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hai/config/SpPrinterTemplate.java | 4 ++-- .../src/main/java/com/hai/config/ZkcPrinterTemplate.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java b/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java index d2b3aecc..032c3345 100644 --- a/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java +++ b/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java @@ -77,7 +77,7 @@ public class SpPrinterTemplate { "------------------------------
" + "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + "支付时间:" + payTime + "
" + - "电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" + + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + "油枪:"+ gunNo + "号
" + "油品:" + oilNo + "#
" + @@ -122,7 +122,7 @@ public class SpPrinterTemplate { "------------------------------
" + "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + "支付时间:" + payTime + "
" + - "电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" + + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + "油枪:"+ gunNo + "号
" + "油品:" + oilNo + "#
" + diff --git a/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java b/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java index b85b8668..ea5f3f6f 100644 --- a/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java +++ b/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java @@ -153,7 +153,7 @@ public class ZkcPrinterTemplate { stream.write(("支付时间:" + payTime).getBytes("UTF-8")); stream.write(0x0A); - stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8")); + stream.write(("电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"")).getBytes("UTF-8")); stream.write(0x0A); stream.write(("来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")).getBytes("UTF-8")); @@ -257,7 +257,7 @@ public class ZkcPrinterTemplate { stream.write(("支付时间:" + payTime).getBytes("UTF-8")); stream.write(0x0A); - stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8")); + stream.write(("电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"")).getBytes("UTF-8")); stream.write(0x0A); stream.write("来源:嗨森逛".getBytes("UTF-8"));