|
|
@@ -732,24 +732,11 @@ public class CommodityProcureServiceImpl implements CommodityProcureService {
|
|
|
throw new ApiException("店铺不存在!");
|
|
|
}
|
|
|
|
|
|
- // 2. 判断在云商城中是否有配送方式
|
|
|
- String checkExpressUrl = mallHost + "/checkExpress?shop_id=" + apply.getStoreid();
|
|
|
- try {
|
|
|
- String expressResp = HttpUtil.restTemplateGet(checkExpressUrl, null);
|
|
|
- log.info("配送方式查询 storeid={}, url={}, resp={}", apply.getStoreid(), checkExpressUrl, expressResp);
|
|
|
- JSONObject expressJson = JSON.parseObject(expressResp);
|
|
|
- if (expressJson == null || expressJson.getIntValue("head") != 200) {
|
|
|
- throw new ApiException("配送方式查询失败!");
|
|
|
- }
|
|
|
- if (expressJson.getJSONObject("result") != null
|
|
|
- && expressJson.getJSONObject("result").getIntValue("hasExpress") == 2) {
|
|
|
- throw new ApiException("请添加配送方式!");
|
|
|
- }
|
|
|
- } catch (ApiException e) {
|
|
|
- throw e;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("配送方式查询异常 storeid={}", apply.getStoreid(), e);
|
|
|
- throw new ApiException("配送方式查询失败!");
|
|
|
+ // 2. 判断在云商城中是否有配送方式(替换原 PHP checkExpress 接口,直连BD查询)
|
|
|
+ // 对应PHP逻辑:查询b2c_shipping_status表是否存在is_default=1的配送方式
|
|
|
+ int defaultShippingCount = b2cGoodsSpuInOnlineMapper.countDefaultShipping(apply.getStoreid());
|
|
|
+ if (defaultShippingCount <= 0) {
|
|
|
+ throw new ApiException("请添加配送方式!");
|
|
|
}
|
|
|
|
|
|
// 3. 供货时品类必填
|