单菜票扩展纸张大小
This commit is contained in:
@@ -71,8 +71,16 @@ public interface PrinterImpl {
|
||||
private String out;
|
||||
private String rs;
|
||||
|
||||
|
||||
/**
|
||||
* 走纸
|
||||
*/
|
||||
public String out(int num) {
|
||||
return StrUtil.format("<{}:{}>", out, num);
|
||||
}
|
||||
|
||||
public String out() {
|
||||
return StrUtil.format("<{}:{}>", out, 180);
|
||||
return out(180);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,14 +176,14 @@ public interface PrinterImpl {
|
||||
|
||||
if (StrUtil.isNotBlank(handoverRecord.getCategoryData())) {
|
||||
builder.append(formatLabel("----------- 销售数据 -----------", signLabelInfo.s)).append(signLabelInfo.br)
|
||||
.append(formatLabel(key3("商品分类", "数量", "总计", 14, 8,32), signLabelInfo.s))
|
||||
.append(formatLabel(key3("商品分类", "数量", "总计", 14, 8, 32), signLabelInfo.s))
|
||||
.append(signLabelInfo.br);
|
||||
JSONArray.parseArray(handoverRecord.getCategoryData()).forEach(item -> {
|
||||
JSONObject info = (JSONObject) item;
|
||||
String categoryName = info.getString("categoryName");
|
||||
Integer quantity = info.getInteger("quantity");
|
||||
BigDecimal amount = info.getBigDecimal("amount");
|
||||
builder.append(formatLabel(key3(categoryName, quantity.toString(), bdToStr(amount), 14, 8,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
builder.append(formatLabel(key3(categoryName, quantity.toString(), bdToStr(amount), 14, 8, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
});
|
||||
}
|
||||
builder.append(getDividingLine()).append(signLabelInfo.br)
|
||||
@@ -204,7 +212,7 @@ public interface PrinterImpl {
|
||||
data.append(formatLabel(StrUtil.format("结账时间:{}", orderPrintDTO.getTradeDate()), signLabel.s)).append(signLabel.br);
|
||||
}
|
||||
data.append(getDividingLine()).append(signLabel.br);
|
||||
data.append(formatLabel(key3("品名", "单价", "数量", 18, 9,32), signLabel.s)).append(signLabel.br);
|
||||
data.append(formatLabel(key3("品名", "单价", "数量", 18, 9, 32), signLabel.s)).append(signLabel.br);
|
||||
|
||||
for (OrderDetail detail : detailList) {
|
||||
BigDecimal subtract = detail.getNum().subtract(detail.getReturnNum());
|
||||
@@ -213,7 +221,7 @@ public interface PrinterImpl {
|
||||
}
|
||||
String number = subtract.stripTrailingZeros().toPlainString();
|
||||
String unitPrice = toPlainStr(detail.getUnitPrice().stripTrailingZeros().toPlainString());
|
||||
data.append(formatLabel(key3(detail.getProductName(), unitPrice, number, 18, 7,32), signLabel.s)).append(signLabel.br);
|
||||
data.append(formatLabel(key3(detail.getProductName(), unitPrice, number, 18, 7, 32), signLabel.s)).append(signLabel.br);
|
||||
// data.append(formatLabel(key3(detail.getProductName(), unitPrice, number, 13, 4,24), signLabel.cs(32))).append(signLabel.br);
|
||||
|
||||
if (StrUtil.isNotBlank(detail.getSkuName())) {
|
||||
@@ -233,15 +241,15 @@ public interface PrinterImpl {
|
||||
jsonObject.getJSONArray("goods").forEach(item -> {
|
||||
String proName = ((JSONObject) item).getString("proName");
|
||||
String qty = ((JSONObject) item).getString("number");
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9,32), signLabel.s)).append(signLabel.br);
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9, 32), signLabel.s)).append(signLabel.br);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(orderPrintDTO.getSeatAmount())) {
|
||||
data.append(formatLabel(key3("餐位费", orderPrintDTO.getSeatAmount(), orderPrintDTO.getSeatNum(), 18, 9,32), signLabel.s)).append(signLabel.br);
|
||||
data.append(formatLabel(key3("餐位费", orderPrintDTO.getSeatAmount(), orderPrintDTO.getSeatNum(), 18, 9, 32), signLabel.s)).append(signLabel.br);
|
||||
}
|
||||
if (StrUtil.isNotBlank(orderPrintDTO.getPackFee())) {
|
||||
data.append(formatLabel(key3("打包费", toPlainStr(orderPrintDTO.getPackFee()), "", 18, 9,32), signLabel.s)).append(signLabel.br);
|
||||
data.append(formatLabel(key3("打包费", toPlainStr(orderPrintDTO.getPackFee()), "", 18, 9, 32), signLabel.s)).append(signLabel.br);
|
||||
|
||||
}
|
||||
data.append(getDividingLine())
|
||||
@@ -289,7 +297,7 @@ public interface PrinterImpl {
|
||||
data.append(formatLabel(formatLabel(LRAlign(orderPrintDTO.getPrintType(), StrUtil.isNotBlank(orderPrintDTO.getSeatNum()) ? orderPrintDTO.getSeatNum() + "人" : "", 32))
|
||||
, signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(getDividingLine()).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3("品名", "单价", "数量", 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3("品名", "单价", "数量", 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
|
||||
for (OrderDetail detail : detailList) {
|
||||
BigDecimal subtract = detail.getNum().subtract(detail.getReturnNum());
|
||||
@@ -298,7 +306,7 @@ public interface PrinterImpl {
|
||||
}
|
||||
String number = subtract.stripTrailingZeros().toPlainString();
|
||||
String unitPrice = toPlainStr(detail.getUnitPrice().stripTrailingZeros().toPlainString());
|
||||
data.append(formatLabel(key3(detail.getProductName(), unitPrice, number, 18, 7,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3(detail.getProductName(), unitPrice, number, 18, 7, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
|
||||
if (StrUtil.isNotBlank(detail.getSkuName())) {
|
||||
data.append(formatLabel(StrUtil.format("规格:{}", detail.getSkuName()), signLabelInfo.s))
|
||||
@@ -317,15 +325,15 @@ public interface PrinterImpl {
|
||||
jsonObject.getJSONArray("goods").forEach(item -> {
|
||||
String proName = ((JSONObject) item).getString("proName");
|
||||
String qty = ((JSONObject) item).getString("number");
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(orderPrintDTO.getSeatAmount())) {
|
||||
data.append(formatLabel(key3("餐位费", orderPrintDTO.getSeatAmount(), orderPrintDTO.getSeatNum(), 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3("餐位费", orderPrintDTO.getSeatAmount(), orderPrintDTO.getSeatNum(), 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
}
|
||||
if (StrUtil.isNotBlank(orderPrintDTO.getPackFee())) {
|
||||
data.append(formatLabel(key3("打包费", toPlainStr(orderPrintDTO.getPackFee()), "", 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3("打包费", toPlainStr(orderPrintDTO.getPackFee()), "", 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
}
|
||||
data.append(getDividingLine()).append(signLabelInfo.br);
|
||||
data.append(formatLabel(LRAlign("原价:", orderPrintDTO.getOriginalAmount(), 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
@@ -361,7 +369,7 @@ public interface PrinterImpl {
|
||||
, signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(getDividingLine()).append(signLabelInfo.br);
|
||||
if (CollUtil.isNotEmpty(detailList)) {
|
||||
data.append(formatLabel(key3("退款明细", "数量", "小计", 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3("退款明细", "数量", "小计", 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
|
||||
for (OrderDetail detail : detailList) {
|
||||
String number = detail.getNum().stripTrailingZeros().toPlainString();
|
||||
@@ -369,7 +377,7 @@ public interface PrinterImpl {
|
||||
if ("退款单".equals(orderPrintDTO.getPrintTitle())) {
|
||||
amount = detail.getReturnAmount().stripTrailingZeros().toPlainString();
|
||||
}
|
||||
data.append(formatLabel(key3(detail.getProductName(), number, amount, 18, 7,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3(detail.getProductName(), number, amount, 18, 7, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
if (StrUtil.isNotBlank(detail.getSkuName())) {
|
||||
data.append(formatLabel(StrUtil.format("规格:{}", detail.getSkuName()), signLabelInfo.s))
|
||||
.append(signLabelInfo.br);
|
||||
@@ -387,7 +395,7 @@ public interface PrinterImpl {
|
||||
jsonObject.getJSONArray("goods").forEach(item -> {
|
||||
String proName = ((JSONObject) item).getString("proName");
|
||||
String qty = ((JSONObject) item).getString("number");
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -446,7 +454,7 @@ public interface PrinterImpl {
|
||||
jsonObject.getJSONArray("goods").forEach(item -> {
|
||||
String proName = ((JSONObject) item).getString("proName");
|
||||
String qty = ((JSONObject) item).getString("number");
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9,32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
data.append(formatLabel(key3(" - " + proName, "", qty, 18, 9, 32), signLabelInfo.s)).append(signLabelInfo.br);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -481,8 +489,13 @@ public interface PrinterImpl {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(formatLabel(pickupNumber, signLabelInfo.centerBold))
|
||||
.append(signLabelInfo.br);
|
||||
builder.append(signLabelInfo.br);
|
||||
builder.append(signLabelInfo.br);
|
||||
builder.append(signLabelInfo.br);
|
||||
builder.append(formatLabel(StrUtil.format("时间:{}", DateUtil.format(orderDetail.getCreateTime(), "yyyy-MM-dd HH:mm:ss")), signLabelInfo.s, signLabelInfo.center))
|
||||
.append(signLabelInfo.br);
|
||||
builder.append(signLabelInfo.out(70));
|
||||
|
||||
Integer isWaitCall = ObjectUtil.defaultIfNull(orderDetail.getIsWaitCall(), 0);
|
||||
if (isWaitCall == 1) {
|
||||
if (!orderDetail.getProductName().contains("【等叫】")) {
|
||||
@@ -709,7 +722,7 @@ public interface PrinterImpl {
|
||||
builder.append(formatLabel("敏感操作记录", signLabelInfo.bold)).append(signLabelInfo.br);
|
||||
for (DaySettlePrintDTO.OperationRecord operation : operationRecords) {
|
||||
builder.append(formatLabel(
|
||||
key3(operation.getOperation(), "数量:" + operation.getCount(), "金额" + bdToStr(operation.getAmount()), 8, 14,32)
|
||||
key3(operation.getOperation(), "数量:" + operation.getCount(), "金额" + bdToStr(operation.getAmount()), 8, 14, 32)
|
||||
, signLabelInfo.s)).append(signLabelInfo.br);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user