| | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (PrizeRecordVO vo : list){ |
| | | PrizeRecordExportDetailDTO detailDtO = new PrizeRecordExportDetailDTO(); |
| | | BeanUtils.copyProperties(vo,detailDtO); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // 将Date类型转换为指定格式的字符串 |
| | | String createTimeStr = sdf.format(vo.getCreateTime()); |
| | | // 设置到DTO中 |
| | | detailDtO.setCreateTime(createTimeStr); |
| | | exportDetailDTOS.add(detailDtO); |
| | | } |
| | | XSSFWorkbook workbook = new XSSFWorkbook(); |
| | |
| | | Row header = sheet.createRow(0); |
| | | String[] headers = { |
| | | "用户昵称", "活动名","中奖状态", |
| | | "中奖内容","奖品发放状态" |
| | | "中奖内容","奖品发放状态","抽奖时间" |
| | | }; |
| | | for(int i= 0 ;i< headers.length;i++){ |
| | | Cell cell = header.createCell(i); |
| | |
| | | }else { |
| | | row.createCell(4).setCellValue(PrizeDistributeStatusEnum.WAIT.getDescription()); |
| | | } |
| | | |
| | | row.createCell(5).setCellValue(dto.getCreateTime()); |
| | | } |
| | | |
| | | return workbook; |