| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.BalanceChangeRecord; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.dto.WithQuery; |
| | | import com.ruoyi.account.dto.WithdrawalRequestsDTO; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private WithdrawalRequestsService withdrawalRequestsService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | /** |
| | | * 提现申请 |
| | |
| | | @ApiOperation(value = "提现申请列表", tags = {"后台"}) |
| | | public R<IPage<WithdrawalRequests>> page(@RequestBody WithQuery withQuery){ |
| | | return R.ok(withdrawalRequestsService.pageList(withQuery)); |
| | | |
| | | } |
| | | // @PostMapping("/auth") |
| | | // @ApiOperation(value = "提现申请", tags = {"后台"}) |
| | | // public R<IPage<WithdrawalRequests>> page(@RequestBody WithQuery withQuery){ |
| | | // return R.ok(withdrawalRequestsService.pageList(withQuery)); |
| | | // |
| | | // } |
| | | @PostMapping("/auth") |
| | | @ApiOperation(value = "提现申请审批", tags = {"后台"}) |
| | | public R<IPage<WithdrawalRequests>> auth(@RequestParam Long id,@ApiParam("2'审核通过',3'审核拒绝'") Integer auditStatus){ |
| | | WithdrawalRequests byId = withdrawalRequestsService.getById(id); |
| | | if (auditStatus==2){ |
| | | |
| | | //将用户待审核金额减少,已提现金额增加 |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | byId1.setWithdrawnAmount(byId1.getWithdrawnAmount().add(byId.getWithdrawalAmount())); |
| | | appUserService.updateById(byId1); |
| | | //执行对应的第三方提现 todo |
| | | } |
| | | //通过 |
| | | byId.setAuditStatus(auditStatus); |
| | | withdrawalRequestsService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |