Commit 89b4eaf4 authored by unset's avatar unset

123

parent 0a174b2c
......@@ -123,9 +123,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
ImageDataVO imageDataVO = imageDataVOList.get(0);
ShoppingCartInfo old = selectByUser(appUserDTO.getUserid(), Long.valueOf(imageDataVO.getId()));
if (old != null) {
old.setNumber(old.getNumber() + orderInfoDto.getNumber());
old.setTotalAmount(old.getPrice().multiply(new BigDecimal(old.getNumber())));
updateSelectiveByIdRe(old);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "商品不能重复添加购物车!");
} else {
ShoppingCartInfo shoppingCartInfo = new ShoppingCartInfo();
shoppingCartInfo.setDetailId(Long.valueOf(imageDataVO.getId()));
......@@ -154,9 +152,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
if (imageImgStorage != null) {
ShoppingCartInfo old = selectByUser(appUserDTO.getUserid(), Long.valueOf(imageImgStorage.getId()));
if (old != null) {
old.setNumber(old.getNumber() + orderInfoDto.getNumber());
old.setTotalAmount(old.getPrice().multiply(new BigDecimal(old.getNumber())));
updateSelectiveByIdRe(old);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "商品不能重复添加购物车!");
} else {
ShoppingCartInfo shoppingCartInfo = new ShoppingCartInfo();
shoppingCartInfo.setDetailId(Long.valueOf(imageImgStorage.getId()));
......@@ -187,9 +183,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
if (industryApplicationInfo != null) {
ShoppingCartInfo old = selectByUser(appUserDTO.getUserid(), Long.valueOf(industryApplicationInfo.getId()));
if (old != null) {
old.setNumber(old.getNumber() + orderInfoDto.getNumber());
old.setTotalAmount(old.getPrice().multiply(new BigDecimal(old.getNumber())));
updateSelectiveByIdRe(old);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "商品不能重复添加购物车!");
} else {
ShoppingCartInfo shoppingCartInfo = new ShoppingCartInfo();
shoppingCartInfo.setDetailId(Long.valueOf(industryApplicationInfo.getId()));
......
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