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

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

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

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