出入库

This commit is contained in:
2026-04-16 17:25:58 +08:00
parent 821f3c58e6
commit c705265047
2 changed files with 6 additions and 4 deletions

View File

@@ -551,7 +551,7 @@ public interface PrinterImpl {
builder.append(getFormatLabel(StrUtil.format("IN".equals(record.getType()) ? "入库时间: {}" : "出库时间: {}", DateUtil.format(record.getInStockTime(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(StrUtil.format("IN".equals(record.getType()) ? "入库时间: {}" : "出库时间: {}", DateUtil.format(record.getInStockTime(), "yyyy/MM/dd HH:mm:ss")), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getDividingLine()).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br);
builder.append(getFormatLabel(key4("耗材名称", "库存单位", "IN".equals(record.getType()) ? "入库数量" : "出库数量", "金额", builder.append(getFormatLabel(key4("耗材名称", "库存单位", "IN".equals(record.getType()) ? "入库数量" : "出库数量", "金额",
14, 6, 6), signLabelInfo.s)).append(signLabelInfo.br); 10, 8, 8), signLabelInfo.s)).append(signLabelInfo.br);
// 遍历耗材明细,逐行打印 // 遍历耗材明细,逐行打印
List<StockPrintDTO.InStockItem> items = record.getItems(); List<StockPrintDTO.InStockItem> items = record.getItems();
@@ -560,7 +560,7 @@ public interface PrinterImpl {
String stockNumber = item.getStockNumber().stripTrailingZeros().toPlainString(); String stockNumber = item.getStockNumber().stripTrailingZeros().toPlainString();
String amount = item.getAmount().stripTrailingZeros().toPlainString(); String amount = item.getAmount().stripTrailingZeros().toPlainString();
// 左对齐排版,保证列对齐 // 左对齐排版,保证列对齐
String itemLine = key4(item.getConsName(), item.getUnit(), stockNumber, amount, 14, 6, 6); String itemLine = key4(item.getConsName(), item.getUnit(), stockNumber, amount, 10, 9, 9);
builder.append(getFormatLabel(itemLine, signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(itemLine, signLabelInfo.s)).append(signLabelInfo.br);
} }
} }
@@ -570,7 +570,7 @@ public interface PrinterImpl {
String stockNumberCountStr = "数量" + record.getStockNumberCount(); String stockNumberCountStr = "数量" + record.getStockNumberCount();
String amountCountStr = "金额" + record.getAmountCount(); String amountCountStr = "金额" + record.getAmountCount();
String totalLine = key4("总计", consCountStr, stockNumberCountStr, amountCountStr, 8, 8, 8); String totalLine = key4("总计", consCountStr, stockNumberCountStr, amountCountStr, 6, 9, 7);
builder.append(getFormatLabel(totalLine, signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(totalLine, signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getDividingLine()).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br);
@@ -733,13 +733,14 @@ public interface PrinterImpl {
if (record.getGiftCoupon() != null && record.getGiftCoupon() > 0) { if (record.getGiftCoupon() != null && record.getGiftCoupon() > 0) {
builder.append(getFormatLabel(leftRightAlign("赠送优惠券:", record.getGiftCoupon() + "", 32), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(leftRightAlign("赠送优惠券:", record.getGiftCoupon() + "", 32), signLabelInfo.s)).append(signLabelInfo.br);
} }
builder.append(getFormatLabel(leftRightAlign(" 充值后余额:", record.getBalance().stripTrailingZeros().toPlainString(), 32), signLabelInfo.s)).append(signLabelInfo.br); builder.append(getFormatLabel(leftRightAlign("充值后余额:", record.getBalance().stripTrailingZeros().toPlainString(), 32), signLabelInfo.s)).append(signLabelInfo.br);
builder.append(getDividingLine()).append(signLabelInfo.br); builder.append(getDividingLine()).append(signLabelInfo.br);
// 支付信息 // 支付信息
builder.append(getFormatLabel(leftRightAlign("已付金额:", record.getRechargeAmount().stripTrailingZeros().toPlainString(), 16), signLabelInfo.f)).append(signLabelInfo.br); builder.append(getFormatLabel(leftRightAlign("已付金额:", record.getRechargeAmount().stripTrailingZeros().toPlainString(), 16), signLabelInfo.f)).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("操作员: {}", StrUtil.isNotBlank(record.getOperator()) ? 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(LocalDateTime.now(), "yyyy/MM/dd HH:mm:ss")), 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);
// 结尾空行 + 切纸 // 结尾空行 + 切纸

View File

@@ -156,6 +156,7 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
StockPrintDTO stockPrint = new StockPrintDTO(); StockPrintDTO stockPrint = new StockPrintDTO();
stockPrint.setType(type); stockPrint.setType(type);
stockPrint.setPrintTime(LocalDateTime.now()); stockPrint.setPrintTime(LocalDateTime.now());
stockPrint.setInStockTime(LocalDateTime.now());
stockPrint.setOperator(param.getOperator()); stockPrint.setOperator(param.getOperator());
stockPrint.setConsCount(param.getBodyList().size()); stockPrint.setConsCount(param.getBodyList().size());
List<StockPrintDTO.InStockItem> items = new ArrayList<>(); List<StockPrintDTO.InStockItem> items = new ArrayList<>();