Commit 89b4eaf4 authored by unset's avatar unset

123

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