Commit 94af7352 by 孙昱

sunyu::update::update about batchOperateCartGoods

parent 036acadf
...@@ -39,7 +39,6 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{ ...@@ -39,7 +39,6 @@ public class BatchOperateCartGoodsRequestVo extends BaseRequestVo{
/** /**
* 商品信息 * 商品信息
*/ */
@NotEmpty(message = "商品信息不可为空")
private List<BatchGoodsInfoVo> goodsInfos; private List<BatchGoodsInfoVo> goodsInfos;
} }
\ No newline at end of file
...@@ -370,14 +370,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -370,14 +370,11 @@ public class ShoppingCartMCoffeeServiceImpl {
if (StringUtils.isEmpty(requestVo.getShopId())) { if (StringUtils.isEmpty(requestVo.getShopId())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY); throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
} }
if (CollectionUtils.isEmpty(requestVo.getGoodsInfos())) { if (CollectionUtils.isEmpty(requestVo.getGoodsInfos()) && CollectionUtils.isEmpty(requestVo.getQtyInfoList())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_INVAILD); return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_INVAILD);
} }
if (CollectionUtils.isEmpty(requestVo.getQtyInfoList())){ BaseResponse baseResponse = new BaseResponse();
return ResponseUtil.error(ResponseResult.SHOPPING_CART_UPDATE_ERROR); if (CollectionUtils.isNotEmpty(requestVo.getQtyInfoList())) {
}
BaseResponse baseResponse;
BatchUpdateGoodsQtyRequestVo updateGoodsQtyRequestVo = new BatchUpdateGoodsQtyRequestVo(); BatchUpdateGoodsQtyRequestVo updateGoodsQtyRequestVo = new BatchUpdateGoodsQtyRequestVo();
updateGoodsQtyRequestVo.setAppId(requestVo.getAppId()); updateGoodsQtyRequestVo.setAppId(requestVo.getAppId());
updateGoodsQtyRequestVo.setChannelType(requestVo.getChannelType()); updateGoodsQtyRequestVo.setChannelType(requestVo.getChannelType());
...@@ -391,10 +388,11 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -391,10 +388,11 @@ public class ShoppingCartMCoffeeServiceImpl {
updateGoodsQtyRequestVo.setQtyInfoList(requestVo.getQtyInfoList()); updateGoodsQtyRequestVo.setQtyInfoList(requestVo.getQtyInfoList());
baseResponse = this.batchUpdateGoodsQty(updateGoodsQtyRequestVo); baseResponse = this.batchUpdateGoodsQty(updateGoodsQtyRequestVo);
//批量更新失败,直接返回错误 //批量更新失败,直接返回错误
if (!Objects.equals(ResponseResult.SUCCESS.getCode(),baseResponse.getCode())){ if (!Objects.equals(ResponseResult.SUCCESS.getCode(), baseResponse.getCode())) {
return baseResponse; return baseResponse;
} }
}
if (CollectionUtils.isNotEmpty(requestVo.getGoodsInfos())) {
MCoffeeBatchAddGoodsRequestVo addGoodsRequestVo = new MCoffeeBatchAddGoodsRequestVo(); MCoffeeBatchAddGoodsRequestVo addGoodsRequestVo = new MCoffeeBatchAddGoodsRequestVo();
addGoodsRequestVo.setAppId(requestVo.getAppId()); addGoodsRequestVo.setAppId(requestVo.getAppId());
addGoodsRequestVo.setChannelType(requestVo.getChannelType()); addGoodsRequestVo.setChannelType(requestVo.getChannelType());
...@@ -408,9 +406,10 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -408,9 +406,10 @@ public class ShoppingCartMCoffeeServiceImpl {
addGoodsRequestVo.setGoodsInfos(requestVo.getGoodsInfos()); addGoodsRequestVo.setGoodsInfos(requestVo.getGoodsInfos());
baseResponse = this.addBatchGoods(addGoodsRequestVo); baseResponse = this.addBatchGoods(addGoodsRequestVo);
//批量新增失败,直接返回错误 //批量新增失败,直接返回错误
if (!Objects.equals(ResponseResult.SUCCESS.getCode(),baseResponse.getCode())){ if (!Objects.equals(ResponseResult.SUCCESS.getCode(), baseResponse.getCode())) {
return baseResponse; return baseResponse;
} }
}
return baseResponse; return baseResponse;
} }
......
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