1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package com.zhongzheng.controller.distribution;
- import java.util.List;
- import java.util.Arrays;
- import com.zhongzheng.common.utils.ServletUtils;
- import com.zhongzheng.framework.web.service.SellerTokenService;
- import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalAddBo;
- import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalQueryBo;
- import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
- import com.zhongzheng.modules.distribution.vo.DistributionCashWithdrawalVo;
- import com.zhongzheng.modules.user.entity.ClientLoginSeller;
- import lombok.RequiredArgsConstructor;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.zhongzheng.common.annotation.Log;
- import com.zhongzheng.common.core.controller.BaseController;
- import com.zhongzheng.common.core.domain.AjaxResult;
- import com.zhongzheng.common.enums.BusinessType;
- import com.zhongzheng.common.utils.poi.ExcelUtil;
- import com.zhongzheng.common.core.page.TableDataInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- /**
- * 分销业务员提现申请Controller
- *
- * @author ruoyi
- * @date 2023-03-25
- */
- @Api(value = "分销业务员提现申请控制器", tags = {"分销业务员提现申请管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/distribution/withdrawal")
- public class DistributionCashWithdrawalController extends BaseController {
- private final IDistributionCashWithdrawalService iDistributionCashWithdrawalService;
- private final SellerTokenService sellerTokenService;
- /**
- * 查询分销业务员提现申请列表
- */
- @ApiOperation("查询分销业务员提现申请列表")
- @PreAuthorize("@ss.hasPermi('system:withdrawal:list')")
- @GetMapping("/list")
- public TableDataInfo<DistributionCashWithdrawalVo> list(DistributionCashWithdrawalQueryBo bo) {
- startPage();
- List<DistributionCashWithdrawalVo> list = iDistributionCashWithdrawalService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 获取分销业务员提现申请详细信息
- */
- @ApiOperation("获取分销业务员提现申请详细信息")
- @PreAuthorize("@ss.hasPermi('system:withdrawal:query')")
- @GetMapping("/{id}")
- public AjaxResult<DistributionCashWithdrawalVo> getInfo(@PathVariable("id" ) Long id) {
- return AjaxResult.success(iDistributionCashWithdrawalService.queryById(id));
- }
- /**
- * 新增分销业务员提现申请
- */
- @ApiOperation("新增分销业务员提现申请")
- @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
- @Log(title = "分销业务员提现申请", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody DistributionCashWithdrawalAddBo bo) {
- ClientLoginSeller loginUser = sellerTokenService.getLoginUser(ServletUtils.getRequest());
- bo.setSellerId(loginUser.getSeller().getSellerId());
- return toAjax(iDistributionCashWithdrawalService.insertByAddBo(bo) ? 1 : 0);
- }
- }
|