| | |
| | | package com.ruoyi.chargingPile.api.factory; |
| | | |
| | | import com.ruoyi.chargingPile.api.dto.CheckChargingStrategyDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyDetailClient; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | public AccountingStrategyDetailClient create(Throwable throwable) { |
| | | log.error("计费策略调用失败:{}", throwable.getMessage()); |
| | | return new AccountingStrategyDetailClient(){ |
| | | |
| | | @Override |
| | | public R<TAccountingStrategyDetail> getNowData(Integer accountingStrategyId) { |
| | | return R.fail("获取当前有效的计费策略明细失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TAccountingStrategyDetail> getDetailBySiteId(Integer siteId) { |
| | | return R.fail("通过站点id查询当前时段使用的策略明细失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TAccountingStrategyDetail> getDetailByCode(String code) { |
| | | return R.fail("通过桩编号查询当前时段使用的策略明细失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> checkChargingStrategy(CheckChargingStrategyDTO dto) { |
| | | return R.fail("校验充电桩计费模版是否准确失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<TAccountingStrategyDetail>> getListByAccountingStrategyId(Integer id) { |
| | | throw new RuntimeException("根据计费策略主表id策略明细失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<TAccountingStrategyDetail>> getDetailListByCode(String code) { |
| | | return R.fail("通过桩编号查询当前使用的策略明细列表失败:" + throwable.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |