trade:初始化

This commit is contained in:
YunaiV
2023-10-23 09:48:38 +08:00
parent 52f014b195
commit 537d3421a8
305 changed files with 21783 additions and 16 deletions

View File

@@ -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);
}
}

View File

@@ -98,6 +98,14 @@ public interface PayOrderService {
*/
void updateOrderRefundPrice(Long id, Integer incrRefundPrice);
/**
* 更新支付订单价格
*
* @param id 支付单编号
* @param payPrice 支付单价格
*/
void updatePayOrderPrice(Long id, Integer payPrice);
/**
* 更新支付订单价格
*

View File

@@ -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 哈;