From d3f5a984360ae152369e6edf743cf8ace4e1d8ec Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期四, 28 八月 2025 14:23:08 +0800 Subject: [PATCH] 导出时间 --- framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeRecordServiceImpl.java | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeRecordServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeRecordServiceImpl.java index b8cdd6e..d2bb6af 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeRecordServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/PrizeRecordServiceImpl.java @@ -1,7 +1,7 @@ package cn.lili.modules.lmk.service.impl; +import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.StringUtils; -import cn.lili.modules.lmk.domain.query.PrizeGrantRecordQuery; import cn.lili.modules.lmk.domain.query.PrizeRecordTimeQuery; import cn.lili.modules.lmk.domain.vo.PrizeRecordTimeVO; import cn.lili.modules.lmk.enums.general.PrizeDistributeStatusEnum; @@ -31,6 +31,7 @@ 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; @@ -76,6 +77,11 @@ for (PrizeRecordVO vo : list){ PrizeRecordExportDetailDTO detailDtO = new PrizeRecordExportDetailDTO(); BeanUtils.copyProperties(vo,detailDtO); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 灏咲ate绫诲瀷杞崲涓烘寚瀹氭牸寮忕殑瀛楃涓� + String createTimeStr = sdf.format(vo.getCreateTime()); + // 璁剧疆鍒癉TO涓� + detailDtO.setCreateTime(createTimeStr); exportDetailDTOS.add(detailDtO); } XSSFWorkbook workbook = new XSSFWorkbook(); @@ -85,7 +91,7 @@ Row header = sheet.createRow(0); String[] headers = { "鐢ㄦ埛鏄电О", "娲诲姩鍚�","涓鐘舵��", - "涓鍐呭","濂栧搧鍙戞斁鐘舵��" + "涓鍐呭","濂栧搧鍙戞斁鐘舵��","鎶藉鏃堕棿" }; for(int i= 0 ;i< headers.length;i++){ Cell cell = header.createCell(i); @@ -113,7 +119,7 @@ }else { row.createCell(4).setCellValue(PrizeDistributeStatusEnum.WAIT.getDescription()); } - + row.createCell(5).setCellValue(dto.getCreateTime()); } return workbook; @@ -188,6 +194,25 @@ } return Result.ok().data(page.getRecords()).total(page.getTotal()); } + @Override + public Result pageByUserId(PrizeRecordQuery query) { + String userId = UserContext.getCurrentUser().getId(); + IPage<PrizeRecordVO> page = PageUtil.getPage(query, PrizeRecordVO.class); + if (StringUtils.isNotBlank(userId)){ + baseMapper.getByUserIdPage(page, query, userId); + for (PrizeRecordVO vo :page.getRecords()){ + if (StringUtils.isNotBlank(vo.getPrizeActivityCover())){ + vo.setPrizeActivityCoverUrl(cosUtil.getPreviewUrl(vo.getPrizeActivityCover())); + } + if (StringUtils.isNotBlank(vo.getPrizeImg())){ + vo.setPrizeImgUrl(cosUtil.getPreviewUrl(vo.getPrizeImg())); + } + } + + } + return Result.ok().data(page.getRecords()).total(page.getTotal()); + + } /** * 鏍规嵁id鏌ユ壘 -- Gitblit v1.8.0