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

Commit f3a924dc authored by zz's avatar zz

Merge remote-tracking branch 'origin/20240123_COUPON_SPU' into 阶梯退票_羊毛券_合并分支

parents 5e48d024 54d787d8
...@@ -165,6 +165,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -165,6 +165,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit(); int limitCount = skuVo.getBuyLimit() == 0 ? Integer.MAX_VALUE : skuVo.getBuyLimit();
//判断限购 //判断限购
if (orderUtils.noZhengzaiOrder(uid)) { if (orderUtils.noZhengzaiOrder(uid)) {
String res1 = orderUtils.judgeOrderLimit(uid, skuParam.getSkuId(), skuParam.getNumber(), limitCount);
if (!res1.equals("")) {
throw new Exception("已超出限购数量");
}
//权限限购
Boolean res2 = orderUtils.judgeOrderRose(isMember, skuParam.getSkuId(), StringUtils.defaultString(((String) CurrentUtil.getTokenClaims().get("mobile")), ""), Integer.parseInt(skuVo.getBuyFactor()));
if (!res2) {
throw new Exception("无权购买");
}
if (Objects.equals(skuVo.getSkuType(), 2)) {// 券类商品 if (Objects.equals(skuVo.getSkuType(), 2)) {// 券类商品
if (skuParam.getNumber() > 1) {// 券类商品单次下单限购1 if (skuParam.getNumber() > 1) {// 券类商品单次下单限购1
throw new LiquidnetServiceException("-1", String.format("代金券商品单次下单限购%d张", 1)); throw new LiquidnetServiceException("-1", String.format("代金券商品单次下单限购%d张", 1));
...@@ -178,16 +188,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -178,16 +188,6 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
} }
} }
String res1 = orderUtils.judgeOrderLimit(uid, skuParam.getSkuId(), skuParam.getNumber(), limitCount);
if (!res1.equals("")) {
throw new Exception("已超出限购数量");
}
//权限限购
Boolean res2 = orderUtils.judgeOrderRose(isMember, skuParam.getSkuId(), StringUtils.defaultString(((String) CurrentUtil.getTokenClaims().get("mobile")), ""), Integer.parseInt(skuVo.getBuyFactor()));
if (!res2) {
throw new Exception("无权购买");
}
} }
//库存回滚 //库存回滚
if (surplusGeneral < 0) { if (surplusGeneral < 0) {
......
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