trade:初始化
This commit is contained in:
@@ -30,4 +30,9 @@ public class PayOrderApiImpl implements PayOrderApi {
|
||||
return PayOrderConvert.INSTANCE.convert2(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePayOrderPrice(Long id, Integer payPrice) {
|
||||
payOrderService.updatePayOrderPrice(id, payPrice);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -98,6 +98,14 @@ public interface PayOrderService {
|
||||
*/
|
||||
void updateOrderRefundPrice(Long id, Integer incrRefundPrice);
|
||||
|
||||
/**
|
||||
* 更新支付订单价格
|
||||
*
|
||||
* @param id 支付单编号
|
||||
* @param payPrice 支付单价格
|
||||
*/
|
||||
void updatePayOrderPrice(Long id, Integer payPrice);
|
||||
|
||||
/**
|
||||
* 更新支付订单价格
|
||||
*
|
||||
|
||||
@@ -407,6 +407,24 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePayOrderPrice(Long id, Integer payPrice) {
|
||||
PayOrderDO order = orderMapper.selectById(id);
|
||||
if (order == null) {
|
||||
throw exception(ORDER_NOT_FOUND);
|
||||
}
|
||||
if (ObjectUtil.notEqual(PayOrderStatusEnum.WAITING.getStatus(), order.getStatus())) {
|
||||
throw exception(ORDER_STATUS_IS_NOT_WAITING);
|
||||
}
|
||||
if (ObjectUtil.equal(order.getPrice(), payPrice)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO 芋艿:应该 new 出来更新
|
||||
order.setPrice(payPrice);
|
||||
orderMapper.updateById(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePayOrderPriceById(Long payOrderId, Integer payPrice) {
|
||||
// TODO @puhui999:不能直接这样修改哈;应该只有未支付状态的订单才可以改;另外,如果价格如果没变,可以直接 return 哈;
|
||||
|
||||
Reference in New Issue
Block a user