101captain
2022-02-22 c83cf9d2d82a0a29a15e38f4566eb470b9a3517b
抽奖相关提交
3个文件已添加
9个文件已修改
449 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleRecordApi.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/raffle/ComActRaffleRecordExcelVO.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/raffle/ComActRaffleRecordVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActRaffleRecordApi.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActRaffleRecordApi.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/config/RabbitmqConfig.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActRaffleRecordDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/RaffleMessage.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActRaffleRecordService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActRaffleRecordServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActRaffleRecordMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActRaffleRecordApi.java
New file
@@ -0,0 +1,94 @@
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);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/raffle/ComActRaffleRecordExcelVO.java
New file
@@ -0,0 +1,51 @@
package com.panzhihua.common.model.vos.community.raffle;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.net.URL;
import java.util.Date;
/**
 * @author zzj
 */
@Data
public class ComActRaffleRecordExcelVO {
    @ApiModelProperty(value = "昵称")
    @ExcelProperty(value = "昵称",index = 0)
    private String nickName;
    @ApiModelProperty(value = "姓名")
    @ExcelProperty(value = "姓名",index = 1)
    private String username;
    @ApiModelProperty(value = "联系电话")
    @ExcelProperty(value = "联系电话",index = 2)
    private String phone;
    /**
     * 创建时间
     */
    @ExcelProperty(value = "中奖时间",index = 3)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "奖品名称")
    @ExcelProperty(value = "奖品名称",index = 4)
    private String prizeName;
    @ApiModelProperty(value = "奖品图片")
    @ExcelProperty(value = "奖品图片",index = 5)
    private URL imageUrl;
    @ApiModelProperty(value = "核销人名称")
    @ExcelProperty(value = "核销人",index = 6)
    private String staffName;
    @ApiModelProperty(value = "核销时间")
    @ExcelProperty(value = "核销时间",index = 7)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date staffTime;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/raffle/ComActRaffleRecordVO.java
@@ -57,7 +57,7 @@
    @ApiModelProperty(value = "核销时间")
    private Date staffTime;
    @ApiModelProperty(value = "0 已参加 1待兑奖 2已兑奖 3已失效")
    @ApiModelProperty(value = "0 已参加 1待兑奖 2已兑奖 3已失效 4未中奖")
    private Integer status;
    @ApiModelProperty(value = "抽奖id")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -24,6 +24,7 @@
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
import com.panzhihua.common.model.vos.community.social.*;
import io.swagger.annotations.ApiOperation;
@@ -8096,4 +8097,44 @@
    @GetMapping("/comActRaffle/del")
    R deleteComActRaffle(@RequestParam("id") Long id);
    /**
     * 分页查询所有数据
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @PostMapping("/comActRaffleRecord/queryAll")
    R selectAllComActRaffleRecord(@RequestBody CommonPage commonPage);
    @GetMapping("/comActRaffleRecord/queryPrize")
    R queryPrize(@RequestParam("id")Long id);
    /**
     * 生成二维码
     * @param qrCodeVO
     * @return
     */
    @PostMapping("/comActRaffleRecord/getQRCode")
    R getRaffleQRCode(@RequestBody QRCodeVO qrCodeVO);
    /**
     * 修改数据
     *
     * @param comActRaffleRecordVO 实体对象
     * @return 修改结果
     */
    @PostMapping("/comActRaffleRecord/update")
    R updateRaffleRecord(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO);
    @PostMapping("/comActRaffleRecord")
    R insertRaffleRecord(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO);
    /**
     * 导出
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @PostMapping("/comActRaffleRecord/export")
    R exportComActRaffleRecord(@RequestBody CommonPage commonPage);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActRaffleRecordApi.java
@@ -1,14 +1,29 @@
package com.panzhihua.community_backstage.api;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONArray;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordExcelVO;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
import com.panzhihua.common.model.vos.community.warehouse.ComActWarehouseApplyExcelVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.Serializable;
/**
@@ -30,4 +45,89 @@
    @Resource
    private CommunityService communityService;
    @Value("${excel.userurl}")
    private String excelUrl;
    // FTP 登录用户名
    @Value("${ftp.username}")
    private String userName;
    // FTP 登录密码
    @Value("${ftp.password}")
    private String password;
    // FTP 服务器地址IP地址
    @Value("${ftp.host}")
    private String host;
    // FTP 端口
    @Value("${ftp.port}")
    private int port;
    /**
     * 分页查询所有数据
     *
     * @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);
    }
    @ApiOperation(value = "导出")
    @PostMapping("/export")
    public R export(@RequestBody CommonPage commonPage) {
        String name = "获奖名单.xlsx";
        String ftpUrl = "/mnt/data/web/excel/";
        // 用户搜索了就下载搜索的用户否则下载所有用户
        R r = communityService.exportComActRaffleRecord(commonPage);
        if (R.isOk(r)) {
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComActRaffleRecordExcelVO.class)
                                .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                                .registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet( "导出").build();
                        excelWriter.write(JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActRaffleRecordExcelVO.class), writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        return r;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComActRaffleRecordApi.java
@@ -6,8 +6,12 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO;
import com.panzhihua.service_community.entity.ComActRaffleRecord;
import com.panzhihua.service_community.service.ComActRaffleRecordService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -47,6 +51,17 @@
    }
    /**
     * 生成二维码
     * @param qrCodeVO
     * @return
     */
    @ApiOperation("生成二维码")
    @PostMapping("/getQRCode")
    public R getQRCode(@RequestBody QRCodeVO qrCodeVO){
        return this.comActRaffleRecordService.queryQrCode(qrCodeVO);
    }
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
@@ -60,22 +75,26 @@
    /**
     * 新增数据
     *
     * @param comActRaffleRecord 实体对象
     * @param comActRaffleRecordVO 实体对象
     * @return 新增结果
     */
    @PostMapping
    public R insert(@RequestBody ComActRaffleRecord comActRaffleRecord) {
    public R insert(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) {
        ComActRaffleRecord comActRaffleRecord=new ComActRaffleRecord();
        BeanUtils.copyProperties(comActRaffleRecordVO,comActRaffleRecord);
        return R.ok(this.comActRaffleRecordService.save(comActRaffleRecord));
    }
    /**
     * 修改数据
     *
     * @param comActRaffleRecord 实体对象
     * @param comActRaffleRecordVO 实体对象
     * @return 修改结果
     */
    @PostMapping("/update")
    public R update(@RequestBody ComActRaffleRecord comActRaffleRecord) {
    public R update(@RequestBody ComActRaffleRecordVO comActRaffleRecordVO) {
        ComActRaffleRecord comActRaffleRecord=new ComActRaffleRecord();
        BeanUtils.copyProperties(comActRaffleRecordVO,comActRaffleRecord);
        return R.ok(this.comActRaffleRecordService.updateById(comActRaffleRecord));
    }
@@ -89,4 +108,15 @@
    public R delete(@RequestParam("id") Long id) {
        return R.ok(this.comActRaffleRecordService.removeById(id));
    }
    /**
     * 分页查询所有数据
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @PostMapping("export")
    public R export(@RequestBody CommonPage commonPage) {
        return this.comActRaffleRecordService.export(commonPage);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/config/RabbitmqConfig.java
@@ -21,6 +21,10 @@
    public static final String Order_ROUTING_KEY="order.key";
    public static final String Order_EXCHANGE="order.exchange";
    public static final String RAFFLE_QUEUE="raffle.queue";
    public static final String RAFFLE_ROUTING_KEY="raffle.key";
    public static final String RAFFLE_EXCHANGE="raffle.exchange";
    @Bean
@@ -41,6 +45,23 @@
    }
    @Bean
    public Queue raffleQueue(){
        return new Queue(RAFFLE_QUEUE,true,false,false,null);
    }
    @Bean
    public Exchange raffleExchange(){
        Map<String, Object> arguments = new HashMap<>();
        arguments.put("x-delayed-type", ExchangeTypes.DIRECT);
        return new CustomExchange(RAFFLE_EXCHANGE,"x-delayed-message",true,false,arguments);
    }
    @Bean
    public Binding raffleBinding(){
        return BindingBuilder.bind(raffleQueue()).to(raffleExchange()).with(RAFFLE_ROUTING_KEY).noargs();
    }
    @Bean
    public Queue orderQueue(){
        return new Queue(Order_QUEUE,true,false,false,null);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActRaffleRecordDao.java
@@ -4,11 +4,14 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordExcelVO;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
import org.apache.ibatis.annotations.Mapper;
import com.panzhihua.service_community.entity.ComActRaffleRecord;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
 * 抽奖活动中奖记录表(ComActRaffleRecord)表数据库访问层
@@ -35,4 +38,11 @@
     * @return
     */
    IPage<ComActRaffleRecordVO> pageList(Page page, @Param("commonPage")CommonPage commonPage);
    /**
     * 导出
     * @param commonPage
     * @return
     */
    List<ComActRaffleRecordExcelVO> export(@Param("commonPage")CommonPage commonPage);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/RaffleMessage.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.service_community.message;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
import com.panzhihua.service_community.dao.ComActRaffleDao;
import com.panzhihua.service_community.entity.ComActRaffle;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
/**
 * @author zzj
 */
@Component
public class RaffleMessage {
    public static final String DELAYED_QUEUE="raffle.queue";
    @Resource
    private ComActRaffleDao comActRaffleDao;
    @RabbitListener(queues=DELAYED_QUEUE)
    public void doRaffle(ComActRaffleVO comActRaffleVO){
        ComActRaffle comActRaffle=comActRaffleDao.selectOne(new QueryWrapper<ComActRaffle>().lambda().eq(ComActRaffle::getId,comActRaffleVO.getId()));
        if(comActRaffle!=null&&comActRaffle.getStatus()==0&&comActRaffle.getLotteryTime().before(new Date())){
        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActRaffleRecordService.java
@@ -3,6 +3,7 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO;
import com.panzhihua.service_community.entity.ComActRaffleRecord;
/**
@@ -28,4 +29,19 @@
     * @return
     */
    R queryPrize(Long id);
    /**
     * 生成二维码
     * @param qrCodeVO
     * @return
     */
    R queryQrCode(QRCodeVO qrCodeVO);
    /**
     * 导出
     *
     * @param commonPage
     * @return
     */
    R export(CommonPage commonPage);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActRaffleRecordServiceImpl.java
@@ -1,14 +1,17 @@
package com.panzhihua.service_community.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.raffle.ComActRafflePrizeCount;
import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO;
import com.panzhihua.service_community.dao.ComActRafflePrizeDao;
import com.panzhihua.service_community.entity.ComActRaffleRecord;
import com.panzhihua.service_community.dao.ComActRaffleRecordDao;
import com.panzhihua.service_community.service.ComActRaffleRecordService;
import com.panzhihua.service_community.util.QRCodeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -39,4 +42,18 @@
        comActRafflePrizeCount.setComActRafflePrizeVOList(comActRafflePrizeDao.selectByRaffleId(id));
        return R.ok(comActRafflePrizeCount);
    }
    @Override
    public R queryQrCode(QRCodeVO qrCodeVO) {
        ComActRaffleRecord comActRaffleRecord=this.baseMapper.selectById(qrCodeVO.getId());
        if(comActRaffleRecord!=null){
            return R.ok(QRCodeUtil.getBase64QRCode(JSON.toJSONString(qrCodeVO)));
        }
        return R.fail("抽奖记录不存在");
    }
    @Override
    public R export(CommonPage commonPage) {
        return R.ok(this.baseMapper.export(commonPage));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActRaffleRecordMapper.xml
@@ -23,7 +23,7 @@
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO">
        select t.*, t1.image, t1.name as prizeName, t2.nick_name, t2.phone, t2.`name` as username, t3.name as staffName
        from com_act_raffle_record t
        left join com_act_raffle_prize t1 on t.staff_id = t1.id
        left join com_act_raffle_prize t1 on t.prize_id = t1.id
        left join sys_user t2 on t.user_id = t2.user_id
        left join sys_user t3 on t.staff_id = t3.user_id
        <where>
@@ -37,6 +37,33 @@
            <if test="commonPage.paramId !=null">
                and t.raffle_id = #{commonPage.paramId}
            </if>
            <if test="commonPage.userId !=null">
                and t.user_id = #{commonPage.userId}
            </if>
        </where>
        order by t.create_time desc
    </select>
    <select id="export" resultType="com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordExcelVO">
        select t.*, t1.image as imageUrl, t1.name as prizeName, t2.nick_name, t2.phone, t2.`name` as username, t3.name as staffName
        from com_act_raffle_record t
        left join com_act_raffle_prize t1 on t.prize_id = t1.id
        left join sys_user t2 on t.user_id = t2.user_id
        left join sys_user t3 on t.staff_id = t3.user_id
        <where>
            <if test="commonPage.status!=null">
                and t.status = #{commonPage.status}
            </if>
            <if test="commonPage.keyword!=null and commonPage.keyword!=''">
                and (t2.name like concat('%',#{commonPage.keyword},'%') or t2.phone like
                concat('%',#{commonPage.keyword},'%') or t1.name like concat('%',#{commonPage.keyword},'%') )
            </if>
            <if test="commonPage.paramId !=null">
                and t.raffle_id = #{commonPage.paramId}
            </if>
            <if test="commonPage.userId !=null">
                and t.user_id = #{commonPage.userId}
            </if>
        </where>
        order by t.create_time desc
    </select>