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"));