购物车,新增重试
This commit is contained in:
parent
d2746dc5b6
commit
9136af8a52
@ -270,9 +270,18 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl<ShopUserCartMapper,
|
|||||||
|
|
||||||
if (ObjectUtil.equal(cart.getUser_id(), user_id)) {
|
if (ObjectUtil.equal(cart.getUser_id(), user_id)) {
|
||||||
cart.setCart_quantity(cart_quantity);
|
cart.setCart_quantity(cart_quantity);
|
||||||
|
int i=0;
|
||||||
if (!edit(cart)) {
|
while (i<3){
|
||||||
throw new ApiException(ResultCode.FAILED);
|
boolean result=edit(cart);
|
||||||
|
if (!result) {
|
||||||
|
i++;
|
||||||
|
if(i==3){
|
||||||
|
throw new ApiException(ResultCode.FAILED);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
logger.info("重试成功,跳出");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<ShopUserCart> userCartQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopUserCart> userCartQueryWrapper = new QueryWrapper<>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user