记得上下班打卡 | git大法好,push需谨慎

Commit cadeb60e authored by wanglele's avatar wanglele

兑换码sku--->时间

parent febe7020
package com.liquidnet.service.goblin.dto.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
@Data
@HeadRowHeight(value = 20)//设置表头行高
@ColumnWidth(value = 15)//设置表头行宽
public class ActivityExcelVo {
/**
* 活动标题
*/
@ExcelProperty(value = "活动标题", index = 0)
private String title;
@ExcelProperty(value = "时间", index = 1)
private String excelTime;
/**
* 总数量
*/
@ExcelProperty(value = "兑换码数量", index = 2)
private Integer countNumber;
/**
* 使用数量
*/
@ExcelProperty(value = "已兑换", index = 3)
private Integer useNumber;
/**
* 未使用数量
*/
@ExcelProperty(value = "未兑换", index = 4)
private Integer unUseNumber;
private final static ActivityExcelVo obj = new ActivityExcelVo();
public static ActivityExcelVo getNew(){
try {
return (ActivityExcelVo) obj.clone();
}catch (CloneNotSupportedException e){
return new ActivityExcelVo();
}
}
}
package com.liquidnet.service.goblin.dto.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
@Data
@HeadRowHeight(value = 20)//设置表头行高
@ColumnWidth(value = 15)//设置表头行宽
public class CodeExcelVo {
@ExcelProperty(value = "兑换码", index = 0)
private String code;
@ExcelProperty(value = "藏品名称", index = 1)
private String skuName;
@ExcelProperty(value = "兑换开始时间", index = 2)
private String excelStartTime;
@ExcelProperty(value = "兑换结束时间", index = 3)
private String excelStopTime;
@ExcelProperty(value = "用户id", index = 4)
private String redeemUid;
@ExcelProperty(value = "状态", index = 5)
private String state;
private static final CodeExcelVo obj = new CodeExcelVo();
public static CodeExcelVo getNew() {
try {
return (CodeExcelVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new CodeExcelVo();
}
}
}
...@@ -25,8 +25,6 @@ import java.util.List; ...@@ -25,8 +25,6 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@HeadRowHeight(value = 20)//设置表头行高
@ColumnWidth(value = 15)//设置表头行宽
public class GoblinNftExActivityVo implements Serializable,Cloneable { public class GoblinNftExActivityVo implements Serializable,Cloneable {
...@@ -54,9 +52,10 @@ public class GoblinNftExActivityVo implements Serializable,Cloneable { ...@@ -54,9 +52,10 @@ public class GoblinNftExActivityVo implements Serializable,Cloneable {
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 12,required = true,value ="创建时间") @ApiModelProperty(position = 12,required = true,value ="创建时间")
@ExcelProperty(value = "时间", index = 1)//”0“表示excel中的第一列
private LocalDateTime createdAt; private LocalDateTime createdAt;
/** /**
* 更新时间 * 更新时间
*/ */
......
...@@ -49,7 +49,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -49,7 +49,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* 兑换码 * 兑换码
*/ */
@ExcelProperty(value = "兑换码", index = 0)//”0“表示excel中的第一列
@ApiModelProperty(position = 12,required = true,value ="兑换码") @ApiModelProperty(position = 12,required = true,value ="兑换码")
private String code; private String code;
...@@ -81,7 +81,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -81,7 +81,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* 兑换码状态 1 未兑换 2 已兑换 * 兑换码状态 1 未兑换 2 已兑换
*/ */
@ExcelProperty(value = "状态", index = 4)//”0“表示excel中的第一列
@ApiModelProperty(position = 17,required = true,value ="兑换码状态 1 未兑换 2 已兑换") @ApiModelProperty(position = 17,required = true,value ="兑换码状态 1 未兑换 2 已兑换")
private Integer state; private Integer state;
...@@ -89,7 +89,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -89,7 +89,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* 兑换用户id * 兑换用户id
*/ */
@ExcelProperty(value = "用户id", index = 4)//”0“表示excel中的第一列
@ApiModelProperty(position = 18,required = true,value ="兑换用户id") @ApiModelProperty(position = 18,required = true,value ="兑换用户id")
private String redeemUid; private String redeemUid;
...@@ -131,7 +131,6 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -131,7 +131,6 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* 兑换生效开始时间 * 兑换生效开始时间
*/ */
@ExcelProperty(value = "兑换开始时间", index = 2)//”0“表示excel中的第一列
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 24,required = true,value ="兑换生效开始时间") @ApiModelProperty(position = 24,required = true,value ="兑换生效开始时间")
private LocalDateTime exStartTime; private LocalDateTime exStartTime;
...@@ -140,7 +139,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -140,7 +139,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* 兑换生效结束时间 * 兑换生效结束时间
*/ */
@ExcelProperty(value = "兑换结束时间", index = 3)//”0“表示excel中的第一列
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 25,required = true,value ="兑换生效结束时间") @ApiModelProperty(position = 25,required = true,value ="兑换生效结束时间")
private LocalDateTime exStopTime; private LocalDateTime exStopTime;
...@@ -148,7 +147,6 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -148,7 +147,6 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
/** /**
* sku名称 * sku名称
*/ */
@ExcelProperty(value = "藏品名称", index = 1)//”0“表示excel中的第一列
@ApiModelProperty(position = 26,required = true,value ="sku名称") @ApiModelProperty(position = 26,required = true,value ="sku名称")
private String skuName; private String skuName;
...@@ -171,6 +169,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable { ...@@ -171,6 +169,7 @@ public class GoblinNftExCodeVo implements Serializable, Cloneable {
this.setCode(goblinNftExCode.getCode()); this.setCode(goblinNftExCode.getCode());
this.setSkuId(goblinNftExCode.getSkuId()); this.setSkuId(goblinNftExCode.getSkuId());
this.setState(goblinNftExCode.getState()); this.setState(goblinNftExCode.getState());
this.setBoxSkuId(goblinNftExCode.getBoxSkuId());
this.setRedeemUid(goblinNftExCode.getRedeemUid()); this.setRedeemUid(goblinNftExCode.getRedeemUid());
this.setAdminUid(goblinNftExCode.getAdminUid()); this.setAdminUid(goblinNftExCode.getAdminUid());
this.setRedeemAt(goblinNftExCode.getRedeemAt()); this.setRedeemAt(goblinNftExCode.getRedeemAt());
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</resultMap> </resultMap>
<select id="selectByIds" resultMap="BeseResult"> <select id="selectByIds" resultMap="BeseResult">
select code_id,activity_id,state,code from goblin_nft_ex_code select code_id,activity_id,sku_id,box_sku_id,state,code from goblin_nft_ex_code
where code_id in where code_id in
<foreach collection="codeIds.split(',')" item="codeId" open="(" separator="," close=")"> <foreach collection="codeIds.split(',')" item="codeId" open="(" separator="," close=")">
#{codeId,jdbcType=VARCHAR} #{codeId,jdbcType=VARCHAR}
......
...@@ -62,4 +62,5 @@ public class GoblinNftExActivityController { ...@@ -62,4 +62,5 @@ public class GoblinNftExActivityController {
public void excel(HttpServletResponse httpServletResponse, @RequestBody GoblinNftExActivityParam goblinNftExActivityParam) { public void excel(HttpServletResponse httpServletResponse, @RequestBody GoblinNftExActivityParam goblinNftExActivityParam) {
iGoblinNftExActivityService.excel(httpServletResponse, goblinNftExActivityParam); iGoblinNftExActivityService.excel(httpServletResponse, goblinNftExActivityParam);
} }
} }
...@@ -8,7 +8,6 @@ import com.github.pagehelper.PageHelper; ...@@ -8,7 +8,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExSkuVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExSkuVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftSkuVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftSkuVo;
...@@ -16,7 +15,7 @@ import com.liquidnet.service.goblin.entity.*; ...@@ -16,7 +15,7 @@ import com.liquidnet.service.goblin.entity.*;
import com.liquidnet.service.goblin.mapper.*; import com.liquidnet.service.goblin.mapper.*;
import com.liquidnet.service.goblin.param.GoblinNftExActivityParam; import com.liquidnet.service.goblin.param.GoblinNftExActivityParam;
import com.liquidnet.service.goblin.service.IGoblinNftExActivityService; import com.liquidnet.service.goblin.service.IGoblinNftExActivityService;
import com.liquidnet.service.platform.utils.GoblinRedisUtils; import com.liquidnet.service.goblin.dto.vo.ActivityExcelVo;
import com.liquidnet.service.platform.utils.ObjectUtil; import com.liquidnet.service.platform.utils.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
...@@ -226,7 +225,7 @@ public class GoblinNftExActivityServiceImpl implements IGoblinNftExActivityServi ...@@ -226,7 +225,7 @@ public class GoblinNftExActivityServiceImpl implements IGoblinNftExActivityServi
} }
ArrayList<GoblinNftExActivityVo> goblinNftExActivityArrayList = ObjectUtil.getGoblinNftExActivityArrayList(); ArrayList<ActivityExcelVo> activityExcelVoArrayList = ObjectUtil.getActivityExcelVoArrayList();
if (StringUtil.isNotBlank(activityIds)) { if (StringUtil.isNotBlank(activityIds)) {
activityIds.deleteCharAt(activityIds.length() - 1); activityIds.deleteCharAt(activityIds.length() - 1);
...@@ -250,16 +249,18 @@ public class GoblinNftExActivityServiceImpl implements IGoblinNftExActivityServi ...@@ -250,16 +249,18 @@ public class GoblinNftExActivityServiceImpl implements IGoblinNftExActivityServi
} }
} }
} }
ActivityExcelVo activityExcelVo = ActivityExcelVo.getNew();
goblinNftExActivity.setCountNumber(countNumber); activityExcelVo.setTitle(goblinNftExActivity.getTitle());
goblinNftExActivity.setUseNumber(useNumber); activityExcelVo.setExcelTime(goblinNftExActivity.getCreatedAt().toString());
goblinNftExActivity.setUnUseNumber(unUseNumber); activityExcelVo.setCountNumber(countNumber);
goblinNftExActivityArrayList.add(GoblinNftExActivityVo.getNew().copy(goblinNftExActivity)); activityExcelVo.setUseNumber(useNumber);
activityExcelVo.setUnUseNumber(unUseNumber);
activityExcelVoArrayList.add(activityExcelVo);
} }
} }
try{ try{
writeExcel(httpServletResponse,goblinNftExActivityArrayList,"活动excel","sheet1",GoblinNftExActivityVo.class); writeExcel(httpServletResponse,activityExcelVoArrayList,"活动excel","sheet1",ActivityExcelVo.class);
}catch (Exception e){ }catch (Exception e){
log.error("导出excel失败!"); log.error("导出excel失败!");
} }
......
...@@ -9,6 +9,7 @@ import com.github.pagehelper.PageHelper; ...@@ -9,6 +9,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.dto.vo.CodeExcelVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExActivityVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftExCodeVo; import com.liquidnet.service.goblin.dto.vo.GoblinNftExCodeVo;
import com.liquidnet.service.goblin.entity.GoblinGoodsSku; import com.liquidnet.service.goblin.entity.GoblinGoodsSku;
...@@ -86,9 +87,9 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -86,9 +87,9 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
StringBuffer skuIds = new StringBuffer(); StringBuffer skuIds = new StringBuffer();
StringBuffer acticityIds = new StringBuffer(); StringBuffer acticityIds = new StringBuffer();
for (GoblinNftExCode gnc : goblinNftExCodes) { for (GoblinNftExCode gnc : goblinNftExCodes) {
if (StringUtil.isNotBlank(gnc.getSkuId())){ if (StringUtil.isNotBlank(gnc.getSkuId())) {
skuIds.append(gnc.getSkuId()).append(","); skuIds.append(gnc.getSkuId()).append(",");
}else { } else {
skuIds.append(gnc.getBoxSkuId()).append(","); skuIds.append(gnc.getBoxSkuId()).append(",");
} }
...@@ -106,12 +107,12 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -106,12 +107,12 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) { for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) {
GoblinNftExCodeVo goblinNftExCodeVo = GoblinNftExCodeVo.getNew().copy(gnc); GoblinNftExCodeVo goblinNftExCodeVo = GoblinNftExCodeVo.getNew().copy(gnc);
if (StringUtil.isNotBlank(gnc.getBoxSkuId())&&gnc.getBoxSkuId().equals(goblinGoodsSku.getSkuId())){ if (StringUtil.isNotBlank(gnc.getBoxSkuId()) && gnc.getBoxSkuId().equals(goblinGoodsSku.getSkuId())) {
goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName()); goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName());
goblinNftExCodeArrayList.add(goblinNftExCodeVo); goblinNftExCodeArrayList.add(goblinNftExCodeVo);
break; break;
}else { } else {
if (gnc.getSkuId().equals(goblinGoodsSku.getSkuId())){ if (gnc.getSkuId().equals(goblinGoodsSku.getSkuId())) {
goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName()); goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName());
goblinNftExCodeArrayList.add(goblinNftExCodeVo); goblinNftExCodeArrayList.add(goblinNftExCodeVo);
break; break;
...@@ -140,11 +141,11 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -140,11 +141,11 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
List<GoblinNftExSku> goblinNftExSkuList = map.get(gnc.getActivityId()); List<GoblinNftExSku> goblinNftExSkuList = map.get(gnc.getActivityId());
for (GoblinNftExSku goblinNftExSku : goblinNftExSkuList) { for (GoblinNftExSku goblinNftExSku : goblinNftExSkuList) {
if (StringUtil.isNotBlank(gnc.getBoxSkuId()) && gnc.getSkuId().equals(goblinNftExSku.getSkuId())){ if (StringUtil.isNotBlank(gnc.getBoxSkuId()) && gnc.getSkuId().equals(goblinNftExSku.getSkuId())) {
gnc.setExStartTime(goblinNftExSku.getExStartTime()); gnc.setExStartTime(goblinNftExSku.getExStartTime());
gnc.setExStopTime(goblinNftExSku.getExStopTime()); gnc.setExStopTime(goblinNftExSku.getExStopTime());
break; break;
}else { } else {
if (gnc.getSkuId().equals(goblinNftExSku.getSkuId())) { if (gnc.getSkuId().equals(goblinNftExSku.getSkuId())) {
gnc.setExStartTime(goblinNftExSku.getExStartTime()); gnc.setExStartTime(goblinNftExSku.getExStartTime());
gnc.setExStopTime(goblinNftExSku.getExStopTime()); gnc.setExStopTime(goblinNftExSku.getExStopTime());
...@@ -176,10 +177,10 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -176,10 +177,10 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
goblinNftExCode.setUpdatedAt(LocalDateTime.now()); goblinNftExCode.setUpdatedAt(LocalDateTime.now());
String skuId = ""; String skuId = "";
if (StringUtil.isNotBlank(goblinNftExCode.getSkuId())) { if (StringUtil.isNotBlank(goblinNftExCode.getBoxSkuId())) {
skuId = goblinNftExCode.getSkuId();
} else if (StringUtil.isNotBlank(goblinNftExCode.getBoxSkuId())) {
skuId = goblinNftExCode.getBoxSkuId(); skuId = goblinNftExCode.getBoxSkuId();
} else {
skuId = goblinNftExCode.getSkuId();
} }
if (StringUtil.isNotBlank(skuId)) { if (StringUtil.isNotBlank(skuId)) {
...@@ -231,7 +232,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -231,7 +232,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
String skuName = goblinNftExCodeParam.getSkuName(); String skuName = goblinNftExCodeParam.getSkuName();
List<GoblinGoodsSku> goblinGoodsSkus = goblinGoodsSkuMapper.selectSkuLikeName(skuName); List<GoblinGoodsSku> goblinGoodsSkus = goblinGoodsSkuMapper.selectSkuLikeName(skuName);
if (goblinGoodsSkus.size() <= 0) { if (goblinGoodsSkus.size() <= 0) {
return; return ;
} }
StringBuffer skuIds = new StringBuffer(); StringBuffer skuIds = new StringBuffer();
for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) { for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) {
...@@ -246,9 +247,12 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -246,9 +247,12 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
StringBuffer skuIds = new StringBuffer(); StringBuffer skuIds = new StringBuffer();
StringBuffer acticityIds = new StringBuffer(); StringBuffer acticityIds = new StringBuffer();
for (GoblinNftExCode gnc : goblinNftExCodes) { for (GoblinNftExCode gnc : goblinNftExCodes) {
if (gnc.getState().equals(2)) { if (StringUtil.isNotBlank(gnc.getSkuId())) {
skuIds.append(gnc.getSkuId()).append(","); skuIds.append(gnc.getSkuId()).append(",");
} else {
skuIds.append(gnc.getBoxSkuId()).append(",");
} }
acticityIds.append(gnc.getActivityId()).append(","); acticityIds.append(gnc.getActivityId()).append(",");
} }
...@@ -261,12 +265,21 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -261,12 +265,21 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
List<GoblinGoodsSku> goblinGoodsSkus = goblinGoodsSkuMapper.selectBySkuIds(skuIds.toString()); List<GoblinGoodsSku> goblinGoodsSkus = goblinGoodsSkuMapper.selectBySkuIds(skuIds.toString());
for (GoblinNftExCode gnc : goblinNftExCodes) { for (GoblinNftExCode gnc : goblinNftExCodes) {
for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) { for (GoblinGoodsSku goblinGoodsSku : goblinGoodsSkus) {
if (gnc.getSkuId().equals(goblinGoodsSku.getSkuId())) {
GoblinNftExCodeVo goblinNftExCodeVo = GoblinNftExCodeVo.getNew().copy(gnc); GoblinNftExCodeVo goblinNftExCodeVo = GoblinNftExCodeVo.getNew().copy(gnc);
if (StringUtil.isNotBlank(gnc.getBoxSkuId()) && gnc.getBoxSkuId().equals(goblinGoodsSku.getSkuId())) {
goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName()); goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName());
goblinNftExCodeArrayList.add(goblinNftExCodeVo); goblinNftExCodeArrayList.add(goblinNftExCodeVo);
break; break;
} else {
if (gnc.getSkuId().equals(goblinGoodsSku.getSkuId())) {
goblinNftExCodeVo.setSkuName(goblinGoodsSku.getName());
goblinNftExCodeArrayList.add(goblinNftExCodeVo);
break;
}
} }
} }
} }
} }
...@@ -284,20 +297,53 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService { ...@@ -284,20 +297,53 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
} }
ArrayList<CodeExcelVo> codeExcelVoArrayList = ObjectUtil.getCodeExcelVoArrayList();
for (GoblinNftExCodeVo gnc : goblinNftExCodeArrayList) { for (GoblinNftExCodeVo gnc : goblinNftExCodeArrayList) {
List<GoblinNftExSku> goblinNftExSkuList = map.get(gnc.getActivityId()); List<GoblinNftExSku> goblinNftExSkuList = map.get(gnc.getActivityId());
for (GoblinNftExSku goblinNftExSku : goblinNftExSkuList) { for (GoblinNftExSku goblinNftExSku : goblinNftExSkuList) {
if (gnc.getSkuId().equals(goblinNftExSku.getSkuId())) {
if (StringUtil.isNotBlank(gnc.getBoxSkuId()) && gnc.getSkuId().equals(goblinNftExSku.getSkuId())) {
gnc.setExStartTime(goblinNftExSku.getExStartTime()); gnc.setExStartTime(goblinNftExSku.getExStartTime());
gnc.setExStopTime(goblinNftExSku.getExStopTime()); gnc.setExStopTime(goblinNftExSku.getExStopTime());
break; break;
} else {
if (gnc.getSkuId().equals(goblinNftExSku.getSkuId())) {
gnc.setExStartTime(goblinNftExSku.getExStartTime());
gnc.setExStopTime(goblinNftExSku.getExStopTime());
break;
}
} }
} }
CodeExcelVo codeExcelVo = new CodeExcelVo();
codeExcelVo.setCode(gnc.getCode());
String val = "";
switch (gnc.getState()) {
case 1:
val = "未兑换";
break;
case 2:
val = "已兑换";
break;
case 3:
val = "已失效";
break;
default:
val = "状态处理中";
}
codeExcelVo.setSkuName(gnc.getSkuName());
codeExcelVo.setState(val);
codeExcelVo.setExcelStartTime(gnc.getExStartTime().toString());
codeExcelVo.setExcelStopTime(gnc.getExStopTime().toString());
codeExcelVo.setRedeemUid(gnc.getRedeemUid());
codeExcelVoArrayList.add(codeExcelVo);
} }
try { try {
writeExcel(httpServletResponse, goblinNftExCodeArrayList, "活动excel", "sheet1", GoblinNftExCodeVo.class); writeExcel(httpServletResponse, codeExcelVoArrayList, "兑换码excel", "sheet1", CodeExcelVo.class);
} catch (Exception e) { } catch (Exception e) {
log.error("导出excel失败!"); log.error("导出excel失败!");
} }
......
...@@ -148,7 +148,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService { ...@@ -148,7 +148,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
// redis 存储 // redis 存储
goblinRedisUtils.addCode(code, goblinNftExCodeVo, millisNum); goblinRedisUtils.addCode(code, goblinNftExCodeVo, millisNum);
goblinNftExCode.setSkuId(key); goblinNftExCode.setSkuId(goblinNftExSkuParam.getSkuId());
} }
goblinNftExSkuParamMap.put(key, goblinNftExSkuParam); goblinNftExSkuParamMap.put(key, goblinNftExSkuParam);
} }
......
...@@ -7,11 +7,9 @@ import com.liquidnet.service.candy.entity.CandyCouponCode; ...@@ -7,11 +7,9 @@ import com.liquidnet.service.candy.entity.CandyCouponCode;
import com.liquidnet.service.candy.entity.CandyUserCoupon; import com.liquidnet.service.candy.entity.CandyUserCoupon;
import com.liquidnet.service.goblin.dto.GoblinStoreMarketDto; import com.liquidnet.service.goblin.dto.GoblinStoreMarketDto;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinNftExActivity;
import com.liquidnet.service.goblin.entity.GoblinNftExCode;
import com.liquidnet.service.goblin.entity.GoblinNftExSku;
import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo; import com.liquidnet.service.kylin.dto.vo.KylinApiCameraDevicesVo;
import com.liquidnet.service.kylin.entity.KylinOrderCoupons; import com.liquidnet.service.kylin.entity.KylinOrderCoupons;
import com.liquidnet.service.goblin.dto.vo.ActivityExcelVo;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -41,11 +39,6 @@ public class ObjectUtil { ...@@ -41,11 +39,6 @@ public class ObjectUtil {
} }
private static final ArrayList<AdamTagParentVo> adamTagParentVoArrayList = new ArrayList<>(); private static final ArrayList<AdamTagParentVo> adamTagParentVoArrayList = new ArrayList<>();
private static final ArrayList<AdamTagVo> adamTagVoArrayList = new ArrayList<>(); private static final ArrayList<AdamTagVo> adamTagVoArrayList = new ArrayList<>();
private static final ArrayList<AdamMemberOrderSimpleVo> adamMemberOrderSimpleVoArrayList = new ArrayList<>(); private static final ArrayList<AdamMemberOrderSimpleVo> adamMemberOrderSimpleVoArrayList = new ArrayList<>();
...@@ -69,12 +62,15 @@ public class ObjectUtil { ...@@ -69,12 +62,15 @@ public class ObjectUtil {
private static final ArrayList<GoblinNftExCodeVo> goblinNftExCodeVoArrayList = new ArrayList<>(); private static final ArrayList<GoblinNftExCodeVo> goblinNftExCodeVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinNftExSkuVo> goblinNftExSkuVoArrayList = new ArrayList<>(); private static final ArrayList<GoblinNftExSkuVo> goblinNftExSkuVoArrayList = new ArrayList<>();
private static final ArrayList<GoblinNftSkuVo> goblinNftSkuVoArrayList = new ArrayList<>(); private static final ArrayList<GoblinNftSkuVo> goblinNftSkuVoArrayList = new ArrayList<>();
private static final ArrayList<ActivityExcelVo> activityExcelVoArrayList = new ArrayList();
private static final ArrayList<CodeExcelVo> codeExcelVoArrayList = new ArrayList();
private static final ArrayList<GoblinStoreMarketDto> goblinStoreMarketDtoArrayList = new ArrayList<>(); private static final ArrayList<GoblinStoreMarketDto> goblinStoreMarketDtoArrayList = new ArrayList<>();
public static ArrayList<SellDataOneVO> getSellDataOneVOArrayList() { public static ArrayList<SellDataOneVO> getSellDataOneVOArrayList() {
return (ArrayList<SellDataOneVO>) sellDataOneVOArrayList.clone(); return (ArrayList<SellDataOneVO>) sellDataOneVOArrayList.clone();
} }
public static ArrayList<AdamTagParentVo> getAdamTagParentVoArrayList() { public static ArrayList<AdamTagParentVo> getAdamTagParentVoArrayList() {
return (ArrayList<AdamTagParentVo>) adamTagParentVoArrayList.clone(); return (ArrayList<AdamTagParentVo>) adamTagParentVoArrayList.clone();
} }
...@@ -147,22 +143,29 @@ public class ObjectUtil { ...@@ -147,22 +143,29 @@ public class ObjectUtil {
return (ArrayList<KylinApiCameraDevicesVo>) kylinApiCameraDevicesVoArrayList.clone(); return (ArrayList<KylinApiCameraDevicesVo>) kylinApiCameraDevicesVoArrayList.clone();
} }
public static ArrayList<GoblinNftExActivityVo> getGoblinNftExActivityArrayList(){ public static ArrayList<GoblinNftExActivityVo> getGoblinNftExActivityArrayList() {
return (ArrayList<GoblinNftExActivityVo>) goblinNftExActivityVoArrayList.clone(); return (ArrayList<GoblinNftExActivityVo>) goblinNftExActivityVoArrayList.clone();
} }
public static ArrayList<GoblinNftExCodeVo> getGoblinNftExCodeArrayList(){ public static ArrayList<GoblinNftExCodeVo> getGoblinNftExCodeArrayList() {
return (ArrayList<GoblinNftExCodeVo>) goblinNftExCodeVoArrayList.clone(); return (ArrayList<GoblinNftExCodeVo>) goblinNftExCodeVoArrayList.clone();
} }
public static ArrayList<GoblinNftExSkuVo> getGoblinNftExSkuArrayList(){ public static ArrayList<GoblinNftExSkuVo> getGoblinNftExSkuArrayList() {
return (ArrayList<GoblinNftExSkuVo>) goblinNftExSkuVoArrayList.clone(); return (ArrayList<GoblinNftExSkuVo>) goblinNftExSkuVoArrayList.clone();
} }
public static ArrayList<GoblinNftSkuVo> getGoblinNftSkuVoArrayList(){ public static ArrayList<GoblinNftSkuVo> getGoblinNftSkuVoArrayList() {
return (ArrayList<GoblinNftSkuVo>) goblinNftSkuVoArrayList.clone(); return (ArrayList<GoblinNftSkuVo>) goblinNftSkuVoArrayList.clone();
} }
public static ArrayList<ActivityExcelVo> getActivityExcelVoArrayList() {
return (ArrayList<ActivityExcelVo>) activityExcelVoArrayList.clone();
}
public static ArrayList<CodeExcelVo> getCodeExcelVoArrayList(){
return (ArrayList<CodeExcelVo>)codeExcelVoArrayList.clone();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment