打包费

This commit is contained in:
2026-03-30 14:09:36 +08:00
parent f7b30a5142
commit bb414d2776
2 changed files with 9 additions and 4 deletions

View File

@@ -172,7 +172,7 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
? orderInfo.getDiscountAllAmount().toPlainString()
: "0.00");
BigDecimal originalAmount = orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee());
BigDecimal originalAmount = orderInfo.getOriginAmount();
printInfoDTO.setOriginalAmount(originalAmount.toPlainString());
if (isPre) {
originalAmount = BigDecimal.ZERO;
@@ -180,8 +180,10 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
originalAmount = originalAmount.add((orderDetail.getNum().subtract(orderDetail.getReturnNum()).subtract(orderDetail.getRefundNum())).multiply(orderDetail.getPrice()));
}
printInfoDTO.setOriginalAmount((originalAmount.add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee())).toPlainString());
printInfoDTO.setPayAmount(originalAmount.subtract(orderInfo.getDiscountAllAmount()).setScale(2, RoundingMode.HALF_UP).toPlainString());
}else {
printInfoDTO.setPayAmount(originalAmount.subtract(orderInfo.getDiscountAllAmount()).setScale(2, RoundingMode.HALF_UP).toPlainString());
}
printInfoDTO.setPayAmount(originalAmount.subtract(orderInfo.getDiscountAllAmount()).setScale(2, RoundingMode.HALF_UP).toPlainString());
printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle());
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());

View File

@@ -314,7 +314,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
}
orderDetails.forEach(item -> item.setOrderTime(DateUtil.date().toLocalDateTime()));
AssertUtil.isListEmpty(orderDetails, "下单失败 购物车为空");
processOrderDetails(orderDetails, param.getLimitRate());
processOrderDetails(orderDetails, param.getLimitRate(),param);
//生成订单
OrderInfo orderInfo = initOrderInfo(param, shopInfo, table);
orderDetailService.createOrderDetails(orderInfo.getId(), orderDetails);
@@ -1028,7 +1028,8 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
*
* @param orderDetails 订单详情 需要回填
*/
private void processOrderDetails(List<OrderDetail> orderDetails, LimitRateDTO limitRate) throws CzgException {
private void processOrderDetails(List<OrderDetail> orderDetails, LimitRateDTO limitRate,OrderInfoAddDTO param) throws CzgException {
BigDecimal packFee = BigDecimal.ZERO;
for (OrderDetail detail : orderDetails) {
if (!detail.getIsTemporary().equals(1) && detail.getProductId() > 0) {
Product product = productService.getOne(QueryWrapper.create()
@@ -1054,7 +1055,9 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
detail.setUnitPrice(detail.getPrice());
}
detail.setPayAmount(detail.getNum().multiply(detail.getUnitPrice()));
packFee = packFee.add(detail.getPackAmount().multiply(detail.getPackNumber()));
}
param.setPackFee(packFee);
}
@Override