1.pms电能质量报表
2.园区功能接口 3.自定义报表(部分)
This commit is contained in:
@@ -2,7 +2,7 @@ package com.njcn.prepare.harmonic.api.line;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.line.fallback.CoustomReportFeignClientFallbackFactory;
|
||||
import com.njcn.prepare.harmonic.api.line.fallback.CustomReportFeignClientFallbackFactory;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -16,9 +16,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
@FeignClient(
|
||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||
path = "/report",//对应controller请求类
|
||||
fallbackFactory = CoustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||
fallbackFactory = CustomReportFeignClientFallbackFactory.class//服务降级处理类
|
||||
)
|
||||
public interface CoustmReportFeignClient {
|
||||
public interface CustomReportFeignClient {
|
||||
|
||||
/**
|
||||
* 批量处理报表
|
||||
@@ -3,7 +3,7 @@ package com.njcn.prepare.harmonic.api.line.fallback;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.line.CoustmReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.api.line.CustomReportFeignClient;
|
||||
import com.njcn.prepare.harmonic.pojo.param.LineParam;
|
||||
import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -20,10 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<CoustmReportFeignClient> {
|
||||
public class CustomReportFeignClientFallbackFactory implements FallbackFactory<CustomReportFeignClient> {
|
||||
|
||||
@Override
|
||||
public CoustmReportFeignClient create(Throwable throwable) {
|
||||
public CustomReportFeignClient create(Throwable throwable) {
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException)throwable.getCause();
|
||||
@@ -31,7 +31,7 @@ public class CoustomReportFeignClientFallbackFactory implements FallbackFactory<
|
||||
}
|
||||
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CoustmReportFeignClient() {
|
||||
return new CustomReportFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> batchReport(@RequestBody LineParam reportParam){
|
||||
log.error("{}异常,降级处理,异常为:{}", "生成自定义报表: ", throwable.toString());
|
||||
Reference in New Issue
Block a user