package com.yuchen.saas.parking.api.feign;

import com.yuchen.saas.parking.api.dto.ParkingBillByCouponDTO;
import com.yuchen.saas.parking.api.entity.PmgBatParkBill;
import com.yuchen.saas.parking.api.entity.PmgBatParkBillLog;
import com.yuchen.saas.parking.api.entity.PmgBatParkParking;
import com.yuchen.saas.parking.api.entity.VehicleOccupancyFeeBill;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import javax.validation.Valid;
import java.util.List;

/**
 * @author 刘碧清
 * @version 1.0
 * @date 2021-05-26 17:55
 */
@Component
public class PmgBatCarChargeHandlerBack implements FallbackFactory<PmgBatCarChargeClient> {


    @Override
    public PmgBatCarChargeClient create(Throwable throwable) {

        return new PmgBatCarChargeClient() {

            @Override
            public R entranceSave(@Valid PmgBatParkBillVo pmgBatParkBillVo) {
                return R.fail("查询失败");
            }

            @Override
            public R settleAccounts(String plateNo, Long parkingId, String paidCost) {
                return R.fail("查询失败");
            }

            @Override
            public R updateBillById(PmgBatParkBill pmgBatParkBill) {
                return R.fail("查询失败");
            }

            @Override
            public R<ResultDTO> updatePaymentBill(Long billId, Long paidCost, Long paidPlaceIdleCost, String payUserId, String payType, String tenantId, Long parkingId) {
                return R.fail("查询失败");
            }

            @Override
            public R<ResultDTO> updatePaymentBillV2(Long billId, Long paidCost, Long paidPlaceIdleCost, String payUserId, String payType, String tenantId, Long parkingId, String couponCode) {
                return R.fail("查询失败");
            }

            @Override
            public R<ResultDTO> updateOccFeePaymentBill(Long billId, Long paidCost, Long paidPlaceIdleCost, String payUserId, String payType, String tenantId, Long parkingId) {
                return R.fail("查询失败");
            }

            @Override
            public R updateOccFeeBillById(VehicleOccupancyFeeBill vehicleOccupancyFeeBill) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> getOneBill(Long parkingId, String plateNo, Long noPlateId) {
                return R.fail("查询失败");
            }

            @Override
            public R<List<ParkingSettleBillVo>> getBillList(Long parkingId, String plateNo, Long noPlateId) {
                return R.fail("查询失败");
            }

            @Override
            public R<List<ParkingSettleBillVo>> getSupplementaryPaymentBillList(Long parkingId, String plateNo, Long noPlateId) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> getOneBillNoReSettlement(Long parkingId, String plateNo) {
                return R.fail("查询失败");
            }

            @Override
            public R getCarRuleConfigById(Long ruleId) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> getParkingBillByIdVerifyCost(String billId) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> createBillPayment(String billId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatParkBill> updateBillPayment(PmgBatParkBill pmgBatParkBill) {
                return R.fail("查询失败");
            }

            @Override
            public R<VehicleOccupancyFeeBill> getOccupancyBillByIdVerifyCost(String billId) {
                return R.fail("查询失败");
            }

            @Override
            public R<VehicleOccupancyFeeBill> createOccFeeBillPayment(String billId) {
                return R.fail("查询失败");
            }

            @Override
            public R updateInvoicingStatus(String ids, Integer monthlyBill, Integer invoicingStatus) {
                return R.fail("查询失败");
            }

            @Override
            public R getBillPageList(@Valid SearchBillVo searchBillVo) {
                return R.fail("查询失败");
            }

            @Override
            public R getBillPageListNew(@Valid List<String> billIds) {
                return R.fail("查询失败");
            }

            @Override
            public R<List<PmgBatParkBillLog>> getBillList(String payUserId, String invoicingStatus, String billIds) {
                return R.fail("查询失败");
            }

            @Override
            public R getRuleDetails(String parkingId, String vehicleType, String ruleType) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkParking> getParkingInfo(Long parkingId) {
                return R.fail("查询失败");
            }

            @Override
            public R<List<VehicleOccupancyFeeBill>> getOccFeeBillsByPlateNo(String plateNo, String parkingId) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> getOneBillById(String billId) {
                return R.fail("查询失败");
            }

            @Override
            public R<VehicleOccupancyFeeBill> getOccFeeOneBillById(String billId) {
                return R.fail("查询失败");
            }

            @Override
            public R<PmgBatParkBill> getParkingBill(ParkingBillVo parkingBillVo) {
                return R.fail("查询失败");
            }

            @Override
            public R<ParkingSettleBillByCouponVo> getBillByCoupon(String plateNo, Long qrCodeId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R settleBillByCoupon(ParkingBillByCouponDTO parkingBillVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
