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

Commit ec330de0 authored by 胡佳晨's avatar 胡佳晨

提交bug

parent 9357af17
...@@ -13,6 +13,8 @@ public class GoblinStoreOrderListSkuVo implements Cloneable { ...@@ -13,6 +13,8 @@ public class GoblinStoreOrderListSkuVo implements Cloneable {
private String orderSkuId; private String orderSkuId;
@ApiModelProperty(value = "skuId") @ApiModelProperty(value = "skuId")
private String skuId; private String skuId;
@ApiModelProperty(value = "spu名称")
private String spuName;
@ApiModelProperty(value = "sku名称") @ApiModelProperty(value = "sku名称")
private String skuName; private String skuName;
@ApiModelProperty(value = "款式") @ApiModelProperty(value = "款式")
......
...@@ -128,7 +128,7 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -128,7 +128,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
List<GoblinUserCouponVo> voList = goblinRedisUtils.getUserCouponVos(uid); List<GoblinUserCouponVo> voList = goblinRedisUtils.getUserCouponVos(uid);
for (GoblinUserCouponVo vo : voList) { for (GoblinUserCouponVo vo : voList) {
//判断券状态 和 触发金额 //判断券状态 和 触发金额
if (vo.getState().equals(1) && vo.getTriggers().compareTo(totalPrice) >= 0) { if (vo.getState().equals(1) && vo.getTriggers().compareTo(totalPrice) <= 0) {
List<String> spuIds = goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId()); List<String> spuIds = goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId());
//判断是否在可用商品内 //判断是否在可用商品内
for (String item : spuIds) { for (String item : spuIds) {
...@@ -138,8 +138,11 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -138,8 +138,11 @@ public class GoblinCouponImpl implements GoblinCouponService {
if (vo.getType().equals("1")) {//代金券 if (vo.getType().equals("1")) {//代金券
tempPrice = vo.getValFace(); tempPrice = vo.getValFace();
} else if (vo.getType().equals("2")) {//折扣 } else if (vo.getType().equals("2")) {//折扣
tempPrice = totalPrice.multiply(vo.getDeduction()).setScale(2, BigDecimal.ROUND_HALF_UP); tempPrice = totalPrice.multiply(vo.getDiscount()).setScale(2, BigDecimal.ROUND_HALF_UP);
} else if (vo.getType().equals("3") && vo.getTriggers().compareTo(totalPrice) >= 0) {//满减 if (tempPrice.compareTo(vo.getDeduction()) > 0) {
tempPrice = vo.getDeduction();
}
} else if (vo.getType().equals("3") && vo.getTriggers().compareTo(totalPrice) <= 0) {//满减
tempPrice = vo.getValMinus(); tempPrice = vo.getValMinus();
} }
if (maxPrice.compareTo(tempPrice) < 0) { if (maxPrice.compareTo(tempPrice) < 0) {
...@@ -183,7 +186,7 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -183,7 +186,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
for (GoblinUserCouponVo vo : voList) { for (GoblinUserCouponVo vo : voList) {
if (vo.getUcouponId().equals(ucouponId)) { if (vo.getUcouponId().equals(ucouponId)) {
//判断券状态 和 触发金额 //判断券状态 和 触发金额
if (vo.getState().equals(1) && vo.getTriggers().compareTo(totalPrice) >= 0) { if (vo.getState().equals(1) && vo.getTriggers().compareTo(totalPrice) <= 0) {
List<String> spuIds = goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId()); List<String> spuIds = goblinRedisUtils.getStoreCouponSpuIds(vo.getStoreCouponId());
//判断是否在可用商品内 //判断是否在可用商品内
for (String item : spuIds) { for (String item : spuIds) {
...@@ -193,9 +196,13 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -193,9 +196,13 @@ public class GoblinCouponImpl implements GoblinCouponService {
returnVo.setValue(vo.getValFace()); returnVo.setValue(vo.getValFace());
returnVo.setCouType(vo.getType()); returnVo.setCouType(vo.getType());
} else if (vo.getType().equals("2")) {//折扣 } else if (vo.getType().equals("2")) {//折扣
returnVo.setValue(totalPrice.multiply(vo.getDeduction()).setScale(2, BigDecimal.ROUND_HALF_UP)); BigDecimal tempPrice = totalPrice.multiply(vo.getDiscount()).setScale(2, BigDecimal.ROUND_HALF_UP);
if (tempPrice.compareTo(vo.getDeduction()) > 0) {
tempPrice = vo.getDeduction();
}
returnVo.setValue(tempPrice);
returnVo.setCouType(vo.getType()); returnVo.setCouType(vo.getType());
} else if (vo.getType().equals("3") && vo.getTriggers().compareTo(totalPrice) >= 0) {//满减 } else if (vo.getType().equals("3") && vo.getTriggers().compareTo(totalPrice) <= 0) {//满减
returnVo.setValue(vo.getValMinus()); returnVo.setValue(vo.getValMinus());
returnVo.setCouType(vo.getType()); returnVo.setCouType(vo.getType());
} }
......
...@@ -85,6 +85,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -85,6 +85,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
itemSkuVo.setOrderSkuId(orderSkuVo.getOrderSkuId()); itemSkuVo.setOrderSkuId(orderSkuVo.getOrderSkuId());
itemSkuVo.setSkuId(orderSkuVo.getSkuId()); itemSkuVo.setSkuId(orderSkuVo.getSkuId());
itemSkuVo.setSkuName(orderSkuVo.getSkuName()); itemSkuVo.setSkuName(orderSkuVo.getSkuName());
itemSkuVo.setSpuName(orderSkuVo.getSpuName());
itemSkuVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual()); itemSkuVo.setSkuPriceActual(orderSkuVo.getSkuPriceActual());
itemSkuVo.setSkuSpecs(orderSkuVo.getSkuSpecs()); itemSkuVo.setSkuSpecs(orderSkuVo.getSkuSpecs());
itemSkuVo.setSkuImage(orderSkuVo.getSkuImage()); itemSkuVo.setSkuImage(orderSkuVo.getSkuImage());
......
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