| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | |
| | | private String activityName; |
| | | //中奖状态 |
| | | private String grantStatus; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | } |
| | | |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | |
| | | private String prizeStatus; |
| | | |
| | | private String distributeStatus; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | } |
| | | |
| | |
| | | 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 (PrizeGrantRecordVO vo : list){ |
| | | PrizeGrantRecordExportDetailDtO detailDtO = new PrizeGrantRecordExportDetailDtO(); |
| | | 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); |
| | | } |
| | | |
| | |
| | | String[] headers = { |
| | | "用户昵称", "活动名","商品名", |
| | | "商品内容","发放状态" |
| | | ,"描述" |
| | | ,"描述","发布时间" |
| | | }; |
| | | for(int i= 0 ;i< headers.length;i++){ |
| | | Cell cell = header.createCell(i); |
| | |
| | | } |
| | | |
| | | row.createCell(5).setCellValue(dto.getDes()); |
| | | row.createCell(6).setCellValue(dto.getCreateTime()); |
| | | } |
| | | |
| | | return workbook; |
| | |
| | | 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; |
| | |
| | | //描述 |
| | | private String des; |
| | | |
| | | private String createTime; |
| | | |
| | | } |
| | |
| | | * @see PrizeDistributeStatusEnum |
| | | * */ |
| | | private String distributeStatus; |
| | | |
| | | private String createTime; |
| | | } |
| | |
| | | LPGR.prize_content, |
| | | LPGR.grant_status, |
| | | LPGR.prize_num_id, |
| | | LPGR.create_time, |
| | | LPGR.des, |
| | | LPGR.id |
| | | FROM |
| | |
| | | <if test="query.grantStatus != null and query.grantStatus !=''"> |
| | | AND LPGR.grant_status = #{query.grantStatus} |
| | | </if> |
| | | <if test="query.startTime != null">AND LPGR.create_time >= #{query.startTime}</if> |
| | | <if test="query.endTime != null">AND LPGR.create_time <= #{query.endTime}</if> |
| | | </select> |
| | | <select id="getExportData" resultMap="BaseResultMap"> |
| | | SELECT |
| | |
| | | LPGR.grant_status, |
| | | LPGR.prize_num_id, |
| | | LPGR.des, |
| | | LPGR.create_time, |
| | | LPGR.id |
| | | FROM |
| | | lmk_prize_grant_record LPGR |
| | |
| | | <if test="query.grantStatus != null and query.grantStatus !=''"> |
| | | AND LPGR.grant_status = #{query.grantStatus} |
| | | </if> |
| | | <if test="query.startTime != null">AND LPGR.create_time >= #{query.startTime}</if> |
| | | <if test="query.endTime != null">AND LPGR.create_time <= #{query.endTime}</if> |
| | | </select> |
| | | </mapper> |
| | |
| | | LPR.prize_num_id, |
| | | LPR.activity_prize_ref_id, |
| | | LPR.distribute_status, |
| | | LPR.create_time, |
| | | LPR.id |
| | | FROM |
| | | lmk_prize_record LPR |
| | |
| | | <if test="query.distributeStatus != null and query.distributeStatus !=''"> |
| | | AND LPR.distribute_status = #{query.distributeStatus} |
| | | </if> |
| | | <if test="query.startTime != null">AND LPR.create_time >= #{query.startTime}</if> |
| | | <if test="query.endTime != null">AND LPR.create_time <= #{query.endTime}</if> |
| | | </select> |
| | | <select id="getByUserIdPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | |
| | | LPR.prize_num_id, |
| | | LPR.activity_prize_ref_id, |
| | | LPR.distribute_status, |
| | | LPR.create_time, |
| | | LPR.id |
| | | FROM |
| | | lmk_prize_record LPR |
| | |
| | | <if test="query.distributeStatus != null and query.distributeStatus !=''"> |
| | | AND LPR.distribute_status = #{query.distributeStatus} |
| | | </if> |
| | | <if test="query.startTime != null">AND LPR.create_time >= #{query.startTime}</if> |
| | | <if test="query.endTime != null">AND LPR.create_time <= #{query.endTime}</if> |
| | | </select> |
| | | <resultMap id="getPrizeRecordListByTimeMap" type="cn.lili.modules.lmk.domain.vo.PrizeRecordTimeVO"> |
| | | <result property="activityPrizeRefId" column="activity_prize_ref_id"/> |