预结算单 原价

打印单上的二维码
This commit is contained in:
2026-03-30 10:07:34 +08:00
parent 7d619b8260
commit 8c559b1c0c
4 changed files with 15 additions and 21 deletions

View File

@@ -131,7 +131,7 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
if (StrUtil.isNotBlank(machine.getPrintQty())) {
printerNum = machine.getPrintQty().split("\\^")[1];
}
PrintInfoDTO printInfoDTO = new PrintInfoDTO().setShopName(shopInfo.getShopName())
.setCount(count)
.setPrintType("普通打印").setPickupNum(getPickupNum(orderInfo))

View File

@@ -18,7 +18,6 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 打印机具体打印方法接口,提供打印元数据获取,具体打印机实现对应方法即可
@@ -353,11 +352,11 @@ public interface PrinterImpl {
.append(signLabelInfo.br);
// data.append(StrUtil.format("<L><BOLD>备注:{}</BOLD></L><BR>", printInfoDTO.getRemark()));
}
if (Objects.nonNull(printInfoDTO.getOutNumber())) {
data.append(getFormatLabel(printInfoDTO.getOutNumber(), signLabelInfo.center, signLabelInfo.qr))
.append(signLabelInfo.br);
// data.append("<QR>".concat(printInfoDTO.getOutNumber()).concat("</QR><BR>"));
}
// if (Objects.nonNull(printInfoDTO.getOutNumber())) {
// data.append(getFormatLabel(printInfoDTO.getOutNumber(), signLabelInfo.center, signLabelInfo.qr))
// .append(signLabelInfo.br);
//// data.append("<QR>".concat(printInfoDTO.getOutNumber()).concat("</QR><BR>"));
// }
data.append(getFormatLabel(StrUtil.format("打印时间:{}", DateUtil.date().toString()), signLabelInfo.s))
.append(signLabelInfo.br)
.append(signLabelInfo.br);
@@ -442,8 +441,8 @@ public interface PrinterImpl {
builder.append(getFormatLabel("【加急】", signLabelInfo.center, signLabelInfo.bold))
.append(signLabelInfo.br);
}
builder.append(getFormatLabel("UP_ORDER_DETAIL:" + orderDetailId, signLabelInfo.center, signLabelInfo.qr))
.append(signLabelInfo.br);
// builder.append(getFormatLabel("UP_ORDER_DETAIL:" + orderDetailId, signLabelInfo.center, signLabelInfo.qr))
// .append(signLabelInfo.br);
builder.append(signLabelInfo.br)
.append(signLabelInfo.getOut(150))
.append(signLabelInfo.cut);
@@ -548,7 +547,7 @@ public interface PrinterImpl {
* @return 添加间距的字符串
*/
default String titleAddSpace(String str, int b1) {
int k = 0;
int k;
try {
k = str.getBytes("GBK").length;
} catch (UnsupportedEncodingException e) {

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.czg.account.dto.HandoverRecordDTO;
import com.czg.account.entity.PrintMachine;
import com.czg.account.entity.ShopInfo;
@@ -174,15 +173,13 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
printInfoDTO.setOriginalAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee())).toPlainString());
if (isPre) {
if (orderInfo.getPlaceNum() == 1) {
BigDecimal refundAmount = BigDecimal.ZERO;
for (OrderDetail orderDetail : detailList) {
refundAmount = refundAmount.add(orderDetail.getReturnAmount());
}
printInfoDTO.setOriginalAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).subtract(refundAmount)).toPlainString());
BigDecimal originalAmount = BigDecimal.ZERO;
for (OrderDetail orderDetail : detailList) {
originalAmount = originalAmount.add((orderDetail.getNum().subtract(orderDetail.getReturnNum()).subtract(orderDetail.getRefundNum())).multiply(orderDetail.getPrice()));
}
printInfoDTO.setPayAmount(printInfoDTO.getOriginalAmount());
printInfoDTO.setOriginalAmount(originalAmount.add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).toPlainString());
}
printInfoDTO.setPayAmount(printInfoDTO.getOriginalAmount());
printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle());
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());

View File

@@ -415,6 +415,7 @@ public class OrderPayServiceImpl implements OrderPayService {
} else {
orderDetail.setStatus(OrderStatusEnums.PART_REFUND.getCode());
}
orderDetail.setReturnAmount(orderDetail.getReturnAmount().add(refundDetail.getReturnAmount()));
} else {
orderDetail.setReturnNum(orderDetail.getReturnNum().add(refNum));
if (orderDetail.getPackNumber().compareTo(BigDecimal.ZERO) > 0 && orderDetail.getPackNumber().compareTo(orderDetail.getNum().subtract(orderDetail.getReturnNum())) > 0) {
@@ -423,12 +424,9 @@ public class OrderPayServiceImpl implements OrderPayService {
}
orderDetail.setRefundNo(refPayOrderNo);
orderDetail.setRefundRemark(orderDetail.getRefundRemark() + param.getRefundReason());
// if (isPay) {
orderDetail.setReturnAmount(orderDetail.getReturnAmount().add(refundDetail.getReturnAmount()));
if (orderDetail.getReturnAmount().compareTo(orderDetail.getPayAmount()) > 0) {
orderDetail.setReturnAmount(orderDetail.getPayAmount());
}
// }
orderDetailService.updateById(orderDetail);
if (orderDetail.getProductId() != null && orderDetail.getProductId() > 0) {
returnProMap.put(Convert.toStr(orderDetail.getProductId()), refundDetail.getNum());