打印样式调整

This commit is contained in:
张松 2025-03-26 18:26:59 +08:00
parent 5be260e0fc
commit a8f716eac6
3 changed files with 12 additions and 11 deletions

View File

@ -51,12 +51,13 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
private final PrintSignLabel printSignLabel = new PrintSignLabel()
.setBr("<BR>")
.setCut("")
.setCenterBold(new String[]{"<CB>", "</CB>"})
.setF(new String[]{"<F>", "</F>"})
.setL(new String[]{"<L>", "</L>"})
.setS(new String[]{"", ""})
.setF(new String[]{"<B>", "</B>"})
.setQr(new String[]{"<QR>", "</QR>"})
.setCenter(new String[]{"<CB>", "</CB>"})
.setCenter(new String[]{"<C>", "</C>"})
.setBold(new String[]{"<BOLD>", "</BOLD>"});
@Override

View File

@ -237,11 +237,10 @@ public interface PrinterImpl {
data.append(getFormatLabel(printInfoDTO.getShopName(), signLabelInfo.center, signLabelInfo.f)).append(signLabelInfo.br);
// data.append(StrUtil.format("<C><F>{}</F></C><BR>", printInfoDTO.getShopName()));
// data.append("<BR>");
data.append(signLabelInfo.br);
// data.append("<OUT:30>");
data.append(getFormatLabel(StrUtil.format("{}【{}】", printInfoDTO.getPrintTitle(), printInfoDTO.getPickupNum()), signLabelInfo.center, signLabelInfo.bold))
.append(signLabelInfo.br)
data.append(getFormatLabel(StrUtil.format("{}【{}】", printInfoDTO.getPrintTitle(), printInfoDTO.getPickupNum()), signLabelInfo.l, signLabelInfo.center))
.append(signLabelInfo.br);
// data.append(StrUtil.format("<C><BOLD>{}【{}】</BOLD></C><BR>", printInfoDTO.getPrintTitle(), printInfoDTO.getPickupNum()));
//if (Objects.nonNull(printInfoDTO.getOutNumber())) {
// data.append(StrUtil.format("<CB><BOLD>{}</BOLD></CB>",printInfoDTO.getOutNumber()));
@ -375,34 +374,34 @@ public interface PrinterImpl {
PrintSignLabel signLabelInfo = getSignLabelInfo();
StringBuilder builder = new StringBuilder();
if (isReturn) {
builder.append(getFormatLabel(StrUtil.format("{}【退】", pickupNumber), signLabelInfo.center, signLabelInfo.bold))
builder.append(getFormatLabel(StrUtil.format("{}【退】", pickupNumber), signLabelInfo.centerBold))
.append(signLabelInfo.br)
.append(signLabelInfo.br);
// builder.append("<C><B>").append(pickupNumber).append("【退】</B></C><BR><BR>");
} else {
builder.append(getFormatLabel(pickupNumber, signLabelInfo.center, signLabelInfo.bold))
builder.append(getFormatLabel(pickupNumber, signLabelInfo.centerBold))
.append(signLabelInfo.br)
.append(signLabelInfo.br);
// builder.append("<C><B>").append(pickupNumber).append("</B></C><BR><BR>");
}
builder.append(getFormatLabel(StrUtil.format("时间: {}", date), signLabelInfo.l, signLabelInfo.s))
builder.append(getFormatLabel(StrUtil.format("时间: {}", date), signLabelInfo.l, signLabelInfo.center))
.append(signLabelInfo.br)
.append(signLabelInfo.br);
// builder.append("<S><L>时间: ").append(date).append(" </L></S><BR><BR><BR>");
if (productName.length() > 4) {
builder.append(getFormatLabel(StrUtil.format("{} x {}", productName, number.stripTrailingZeros().toPlainString()), signLabelInfo.l, signLabelInfo.f))
builder.append(getFormatLabel(StrUtil.format("{} x {}", productName, number.stripTrailingZeros().toPlainString()), signLabelInfo.l, signLabelInfo.f, signLabelInfo.center))
.append(signLabelInfo.br);
// builder.append("<CS:32>").append(productName).append(" x ").append(number).append("</CS><BR>");
if (StrUtil.isNotBlank(skuName)) {
builder.append(getFormatLabel("(" + skuName + ")", signLabelInfo.l)).append(signLabelInfo.br);
builder.append(getFormatLabel("(" + skuName + ")", signLabelInfo.l, signLabelInfo.f, signLabelInfo.center)).append(signLabelInfo.br);
// builder.append("<CS:32>").append(skuName).append(" </CS><BR>");
}
} else {
builder.append(getFormatLabel(StrUtil.format("{} x {}", productName, number.stripTrailingZeros().toPlainString()), signLabelInfo.l, signLabelInfo.f))
builder.append(getFormatLabel(StrUtil.format("{} x {}", productName, number.stripTrailingZeros().toPlainString()), signLabelInfo.l, signLabelInfo.f, signLabelInfo.center))
.append(signLabelInfo.br);
// builder.append("<B>").append(productName).append(" x ").append(number).append("</B><BR>");
if (StrUtil.isNotBlank(skuName)) {
builder.append(getFormatLabel("(" + skuName + ")", signLabelInfo.l, signLabelInfo.bold))
builder.append(getFormatLabel("(" + skuName + ")", signLabelInfo.l, signLabelInfo.f, signLabelInfo.center))
.append(signLabelInfo.br);
// builder.append("<B>").append(skuName).append(" </B><BR>");
}

View File

@ -61,6 +61,7 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
.setS(new String[]{"<S>", "</S>"})
.setQr(new String[]{"<QR>", "</QR>"})
.setCenter(new String[]{"<C>", "</C>"})
.setCenterBold(new String[]{"<CB>", "</CB>"})
.setRs("RS")
.setBold(new String[]{"<B>", "</B>"});