|
|
|
@ -6,6 +6,8 @@ import com.qniao.dam.api.command.withdrawaudit.user.request.UserApplyWalletAccou |
|
|
|
import com.qniao.dam.api.command.withdrawaudit.user.request.UserAuditWithdrawAuditDto; |
|
|
|
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.dau.infrastructure.constant.RequestHeaderFields; |
|
|
|
import com.qniao.framework.utils.ServletUtils; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.validation.Valid; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("user") |
|
|
|
@ -26,12 +29,19 @@ public class WithdrawAuditUserCommandController { |
|
|
|
@ApiOperation("用户发起提现申请") |
|
|
|
@PostMapping("apply/wallet-account/withdraw") |
|
|
|
public void userApplyWalletAccountWithdraw(@RequestBody @Valid UserApplyWalletAccountWithdrawDto dto, |
|
|
|
@RequestParam("userId") Long userId) { |
|
|
|
@RequestParam("userId") Long userId, |
|
|
|
@RequestHeader(name = RequestHeaderFields.FIELD_ORGANIZATION_ID, required = false) Long orgId) { |
|
|
|
Long appId = Long.valueOf(ServletUtils.getAppId()); |
|
|
|
WithdrawAudit withdrawAudit = dto.trans2Domain(); |
|
|
|
withdrawAudit.setWalletAccountUserId(userId); |
|
|
|
if (Objects.nonNull(orgId)) { |
|
|
|
withdrawAudit.setIdentityType(IdentityTypeEnum.ORGANIZATION); |
|
|
|
withdrawAudit.setWalletAccountOrgId(orgId); |
|
|
|
} else { |
|
|
|
withdrawAudit.setIdentityType(IdentityTypeEnum.INDIVIDUAL); |
|
|
|
withdrawAudit.setWalletAccountUserId(userId); |
|
|
|
} |
|
|
|
List<ThirdPartyField> fieldList = ThirdPartyFieldAssembler.from(dto.getThirdPartyFields()); |
|
|
|
withdrawAuditApplicationService.applyWithdraw(withdrawAudit,fieldList,appId); |
|
|
|
withdrawAuditApplicationService.applyWithdraw(withdrawAudit, fieldList, appId); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("审核提现申请") |
|
|
|
|