退菜同步修改订单金额
This commit is contained in:
parent
608fb72c78
commit
7379b1d85d
|
|
@ -5,7 +5,9 @@ import cn.ysk.cashier.vo.TbOrderSaleVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -32,4 +34,10 @@ public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
|
||||||
" ) " +
|
" ) " +
|
||||||
"</script>")
|
"</script>")
|
||||||
List<TbOrderSaleVO> selectAllSaleInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productSkuIds") List<Integer> productSkuIds, @Param("shopId") Integer shopId);
|
List<TbOrderSaleVO> selectAllSaleInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productSkuIds") List<Integer> productSkuIds, @Param("shopId") Integer shopId);
|
||||||
|
|
||||||
|
@Update("update tb_order_info set settlement_amount=settlement_amount-#{priceAmount}, pack_fee=pack_fee-#{packAmount}," +
|
||||||
|
"order_amount=origin_amount-#{priceAmount}, amount=amount-#{priceAmount}," +
|
||||||
|
"order_amount=order_amount-#{priceAmount} where id=#{orderId} and origin_amount-#{priceAmount} >= 0")
|
||||||
|
int updateOrderAmount(Integer orderId, BigDecimal priceAmount, BigDecimal packAmount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -629,6 +629,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 餐位费直接删除
|
// 餐位费直接删除
|
||||||
|
TbOrderDetail orderDetail = orderDetailMapper.selectOne(new LambdaQueryWrapper<TbOrderDetail>()
|
||||||
|
.eq(TbOrderDetail::getCartId, cashierCart.getId()));
|
||||||
|
|
||||||
if (cashierCart.getId() == -999) {
|
if (cashierCart.getId() == -999) {
|
||||||
cashierCartMapper.deleteById(cashierCart.getId());
|
cashierCartMapper.deleteById(cashierCart.getId());
|
||||||
if (cashierCart.getOrderId() != null) {
|
if (cashierCart.getOrderId() != null) {
|
||||||
|
|
@ -656,6 +659,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cashierCart.getOrderId() != null) {
|
||||||
|
// 减少订单金额
|
||||||
|
orderInfoMapper.updateOrderAmount(cashierCart.getOrderId(), orderDetail.getPriceAmount(), orderDetail.getPackAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue