文件上传https
This commit is contained in:
parent
d473fd27cd
commit
4f23116407
|
@ -12,4 +12,5 @@ public interface RefundRecordService extends IService<RefundRecord> {
|
||||||
* 获取查询条件
|
* 获取查询条件
|
||||||
*/
|
*/
|
||||||
QueryWrapper<RefundRecord> getQueryWrapper(RefundRecordQueryRequest refundRecordQueryRequest);
|
QueryWrapper<RefundRecord> getQueryWrapper(RefundRecordQueryRequest refundRecordQueryRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,6 +412,21 @@ public class WeChatServiceImpl implements WeChatService {
|
||||||
updateWrapper.eq("orderItemId", orderItemId).set("orderItemStatus", OrderStatusConstant.PAYMENT_REFUNDED);
|
updateWrapper.eq("orderItemId", orderItemId).set("orderItemStatus", OrderStatusConstant.PAYMENT_REFUNDED);
|
||||||
boolean update = pendingServiceOrderService.update(updateWrapper);
|
boolean update = pendingServiceOrderService.update(updateWrapper);
|
||||||
ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "服务类订单待处理记录状态更新失败");
|
ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "服务类订单待处理记录状态更新失败");
|
||||||
|
// 如果退款的是订单中最后一个订单明细,则修改订单状态
|
||||||
|
QueryWrapper<RefundRecord> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("outTradeNo", orderNumber);
|
||||||
|
long refundCount = refundRecordService.count(queryWrapper);
|
||||||
|
|
||||||
|
QueryWrapper<OrderItems> orderItemsQueryWrapper = new QueryWrapper<>();
|
||||||
|
orderItemsQueryWrapper.eq("orderId", order.getId());
|
||||||
|
long orderItemCount = orderItemService.count(orderItemsQueryWrapper);
|
||||||
|
|
||||||
|
UpdateWrapper<Order> orderUpdateWrapper = new UpdateWrapper<>();
|
||||||
|
if (refundCount == orderItemCount) {
|
||||||
|
orderUpdateWrapper.eq("id", order.getId()).set("orderStatus", OrderStatusConstant.PAYMENT_REFUNDED);
|
||||||
|
boolean result = orderService.update(orderUpdateWrapper);
|
||||||
|
ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "订单状态更新失败");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 恢复商品库存
|
// 恢复商品库存
|
||||||
OrderItems orderItems = orderItemService.getById(orderItemId);
|
OrderItems orderItems = orderItemService.getById(orderItemId);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user