md
This commit is contained in:
parent
955d5610c1
commit
498132bbb7
@ -54,7 +54,6 @@ public class Oms2cCommonController extends BaseController
|
||||
this.iApiwebSvc = iApiwebSvc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取电子面单单号
|
||||
*/
|
||||
@ -62,9 +61,6 @@ public class Oms2cCommonController extends BaseController
|
||||
public AjaxResult realMatchWaybill(String useSiteCode,String prefix)
|
||||
{
|
||||
try {
|
||||
// String waybillNo = emisElectronicSitePagService.realMatchWaybill(useSiteCode,"T7080");
|
||||
// return AjaxResult.success("处理成功",waybillNo);
|
||||
|
||||
return this.iApiwebSvc.realMatchWaybill(useSiteCode,"T7080");
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
@ -73,7 +69,6 @@ public class Oms2cCommonController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取进仓单号
|
||||
*/
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xdadan.erp.oms.service.svc;
|
||||
|
||||
import feign.Response;
|
||||
import feign.RetryableException;
|
||||
import feign.codec.ErrorDecoder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class FeignErrorDecoder extends ErrorDecoder.Default {
|
||||
|
||||
@Override
|
||||
public Exception decode(String methodKey, Response response) {
|
||||
Exception exception = super.decode(methodKey, response);
|
||||
|
||||
// 如果是RetryableException,则返回继续重试
|
||||
if (exception instanceof RetryableException) {
|
||||
return exception;
|
||||
} else {
|
||||
// 可以自定义一些逻辑,比如抛出一个其他的(统一个异常)
|
||||
exception = new RuntimeException("APISVR调用出错");
|
||||
}
|
||||
return exception;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
//@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",fallback = ProviderClientFallback.class)
|
||||
@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}")
|
||||
@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
|
||||
public interface IApiwebSvc {
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user