OA ZL0010-来料检验不合格控制流程代码
parent
4dd5c4895f
commit
d2e644b74b
@ -0,0 +1,20 @@
|
||||
package com.op.system.api;
|
||||
|
||||
import com.op.common.core.constant.ServiceNameConstants;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.system.api.factory.RemoteOpenFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* Open接口服务
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
@FeignClient(contextId = "remoteOpenService", value = ServiceNameConstants.OPEN_SERVICE, fallbackFactory = RemoteOpenFallbackFactory.class)
|
||||
public interface RemoteOpenService {
|
||||
/**提交ZL0010-来料检验不合格控制流程**/
|
||||
@PostMapping("/openInterface/OAInspection")
|
||||
public AjaxResult OAInspection();
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.op.system.api.factory;
|
||||
|
||||
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.system.api.RemoteOpenService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class RemoteOpenFallbackFactory implements FallbackFactory<RemoteOpenService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteOpenFallbackFactory.class);
|
||||
@Override
|
||||
public RemoteOpenService create(Throwable throwable) {
|
||||
log.error("Open服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteOpenService() {
|
||||
@Override
|
||||
public AjaxResult OAInspection() {
|
||||
return AjaxResult.error("提交ZL0010-来料检验不合格控制流程失败"+throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue