发票打印模版小调整
This commit is contained in:
parent
f2615eb96f
commit
0124099ef0
@ -216,8 +216,6 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
|
||||
|
||||
String sn="922441475";
|
||||
|
||||
// ProductSimpleInfo order1 = new ProductSimpleInfo("6970448170051","aaaaaaaaaaaaaaaaaa",124, "12.45");
|
||||
// ProductSimpleInfo order2 = new ProductSimpleInfo("6970448170052","哇哈哈纯净水",24, "26.45");
|
||||
ProductSimpleInfo order1 = new ProductSimpleInfo("6970448170051","可口可乐CocaCola经典美味汽水1.25L/瓶",110, "1000.45");
|
||||
ProductSimpleInfo order2 = new ProductSimpleInfo("6970448170053","排骨约350g(默认砍小块)",1, "150.13");
|
||||
ProductSimpleInfo order3 = new ProductSimpleInfo("6970448170054","新鲜虫草花1包 约200g", 11,"687.25");
|
||||
@ -235,17 +233,17 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
|
||||
|
||||
StringBuilder cont= new StringBuilder();
|
||||
cont.append("<CB>小发同城</CB><BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("<CB>#000"+DateTimeUtils.formatDateTime(now,"ddHHmm")+"</CB><BR>");
|
||||
// cont.append("<B>买家备注:不用敲门,放在门口旁边的外卖箱,打个电话告知送达就行,谢谢</B><BR>");
|
||||
// cont.append("<BOLD>配送时间:2024-10-25 14:00-14:30</BOLD><BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("订单编号:ES20231026111444527685<BR>");
|
||||
// cont.append("订单来源:微信小程序<BR>");
|
||||
// cont.append("支付方式:微信支付<BR>");
|
||||
// cont.append("配送来源:同城配送<BR>");
|
||||
// cont.append("付款时间:"+currentDateTime+"<BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("<CB>#000"+DateTimeUtils.formatDateTime(now,"ddHHmm")+"</CB><BR>");
|
||||
cont.append("<L>买家备注:不用敲门,放在门口旁边的外卖箱,打个电话告知送达就行,谢谢</L><BR>");
|
||||
cont.append("<BOLD>配送时间:2024-10-25 14:00-14:30</BOLD><BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("订单编号:ES20231026111444527685<BR>");
|
||||
cont.append("订单来源:微信小程序<BR>");
|
||||
cont.append("支付方式:微信支付<BR>");
|
||||
cont.append("配送来源:同城配送<BR>");
|
||||
cont.append("付款时间:"+currentDateTime+"<BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
|
||||
// cont.append("<BOLD>商品名称 数量 <RIGHT>金额</RIGHT><BOLD><BR>");
|
||||
// cont.append("<BOLD>可口可乐Coca_Cola<BR>经典美味汽水1.25L/瓶</BOLD> <RIGHT><BOLD>【x1】</BOLD> <BOLD>5.54</BOLD></RIGHT><BR>");
|
||||
@ -263,24 +261,24 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
|
||||
// 商品列表
|
||||
cont.append(productsStr);
|
||||
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("商品总件数:<BOLD>3</BOLD><BR>");
|
||||
// cont.append("商品总额:<BOLD>¥18.7</BOLD><BR>");
|
||||
// cont.append("押金:<BOLD>¥500</BOLD><BR>");
|
||||
// cont.append("运费:<BOLD>¥5.54</BOLD><BR>");
|
||||
// cont.append("会员权益:<BOLD>-¥50</BOLD><BR>");
|
||||
// cont.append("秒杀:<BOLD>-¥100</BOLD><BR>");
|
||||
// cont.append("实付金额:<BOLD>¥428.9元</BOLD><BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("<BOLD>商家备注:老顾客赠送一箱牛奶;玻璃瓶包装轻拿轻放</BOLD><BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("<BOLD>收货人:张三</BOLD><BR>");
|
||||
// cont.append("<BOLD>收货人手机号:13128778765</BOLD><BR>");
|
||||
// cont.append("<BOLD>收货地址:北京市朝阳区朝阳路朝阳人民小区1号楼1栋1101</BOLD><BR>");
|
||||
// cont.append("--------------------------------<BR>");
|
||||
// cont.append("门店:岛内价生活超市<BR>");
|
||||
// cont.append("门店电话:<BOLD>13665822542</BOLD><BR>");
|
||||
// cont.append("收银员:李小璐<BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("商品总件数:<BOLD>3</BOLD><BR>");
|
||||
cont.append("商品总额:<BOLD>¥18.7</BOLD><BR>");
|
||||
cont.append("押金:<BOLD>¥500</BOLD><BR>");
|
||||
cont.append("运费:<BOLD>¥5.54</BOLD><BR>");
|
||||
cont.append("会员权益:<BOLD>-¥50</BOLD><BR>");
|
||||
cont.append("秒杀:<BOLD>-¥100</BOLD><BR>");
|
||||
cont.append("实付金额:<BOLD>¥428.9元</BOLD><BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("<BOLD>商家备注:老顾客赠送一箱牛奶;玻璃瓶包装轻拿轻放</BOLD><BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("<BOLD>收货人:张三</BOLD><BR>");
|
||||
cont.append("<BOLD>收货人手机:13128778765</BOLD><BR>");
|
||||
cont.append("<BOLD>收货地址:北京市朝阳区朝阳路朝阳人民小区1号楼1栋1101</BOLD><BR>");
|
||||
cont.append("--------------------------------<BR>");
|
||||
cont.append("门店:岛内价生活超市<BR>");
|
||||
cont.append("门店电话:<BOLD>13665822542</BOLD><BR>");
|
||||
cont.append("收银员:李小璐<BR>");
|
||||
|
||||
feieUtil.printContent(sn,cont.toString());
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ public class FeieUtil {
|
||||
*/
|
||||
public String genProductStr(List<ProductSimpleInfo> productList, int titleLen, int numLen, int amountLen) {
|
||||
String resultStr = "";
|
||||
resultStr += "<L>商品名称 数量 金额</L><BR>";
|
||||
resultStr += "<L>商品名称 数量 金额</L><BR>";
|
||||
resultStr += "--------------------------------<BR>";
|
||||
for (int i = 0; i < productList.size(); i++) {
|
||||
String product_sn = productList.get(i).getProduct_sn();
|
||||
@ -271,7 +271,7 @@ public class FeieUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 中英文混合的标题加空格
|
||||
* 给商品标题(中英文混合的标题)后面补充空格
|
||||
*
|
||||
* @param str
|
||||
* @param len
|
||||
@ -286,24 +286,7 @@ public class FeieUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归函数,字符串超长,自动换行
|
||||
*
|
||||
* @param length
|
||||
* @param string
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getStringByEnter(int length, String string) throws Exception {
|
||||
for (int i = 1; i <= string.length(); i++) {
|
||||
if (asciiByteLen(string.substring(0, i)) > length) {
|
||||
return string.substring(0, i - 1) + "<BR>" + getStringByEnter(length, string.substring(i - 1));
|
||||
}
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给字符串前后补充空格,足够size长度,一般用在 数量和价格
|
||||
* 给字符串前后补充空格,指定到size长度,一般用在数量和价格
|
||||
*
|
||||
* @param str
|
||||
* @param size 额定字节数
|
||||
@ -337,6 +320,25 @@ public class FeieUtil {
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归函数,字符串超长,自动换行
|
||||
*
|
||||
* @param length
|
||||
* @param string
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getStringByEnter(int length, String string) throws Exception {
|
||||
for (int i = 1; i <= string.length(); i++) {
|
||||
if (asciiByteLen(string.substring(0, i)) > length) {
|
||||
return string.substring(0, i - 1) + "<BR>" + getStringByEnter(length, string.substring(i - 1));
|
||||
}
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断字符串是否为英文
|
||||
*
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -430,7 +430,7 @@
|
||||
<properties>
|
||||
<spring.profile>prod</spring.profile>
|
||||
<!-- Docker 远程管理地址全局-->
|
||||
<docker.host>https://42.194.196.179:2375</docker.host>
|
||||
<docker.host>https://42.194.196.179:2375888</docker.host>
|
||||
<!-- nacos配置 -->
|
||||
<nacos.server.address>172.16.0.11:8848</nacos.server.address>
|
||||
<nacos.namespace>public</nacos.namespace>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user