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

Commit b4d7185a authored by 张国柄's avatar 张国柄

~API:领取逻辑更正;

parent 44db13ad
...@@ -76,6 +76,7 @@ public class TestAdam { ...@@ -76,6 +76,7 @@ public class TestAdam {
"goblin:sku:relation:226416501783461229", "goblin:sku:relation:226416501783461229",
"goblin:bsc:goods:2264185547679ZZ87427", "goblin:bsc:goods:2264185547679ZZ87427",
"goblin:bsc:goods_sku:226418554767964895ZZ87427", "goblin:bsc:goods_sku:226418554767964895ZZ87427",
"goblin:user_coupon:926591841436344323959830",
"goblin:bsc:ustore:809406", "goblin:bsc:ustore:809406",
"goblin:bsc:ustore:922833055536291845022973", "goblin:bsc:ustore:922833055536291845022973",
"goblin:bsc:store:839fa8dde17b5bf248575370f1249eab", "goblin:bsc:store:839fa8dde17b5bf248575370f1249eab",
......
...@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo; ...@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam; import com.liquidnet.service.goblin.param.BackCouponParam;
import com.liquidnet.service.goblin.service.GoblinCouponService; import com.liquidnet.service.goblin.service.GoblinCouponService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -96,9 +97,10 @@ public class GoblinCouponController { ...@@ -96,9 +97,10 @@ public class GoblinCouponController {
} }
List<GoblinUserCouponVo> userCouponVos = goblinRedisUtils.getUserCouponVos(uid); List<GoblinUserCouponVo> userCouponVos = goblinRedisUtils.getUserCouponVos(uid);
if (!CollectionUtils.isEmpty(userCouponVos)) { if (!CollectionUtils.isEmpty(userCouponVos)) {
int beforeSize = userCouponVos.size(); ArrayList<GoblinUserCouponVo> userCouponVosTmp = ObjectUtil.getGoblinUserCouponVo();
userCouponVos.removeIf(vo -> vo.getStoreCouponId().equals(storeCouponId)); userCouponVosTmp.addAll(userCouponVos);
if ((beforeSize - userCouponVos.size()) >= storeCouponVo.getReceiveLimit()) { userCouponVosTmp.removeIf(vo -> vo.getStoreCouponId().equals(storeCouponId));
if ((userCouponVos.size() - userCouponVosTmp.size()) >= storeCouponVo.getReceiveLimit()) {
return ResponseDto.failure(ErrorMapping.get("140052")); return ResponseDto.failure(ErrorMapping.get("140052"));
} }
} }
......
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