...
|
...
|
@@ -5,9 +5,11 @@ import com.yoho.error.exception.ServiceException; |
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoRespBo;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.utils.AppVersion;
|
|
|
import com.yohoufo.order.model.response.AppraiseAddressResp;
|
|
|
import com.yohoufo.order.service.IExpressInfoService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
import static com.yohoufo.order.utils.ServiceExceptions.throwServiceException;
|
|
|
import static com.yohoufo.order.utils.ServiceExceptions.throwServiceExceptionIf;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -44,11 +47,37 @@ public class ExpressInfoController { |
|
|
@RequestParam("expressCompanyId") Integer expressCompanyId,
|
|
|
@RequestParam("orderCode") Long orderCode,
|
|
|
@RequestParam("wayBillCode") String wayBillCode,
|
|
|
@RequestParam("depotNum") Integer depotNum) {
|
|
|
expressInfoService.deliverToDepot(uid,expressCompanyId, orderCode, wayBillCode,depotNum);
|
|
|
@RequestParam(value = "depotNum", required = false) String depotNum,
|
|
|
@RequestParam(value = "app_version") String appVersion) {
|
|
|
|
|
|
Integer depotNumInt = parseDepotNum(depotNum);
|
|
|
if (Objects.isNull(depotNumInt)) {
|
|
|
// 大于6.9.3 版本
|
|
|
if (AppVersion.of(appVersion).greaterThan(AppVersion.of("6.9.3"))) {
|
|
|
throwServiceException("请选择有效的鉴定中心");
|
|
|
}
|
|
|
// 小于等于6.9.3版本,提升升级APP
|
|
|
else {
|
|
|
throwServiceException(500, "请升级至最新版本");
|
|
|
}
|
|
|
}
|
|
|
expressInfoService.deliverToDepot(uid, expressCompanyId, orderCode, wayBillCode, depotNumInt);
|
|
|
return new ApiResponse();
|
|
|
}
|
|
|
|
|
|
private Integer parseDepotNum(String depotNum) {
|
|
|
if (StringUtils.isBlank(depotNum)) {
|
|
|
return null;
|
|
|
}
|
|
|
try {
|
|
|
return Integer.valueOf(depotNum);
|
|
|
} catch (RuntimeException re) {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询快递详情
|
|
|
*
|
...
|
...
|
|