package com.panzhihua.applets.api;
|
|
|
import com.panzhihua.common.controller.BaseController;
|
import com.panzhihua.common.model.dtos.property.CommonPage;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
|
import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO;
|
import com.panzhihua.common.service.community.CommunityService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.Date;
|
|
/**
|
* 抽奖活动中奖记录表(ComActRaffleRecord)表控制层
|
* projectName 成都呐喊信息技术有限公司-智慧社区项目
|
* description: 抽奖活动中奖记录表相关功能
|
*
|
* @author zzj
|
* @since 2022-02-18 14:32:02
|
*/
|
@Slf4j
|
@Api(tags = {"获奖记录"})
|
@RestController
|
@RequestMapping("comActRaffleRecord")
|
public class ComActRaffleRecordApi extends BaseController {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private CommunityService communityService;
|
|
/**
|
* 分页查询所有数据
|
*
|
* @param commonPage 查询实体
|
* @return 所有数据
|
*/
|
@ApiOperation(value = "分页查询",response = ComActRaffleRecordVO.class)
|
@PostMapping("queryAll")
|
public R selectAll(@RequestBody CommonPage commonPage) {
|
return this.communityService.selectAllComActRaffleRecord(commonPage);
|
}
|
@ApiOperation(value = "根据抽奖活动id获取奖品统计")
|
@GetMapping("/queryPrize")
|
public R queryPrize(@RequestParam("id")Long id){
|
return this.communityService.queryPrize(id);
|
}
|
|
/**
|
* 生成二维码
|
* @param qrCodeVO
|
* @return
|
*/
|
@ApiOperation("生成二维码")
|
@PostMapping("/getQRCode")
|
public R getQRCode(@RequestBody QRCodeVO qrCodeVO){
|
return this.communityService.getRaffleQRCode(qrCodeVO);
|
}
|
|
/**
|
* 修改数据
|
*
|
* @param comActRaffleRecordVO 实体对象
|
* @return 修改结果
|
*/
|
@ApiOperation("核销接口")
|
@PostMapping("/update")
|
public R update(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) {
|
comActRaffleRecordVO.setStaffId(this.getUserId());
|
comActRaffleRecordVO.setStaffTime(new Date());
|
comActRaffleRecordVO.setStatus(2);
|
return this.communityService.updateRaffleRecord(comActRaffleRecordVO);
|
}
|
/**
|
* 新增数据
|
*
|
* @param comActRaffleRecordVO 实体对象
|
* @return 新增结果
|
*/
|
@ApiOperation("参加活动")
|
@PostMapping
|
public R insert(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) {
|
comActRaffleRecordVO.setCreateTime(new Date());
|
comActRaffleRecordVO.setUserId(this.getUserId());
|
comActRaffleRecordVO.setStatus(0);
|
return communityService.insertRaffleRecord(comActRaffleRecordVO);
|
}
|
/**
|
* 通过主键查询单条数据
|
*
|
* @param id 主键
|
* @return 单条数据
|
*/
|
@ApiOperation("详情")
|
@GetMapping("{id}")
|
public R selectOne(@PathVariable("id") Long id) {
|
return this.communityService.selectOneRaffleRecord(id);
|
}
|
}
|