47c7aa7f 刘嘉

菠萝派接口-同步库存,库存必须大于或等于0

1 个父辈 1e2b5f9b
...@@ -39,6 +39,11 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto ...@@ -39,6 +39,11 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto
39 //先判断SKU在判断产品 39 //先判断SKU在判断产品
40 IMProductBean iMProductBean = pineappleDao.getIMProductBeanByMap(params); 40 IMProductBean iMProductBean = pineappleDao.getIMProductBeanByMap(params);
41 if(!StringUtil.isNull(iMProductBean)){ 41 if(!StringUtil.isNull(iMProductBean)){
42 if(callRequest.getBizModel().getQuantity() < 0){
43 log.error(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,method:%s,PlatProductID:%s,SkuID:s%,Quantity:%s",callRequest.getRequest().getAppkey(),callRequest.getRequest().getMethod(),callRequest.getBizModel().getPlatProductID(),callRequest.getBizModel().getSkuID(),callRequest.getBizModel().getQuantity()));
44 throw new BizException(String.format("菠萝派商城appkey[%s]更新库存失败,库存必须大于或等于0,method:%s,PlatProductID:%s,SkuID:s%,Quantity:%s",callRequest.getRequest().getAppkey(),callRequest.getRequest().getMethod(),callRequest.getBizModel().getPlatProductID(),callRequest.getBizModel().getSkuID(),callRequest.getBizModel().getQuantity()));
45
46 }
42 if(!StringUtil.isNull(callRequest.getBizModel().getSkuID()) ) { 47 if(!StringUtil.isNull(callRequest.getBizModel().getSkuID()) ) {
43 params.put("skuId",callRequest.getBizModel().getSkuID()); 48 params.put("skuId",callRequest.getBizModel().getSkuID());
44 //查询该条SKUi 49 //查询该条SKUi
......