Pu Zhibing
9 天以前 7a4f9541331bef779a506b38a27ed5c3373c0bec
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderAccountingStrategyFallbackFactory.java
@@ -4,6 +4,7 @@
import com.ruoyi.order.api.feignClient.ChargingOrderAccountingStrategyClient;
import com.ruoyi.order.api.feignClient.ChargingOrderClient;
import com.ruoyi.order.api.model.TChargingOrder;
import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -11,6 +12,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * 充电订单服务降级处理
@@ -26,11 +28,21 @@
    public ChargingOrderAccountingStrategyClient create(Throwable throwable) {
        log.error("充电订单调用失败:{}", throwable.getMessage());
        return new ChargingOrderAccountingStrategyClient() {
            @Override
            public R<List<List<Map<String, Object>>>> getTotalElectricQuantity(Integer days, Set<Integer> siteIds) {
                return R.fail("获取给定天数每天的充电量统计数据失败:" + throwable.getMessage());
            }
            @Override
            public R<List<Double>> getDailyChargingDegree(Integer days, Set<Integer> siteIds) {
                return R.fail("获取给定天数每天的充电度数失败:" + throwable.getMessage());
            }
    
            @Override
            public R<List<List<Map<String, Object>>>> getTotalElectricQuantity(Integer days) {
                return R.fail("获取给定天数每天的充电量统计数据失败:" + throwable.getMessage());
            public R<List<TChargingOrderAccountingStrategy>> getChargingOrderAccountingStrategyByOrderId(Long chargingOrderId) {
                return R.fail("根据订单id查询充电明细失败:" + throwable.getMessage());
            }
        };
    }