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

Commit 99cf0bc4 authored by 胡佳晨's avatar 胡佳晨

增加使用 临时券(平台券一种)接口

parent 4b3bd2ca
......@@ -80,7 +80,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 38, value = "删除标记[0-未删除|1-删除]")
private String delFlg;
@ApiModelProperty(position = 39, value = "上架时间")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime shelvesAt;
@ApiModelProperty(position = 40, value = "商品图片列表")
private List<String> imageList;
......@@ -88,13 +88,13 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private String logisticsTemplate;
private String createdBy;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt;
private String updatedBy;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt;
private String deletedBy;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime deletedAt;
@ApiModelProperty(position = 51, value = "规格信息")
......@@ -119,6 +119,8 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private Integer count;
@ApiModelProperty(position = 62, value = "商铺名称")
private String storeName;
@ApiModelProperty(position = 63, value = "skuList")
private List<GoblinGoodsSkuInfoVo> goblinOrderSkuVos;
private static final GoblinGoodsInfoVo obj = new GoblinGoodsInfoVo();
......
......@@ -287,15 +287,24 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
//优惠券
BigDecimal voucherPrice = BigDecimal.ZERO;
if (platVoucherCode != null && !platVoucherCode.equals("")) {
TempCouponVo tempCouponVo = redisUtils.getTempCoupon(platVoucherCode);
String spuIds = "";
for (GoblinOrderSkuParam item : storeParam.getGoblinOrderSkuParamArrayList()) {
String pre = GoblinStatusConst.MarketPreStatus.getPre(item.getSpuId());
if (pre != null) {
spuIds = spuIds.concat(item.getSpuId().split(pre)[0]);
spuIds = spuIds.concat("," + item.getSpuId().split(pre)[0]);
} else {
spuIds = spuIds.concat(item.getSpuId());
spuIds = spuIds.concat("," + item.getSpuId());
}
}
if (tempCouponVo != null) {
for (String spuId : spuIds.split(",")) {
if (tempCouponVo.getSpuIdList().contains(spuId)) {
voucherPrice = tempCouponVo.getValue();
break;
}
}
} else {
HashMap<String, Object> hashMap = orderUtils.useCoupon(platVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds);
voucherPrice = (BigDecimal) hashMap.get("voucher");
Integer typeVoucher = (Integer) hashMap.get("type");
......@@ -305,6 +314,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
platformCodeList.add(platVoucherCode);
}
}
}
//商铺券
BigDecimal storeVoucherPrice = BigDecimal.ZERO;
if (storeVoucherCode != null && !storeVoucherCode.equals("")) {
......@@ -312,9 +322,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
for (GoblinOrderSkuParam item : storeParam.getGoblinOrderSkuParamArrayList()) {
String pre = GoblinStatusConst.MarketPreStatus.getPre(item.getSpuId());
if (pre != null) {
spuIds = spuIds.concat(item.getSpuId().split(pre)[0]);
spuIds = spuIds.concat("," + item.getSpuId().split(pre)[0]);
} else {
spuIds = spuIds.concat(item.getSpuId());
spuIds = spuIds.concat("," + item.getSpuId());
}
}
GoblinUseResultVo storeCouponVo = goblinCouponService.useCoupon(storeVoucherCode, "购买商品[" + orderCode + "]", storeTotalPrice, spuIds, uid);
......
......@@ -5,9 +5,7 @@ import com.alibaba.excel.read.listener.PageReadListener;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.TempCouponDto;
import com.liquidnet.service.goblin.dto.vo.ArDataVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.TempCouponVo;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.GoblinFrontService;
import com.liquidnet.service.goblin.service.manage.IGoblinInnerService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
......@@ -69,6 +67,14 @@ public class GoblinInnerServiceImpl implements IGoblinInnerService {
vo.setTempCouponVos(tempCouponVos);
//商品
List<GoblinGoodsInfoVo> goodsInfoVos = goblinFrontService.getGoodByMusicTagP(tag, performanceId);
for (GoblinGoodsInfoVo spuVo : goodsInfoVos) {
List<GoblinGoodsSkuInfoVo> skuVoList = ObjectUtil.getGoblinGoodsSkuInfoVoArrayList();
for (String skuId : spuVo.getSkuIdList()) {
GoblinGoodsSkuInfoVo skuVo = redisUtils.getGoodsSkuInfoVo(skuId);
skuVoList.add(skuVo);
}
spuVo.setGoblinOrderSkuVos(skuVoList);
}
vo.setGoodsInfoVos(goodsInfoVos);
return ResponseDto.success(vo);
}
......
......@@ -1190,7 +1190,7 @@ public class GoblinRedisUtils {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_TEMP_COUPON.concat(ucouponId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return TempCouponVo.getNew();
return null;
} else {
return (TempCouponVo) obj;
}
......
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