打包费
This commit is contained in:
@@ -172,7 +172,7 @@ public class YxyPrinter extends PrinterHandler implements PrinterImpl {
|
|||||||
? orderInfo.getDiscountAllAmount().toPlainString()
|
? orderInfo.getDiscountAllAmount().toPlainString()
|
||||||
: "0.00");
|
: "0.00");
|
||||||
|
|
||||||
BigDecimal originalAmount = orderInfo.getOriginAmount().add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee());
|
BigDecimal originalAmount = orderInfo.getOriginAmount();
|
||||||
printInfoDTO.setOriginalAmount(originalAmount.toPlainString());
|
printInfoDTO.setOriginalAmount(originalAmount.toPlainString());
|
||||||
if (isPre) {
|
if (isPre) {
|
||||||
originalAmount = BigDecimal.ZERO;
|
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()));
|
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.setOriginalAmount((originalAmount.add(orderInfo.getSeatAmount()).add(orderInfo.getPackFee())).toPlainString());
|
||||||
}
|
|
||||||
printInfoDTO.setPayAmount(originalAmount.subtract(orderInfo.getDiscountAllAmount()).setScale(2, RoundingMode.HALF_UP).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.setPrintTitle(printInfoDTO.getPrintTitle());
|
printInfoDTO.setPrintTitle(printInfoDTO.getPrintTitle());
|
||||||
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
|
if (orderInfo.getSeatNum() != null && orderInfo.getSeatAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());
|
printInfoDTO.setSeatNum(orderInfo.getSeatNum().toString());
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
}
|
}
|
||||||
orderDetails.forEach(item -> item.setOrderTime(DateUtil.date().toLocalDateTime()));
|
orderDetails.forEach(item -> item.setOrderTime(DateUtil.date().toLocalDateTime()));
|
||||||
AssertUtil.isListEmpty(orderDetails, "下单失败 购物车为空");
|
AssertUtil.isListEmpty(orderDetails, "下单失败 购物车为空");
|
||||||
processOrderDetails(orderDetails, param.getLimitRate());
|
processOrderDetails(orderDetails, param.getLimitRate(),param);
|
||||||
//生成订单
|
//生成订单
|
||||||
OrderInfo orderInfo = initOrderInfo(param, shopInfo, table);
|
OrderInfo orderInfo = initOrderInfo(param, shopInfo, table);
|
||||||
orderDetailService.createOrderDetails(orderInfo.getId(), orderDetails);
|
orderDetailService.createOrderDetails(orderInfo.getId(), orderDetails);
|
||||||
@@ -1028,7 +1028,8 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
*
|
*
|
||||||
* @param orderDetails 订单详情 需要回填
|
* @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) {
|
for (OrderDetail detail : orderDetails) {
|
||||||
if (!detail.getIsTemporary().equals(1) && detail.getProductId() > 0) {
|
if (!detail.getIsTemporary().equals(1) && detail.getProductId() > 0) {
|
||||||
Product product = productService.getOne(QueryWrapper.create()
|
Product product = productService.getOne(QueryWrapper.create()
|
||||||
@@ -1054,7 +1055,9 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
detail.setUnitPrice(detail.getPrice());
|
detail.setUnitPrice(detail.getPrice());
|
||||||
}
|
}
|
||||||
detail.setPayAmount(detail.getNum().multiply(detail.getUnitPrice()));
|
detail.setPayAmount(detail.getNum().multiply(detail.getUnitPrice()));
|
||||||
|
packFee = packFee.add(detail.getPackAmount().multiply(detail.getPackNumber()));
|
||||||
}
|
}
|
||||||
|
param.setPackFee(packFee);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user