From a988a89e6b0cd75a5df4691eb8196c0ef9513a05 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 26 十二月 2024 19:46:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java index 4bdf64d..c804805 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java @@ -7,19 +7,19 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.security.service.TokenService; +import com.ruoyi.other.api.domain.Shop; import com.ruoyi.other.api.domain.ShopWithdraw; +import com.ruoyi.other.dto.ShopBalanceDto; import com.ruoyi.other.service.ShopService; import com.ruoyi.other.service.ShopWithdrawService; import com.ruoyi.system.api.model.LoginUser; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -57,12 +57,52 @@ return R.ok(page); } + @GetMapping("/shop/list") + @ApiOperation(value = "提现申请列表", notes = "提现申请列表", tags = {"门店后台"}) + public R<IPage<ShopWithdraw>> shoplist(@ApiParam("页码") @RequestParam Integer pageNum, + @ApiParam("每一页数据大小") Integer pageSize, + ShopWithdraw shopWithdraw) { + Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); + Page<ShopWithdraw> page = shopWithdrawService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<ShopWithdraw>() + .eq(ShopWithdraw::getShopId,objectId) + .eq(shopWithdraw.getAuditStatus()!=null,ShopWithdraw::getAuditStatus,shopWithdraw.getAuditStatus()) + .orderByDesc(ShopWithdraw::getCreateTime) + ); + return R.ok(page); + } + + @GetMapping("/shop/info") + @ApiOperation(value = "提现申请列表上方数据", notes = "提现申请列表", tags = {"门店后台"}) + public R<Shop> shopCommissionStatisticsinfo(){ + Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); + Shop byId = shopService.getById(objectId); + return R.ok(byId); + } + @GetMapping("/shop/with") + @ApiOperation(value = "提现申请", notes = "提现申请列表", tags = {"门店后台"}) + public R<Shop> shopwith(@RequestParam BigDecimal money){ + Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); + Shop byId = shopService.getById(objectId); + if (money.compareTo(byId.getCanWithdrawMoney())>0){ + return R.fail("提现金额不能大于可提现金额"); + } + ShopWithdraw shopWithdraw = new ShopWithdraw(); + shopWithdraw.setShopId(objectId); + shopWithdraw.setMoney(money); + shopWithdraw.setAuditStatus(0); + shopWithdraw.setStatus(1); + shopWithdrawService.save(shopWithdraw); + + return R.ok(byId); + } + + /** * 审核 */ - @RequestMapping("/audit") + @PostMapping("/audit") @ApiOperation("审核") - public R<Void> audit(ShopWithdraw shopWithdraw) { + public R<Void> audit(@RequestBody ShopWithdraw shopWithdraw) { LoginUser loginUser = tokenService.getLoginUser(); ShopWithdraw shopWithdraw1 = shopWithdrawService.getById(shopWithdraw.getId()); shopWithdraw1.setAuditStatus(shopWithdraw.getAuditStatus()); -- Gitblit v1.7.1