餐位费 打包费

This commit is contained in:
2025-09-30 15:10:13 +08:00
parent 47e1fee03d
commit ce6cd6b3da
4 changed files with 30 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
@@ -133,6 +134,13 @@ public class FeiPrinter extends PrinterHandler implements PrinterImpl {
.setRemark(orderInfo.getRemark()) .setRemark(orderInfo.getRemark())
.setDiscountAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).subtract(orderInfo.getPayAmount())).toPlainString()); .setDiscountAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).subtract(orderInfo.getPayAmount())).toPlainString());
printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle()); printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle());
if(orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0){
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());
printInfoDTO.setSeatAmount(orderInfo.getSeatAmount().toPlainString());
}
if(orderInfo.getPackFee().compareTo(BigDecimal.ZERO) > 0){
printInfoDTO.setPackFee(orderInfo.getPackFee().toPlainString());
}
String string = buildOrderPrintData(printInfoDTO, detailList); String string = buildOrderPrintData(printInfoDTO, detailList);
Object resp = sendPrintRequest(machine.getAddress(), string, null, printerNum); Object resp = sendPrintRequest(machine.getAddress(), string, null, printerNum);

View File

@@ -127,6 +127,9 @@ public abstract class PrinterHandler {
private String discountAmount; private String discountAmount;
private String discountRadio; private String discountRadio;
private String orderNum; private String orderNum;
private String seatNum;
private String seatAmount;
private String packFee;
// 是否退款单 // 是否退款单
private boolean isReturn; private boolean isReturn;

View File

@@ -298,6 +298,16 @@ public interface PrinterImpl {
}); });
} }
} }
if(StrUtil.isNotBlank(printInfoDTO.getSeatAmount())){
String row = getRow("餐位费", "", StrUtil.format("{}{}", printInfoDTO.getSeatNum(), printInfoDTO.getSeatAmount()),
toPlainStr(printInfoDTO.getSeatAmount()), 21, 0, 5, 6);
data.append(row);
}
if(StrUtil.isNotBlank(printInfoDTO.getPackFee())){
String row = getRow("打包费", "", StrUtil.format("{}{}", "", printInfoDTO.getPackFee()),
toPlainStr(printInfoDTO.getPackFee()), 21, 0, 5, 6);
data.append(row);
}
if (ObjectUtil.isNotNull(printInfoDTO.getDiscountAmount())) { if (ObjectUtil.isNotNull(printInfoDTO.getDiscountAmount())) {
data.append(getFormatLabel("--------------------------------", signLabelInfo.s)) data.append(getFormatLabel("--------------------------------", signLabelInfo.s))
.append(signLabelInfo.br); .append(signLabelInfo.br);

View File

@@ -23,6 +23,7 @@ import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@@ -172,6 +173,14 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
.setRemark(orderInfo.getRemark()) .setRemark(orderInfo.getRemark())
.setDiscountAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).subtract(orderInfo.getPayAmount())).toPlainString()); .setDiscountAmount((orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee()).subtract(orderInfo.getPayAmount())).toPlainString());
printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle()); printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle());
if(orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0){
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());
printInfoDTO.setSeatAmount(orderInfo.getSeatAmount().toPlainString());
}
if(orderInfo.getPackFee().compareTo(BigDecimal.ZERO) > 0){
printInfoDTO.setPackFee(orderInfo.getPackFee().toPlainString());
}
String data = buildOrderPrintData(printInfoDTO, detailList); String data = buildOrderPrintData(printInfoDTO, detailList);
String voiceJson = "{\"PbizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}"; String voiceJson = "{\"PbizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
// String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}"; // String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";