package com.jsowell.thirdparty.yongchengboche.service.impl;

import com.jsowell.pile.dto.*;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
import com.jsowell.thirdparty.zhongdianlian.service.ZDLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * 甬城泊车 Service
 *
 * @author Lemon
 * @Date 2023/10/30 15:44:58
 */
@Service
public class YCBCServiceImpl implements YCBCService {

    @Autowired
    private ZDLService zdlService;

    @Autowired
    private LianLianService lianLianService;


    /**
     * 获取令牌
     * @param dto
     * @return
     */
    @Override
    public String YCBCGetToken(YCBCGetTokenDTO dto) {
        return zdlService.ZDLGetToken(dto);
    }

    /**
     * 生成令牌
     * @param dto
     * @return
     * @throws UnsupportedEncodingException
     */
    @Override
    public Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException {
        return zdlService.generateToken(dto);
    }

    /**
     * 获取充电站信息
     * @param dto
     * @return
     */
    @Override
    public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
        return zdlService.queryStationsInfo(dto);
    }


    /**
     * 设备接口状态查询
     * @param dto
     * @return
     */
    @Override
    public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
        return zdlService.queryStationStatus(dto);
    }

    /**
     * 设备状态变化推送
     * @param pileConnectorCode
     * @param status
     * @return
     */
    @Override
    public String notificationStationStatus(String pileConnectorCode, String status) {
        return zdlService.notificationStationStatus(pileConnectorCode, status);
    }

    /**
     * 请求设备认证
     * @param dto
     * @return
     */
    @Override
    public Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
        return lianLianService.query_equip_auth(dto);
    }

    /**
     * 请求开始充电
     * @param dto
     * @return
     */
    @Override
    public Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
        return lianLianService.query_start_charge(dto);
    }

    /**
     * 推送启动充电结果
     * @return
     */
    @Override
    public String pushStartChargeResult(String orderCode) {
        return lianLianService.pushStartChargeResult(orderCode);
    }

    /**
     * 查询充电状态
     * @param dto
     */
    @Override
    public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
        return lianLianService.query_equip_charge_status(dto);
    }

    /**
     * 推送充电状态
     * @param orderCode
     * @return
     */
    @Override
    public String pushChargeStatus(String orderCode) throws UnsupportedEncodingException {
        return lianLianService.pushChargeStatus(orderCode);
    }

    /**
     * 请求停止充电
     * @param dto
     * @return
     */
    @Override
    public Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
        return lianLianService.query_stop_charge(dto);
    }

    /**
     * 推送停止充电结果(仅在 0x19的帧类型中调用)
     * @param orderCode
     * @return
     */
    @Override
    public String pushStopChargeResult(String orderCode) {
        return lianLianService.pushStopChargeResult(orderCode);
    }

    /**
     * 推送充电订单信息
     * @param orderCode
     * @return
     */
    @Override
    public String pushChargeOrderInfo(String orderCode) {
        return lianLianService.pushChargeOrderInfo(orderCode);
    }

    /**
     * 推送充电站信息
     * @param dto
     * @return
     */
    @Override
    public String pushStationInfo(PushStationInfoDTO dto) {
        return zdlService.pushStationInfo(dto);
    }

}
