Cui Zhi Feng
2024-09-08 bc9bd69850c95dacb22c7da4777a1d0470c33722
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package com.mzl.flower.web.flower;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.*;
import com.mzl.flower.service.flower.FlowerMarkupPsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@RestController
@RequestMapping("/api/flower/markup/ps")
@Api(value = "平台二次加价管理", tags = "平台二次加价管理")
@Validated
@Slf4j
public class FlowerMarkupPsController extends BaseController {
 
    @Autowired
    private FlowerMarkupPsService psService;
 
    @PostMapping("/list/new")
    @ApiOperation(value = "新增合伙人配置")
    public ResponseEntity<ReturnDataDTO> saveMarkupPs(@RequestBody FlowerMarkupPsSaveDTO dto) {
        return returnData(R.SUCCESS.getCode(), psService.saveMarkupPs(dto));
    }
 
    @GetMapping("/list")
    @ApiOperation(value = "获取合伙人配置列表")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupPsDTO>>> selectMarkupPsList(Page page, FlowerMarkupPsQueryDTO dto){
        return returnData(R.SUCCESS.getCode(), psService.selectMarkupPsList(page, dto));
    }
 
    @GetMapping("/list/delete")
    @ApiOperation(value = "删除合伙人配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupPs(Long id){
        psService.deleteMarkupPs(id);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping("/spcg/list/save/batch")
    @ApiOperation(value = "批量新增商品分类加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCgBatch(@RequestBody FlowerMarkupPsSpCgBatchSaveDTO dto) {
        psService.saveMarkupSpCgBatch(dto);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping("/spcg/list/save")
    @ApiOperation(value = "新增商品分类加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSpCg(@RequestBody FlowerMarkupPsSpCgSaveDTO dto) {
        psService.saveMarkupSpCg(dto);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @GetMapping("/spcg/list/view")
    @ApiOperation(value = "查询商品分类加价详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
            @ApiImplicitParam(name = "categoryId", value = "商品分类id", required = true, dataType = "Long", paramType = "query"),
    })
    public ResponseEntity<ReturnDataDTO<FlowerMarkupSpCgDTO>> getMarkupSpCg(Long partnerId, Long categoryId){
        return returnData(R.SUCCESS.getCode(), psService.getMarkupSpCg(partnerId, categoryId));
    }
 
    @GetMapping("/spcg/list")
    @ApiOperation(value = "获取商品分类加价列表")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpCgListDTO>>> selectMarkupSpCgList(Page page
            , FlowerMarkupPsSpCgQueryDTO dto){
        return returnData(R.SUCCESS.getCode(), psService.selectMarkupSpCgList(page, dto));
    }
 
    @GetMapping("/spcg/list/delete")
    @ApiOperation(value = "删除商品分类加价")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
            @ApiImplicitParam(name = "categoryId", value = "商品分类id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupSpCg(Long partnerId, Long categoryId){
        psService.deleteMarkupSpCg(partnerId, categoryId);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping("/sp/list/save")
    @ApiOperation(value = "新增商品加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSp(@RequestBody FlowerMarkupPsSpSaveDTO dto) {
        psService.saveMarkupSp(dto);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @GetMapping("/sp/list/view")
    @ApiOperation(value = "查询商品加价详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
            @ApiImplicitParam(name = "flowerId", value = "商品id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<FlowerMarkupSpDTO>> getMarkupSp(Long partnerId, Long flowerId){
        return returnData(R.SUCCESS.getCode(), psService.getMarkupSp(partnerId, flowerId));
    }
 
    @GetMapping("/sp/list")
    @ApiOperation(value = "获取商品加价列表")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpList(Page page, FlowerMarkupPsSpQueryDTO dto){
        return returnData(R.SUCCESS.getCode(), psService.selectMarkupSpList(page, dto));
    }
 
    @GetMapping("/sp/list/delete")
    @ApiOperation(value = "删除商品加价")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "partnerId", value = "合伙人id", required = true, dataType = "Long", paramType = "query"),
            @ApiImplicitParam(name = "flowerId", value = "商品id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteMarkupSp(Long partnerId, Long flowerId){
        psService.deleteMarkupSp(partnerId, flowerId);
        return returnData(R.SUCCESS.getCode(), null);
    }
}