|
@@ -167,6 +167,11 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
throw new ApiException("云商城商品数据为空: gdId=" + gdId);
|
|
throw new ApiException("云商城商品数据为空: gdId=" + gdId);
|
|
|
}
|
|
}
|
|
|
List<B2cGoodsSkuInOnline> dbSkuList = b2cGoodsSkuInOnlineService.findByGdId(String.valueOf(gdId));
|
|
List<B2cGoodsSkuInOnline> dbSkuList = b2cGoodsSkuInOnlineService.findByGdId(String.valueOf(gdId));
|
|
|
|
|
+
|
|
|
|
|
+ if (dbSkuList == null || dbSkuList.isEmpty()) {
|
|
|
|
|
+ throw new ApiException("云商城商品库存为0: gdId=" + gdId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<B2cGoodsImgInOnline> dbImgList = b2cGoodsImgInOnlineService.findByGdId(String.valueOf(gdId));
|
|
List<B2cGoodsImgInOnline> dbImgList = b2cGoodsImgInOnlineService.findByGdId(String.valueOf(gdId));
|
|
|
B2cShop b2cShop = b2cShopService.getById(spu.getShopId());
|
|
B2cShop b2cShop = b2cShopService.getById(spu.getShopId());
|
|
|
|
|
|
|
@@ -1222,14 +1227,14 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
}
|
|
}
|
|
|
Integer gdId = item.getGdId();
|
|
Integer gdId = item.getGdId();
|
|
|
|
|
|
|
|
- // Step 1: 下架商品(is_on_sale=2)
|
|
|
|
|
|
|
+ // Step 1: 下架商品(is_on_sale=2) 并且软删除
|
|
|
int affected = b2cGoodsStatusMapper.updateOnSaleStatus(gdId, 2);
|
|
int affected = b2cGoodsStatusMapper.updateOnSaleStatus(gdId, 2);
|
|
|
if (affected <= 0) {
|
|
if (affected <= 0) {
|
|
|
throw new ApiException("停止供货失败!");
|
|
throw new ApiException("停止供货失败!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Step 2: 软删除商品(is_del=1)
|
|
// Step 2: 软删除商品(is_del=1)
|
|
|
- b2cGoodsStatusMapper.softDeleteSpu(gdId);
|
|
|
|
|
|
|
+// b2cGoodsStatusMapper.softDeleteSpu(gdId);
|
|
|
|
|
|
|
|
// Step 3: 更新货架商品数量 + 软删除货架商品
|
|
// Step 3: 更新货架商品数量 + 软删除货架商品
|
|
|
updateShelfCountAndDelete(storeid, gdId);
|
|
updateShelfCountAndDelete(storeid, gdId);
|