fix: 修复微信入账重复统计,入账幂等防双记
This commit is contained in:
@@ -43,7 +43,7 @@ from utils.fadan_utils import check_fadan_qiangdan_eligible
|
||||
|
||||
from orders.utils import (
|
||||
calc_shangjia_order_fencheng,
|
||||
update_daily_income, update_daily_payout,
|
||||
update_daily_payout,
|
||||
settle_shangjia_order_guanshi_fenhong
|
||||
)
|
||||
from shop.utils import calculate_pingtai_and_dianpu_shouyi, validate_shangpin_and_dianpu, update_dianpu_daily_stat
|
||||
@@ -307,10 +307,10 @@ class WechatPayNotifyView(APIView):
|
||||
|
||||
|
||||
# 更新收支记录(总累计)
|
||||
self._update_szjilu(dingdan.Amount, getattr(dingdan, 'ClubID', None))
|
||||
|
||||
# 更新每日收入统计
|
||||
update_daily_income(dingdan.Amount, getattr(dingdan, 'ClubID', None))
|
||||
from jituan.services.szjilu_accounting import record_wechat_income_once
|
||||
record_wechat_income_once(
|
||||
dingdan.Amount, getattr(dingdan, 'ClubID', None), biz_ref=f'order:{out_trade_no}',
|
||||
)
|
||||
|
||||
# 构建通知数据(你的 _get_game_type_name 方法保留在视图里直接用)
|
||||
order_info = {
|
||||
@@ -568,10 +568,12 @@ class PaymentVerifyView(APIView):
|
||||
|
||||
|
||||
# 更新收支记录
|
||||
self._update_szjilu(dingdan.Amount, getattr(dingdan, 'ClubID', None))
|
||||
|
||||
# 更新每日收入统计
|
||||
update_daily_income(dingdan.Amount, getattr(dingdan, 'ClubID', None))
|
||||
from jituan.services.szjilu_accounting import record_wechat_income_once
|
||||
record_wechat_income_once(
|
||||
dingdan.Amount,
|
||||
getattr(dingdan, 'ClubID', None),
|
||||
biz_ref=f'order:{dingdan.OrderID}',
|
||||
)
|
||||
|
||||
def _query_wechat_payment(self, out_trade_no):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user