|
|
@ -6,6 +6,7 @@ import com.qniao.dam.domain.aggregate.walletaccount.entity.WalletAccount; |
|
|
import com.qniao.dam.domain.aggregate.withdrawaudit.entity.WithdrawAudit; |
|
|
import com.qniao.dam.domain.aggregate.withdrawaudit.entity.WithdrawAudit; |
|
|
import com.qniao.dam.domian.aggregate.withdrawaudit.constant.WithdrawAuditStatus; |
|
|
import com.qniao.dam.domian.aggregate.withdrawaudit.constant.WithdrawAuditStatus; |
|
|
import com.qniao.dam.domian.aggregate.withdrawaudit.event.WithdrawAuditAuditedEvent; |
|
|
import com.qniao.dam.domian.aggregate.withdrawaudit.event.WithdrawAuditAuditedEvent; |
|
|
|
|
|
import com.qniao.dam.domian.aggregate.withdrawaudit.event.WithdrawAuditRemittedEvent; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.WithdrawAuditDao; |
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.WithdrawAuditDao; |
|
|
import com.qniao.domain.BaseApplicationService; |
|
|
import com.qniao.domain.BaseApplicationService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -26,9 +27,7 @@ public class WithdrawAuditEventHandler extends BaseApplicationService { |
|
|
private void handle(WithdrawAuditAuditedEvent event) { |
|
|
private void handle(WithdrawAuditAuditedEvent event) { |
|
|
try { |
|
|
try { |
|
|
WithdrawAudit withdrawAudit = withdrawAuditDao.selectById(event.getId()); |
|
|
WithdrawAudit withdrawAudit = withdrawAuditDao.selectById(event.getId()); |
|
|
if (WithdrawAuditStatus.PASS_VERIFICATION.equals(withdrawAudit.getStatus())) { |
|
|
|
|
|
walletAccountApplicationService.confirmWithdraw(withdrawAudit.getWalletAccountId(), withdrawAudit.getWithdrawAmount()); |
|
|
|
|
|
} else if (WithdrawAuditStatus.AUDIT_FAILURE.equals(withdrawAudit.getStatus())) { |
|
|
|
|
|
|
|
|
if (WithdrawAuditStatus.AUDIT_FAILURE.equals(withdrawAudit.getStatus())) { |
|
|
walletAccountApplicationService.failWithdraw(withdrawAudit.getWalletAccountId(), withdrawAudit.getWithdrawAmount()); |
|
|
walletAccountApplicationService.failWithdraw(withdrawAudit.getWalletAccountId(), withdrawAudit.getWithdrawAmount()); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -36,4 +35,15 @@ public class WithdrawAuditEventHandler extends BaseApplicationService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Subscribe |
|
|
|
|
|
private void handle(WithdrawAuditRemittedEvent event) { |
|
|
|
|
|
try { |
|
|
|
|
|
WithdrawAudit withdrawAudit = withdrawAuditDao.selectById(event.getId()); |
|
|
|
|
|
if (withdrawAudit.getRemitStatus()) { |
|
|
|
|
|
walletAccountApplicationService.confirmWithdraw(withdrawAudit.getWalletAccountId(), withdrawAudit.getWithdrawAmount()); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("提现申请审核事件处理异常", e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |