!610 营销活动+订单:完善大部分 TODO 提到的问题

Merge pull request !610 from puhui999/feature/mall_product
This commit is contained in:
芋道源码
2023-09-08 15:36:51 +00:00
committed by Gitee
34 changed files with 478 additions and 197 deletions

View File

@ -29,4 +29,11 @@ public interface PayOrderApi {
*/
PayOrderRespDTO getOrder(Long id);
/**
* 更新支付订单价格
*
* @param payOrderId 支付单编号
* @param payPrice 支付单价格
*/
void updatePayOrderPriceById(Long payOrderId, Integer payPrice);
}

View File

@ -28,6 +28,7 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1007002004, "发起支付报错,错误码:{},错误提示:{}");
ErrorCode ORDER_REFUND_FAIL_STATUS_ERROR = new ErrorCode(1007002005, "支付订单退款失败,原因:状态不是已支付或已退款");
ErrorCode ORDER_UPDATE_PRICE_FAIL_PAID = new ErrorCode(1007002006, "支付订单调价失败,原因:支付订单已付款,不能调价");
ErrorCode ORDER_UPDATE_PRICE_FAIL_EQUAL = new ErrorCode(1007002007, "支付订单调价失败,原因:价格没有变化");
// ========== ORDER 模块(拓展单) 1007003000 ==========
ErrorCode ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1007003000, "支付交易拓展单不存在");

View File

@ -31,4 +31,10 @@ public class PayOrderApiImpl implements PayOrderApi {
return PayOrderConvert.INSTANCE.convert2(order);
}
@Override
public void updatePayOrderPriceById(Long payOrderId, Integer payPrice) {
payOrderService.updatePayOrderPriceById(payOrderId, payPrice);
}
}

View File

@ -33,7 +33,7 @@ public interface PayOrderService {
/**
* 获得支付订单
*
* @param appId 应用编号
* @param appId 应用编号
* @param merchantOrderId 商户订单编号
* @return 支付订单
*/
@ -75,7 +75,7 @@ public interface PayOrderService {
* 提交支付
* 此时,会发起支付渠道的调用
*
* @param reqVO 提交请求
* @param reqVO 提交请求
* @param userIp 提交 IP
* @return 提交结果
*/
@ -93,11 +93,19 @@ public interface PayOrderService {
/**
* 更新支付订单的退款金额
*
* @param id 编号
* @param id 编号
* @param incrRefundPrice 增加的退款金额
*/
void updateOrderRefundPrice(Long id, Integer incrRefundPrice);
/**
* 更新支付订单价格
*
* @param payOrderId 支付单编号
* @param payPrice 支付单价格
*/
void updatePayOrderPriceById(Long payOrderId, Integer payPrice);
/**
* 获得支付订单
*

View File

@ -411,6 +411,17 @@ public class PayOrderServiceImpl implements PayOrderService {
}
}
@Override
public void updatePayOrderPriceById(Long payOrderId, Integer payPrice) {
PayOrderDO order = orderMapper.selectById(payOrderId);
if (order == null) {
throw exception(ORDER_NOT_FOUND);
}
order.setPrice(payPrice);
orderMapper.updateById(order);
}
@Override
public PayOrderExtensionDO getOrderExtension(Long id) {
return orderExtensionMapper.selectById(id);