package jnpf.doclibrary.fallback;

import com.github.pagehelper.PageInfo;
import jnpf.base.ActionResult;
import jnpf.doclibrary.StoreApi;
import jnpf.entity.StoreEntity;
import jnpf.model.store.Store;
import jnpf.model.store.StorePositionInfoVo;
import jnpf.model.store.StoreUserNumVo;
import jnpf.model.store.dto.StoreAbnormalIdsQueryDTO;
import jnpf.model.store.dto.StorePageByIdsNoDsQueryDTO;
import jnpf.model.store.dto.StorePageByIdsQueryDTO;
import jnpf.model.store.vo.StoreBaseListVO;
import jnpf.model.store.vo.StoreLocationVO;
import jnpf.model.store.vo.UserStoreListVo;
import jnpf.model.vo.StoreExecutionVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 资料库内部调用fallback
 *
 * @author yanwenfu
 * @create 2023-07-12
 */
@Slf4j
@Component
public class StoreFallback implements StoreApi {
    @Override
    public List<StorePositionInfoVo> getStorePositionInfoList(String storeId, List<String> positionList) {

        log.error("类名: StoreFallback, 方法名: getStorePositionInfoList, 错误信息: 调用失败...");
        return new ArrayList<>();
    }

    @Override
    public List<StoreUserNumVo> getUserNum(List<String> storeIds) {
        log.error("类名: StoreFallback, 方法名: getUserNum, 错误信息: 调用失败...");
        return new ArrayList<>();
    }

    @Override
    public List<Store> getListByUserId(String userId) {

        log.error("类名: StoreFallback, 方法名: getStoreListByUser, 错误信息: 调用失败...");
        return new ArrayList<>();
    }

    @Override
    public List<UserStoreListVo> getAllUserStores() {
        log.error("类名: StoreFallback, 方法名: getAllUserStores, 错误信息: 调用失败...");
        return null;
    }

    @Override
    public List<Store> getListByIds(List<String> storeIds) {

        log.error("类名: StoreFallback, 方法名: getListByIds, 错误信息: 调用失败...");
        return new ArrayList<>();
    }

    @Override
    public ActionResult<List<Store>> getList(String selectKey, String organizeId, String longitude, String latitude) {

        log.error("类名: StoreFallback, 方法名: getList, 错误信息: 调用失败...");
        return null;
    }

    @Override
    public ActionResult<List<Store>> getUserStoreList() {
        log.error("类名: StoreFallback, 方法名: getUserStoreList, 错误信息: 调用失败...");
        return null;
    }

    @Override
    public ActionResult<List<Store>> getUserStoreListDuty() {
        return null;
    }

    @Override
    public List<Store> getStoreList(String organizeId) {

        log.error("类名: StoreFallback, 方法名: getStoreList, 错误信息: 调用失败...");
        return new ArrayList<>();
    }

    @Override
    public List<Store> getOrgStoreList(String organizeId, List<String> queryStoreIds) {
        log.error("类名: StoreFallback, 方法名: getOrgStoreList, 错误信息: 调用失败...");
        return null;
    }


    @Override
    public Store getStoreInfo(String id) {

        log.error("类名: StoreFallback, 方法名: getStoreInfo, 错误信息: 调用失败...");
        return null;
    }

    /**
     * 查询门店信息
     *
     * @param id       门店id
     * @param tenantId
     * @return jnpf.model.store.Store
     */
    @Override
    public StoreEntity getStoreInfoNoData(String id, String tenantId) {

        log.error("FTB_类名: StoreFallback, 方法名: getStoreInfoDutyQuery, 错误信息: 调用失败..., 当前租户号[{}] - 门店号[{}]", tenantId, id);
        log.error(" getStoreInfoDutyQuery 没有拿到门店信息,走了fallback");
        return null;
    }

    @Override
    public PageInfo<StoreExecutionVo> getStorePageByIds(StorePageByIdsQueryDTO query) {

        return new PageInfo<>();
    }

    @Override
    public boolean checkStoreUser(String userId) {
        log.error("类名: StoreFallback, 方法名: checkStoreUser, 错误信息: 调用失败...");
        return false;
    }

    @Override
    public ActionResult<List<StoreBaseListVO>> getStoreListByOrganizeIdAndChildOrganize(String organizeId, Boolean disabled) {
        return null;
    }

    @Override
    public List<StorePositionInfoVo> getStorePositionInfoListNodata(String storeId, List<String> positionList, String tenantId) {
        return null;
    }

    @Override
    public List<Store> getListByUserIdNodata(String userId, String tenantId) {
        return null;
    }

    @Override
    public StoreLocationVO getStoreLocation(String storeId) {
        return null;
    }

    @Override
    public PageInfo<StoreExecutionVo> getStorePageByIdsNoDataSource(StorePageByIdsNoDsQueryDTO query) {

        return new PageInfo<>();
    }

    @Override
    public List<String> getAbnormalStoreIds(StoreAbnormalIdsQueryDTO query) {
        return new ArrayList<>();
    }

    @Override
    public List<Store> getStoreListByOrganizeList(List<String> organizeIdList) {

        return new ArrayList<>();
    }

    @Override
    public List<Store> getListByIdsNoDataSource(String tenantId, List<String> storeIds) {

        return new ArrayList<>();
    }

//    @Override
//    public ActionResult<Store> info(String id) {
//        return null;
//    }
}
