This commit is contained in:
aaron 2025-04-02 10:44:14 +08:00
parent 07c4f76701
commit ae77e1fdcb
3 changed files with 15 additions and 2 deletions

View File

@ -48,7 +48,7 @@ from app.models.timeperiod import TimePeriodDB
from app.models.community_timeperiod import CommunityTimePeriodDB
from app.models.community_profit_sharing import CommunityProfitSharing
from app.core.qcloud import QCloudManager
from app.core.wechat import WeChatClient
router = APIRouter()
def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: Session) -> OrderPriceResult:
@ -906,6 +906,13 @@ async def cancel_order(
db.commit()
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="用户取消订单"
)
# 发送企业微信消息
wecom_bot = WecomBot()
order_info = OrderInfo.model_validate(order)
@ -1160,6 +1167,13 @@ async def deliveryman_cancel_order(
db.commit()
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="配送员取消订单"
)
# 发送企业微信消息
wecom_bot = WecomBot()
order_info = OrderInfo.model_validate(order)

View File

@ -430,7 +430,6 @@ async def refund_notify(
description = f"订单取消扣除",
order_id = order.order_id
)
else:
return error_response(code=400, message="不支持的订单类型")

Binary file not shown.