添加打印日志

This commit is contained in:
牛叉闪闪 2024-07-25 16:52:11 +08:00
parent 9101c788c2
commit c6f392f701
1 changed files with 134 additions and 146 deletions

View File

@ -31,6 +31,7 @@ public class PrinterUtils {
/**
* 获取TOKEN值
*
* @param timestamp 时间戳13位
* @param requestId 请求ID自定义
* @return
@ -62,6 +63,7 @@ public class PrinterUtils {
/**
* 厨房打印机
*
* @param pickupNumber
* @param date
* @param productName
@ -220,7 +222,6 @@ public class PrinterUtils {
}
if (ObjectUtil.isNotEmpty(handoverInfo.getProductInfoPOS()) && handoverInfo.getProductInfoPOS().size() > 0) {
sb.append("<S>商品数据</S><BR>");
char paddingCharacter = ' ';
@ -255,9 +256,6 @@ public class PrinterUtils {
}
sb.append("<S>快捷收款金额 :".concat(ObjectUtil.isNull(handoverInfo.getQuickAmount()) ? "0" : handoverInfo.getQuickAmount()) + "</S><BR>");
sb.append("<S>退款金额 :".concat(handoverInfo.getReturnAmount()) + "</S><BR>");
sb.append("<S>总收入: " + handoverInfo.getTotalAmount() + "</S><BR>");
@ -277,26 +275,19 @@ public class PrinterUtils {
}
public static String printInvoice(String content, String remark, String amount) {
StringBuilder sb=new StringBuilder();
sb.append("<C><QR>".concat(content.concat("</QR></C><BR>")));
sb.append("<C><BOLD>".concat(remark).concat("</BOLD></C><BR>"));
sb.append("<C><BOLD>【开票金额:".concat(amount).concat("】</BOLD></C>"));
sb.append("<OUT:200>");
sb.append("<PCUT>");
return sb.toString();
String sb = "<C><QR>".concat(content.concat("</QR></C><BR>")) +
"<C><BOLD>".concat(remark).concat("</BOLD></C><BR>") +
"<C><BOLD>【开票金额:".concat(amount).concat("】</BOLD></C>") +
"<OUT:200>" +
"<PCUT>";
return sb;
}
/**
* 打印票据
*
* @throws Exception
*/
public static void printTickets(String voiceJson, Integer actWay, Integer cn, String devName, String data) {
@ -335,8 +326,6 @@ public class PrinterUtils {
}
public static int getProducrName(String str) {
int count = 0;
for (int i = 0; i < str.length(); i++) {
@ -368,12 +357,12 @@ public class PrinterUtils {
List<ProductInfo> productInfos = new ArrayList<>();
productInfos.add(new ProductInfo("161616161616161616161616161",16,new BigDecimal(65.00)));
productInfos.add(new ProductInfo("161616161616161616161616161", 16, new BigDecimal("65.00")));
productInfos.add(new ProductInfo("张三",16,new BigDecimal(65.00)));
productInfos.add(new ProductInfo("张三", 16, new BigDecimal("65.00")));
productInfos.add(new ProductInfo("牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪",16,new BigDecimal(65.00)));
productInfos.add(new ProductInfo("牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪牛叉闪闪", 16, new BigDecimal("65.00")));
HandoverInfo handoverInfo = new HandoverInfo("牛叉闪闪", DateUtils.getTime(new Date()), DateUtils.getTime(new Date()), "李四", payInfos, memberDatas, "5000.00", "5000.00", "5000.00", "5000.00", "50.00", "80", null, "5000.00", null, productInfos);
@ -395,7 +384,6 @@ public class PrinterUtils {
// printTickets(voiceJson,1,1,"ZF544PG03W00002",getCashPrintData(detailPO,"结算单",""));\\
// String voiceJson = "{\"bizType\":\"1\",\"content\":\"您有一笔新的订单,请及时处理\"}";
// printTickets(voiceJson,1,1,"ZF544PG03W00002", printInvoice("http://weixin.qq.com/q/020fVS8lcLeiG1ID3SxCcH","【30天内开票有效】","1000000"));