fix: separate penalty czjilu from merchant recharge and correct finance stats
This commit is contained in:
@@ -12011,8 +12011,10 @@ class FaKuanPayView(APIView):
|
||||
random_num = random.randint(0, 99)
|
||||
dingdanid = f"FK{timestamp_ms:011d}{timestamp_ns:06d}{random_num:02d}"
|
||||
|
||||
from jituan.services.club_write import resolve_club_id_for_write
|
||||
from jituan.services.club_penalty import penalty_cz_club_id
|
||||
from jituan.services.club_user import get_payment_openid
|
||||
from products.czjilu_types import CZJILU_LEIXING_FAKUAN, penalty_cz_shuoming
|
||||
|
||||
pay_openid, _ = get_payment_openid(request)
|
||||
if not pay_openid:
|
||||
return Response({
|
||||
@@ -12025,9 +12027,9 @@ class FaKuanPayView(APIView):
|
||||
zhuangtai=9,
|
||||
yonghuid=request.user.UserUID,
|
||||
jine=jine,
|
||||
leixing=4,
|
||||
shuoming=f'{settings.FAKUAN_PAY_DESCRIPTION}#fadan:{fadan.id}',
|
||||
club_id=resolve_club_id_for_write(request, request.user),
|
||||
leixing=CZJILU_LEIXING_FAKUAN,
|
||||
shuoming=penalty_cz_shuoming(fadan.id),
|
||||
club_id=penalty_cz_club_id(fadan),
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -12233,6 +12235,11 @@ class FaKuanHuitiaoView(View):
|
||||
logger.error(f"订单不存在: {out_trade_no}")
|
||||
return self.wechat_response('FAIL', '订单不存在')
|
||||
|
||||
from products.czjilu_types import is_penalty_czjilu
|
||||
if not is_penalty_czjilu(order):
|
||||
logger.error(f"非罚款支付订单误入罚款回调: {out_trade_no}, leixing={order.leixing}")
|
||||
return self.wechat_response('FAIL', '订单类型错误')
|
||||
|
||||
# 5. 检查订单状态是否为未支付(9)
|
||||
if order.zhuangtai != 9:
|
||||
logger.warning(f"订单状态不是未支付: {order.dingdan_id}, 当前状态: {order.zhuangtai}")
|
||||
|
||||
Reference in New Issue
Block a user