操作员

This commit is contained in:
2026-04-16 17:11:24 +08:00
parent f53fb1d916
commit c3fb4258d2

View File

@@ -113,6 +113,7 @@ public interface PrinterImpl {
String line = StrUtil.repeat("-", 32); String line = StrUtil.repeat("-", 32);
return getFormatLabel(line, getSignLabelInfo().s); return getFormatLabel(line, getSignLabelInfo().s);
} }
default String getDividingLine(Integer num) { default String getDividingLine(Integer num) {
int length = num == null ? 32 : num; int length = num == null ? 32 : num;
String line = StrUtil.repeat("-", length); String line = StrUtil.repeat("-", length);
@@ -574,7 +575,7 @@ public interface PrinterImpl {
builder.append(getDividingLine()).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br);
// 操作员、打印时间 // 操作员、打印时间
builder.append(getFormatLabel(StrUtil.format("操作员: {}", record.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("操作员: {}", StrUtil.isNotBlank(record.getOperator()) ? record.getOperator() : ""), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(record.getPrintTime(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(record.getPrintTime(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br);
// 结尾空行 + 切纸(和充值单保持一致) // 结尾空行 + 切纸(和充值单保持一致)
@@ -595,7 +596,7 @@ public interface PrinterImpl {
// 基础信息:打印时间、操作人、统计时间 // 基础信息:打印时间、操作人、统计时间
builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("操作人: {}", record.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("操作人: {}", StrUtil.isNotBlank(record.getOperator()) ? record.getOperator() : ""), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("时间: {}", record.getStatisticsTime()), signLabelInfo.s)).append(signLabelInfo.br).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("时间: {}", record.getStatisticsTime()), signLabelInfo.s)).append(signLabelInfo.br).append(signLabelInfo.br);
// 营业总额 // 营业总额
@@ -663,7 +664,7 @@ public interface PrinterImpl {
// 基础信息:打印时间、操作人、统计时间 // 基础信息:打印时间、操作人、统计时间
builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("操作人: {}", record.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("操作人: {}", StrUtil.isNotBlank(record.getOperator()) ? record.getOperator() : ""), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("时间: {}", record.getStatisticsTime()), signLabelInfo.s)).append(signLabelInfo.br).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("时间: {}", record.getStatisticsTime()), signLabelInfo.s)).append(signLabelInfo.br).append(signLabelInfo.br);
// 总计行总计商品X件实收金额X元 // 总计行总计商品X件实收金额X元
@@ -738,7 +739,7 @@ public interface PrinterImpl {
builder.append(getFormatLabel(leftRightAlign("已付金额:", record.getRechargeAmount().stripTrailingZeros().toPlainString(), 32), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(leftRightAlign("已付金额:", record.getRechargeAmount().stripTrailingZeros().toPlainString(), 32), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(leftRightAlign("支付方式:", record.getPayType(), 32), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(leftRightAlign("支付方式:", record.getPayType(), 32), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getDividingLine()).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("操作员: {}", record.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("操作员: {}", StrUtil.isNotBlank(record.getOperator()) ? record.getOperator() : ""), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getFormatLabel(StrUtil.format("充值编号: {}", record.getRechargeId()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("充值编号: {}", record.getRechargeId()), signLabelInfo.s)).append(signLabelInfo.br);
// 结尾空行 + 切纸 // 结尾空行 + 切纸
@@ -784,7 +785,7 @@ public interface PrinterImpl {
builder.append(getDividingLine()).append(signLabelInfo.br).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br).append(signLabelInfo.br);
// 操作员、打印时间 // 操作员、打印时间
builder.append(getFormatLabel(StrUtil.format("操作员: {}", record.getOperator()), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("操作员: {}", StrUtil.isNotBlank(record.getOperator()) ? record.getOperator() : ""), signLabelInfo.s)).append(signLabelInfo.br);
// 打印时间复用之前的DateUtil格式化若DTO需补充printTime字段可按需求添加 // 打印时间复用之前的DateUtil格式化若DTO需补充printTime字段可按需求添加
builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("打印时间: {}", DateUtil.format(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br);