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

Commit 6c2f3ed8 authored by 胡佳晨's avatar 胡佳晨

修改 订单用券逻辑

1.跨店铺不可用平台券
2.店铺券+平台券不可一起使用
parent df34e665
...@@ -194,7 +194,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -194,7 +194,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
return ResponseDto.failure(ErrorMapping.get("20018"));//乱七八糟异常 return ResponseDto.failure(ErrorMapping.get("20018"));//乱七八糟异常
} else if (e.getMessage().equals("无权购买")) { } else if (e.getMessage().equals("无权购买")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
} else if (e.getMessage().equals("平台券不可用")) { } else if (e.getMessage().equals("平台券店铺券不可一起使用")) {
return ResponseDto.failure(e.getMessage());
}else if (e.getMessage().equals("平台券店铺券不可一起使用")) {
return ResponseDto.failure(e.getMessage());
} else if (e.getMessage().equals("跨店铺购物平台券不可用")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
} else if (e.getMessage().equals("店铺券不可用")) { } else if (e.getMessage().equals("店铺券不可用")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
...@@ -284,6 +288,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -284,6 +288,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
orderSku.setSpuPic(spuVo.getCoverPic()); orderSku.setSpuPic(spuVo.getCoverPic());
goblinOrderSkuList.add(orderSku); goblinOrderSkuList.add(orderSku);
} }
if ((platVoucherCode != null && !platVoucherCode.equals("")) && (storeVoucherCode != null && !storeVoucherCode.equals(""))) {
throw new Exception("平台券店铺券不可一起使用");
}
if(param.getGoblinOrderStoreParamList().size()>1 && (platVoucherCode != null && !platVoucherCode.equals(""))){
throw new Exception("跨店铺购物平台券不可用");
}
//优惠券 //优惠券
BigDecimal voucherPrice = BigDecimal.ZERO; BigDecimal voucherPrice = BigDecimal.ZERO;
if (platVoucherCode != null && !platVoucherCode.equals("")) { if (platVoucherCode != null && !platVoucherCode.equals("")) {
...@@ -358,7 +372,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -358,7 +372,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
storeOrder.setPriceRefund(BigDecimal.ZERO); storeOrder.setPriceRefund(BigDecimal.ZERO);
storeOrder.setPriceCoupon(voucherPrice); storeOrder.setPriceCoupon(voucherPrice);
storeOrder.setStorePriceCoupon(storeVoucherPrice); storeOrder.setStorePriceCoupon(storeVoucherPrice);
storeOrder.setPriceVoucher(voucherPrice.add(storeVoucherPrice).add(voucherMarket)); storeOrder.setPriceVoucher(voucherPrice.add(storeVoucherPrice));
storeOrder.setStatus(0); storeOrder.setStatus(0);
storeOrder.setUcouponId(platVoucherCode); storeOrder.setUcouponId(platVoucherCode);
storeOrder.setStoreCouponId(storeVoucherCode); storeOrder.setStoreCouponId(storeVoucherCode);
...@@ -747,7 +761,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -747,7 +761,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
redisUtils.setGoblinOrder(orderId, orderVo); redisUtils.setGoblinOrder(orderId, orderVo);
redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode()); redisUtils.setOffCode(orderVo.getWriteOffCode(), orderVo.getMasterOrderCode());
//删除未支付订单 //删除未支付订单
redisUtils.removeGoblinOrder(orderVo.getRandomKey()+"", orderId); redisUtils.removeGoblinOrder(orderVo.getRandomKey() + "", orderId);
//mongo //mongo
mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo); mongoUtils.updateGoblinStoreOrderVo(orderId, orderVo);
//mysql //mysql
...@@ -929,9 +943,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -929,9 +943,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
SqlMapping.gets(sqls, sqlsOrder, sqlsOrderSku, sqlsBackOrder)); SqlMapping.gets(sqls, sqlsOrder, sqlsOrderSku, sqlsBackOrder));
} else if (0 == status) { } else if (0 == status) {
}
return "success";
} }
return"success";
}
@Override @Override
public ResponseDto<List<GoblinMailVo>> getMail(String orderId, String mailId) { public ResponseDto<List<GoblinMailVo>> getMail(String orderId, String mailId) {
......
...@@ -95,6 +95,7 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer ...@@ -95,6 +95,7 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
List<GoblinOrderSkuVo> orderSkuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList(); List<GoblinOrderSkuVo> orderSkuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) { for (String orderSkuVoId : orderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoId);
orderSkuVo.setStatus(vo.getStatus());
orderSkuVoList.add(orderSkuVo); orderSkuVoList.add(orderSkuVo);
} }
vo.setOrderSkuVoList(orderSkuVoList); vo.setOrderSkuVoList(orderSkuVoList);
......
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