|
|
|
@ -11,7 +11,14 @@ import com.qniao.dam.api.query.withdrawaudit.user.response.UserPageWithdrawAudit |
|
|
|
import com.qniao.dam.application.service.withdrawaudit.WithdrawAuditApplicationService; |
|
|
|
import com.qniao.dam.domain.aggregate.withdrawaudit.entity.WithdrawAudit; |
|
|
|
import com.qniao.dam.domian.aggregate.walletaccount.constant.IdentityTypeEnum; |
|
|
|
import com.qniao.dam.infrastructure.persistent.dao.domain.MatchmakerDao; |
|
|
|
import com.qniao.dam.query.matchmaker.MatchmakerQueryService; |
|
|
|
import com.qniao.dam.query.mntp.MatchmakerNoviceTaskProgressQueryService; |
|
|
|
import com.qniao.das.domian.aggregate.mntp.entity.MatchmakerNoviceTaskProgress; |
|
|
|
import com.qniao.dau.domain.aggregate.matchmaker.entity.Matchmaker; |
|
|
|
import com.qniao.dau.domian.aggregate.matchmaker.constant.MatchmakerLevelEnum; |
|
|
|
import com.qniao.dau.infrastructure.constant.RequestHeaderFields; |
|
|
|
import com.qniao.framework.exception.BizException; |
|
|
|
import com.qniao.framework.utils.PageUtil; |
|
|
|
import com.qniao.framework.utils.ServletUtils; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@ -30,6 +37,10 @@ public class WithdrawAuditUserCommandController { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private WithdrawAuditApplicationService withdrawAuditApplicationService; |
|
|
|
@Resource |
|
|
|
private MatchmakerNoviceTaskProgressQueryService matchmakerNoviceTaskProgressQueryService; |
|
|
|
@Resource |
|
|
|
private MatchmakerQueryService matchmakerQueryService; |
|
|
|
|
|
|
|
@ApiOperation("用户发起提现申请") |
|
|
|
@PostMapping("apply/wallet-account/withdraw") |
|
|
|
@ -44,6 +55,16 @@ public class WithdrawAuditUserCommandController { |
|
|
|
} else { |
|
|
|
withdrawAudit.setIdentityType(IdentityTypeEnum.INDIVIDUAL); |
|
|
|
withdrawAudit.setWalletAccountUserId(userId); |
|
|
|
//新手任务完成才可以提现 |
|
|
|
Matchmaker matchmaker = matchmakerQueryService.queryByUserId(userId); |
|
|
|
MatchmakerLevelEnum matchmakerLevel = matchmakerQueryService.queryLevelByUserId(userId); |
|
|
|
if (Objects.nonNull(matchmakerLevel) && MatchmakerLevelEnum.MATCHMAKER_PARTNER.getLevel() >= matchmakerLevel.getLevel()) { |
|
|
|
MatchmakerNoviceTaskProgress matchmakerNoviceTaskProgress = matchmakerNoviceTaskProgressQueryService.queryByMatchmakerId(matchmaker.getId()); |
|
|
|
if (Objects.nonNull(matchmakerNoviceTaskProgress) && !matchmakerNoviceTaskProgress.getIsFinish()) { |
|
|
|
//红娘未完成新手任务不能提现 |
|
|
|
throw new BizException("未完成新手任务不能提现"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
List<ThirdPartyField> fieldList = ThirdPartyFieldAssembler.from(dto.getThirdPartyFields()); |
|
|
|
withdrawAuditApplicationService.applyWithdraw(withdrawAudit, fieldList, appId); |
|
|
|
|