feat: 投诉工单正规化(介入/牵连提现拦截,仅俱乐部开关)

支持被投诉对象、平台介入、协商中状态与组长投诉;提现硬拦含管事向上牵连组长,默认仅 lxs 开启。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQueandCursor committed 2026-07-27 00:50:31 +08:00
1 parent 344c7d0f6e
commit 2d4ba56e65
11 files changed
+785 -78

No files matched your search

+10
View File
@@ -337,6 +337,16 @@ def validate_withdraw_eligibility(user_main, leixing, jine):
if not fadan_ok:
return False, fadan_msg, {}
# 投诉未结清 / 管事被诉牵连上级组长(仅俱乐部开关打开时)
try:
from gongdan.services import check_complaint_blocks_withdraw
gd_ok, gd_msg, gd_extra = check_complaint_blocks_withdraw(user_main)
if not gd_ok:
return False, gd_msg, gd_extra or {}
except Exception as e:
import logging
logging.getLogger(__name__).error('投诉提现拦截检查异常: %s', e, exc_info=True)
if leixing == 1:
try:
dashou = UserDashou.query.get(user=user_main)
+9 -2
View File
@@ -402,8 +402,15 @@ class TixianShenqingView(APIView):
ok, elig_msg, extra = validate_withdraw_eligibility(user_main, leixing, jine)
if not ok:
return Response({'code': 8, 'msg': elig_msg},
status=status.HTTP_400_BAD_REQUEST)
body = {'code': 8, 'msg': elig_msg}
if (extra or {}).get('code') == 'COMPLAINT_BLOCK_WITHDRAW':
body['data'] = {
'tab': extra.get('tab') or 'received',
'reason': extra.get('reason') or '',
'count': extra.get('count') or 0,
'code': 'COMPLAINT_BLOCK_WITHDRAW',
}
return Response(body, status=status.HTTP_400_BAD_REQUEST)
# 3. 根据提现类型扣款(资格已在 validate_withdraw_eligibility 校验)
nicheng = extra.get('nicheng', '')