|
@@ -105,6 +105,13 @@ public class OpenApiOrderValuationServiceImpl implements OpenApiOrderValuationSe
|
|
if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+ Merchant merchant = null;
|
|
|
|
+ if (valuationDto.getMerchantId() != null) {
|
|
|
|
+ merchant = iMerchantService.getById(valuationDto.getMerchantId());
|
|
|
|
+ if (merchant == null) {
|
|
|
|
+ return ResponseResult.error(ResponseResultCodeEnum.MERCHANT_DISABLE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
Product product = iProductService.getById(valuationReq.getCategoryId());
|
|
Product product = iProductService.getById(valuationReq.getCategoryId());
|
|
if (product == null) {
|
|
if (product == null) {
|
|
return ResponseResult.error(ResponseResultCodeEnum.CATEGORY_NOT_EXIST);
|
|
return ResponseResult.error(ResponseResultCodeEnum.CATEGORY_NOT_EXIST);
|
|
@@ -131,6 +138,10 @@ public class OpenApiOrderValuationServiceImpl implements OpenApiOrderValuationSe
|
|
if (CollectionUtils.isNotEmpty(disableDeliveryTypes)) {
|
|
if (CollectionUtils.isNotEmpty(disableDeliveryTypes)) {
|
|
types.removeAll(disableDeliveryTypes);
|
|
types.removeAll(disableDeliveryTypes);
|
|
}
|
|
}
|
|
|
|
+ // 开放平台个人发单, 不发美团和蜂鸟
|
|
|
|
+ if (merchant != null && merchant.getAppId() != null && StringUtils.isBlank(valuationReq.getShopCode())) {
|
|
|
|
+ types.removeAll(Arrays.asList(2, 3));
|
|
|
|
+ }
|
|
// 获取可用发单运力
|
|
// 获取可用发单运力
|
|
List<DeliveryInfo> deliveryInfos = this.getDeliveryInfos(valuationDto, types);
|
|
List<DeliveryInfo> deliveryInfos = this.getDeliveryInfos(valuationDto, types);
|
|
if (CollectionUtils.isEmpty(deliveryInfos)) {
|
|
if (CollectionUtils.isEmpty(deliveryInfos)) {
|
|
@@ -741,12 +752,6 @@ public class OpenApiOrderValuationServiceImpl implements OpenApiOrderValuationSe
|
|
valuationDto.setMerchantId(shop.getMerchantId());
|
|
valuationDto.setMerchantId(shop.getMerchantId());
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(valuationReq, valuationDto);
|
|
BeanUtils.copyProperties(valuationReq, valuationDto);
|
|
- if (valuationDto.getMerchantId() != null) {
|
|
|
|
- Merchant merchant = iMerchantService.getById(valuationDto.getMerchantId());
|
|
|
|
- if (merchant == null) {
|
|
|
|
- return ResponseResult.error(ResponseResultCodeEnum.MERCHANT_DISABLE);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|