12345678910111213141516171819202122232425262728293031323334353637383940 |
- # -*- coding: utf-8 -*-
- # !/usr/bin/env python
- from typing import TYPE_CHECKING
- from apps.web.common.models import WithdrawRecord
- from apps.web.common.transaction.withdraw import WithdrawService, WithdrawRetryService
- from apps.web.common.transaction import WithdrawStatus, WithdrawHandler
- from apps.web.core.exceptions import ServiceException
- if TYPE_CHECKING:
- pass
- def check_record_when_revoke_or_approve(withdraw_record, agent_id):
- # type: (WithdrawRecord, str)->None
- if withdraw_record is None:
- raise ServiceException({'result': 0, 'description': u'提现申请不存在', 'payload': {}})
- if withdraw_record.manual:
- if withdraw_record.status != WithdrawStatus.PROCESSING:
- raise ServiceException({'result': 0, 'description': u'订单状态错误,请刷新', 'payload': {}})
- else:
- if withdraw_record.status != WithdrawStatus.FAILED:
- raise ServiceException({'result': 0, 'description': u'订单状态错误,请刷新', 'payload': {}})
- if withdraw_record.payAgentId != agent_id:
- raise ServiceException({'result': 0, 'description': u'不是有效的提现申请(1001)', 'payload': {}})
- class AgentWithdrawHandler(WithdrawHandler):
- pass
- class AgentWithdrawService(WithdrawService):
- pass
- class AgentWithdrawRetryService(WithdrawRetryService):
- pass
|