DistributionCashWithdrawalController.java 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.zhongzheng.controller.distribution;
  2. import java.util.List;
  3. import java.util.Arrays;
  4. import com.zhongzheng.common.utils.ServletUtils;
  5. import com.zhongzheng.framework.web.service.SellerTokenService;
  6. import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalAddBo;
  7. import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalQueryBo;
  8. import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
  9. import com.zhongzheng.modules.distribution.vo.DistributionCashWithdrawalVo;
  10. import com.zhongzheng.modules.user.entity.ClientLoginSeller;
  11. import lombok.RequiredArgsConstructor;
  12. import org.springframework.security.access.prepost.PreAuthorize;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.PostMapping;
  16. import org.springframework.web.bind.annotation.PutMapping;
  17. import org.springframework.web.bind.annotation.DeleteMapping;
  18. import org.springframework.web.bind.annotation.PathVariable;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import com.zhongzheng.common.annotation.Log;
  23. import com.zhongzheng.common.core.controller.BaseController;
  24. import com.zhongzheng.common.core.domain.AjaxResult;
  25. import com.zhongzheng.common.enums.BusinessType;
  26. import com.zhongzheng.common.utils.poi.ExcelUtil;
  27. import com.zhongzheng.common.core.page.TableDataInfo;
  28. import io.swagger.annotations.Api;
  29. import io.swagger.annotations.ApiOperation;
  30. /**
  31. * 分销业务员提现申请Controller
  32. *
  33. * @author ruoyi
  34. * @date 2023-03-25
  35. */
  36. @Api(value = "分销业务员提现申请控制器", tags = {"分销业务员提现申请管理"})
  37. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  38. @RestController
  39. @RequestMapping("/distribution/withdrawal")
  40. public class DistributionCashWithdrawalController extends BaseController {
  41. private final IDistributionCashWithdrawalService iDistributionCashWithdrawalService;
  42. private final SellerTokenService sellerTokenService;
  43. /**
  44. * 查询分销业务员提现申请列表
  45. */
  46. @ApiOperation("查询分销业务员提现申请列表")
  47. @PreAuthorize("@ss.hasPermi('system:withdrawal:list')")
  48. @GetMapping("/list")
  49. public TableDataInfo<DistributionCashWithdrawalVo> list(DistributionCashWithdrawalQueryBo bo) {
  50. startPage();
  51. List<DistributionCashWithdrawalVo> list = iDistributionCashWithdrawalService.queryList(bo);
  52. return getDataTable(list);
  53. }
  54. /**
  55. * 获取分销业务员提现申请详细信息
  56. */
  57. @ApiOperation("获取分销业务员提现申请详细信息")
  58. @PreAuthorize("@ss.hasPermi('system:withdrawal:query')")
  59. @GetMapping("/{id}")
  60. public AjaxResult<DistributionCashWithdrawalVo> getInfo(@PathVariable("id" ) Long id) {
  61. return AjaxResult.success(iDistributionCashWithdrawalService.queryById(id));
  62. }
  63. /**
  64. * 新增分销业务员提现申请
  65. */
  66. @ApiOperation("新增分销业务员提现申请")
  67. @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
  68. @Log(title = "分销业务员提现申请", businessType = BusinessType.INSERT)
  69. @PostMapping()
  70. public AjaxResult<Void> add(@RequestBody DistributionCashWithdrawalAddBo bo) {
  71. ClientLoginSeller loginUser = sellerTokenService.getLoginUser(ServletUtils.getRequest());
  72. bo.setSellerId(loginUser.getSeller().getSellerId());
  73. return toAjax(iDistributionCashWithdrawalService.insertByAddBo(bo) ? 1 : 0);
  74. }
  75. }