47c7aa7f 刘嘉

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

1 个父辈 1e2b5f9b
......@@ -39,6 +39,11 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto
//先判断SKU在判断产品
IMProductBean iMProductBean = pineappleDao.getIMProductBeanByMap(params);
if(!StringUtil.isNull(iMProductBean)){
if(callRequest.getBizModel().getQuantity() < 0){
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()));
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()));
}
if(!StringUtil.isNull(callRequest.getBizModel().getSkuID()) ) {
params.put("skuId",callRequest.getBizModel().getSkuID());
//查询该条SKUi
......