xiaoyong931011
2021-04-08 8f7b99b0a3d53f4410e8b1f2f209ce2743f0a944
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
package com.matrix.system.activity.action;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.activity.dto.ActivitiesListDto;
import com.matrix.system.activity.dto.AddSignAwardSetDto;
import com.matrix.system.activity.dto.BeCloseDto;
import com.matrix.system.activity.dto.BeReadyDto;
import com.matrix.system.activity.dto.CouponDto;
import com.matrix.system.activity.dto.DelRowDto;
import com.matrix.system.activity.dto.GoodsDto;
import com.matrix.system.activity.dto.SignForUpdateDto;
import com.matrix.system.activity.dto.SignReceiveListDto;
import com.matrix.system.activity.dto.UpdateSignAwardSetDto;
import com.matrix.system.activity.service.ActivitySignAwardSetService;
import com.matrix.system.activity.vo.ActivitiesListVo;
import com.matrix.system.activity.vo.CouponVo;
import com.matrix.system.activity.vo.GoodsVo;
import com.matrix.system.activity.vo.SignReceiveListVo;
import com.matrix.system.hive.action.util.QueryUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * @description 奖品设置表
 * @author yourName
 * @date 2021-03-31 16:57
 */
@RestController
@RequestMapping(value = "admin/activitySignAwardSet")
public class ActivitySignAwardSetAction {
 
    @Autowired
    private ActivitySignAwardSetService activitySignAwardSetService;
 
    /**
     * 新增签到活动
     */
    @PostMapping(value = "/addSignAwardSet")
    public @ResponseBody
    AjaxResult addSignAwardSet(@RequestBody AddSignAwardSetDto addSignAwardSetDto) {
        return activitySignAwardSetService.activitySignAwardSetService(addSignAwardSetDto);
    }
    
    /**
     * 查询优惠券
     */
    @ApiOperation(value = "查询优惠券")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = CouponVo.class)
    })
    @PostMapping(value = "/selectCouponList")
    public @ResponseBody
    AjaxResult selectCouponList(@RequestBody CouponDto couponDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(couponDto);
        //排序
        if(StringUtils.isBlank(couponDto.getSort())){
            couponDto.setSort("create_time");
            couponDto.setOrder("desc");
        }
        Page<CouponVo> page = new Page(couponDto.getPageNum(), couponDto.getPageSize());
        IPage<CouponVo> rows = activitySignAwardSetService.selectCouponList(page,couponDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal());
        return result;
    }
    
    /**
     * 查询商品
     */
    @ApiOperation(value = "查询商品")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = GoodsVo.class)
    })
    @PostMapping(value = "/selectGoodsList")
    public @ResponseBody
    AjaxResult selectGoodsList(@RequestBody GoodsDto goodsDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(goodsDto);
        //排序
        if(StringUtils.isBlank(goodsDto.getSort())){
            goodsDto.setSort("create_time");
            goodsDto.setOrder("desc");
        }
        Page<GoodsVo> page = new Page(goodsDto.getPageNum(), goodsDto.getPageSize());
        IPage<GoodsVo> rows = activitySignAwardSetService.selectGoodsList(page,goodsDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal());
        return result;
    }
 
    /**
     * 查询活动列表
     */
    @ApiOperation(value = "查询活动列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = ActivitiesListVo.class)
    })
    @PostMapping(value = "/findActivitiesList")
    public @ResponseBody
    AjaxResult findActivitiesList(@RequestBody ActivitiesListDto activitiesListDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(activitiesListDto);
        //排序
        if(StringUtils.isBlank(activitiesListDto.getSort())){
            activitiesListDto.setSort("create_time");
            activitiesListDto.setOrder("desc");
        }
        Page<ActivitiesListVo> page = new Page(activitiesListDto.getPageNum(), activitiesListDto.getPageSize());
        IPage<ActivitiesListVo> rows = activitySignAwardSetService.findActivitiesList(page,activitiesListDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal());
        return result;
    }
    
    /**
     *发布
     */
    @ApiOperation(value = "发布")
    @PostMapping(value = "/beReady")
    public @ResponseBody
    AjaxResult beReady(@RequestBody BeReadyDto beReadyDto) {
        return activitySignAwardSetService.beReady(beReadyDto);
    }
    
    /**
     *删除
     */
    @ApiOperation(value = "删除")
    @PostMapping(value = "/delRow")
    public @ResponseBody
    AjaxResult delRow(@RequestBody DelRowDto delRowDto) {
        return activitySignAwardSetService.delRow(delRowDto);
    }
    
    /**
     *关闭
     */
    @ApiOperation(value = "关闭")
    @PostMapping(value = "/beClose")
    public @ResponseBody
    AjaxResult beClose(@RequestBody BeCloseDto beCloseDto) {
        return activitySignAwardSetService.beClose(beCloseDto);
    }
    
    /**
     * 活动统计
     */
    @ApiOperation(value = "活动统计")
    @ApiResponses({
            @ApiResponse(code = 200, message = "OK",  response = SignReceiveListVo.class)
    })
    @PostMapping(value = "/findSignReceiveList")
    public @ResponseBody
    AjaxResult findSignReceiveList(@RequestBody SignReceiveListDto signReceiveListDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(signReceiveListDto);
        //排序
        if(StringUtils.isBlank(signReceiveListDto.getSort())){
            signReceiveListDto.setSort("create_time");
            signReceiveListDto.setOrder("desc");
        }
        Page<SignReceiveListVo> page = new Page(signReceiveListDto.getPageNum(), signReceiveListDto.getPageSize());
        IPage<SignReceiveListVo> rows = activitySignAwardSetService.findSignReceiveList(page,signReceiveListDto);
        AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal());
        return result;
    }
    
    /**
     *进入修改
     */
    @ApiOperation(value = "进入修改")
    @PostMapping(value = "/findSignForUpdate")
    public @ResponseBody
    AjaxResult findSignForUpdate(@RequestBody SignForUpdateDto signForUpdateDto) {
        return activitySignAwardSetService.findSignForUpdate(signForUpdateDto);
    }
    
    /**
     * 保存
     */
    @PostMapping(value = "/updateSignAwardSet")
    public @ResponseBody
    AjaxResult updateSignAwardSet(@RequestBody UpdateSignAwardSetDto updateSignAwardSetDto) {
        return activitySignAwardSetService.updateSignAwardSet(updateSignAwardSetDto);
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
  
}