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

Commit 8bc5e22c authored by jiangxiulong's avatar jiangxiulong

整理商品订单详情vo

parent f028a285
......@@ -27,21 +27,17 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
private String name;
@ApiModelProperty(position = 14, value = "单品的副标题[128]")
private String subtitle;
@ApiModelProperty(position = 15, value = "单品默认图片的URL[256]")
private String skuPic;
@ApiModelProperty(position = 15, value = "单品详情展示文件URL[256]")
private String skuWatch;
@ApiModelProperty(position = 15, value = "展示文件类型[1-图片|2-视频|3-模型]")
private String watchType;
@ApiModelProperty(position = 18, value = "单品库存")
private Integer skuStock;
@ApiModelProperty(position = 20, value = "单品销售价-原价[20,2]")
private BigDecimal sellPrice;
@ApiModelProperty(position = 21, value = "单品现价[20,2]")
private BigDecimal price;
@ApiModelProperty(position = 23, value = "单品简介[256]", example = "单品简介...")
private String intro;
@ApiModelProperty(position = 23, value = "单品详情", example = "单品详情...")
private String details;
......@@ -51,12 +47,9 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 27, value = "开售时间")
private LocalDateTime saleStartTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 27, value = "停售时间")
private LocalDateTime saleStopTime;
@ApiModelProperty(position = 33, value = "自定义展示[0-默认展示|1-隐藏不可购买]")
private String skuAppear;
@ApiModelProperty(position = 33, value = "是否购买[0-否|1-是]")
private String skuCanbuy;
@ApiModelProperty(position = 54, value = "单品音乐人标签[藏品类型时使用]")
private List<GoblinGoodsExtagVo> extagVoList;
......@@ -85,17 +78,14 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
this.setSpuId(source.getSpuId());
this.setName(source.getName());
this.setSubtitle(source.getSubtitle());
this.setSkuPic(source.getSkuPic());
this.setSkuWatch(source.getSkuWatch());
this.setWatchType(source.getWatchType());
this.setSkuStock(source.getSkuStock());
this.setSellPrice(source.getSellPrice());
this.setPrice(source.getPrice());
this.setIntro(source.getIntro());
this.setDetails(source.getDetails());
this.setBuyLimit(source.getBuyLimit());
this.setSaleStartTime(source.getSaleStartTime());
this.setSaleStopTime(source.getSaleStopTime());
this.setSkuAppear(source.getSkuAppear());
this.setSkuCanbuy(source.getSkuCanbuy());
this.setExtagVoList(source.getExtagVoList());
return this;
}
......
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@ApiModel(value = "GoblinNftGoodsSkuListVo", description = "NFT商品SKU信息列表使用")
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class GoblinNftGoodsSkuListVo implements Serializable, Cloneable {
private static final long serialVersionUID = -519573757075729441L;
@ApiModelProperty(position = 10, value = "商品单品ID")
private String skuId;
@ApiModelProperty(position = 11, value = "商品ID[64]")
private String spuId;
@ApiModelProperty(position = 13, value = "单品的名称[100]")
private String name;
@ApiModelProperty(position = 14, value = "单品的副标题[128]")
private String subtitle;
@ApiModelProperty(position = 15, value = "单品默认图片的URL[256]")
private String skuPic;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
@ApiModelProperty(position = 27, value = "开售时间")
private LocalDateTime saleStartTime;
@ApiModelProperty(position = 55, value = "spu相关信息")
private GoblinNftGoodsSpuInfoVo goblinNftGoodsSpuInfoVo;
@ApiModelProperty(position = 56, value = "是否还有库存 0没有库存 1有库存 即售罄")
private int isStock;
private static final GoblinNftGoodsSkuListVo obj = new GoblinNftGoodsSkuListVo();
public static GoblinNftGoodsSkuListVo getNew() {
try {
return (GoblinNftGoodsSkuListVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinNftGoodsSkuListVo();
}
}
public GoblinNftGoodsSkuListVo copy(GoblinGoodsSkuInfoVo source) {
if (null == source) return this;
this.setSkuId(source.getSkuId());
this.setSpuId(source.getSpuId());
this.setName(source.getName());
this.setSubtitle(source.getSubtitle());
this.setSkuPic(source.getSkuPic());
this.setSaleStartTime(source.getSaleStartTime());
return this;
}
}
......@@ -3,10 +3,11 @@ package com.liquidnet.service.goblin.service;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuListVo;
public interface IGoblinNftGoodsAppService {
ResponseDto<PageInfo<GoblinNftGoodsSkuInfoVo>> goodsList(int pag);
ResponseDto<PageInfo<GoblinNftGoodsSkuListVo>> goodsList(int pag);
GoblinNftGoodsSkuInfoVo goodsDetail(String skuId);
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.goblin.controller;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuListVo;
import com.liquidnet.service.goblin.service.IGoblinNftGoodsAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -30,7 +31,7 @@ public class GoblinNftGoodsAppController {
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "page", value = "页码", example = "1"),
})
public ResponseDto<PageInfo<GoblinNftGoodsSkuInfoVo>> getGoodsList(
public ResponseDto<PageInfo<GoblinNftGoodsSkuListVo>> getGoodsList(
@RequestParam(name = "page", defaultValue = "1") Integer page
) {
return goblinNftGoodsAppService.goodsList(page);
......
......@@ -3,10 +3,7 @@ package com.liquidnet.service.goblin.service.impl;
import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinNftGoodsSpuInfoVo;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.GoblinCouponService;
import com.liquidnet.service.goblin.service.IGoblinNftGoodsAppService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
......@@ -42,7 +39,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
GoblinCouponService goblinCouponService;
@Override
public ResponseDto<PageInfo<GoblinNftGoodsSkuInfoVo>> goodsList(int page) {
public ResponseDto<PageInfo<GoblinNftGoodsSkuListVo>> goodsList(int page) {
int size = 20;
//条件
......@@ -50,7 +47,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
Criteria.where("skuType").is(1).and("delFlg").is("0").and("status").is("3").and("shelvesStatus").is("3")
);
long count = mongoTemplate.count(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
List<GoblinNftGoodsSkuInfoVo> skuList = goblinRedisUtils.getGoblinNftGoodsInfoListVo();
List<GoblinNftGoodsSkuListVo> skuList = goblinRedisUtils.getGoblinNftGoodsInfoListVo();
if (null == skuList || page > 1) {
skuList = new ArrayList<>();
// 分页 排序:按照开售时间
......@@ -61,7 +58,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
List<GoblinGoodsSkuInfoVo> skuInfoVos = mongoTemplate.find(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
for (GoblinGoodsSkuInfoVo info : skuInfoVos) {
// sku信息
GoblinNftGoodsSkuInfoVo nftGoodsSkuInfoVo = GoblinNftGoodsSkuInfoVo.getNew().copy(info);
GoblinNftGoodsSkuListVo nftGoodsSkuInfoVo = GoblinNftGoodsSkuListVo.getNew().copy(info);
// spu信息
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(info.getSpuId());
GoblinNftGoodsSpuInfoVo nftGoodsSpuInfoVo = GoblinNftGoodsSpuInfoVo.getNew().copy(goodsInfoVo);
......@@ -73,7 +70,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
goblinRedisUtils.setGoblinNftGoodsInfoListVo(skuList);
}
}
for (GoblinNftGoodsSkuInfoVo skuInfoVo : skuList) {
for (GoblinNftGoodsSkuListVo skuInfoVo : skuList) {
int stock = goblinRedisUtils.getSkuStock(null, skuInfoVo.getSkuId());
if (stock <= 0) {
skuInfoVo.setIsStock(0);
......@@ -81,7 +78,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
skuInfoVo.setIsStock(1);
}
}
PageInfo<GoblinNftGoodsSkuInfoVo> pageInfo = new PageInfo(skuList);
PageInfo<GoblinNftGoodsSkuListVo> pageInfo = new PageInfo(skuList);
pageInfo.setTotal(count);
pageInfo.setPageSize(size);
return ResponseDto.success(pageInfo);
......
......@@ -1351,16 +1351,16 @@ public class GoblinRedisUtils {
}
}
public List<GoblinNftGoodsSkuInfoVo> getGoblinNftGoodsInfoListVo() {
public List<GoblinNftGoodsSkuListVo> getGoblinNftGoodsInfoListVo() {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_GOODS_LIST;
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return null;
} else {
return (List<GoblinNftGoodsSkuInfoVo>) obj;
return (List<GoblinNftGoodsSkuListVo>) obj;
}
}
public void setGoblinNftGoodsInfoListVo(List<GoblinNftGoodsSkuInfoVo> spuList) {
public void setGoblinNftGoodsInfoListVo(List<GoblinNftGoodsSkuListVo> spuList) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_GOODS_LIST;
redisUtil.set(redisKey, spuList);
}
......
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