购物车,新增重试
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)) {
|
||||
cart.setCart_quantity(cart_quantity);
|
||||
|
||||
if (!edit(cart)) {
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
int i=0;
|
||||
while (i<3){
|
||||
boolean result=edit(cart);
|
||||
if (!result) {
|
||||
i++;
|
||||
if(i==3){
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
}else {
|
||||
logger.info("重试成功,跳出");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QueryWrapper<ShopUserCart> userCartQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user