fix: 代客下单折扣为空导致详情金额有误修复
This commit is contained in:
@@ -176,8 +176,7 @@ public class PayServiceImpl implements PayService {
|
|||||||
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
||||||
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
||||||
.in(TbOrderDetail::getStatus, "unpaid")
|
.in(TbOrderDetail::getStatus, "unpaid")
|
||||||
.setSql(StrUtil.format("price_amount=price*num*{}", orderInfo.getDiscountRatio()))
|
.setSql(StrUtil.format("price_amount=price*num*{}", orderInfo.getDiscountRatio() == null ? 1 : orderInfo.getDiscountRatio()))
|
||||||
|
|
||||||
.set(TbOrderDetail::getStatus, "closed"));
|
.set(TbOrderDetail::getStatus, "closed"));
|
||||||
|
|
||||||
//修改主单状态
|
//修改主单状态
|
||||||
|
|||||||
@@ -1631,8 +1631,10 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
orderInfo.setPaidTime(DateUtil.current());
|
orderInfo.setPaidTime(DateUtil.current());
|
||||||
orderInfo.setPayAmount(finalAmount);
|
orderInfo.setPayAmount(finalAmount);
|
||||||
orderInfo.setStatus("closed");
|
orderInfo.setStatus("closed");
|
||||||
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
if (payDTO.getDiscount() != null) {
|
||||||
orderInfo.setDiscountAmount(orderInfo.getAmount().subtract(finalAmount));
|
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
||||||
|
orderInfo.setDiscountAmount(orderInfo.getAmount().subtract(finalAmount));
|
||||||
|
}
|
||||||
orderInfoMapper.updateById(orderInfo);
|
orderInfoMapper.updateById(orderInfo);
|
||||||
|
|
||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
@@ -1649,7 +1651,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
||||||
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
||||||
.eq(TbOrderDetail::getStatus, "unpaid")
|
.eq(TbOrderDetail::getStatus, "unpaid")
|
||||||
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount()))
|
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount() == null ? 1: payDTO.getDiscount()))
|
||||||
.set(TbOrderDetail::getStatus, "closed"));
|
.set(TbOrderDetail::getStatus, "closed"));
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user