package com.miya.fastcashier.beans;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;

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

/**
 * 非米雅渠道 自助结算终端用户信息类
 * Created by fengyu on 2018/4/8.
 */
public class SelfCashierAccountInfo extends BaseDO {

    @SerializedName("store")
    private SelfCashierAccountInfo.ShopInfo shopInfo;

    @SerializedName("accessToken")
    private SelfCashierAccountInfo.AccessToken accessToken;

    public SelfCashierAccountInfo.AccessToken getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(SelfCashierAccountInfo.AccessToken accessToken) {
        this.accessToken = accessToken;
    }

    public SelfCashierAccountInfo.ShopInfo getShopInfo() {
        return shopInfo;
    }

    public void setShopInfo(SelfCashierAccountInfo.ShopInfo shopInfo) {
        this.shopInfo = shopInfo;
    }

    public static class ShopInfo {
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getBanners() {
            return banners;
        }

        public void setBanners(String banners) {
            this.banners = banners;
        }

        public String getMerchant() {
            return merchant;
        }

        public void setMerchant(String merchant) {
            this.merchant = merchant;
        }

        private String name;
        private String code;
        private String merchant;
        private String banners;

        //店铺id
        private String storeId;
        //店铺名称
        private String storeName;
        //数据源类名
        private String dataSourceName;
        //图片 文件夹名称
        private String imageFolderName;
        private String logoUrl;

        //横屏 初始页url
        @SerializedName("welcomeLogoUrl")
        private String landWelcomeLogoUrl;
        //竖版屏 初始页url
        private String portraitWelcomeLogoUrl;
        //没商品图片时 默认图片地址
        private String defaultGoodsImgUrl;
        //  ip地址
        private String dataSourceIp;
        //米雅isv pid
        private String partnerId;
        //商户 pid
        @SerializedName("pid")
        private String merchantId;
        //商户appip
        private String appId;
        //posId
        private String posId;
        //支付宝账单显示信息
        private String customerShowTitle;

        private String saasid;
        private String marketid;
        //米雅支付平台 签名key
        private String miyaPayPlatformSignKey;
        //米雅支付平台 支付版本
        private String miyaPayApiVersion;
        //打印提供者类名
        @SerializedName("printDataSourceName")
        private String printerSourceName;

        //會花 hhMerchant
        private String hhMerchant;
        //打印小票页尾显示信息
        private String printFooterMessage;
        //是否需要 初始化
        private boolean needInitBeforeUse = false;
        //是否需要 释放资源
        private boolean needReleaseLogout;
        //会员功能是否启用
        private boolean memberFeatureEnable = false;

        //是否需要结算订单
        private boolean needBalanceOrder = false;
        //是否开启日结功能
        private boolean dailyCheckEnable = false;
        //presenter类名
        @SerializedName("presentCategory")
        private String presenterSourceName;

        /**
         * 日结 启动页面名称 类名 （注：由于登录时不带机器信息，这里要配置非全类名）
         */

        private String dayCheckFragNam;

        /**
         * 商户名称
         */
        String merchantName;

        /**
         * 会员输入页面显示策略  1.只显示扫码录入 2.只显示手动录入 0.都显示，但是先显示扫码 4.都显示 但是先显示手动录入
         */
        private int memberShipTapShowCategory;


        /**
         * 支持的支付方式 1.只有微信 2.只有支付宝 3.全渠道
         */
        private int supportPayWayType;


        /**
         * 支付平台集群地址
         */
        private String miyaPayPlatformUrl;

        /**
         * 是否限制档口商品，0：不限制，1：限制
         */
        private int restrictGoods;


        /**
         * 收银员Id
         */
        private String operatorId;


        /**
         * 组件提供者标示
         */
        private int componentProviderCategory;


        /**
         * 购物袋信息
         */
        private String shoppingBagData;

        /**
         * 扩展信息
         */
        private ShopExtInfo extData;


        public ShopExtInfo getExtData() {
            return extData;
        }

        public void setExtData(ShopExtInfo extData) {
            this.extData = extData;
        }


        public int getRestrictGoods() {
            return restrictGoods;
        }

        public ShopInfo setRestrictGoods(int restrictGoods) {
            this.restrictGoods = restrictGoods;
            return this;
        }

        public String getMerchantName() {
            return merchantName;
        }

        public ShopInfo setMerchantName(String merchantName) {
            this.merchantName = merchantName;
            return this;
        }

        public String getDefaultGoodsImgUrl() {
            return defaultGoodsImgUrl;
        }

        public void setDefaultGoodsImgUrl(String defaultGoodsImgUrl) {
            this.defaultGoodsImgUrl = defaultGoodsImgUrl;
        }

        public int getSupportPayWayType() {
            return supportPayWayType;
        }

        public void setSupportPayWayType(int supportPayWayType) {
            this.supportPayWayType = supportPayWayType;
        }

        public String getMiyaPayPlatformUrl() {
            return miyaPayPlatformUrl;
        }

        public void setMiyaPayPlatformUrl(String miyaPayPlatformUrl) {
            this.miyaPayPlatformUrl = miyaPayPlatformUrl;
        }

        public String getHhMerchant() {
            return hhMerchant;
        }

        public void setHhMerchant(String hhMerchant) {
            this.hhMerchant = hhMerchant;
        }

        public String getPresenterSourceName() {
            return presenterSourceName;
        }

        public void setPresenterSourceName(String presenterSourceName) {
            this.presenterSourceName = presenterSourceName;
        }

        public String getStoreId() {
            return storeId;
        }

        public void setStoreId(String storeId) {
            this.storeId = storeId;
        }

        public String getStoreName() {
            return storeName;
        }

        public boolean isNeedReleaseLogout() {
            return needReleaseLogout;
        }

        public void setNeedReleaseLogout(boolean needReleaseLogout) {
            this.needReleaseLogout = needReleaseLogout;
        }

        public void setStoreName(String storeName) {
            this.storeName = storeName;
        }

        public String getDataSourceName() {
            return dataSourceName;
        }

        public void setDataSourceName(String dataSourceName) {
            this.dataSourceName = dataSourceName;
        }

        public String getImageFolderName() {
            return imageFolderName;
        }

        public void setImageFolderName(String imageFolderName) {
            this.imageFolderName = imageFolderName;
        }

        public String getLogoUrl() {
            return logoUrl;
        }

        public void setLogoUrl(String logoUrl) {
            this.logoUrl = logoUrl;
        }

        public String getLandWelcomeLogoUrl() {
            return landWelcomeLogoUrl;
        }

        public void setLandWelcomeLogoUrl(String landWelcomeLogoUrl) {
            this.landWelcomeLogoUrl = landWelcomeLogoUrl;
        }

        public String getDataSourceIp() {
            return dataSourceIp;
        }

        public void setDataSourceIp(String dataSourceIp) {
            this.dataSourceIp = dataSourceIp;
        }

        public String getPartnerId() {
            return partnerId;
        }

        public void setPartnerId(String partnerId) {
            this.partnerId = partnerId;
        }

        public String getMerchantId() {
            return merchantId;
        }

        public void setMerchantId(String merchantId) {
            this.merchantId = merchantId;
        }

        public String getAppId() {
            return appId;
        }

        public void setAppId(String appId) {
            this.appId = appId;
        }

        public String getPosId() {
            return posId;
        }

        public void setPosId(String posId) {
            this.posId = posId;
        }

        public String getCustomerShowTitle() {
            return customerShowTitle;
        }

        public void setCustomerShowTitle(String customerShowTitle) {
            this.customerShowTitle = customerShowTitle;
        }

        public String getSaasid() {
            return saasid;
        }

        public void setSaasid(String saasid) {
            this.saasid = saasid;
        }

        public String getMarketid() {
            return marketid;
        }

        public void setMarketid(String marketid) {
            this.marketid = marketid;
        }

        public String getMiyaPayPlatformSignKey() {
            return miyaPayPlatformSignKey;
        }

        public void setMiyaPayPlatformSignKey(String miyaPayPlatformSignKey) {
            this.miyaPayPlatformSignKey = miyaPayPlatformSignKey;
        }

        public String getMiyaPayApiVersion() {
            return miyaPayApiVersion;
        }

        public void setMiyaPayApiVersion(String miyaPayApiVersion) {
            this.miyaPayApiVersion = miyaPayApiVersion;
        }

        public String getPrinterSourceName() {
            return printerSourceName;
        }

        public void setPrinterSourceName(String printerSourceName) {
            this.printerSourceName = printerSourceName;
        }

        public String getPrintFooterMessage() {
            return printFooterMessage;
        }

        public void setPrintFooterMessage(String printFooterMessage) {
            this.printFooterMessage = printFooterMessage;
        }

        public boolean isMemberFeatureEnable() {
            return memberFeatureEnable;
        }

        public void setMemberFeatureEnable(boolean memberFeatureEnable) {
            this.memberFeatureEnable = memberFeatureEnable;
        }

        public boolean isNeedInitBeforeUse() {
            return needInitBeforeUse;
        }

        public void setNeedInitBeforeUse(boolean needInitBeforeUse) {
            this.needInitBeforeUse = needInitBeforeUse;
        }

        public boolean isNeedBalanceOrder() {
            return needBalanceOrder;
        }

        public void setNeedBalanceOrder(boolean needBalanceOrder) {
            this.needBalanceOrder = needBalanceOrder;
        }

        public String getPortraitWelcomeLogoUrl() {
            return portraitWelcomeLogoUrl;
        }

        public void setPortraitWelcomeLogoUrl(String portraitWelcomeLogoUrl) {
            this.portraitWelcomeLogoUrl = portraitWelcomeLogoUrl;
        }

        public String getDayCheckFragNam() {
            return dayCheckFragNam;
        }

        public void setDayCheckFragNam(String dayCheckFragNam) {
            this.dayCheckFragNam = dayCheckFragNam;
        }

        public int getMemberShipTapShowCategory() {
            return memberShipTapShowCategory;
        }

        public void setMemberShipTapShowCategory(int memberShipTapShowCategory) {
            this.memberShipTapShowCategory = memberShipTapShowCategory;
        }

        public String getOperatorId() {
            return operatorId;
        }

        public void setOperatorId(String operatorId) {
            this.operatorId = operatorId;
        }

        public int getComponentProviderCategory() {
            return componentProviderCategory;
        }

        public void setComponentProviderCategory(int componentProviderCategory) {
            this.componentProviderCategory = componentProviderCategory;
        }

        public boolean isDailyCheckEnable() {
            return dailyCheckEnable;
        }

        public void setDailyCheckEnable(boolean dailyCheckEnable) {
            this.dailyCheckEnable = dailyCheckEnable;
        }

        public String getShoppingBagData() {
            return shoppingBagData;
        }

        public void setShoppingBagData(String shoppingBagData) {
            this.shoppingBagData = shoppingBagData;
        }
    }


    public class AccessToken {
        @SerializedName("access_token")
        private String accessToken;
        @SerializedName("token_type")
        private String tokenType;

        @SerializedName("refresh_token")
        private String refreshToken;

        private String scope;

        public String getAccessToken() {
            return accessToken;
        }

        public void setAccessToken(String accessToken) {
            this.accessToken = accessToken;
        }

        public String getTokenType() {
            return tokenType;
        }

        public void setTokenType(String tokenType) {
            this.tokenType = tokenType;
        }

        public String getRefreshToken() {
            return refreshToken;
        }

        public void setRefreshToken(String refreshToken) {
            this.refreshToken = refreshToken;
        }

        public String getScope() {
            return scope;
        }

        public void setScope(String scope) {
            this.scope = scope;
        }

    }


    /**
     * 商户账户扩展信息
     */
    public static class ShopExtInfo {

        /**
         * 公众号url，规则：以"|"分隔
         */
        private String officialAccountUrl;

        /**
         * 扫描会员引导提示框文案
         */
        String scanMemberHint;

        /**
         * 是否支持0元支付
         */
        boolean enablePayZero;

        /**
         * 是否开启信用防损功能
         */
        boolean isOpenCredit;

        /**
         * 是否静默授权
         */
        boolean isSilentCredit;

        private String storeAddress;

        /**
         * 平台url，如会花、云中台
         * 注：不包括接口后缀
         * 区别于dataSourceIp，dataSourceIp定义为与pos交互的ip地址
         */
        String platformUrl;

        /**
         * 是否开启称重
         */
        private boolean enableWeighing;

        /**
         * 是否开启重传组件
         */
        private boolean enableReUpload;

        /**
         * 组件提供者标示 0:支付宝 1：微信
         */
        private int componentProviderCategory;

        /**
         * 购物袋信息展示方式（0 弹出框展示 1 平铺展示）
         */
        private int shoppingBagDataShowType;


        /**
         * 微信公众号
         */
        private String wxAppid;

        /**
         * 微信商户号
         */
        private String wxMchId;

        /**
         * 微信子商户公众账号ID(服务商模式)
         */
        private String wxSubAppid;

        /**
         * 微信子商户号(服务商模式)
         */
        private String wxSubMchId;


        /**
         * 微信代理IP
         */
        private String wxProxyIp;
        /**
         * 微信代理端口
         */
        private String wxProxyPort;


        /**
         * 是否上传sub_appid
         */
        private boolean wxAddSubAppid = false;

        /**
         * 是否保持使用空的sub_mch_id，即不传入sub_mch_id，微信万宁的不传，其它商户的传
         */
        private boolean isKeepNullSubMchId = false;


        /**
         * 登录接口错误时，在本地有配置信息的情况下，直接用本地配置信息进入
         */
        private boolean offlineModeEnableWhenNetWorkError;

        /**
         * 开启绑定Mac 地址
         */
        private boolean bindDeviceMacAddressEnbale;

        /**
         * 使用的支付服务标试 1.米雅支付平台，2.米雅jar包链接前置 3.米雅PosHub
         */
        private int usePayServiceTag;

        /**
         * 是否开启非标准商品
         */
        private boolean nonstandardGoodsEnable;


        /**
         * 获取非标准商品的请求地址
         */
        private String queryNonstandardGoodsUrl;

        /**
         * 是否开启会员注册
         */
        private boolean registerMemberEnable;

        /**
         * 会员注册方式对话框
         * 在开启会员注册（registerMemberEnable = true）的前提下
         * 0.requestRegisterMemberUrl传入二维码链接，生成二维码的方式 （微信万宁使用）
         * 1.调用接口注册
         * 以及其它
         */
        private int registerTypeDialog;

        /**
         * 是否需要检验会员号
         */
        private boolean checkMemberIdEnable;

        /**
         * 商品列表分组显示个数，0表示不分组
         */
        private int goodsGroupNum;


        /**
         * 注册会员请求地址
         */
        private String requestRegisterMemberUrl;


        /**
         * 是否开启绑定员工卡
         */

        private boolean bindStaffIdEnable;

        /**
         * 请求绑定员工卡地址
         */
        private String requestBindStaffIdUrl;


        /**
         * 是否启用优惠券
         */
        private boolean couponEnable;

        /**
         * 核验优惠券的地址
         */
        private String verifyCouponUrl;


        /**
         * 是否关闭开启自助收银
         */
        private boolean closeSelfCashierFeatureEnable = false;

        /**
         * 是否开启核验
         */
        private boolean verifyFeatureEnable = false;

        //是否开启优惠明细显示
        private boolean couponDetailShowEnable;

        //是否在会员登录之后立即刷新刷新购物车显示商品的会员信息（目前万宁微信在使用）
        private boolean isChangeGoodsInfoAfterInputMember;

        //首页功能优先级 0优先展示收银 1代表优先展示会员功能
        private int homeFeatureShowCategory = 0;

        //会员功能展示场景 0是首页和扫商品页面都展示 1是只有首页展示
        private int memberFeatureShowScene = 0;

        //是否使用单独的页面进行结算
        private boolean usePageToBalanceOrder;

        //是否开启订单查询
        private boolean orderQueryFeatureEnable = false;

        //是否开启员工登陆
        private boolean staffLoginFeatureEnable = false;

        /**
         * 核验地址
         */
        private String verifyUrl;

        /**
         * 可以使用的支付方式控制 以支付平台的支付方式TAG为准  格式：[1|3|A]
         */
        private String payWayControl;

        /**
         * 商户的自定义参数
         */
        private String shopDiyParams;

        /**
         * 是否通过接口验证会员
         *
         * @return
         */
        private boolean callMemberApi;
        /**
         * 使用电子小票
         */
        private boolean useETicket;

        //是否展示会员积分
        private boolean isShowMemberScore;


        /**
         * 事件分发器实现类全类名 3.0.0 以上版本存在
         * 不配置使用默认实现类
         */
        private String actionDispatcherClassName;


        /**
         * 首页 中间 商户和支付宝 logo图
         */
        private String shopAndAliLogoUrl;

        /**
         * 首页 底部 logo图
         */
        private String homeBottomLogoUrl;

        /**
         * 是否开启手动输入数量功能
         */
        private boolean isEnableModify;


        /**
         * 顶部logo图
         */
        private String topLogoUrl;


        /**
         * 横版-首页 中间 商户和支付宝 logo图
         */
        private String landShopAndAliLogoUrl;
        /**
         * 横版-首页 底部 logo图
         */
        private String landHomeBottomLogoUrl;
        /**
         * 横版-顶部logo图
         */
        private String landTopLogoUrl;

        /**
         * 禁止手动输入商品条码
         */
        private boolean forbidManualInputBarcode;
        /**
         * 授权配置
         * <p>
         * 从低到高，减少商品，删除商品，退出交易，进入功能中心，进入购物车
         * 需要的话填1，不需要的话填0，高位有1的话，那么中间某功能不需要授权的话也要填0
         * 如：只需要进入功能中心授权，配置1000
         * 只需要退出交易授权：配置100
         * 需要退出交易，减少商品，删除商品，进入购物车授权，配置10111
         */
        private String authConfig;

        /**
         * 授权码前缀 - 结合本地一些动态规则，更加保密
         */
        private String authPrefix;


        /**
         * 服务端配置的授权码 - 如果服务端配置了  就以服务端为准
         */
        private String authCode;


        /**
         * 微信（微信）支付活动海报功能展示
         *
         * @return
         */
        private boolean isSdkPayDiscPosterShow = true;

        public boolean isSdkPayDiscPosterShow() {
            return isSdkPayDiscPosterShow;
        }

        public void setSdkPayDiscPosterShow(boolean sdkPayDiscPosterShow) {
            isSdkPayDiscPosterShow = sdkPayDiscPosterShow;
        }

        public String getAuthCode() {
            return authCode;
        }

        public void setAuthCode(String authCode) {
            this.authCode = authCode;
        }

        public String getAuthPrefix() {
            return authPrefix;
        }

        public void setAuthPrefix(String authPrefix) {
            this.authPrefix = authPrefix;
        }

        public String getAuthConfig() {
            return authConfig;
        }

        public void setAuthConfig(String authConfig) {
            this.authConfig = authConfig;
        }

        public String getOfficialAccountUrl() {
            return officialAccountUrl;
        }

        public ShopExtInfo setOfficialAccountUrl(String officialAccountUrl) {
            this.officialAccountUrl = officialAccountUrl;
            return this;
        }

        public int getHomeFeatureShowCategory() {
            return homeFeatureShowCategory;
        }

        public void setHomeFeatureShowCategory(int homeFeatureShowCategory) {
            this.homeFeatureShowCategory = homeFeatureShowCategory;
        }

        public int getMemberFeatureShowScene() {
            return memberFeatureShowScene;
        }

        public void setMemberFeatureShowScene(int memberFeatureShowScene) {
            this.memberFeatureShowScene = memberFeatureShowScene;
        }


        public boolean isWxAddSubAppid() {
            return wxAddSubAppid;
        }

        public void setStaffLoginFeatureEnable(boolean staffLoginFeatureEnable) {
            this.staffLoginFeatureEnable = staffLoginFeatureEnable;
        }

        public boolean isCallMemberApi() {
            return callMemberApi;
        }

        public String getActionDispatcherClassName() {
            return actionDispatcherClassName;
        }

        public void setActionDispatcherClassName(String actionDispatcherClassName) {
            this.actionDispatcherClassName = actionDispatcherClassName;
        }

        public String getScanMemberHint() {
            return scanMemberHint;
        }

        public ShopExtInfo setScanMemberHint(String scanMemberHint) {
            this.scanMemberHint = scanMemberHint;
            return this;
        }

        public boolean isCloseSelfCashierFeatureEnable() {
            return closeSelfCashierFeatureEnable;
        }

        public void setCloseSelfCashierFeatureEnable(boolean closeSelfCashierFeatureEnable) {
            this.closeSelfCashierFeatureEnable = closeSelfCashierFeatureEnable;
        }

        public boolean isOpenCredit() {
            return isOpenCredit;
        }

        public ShopExtInfo setOpenCredit(boolean openCredit) {
            isOpenCredit = openCredit;
            return this;
        }

        public boolean isSilentCredit() {
            return isSilentCredit;
        }

        public ShopExtInfo setSilentCredit(boolean silentCredit) {
            isSilentCredit = silentCredit;
            return this;
        }

        public String getStoreAddress() {
            return storeAddress;
        }

        public void setStoreAddress(String storeAddress) {
            this.storeAddress = storeAddress;
        }

        public boolean isCouponDetailShowEnable() {
            return couponDetailShowEnable;
        }

        public void setCouponDetailShowEnable(boolean couponDetailShowEnable) {
            this.couponDetailShowEnable = couponDetailShowEnable;
        }

        public boolean getWxAddSubAppid() {
            return wxAddSubAppid;
        }

        public void setWxAddSubAppid(boolean wxAddSubAppid) {
            this.wxAddSubAppid = wxAddSubAppid;
        }

        public boolean isKeepNullSubMchId() {
            return isKeepNullSubMchId;
        }

        public void setKeepNullSubMchId(boolean keepNullSubMchId) {
            isKeepNullSubMchId = keepNullSubMchId;
        }

        public boolean isUsePageToBalanceOrder() {
            return usePageToBalanceOrder;
        }

        public void setUsePageToBalanceOrder(boolean usePageToBalanceOrder) {
            this.usePageToBalanceOrder = usePageToBalanceOrder;
        }

        public boolean isOrderQueryFeatureEnable() {
            return orderQueryFeatureEnable;
        }

        public void setOrderQueryFeatureEnable(boolean orderQueryFeatureEnable) {
            this.orderQueryFeatureEnable = orderQueryFeatureEnable;
        }

        public boolean isStaffLoginFeatureEnable() {
            return staffLoginFeatureEnable;
        }

        public void setStarfLoginFeatureEnable(boolean starffLoginFeatureEnable) {
            this.staffLoginFeatureEnable = starffLoginFeatureEnable;
        }

        public boolean isVerifyFeatureEnable() {
            return verifyFeatureEnable;
        }

        public void setVerifyFeatureEnable(boolean verifyFeatureEnable) {
            this.verifyFeatureEnable = verifyFeatureEnable;
        }

        public boolean getCallMemberApi() {
            return callMemberApi;
        }

        public void setCallMemberApi(boolean callMemberApi) {
            this.callMemberApi = callMemberApi;
        }

        public boolean isEnableModify() {
            return isEnableModify;
        }

        public void setEnableModify(boolean enableModify) {
            isEnableModify = enableModify;
        }

        public String getShopDiyParams() {
            return shopDiyParams;
        }

        public void setShopDiyParams(String shopDiyParams) {
            this.shopDiyParams = shopDiyParams;
        }

        public String getWxProxyIp() {
            return wxProxyIp;
        }

        public void setWxProxyIp(String wxProxyIp) {
            this.wxProxyIp = wxProxyIp;
        }

        public String getWxProxyPort() {
            return wxProxyPort;
        }

        public void setWxProxyPort(String wxProxyPort) {
            this.wxProxyPort = wxProxyPort;
        }

        public String getVerifyUrl() {
            return verifyUrl;
        }

        public void setVerifyUrl(String verifyUrl) {
            this.verifyUrl = verifyUrl;
        }

        public boolean isChangeGoodsInfoAfterInputMember() {
            return isChangeGoodsInfoAfterInputMember;
        }

        public void setChangeGoodsInfoAfterInputMember(boolean changeGoodsInfoAfterInputMember) {
            isChangeGoodsInfoAfterInputMember = changeGoodsInfoAfterInputMember;
        }


        public String getLandShopAndAliLogoUrl() {
            return landShopAndAliLogoUrl;
        }

        public void setLandShopAndAliLogoUrl(String landShopAndAliLogoUrl) {
            this.landShopAndAliLogoUrl = landShopAndAliLogoUrl;
        }

        public String getLandHomeBottomLogoUrl() {
            return landHomeBottomLogoUrl;
        }

        public void setLandHomeBottomLogoUrl(String landHomeBottomLogoUrl) {
            this.landHomeBottomLogoUrl = landHomeBottomLogoUrl;
        }

        public String getLandTopLogoUrl() {
            return landTopLogoUrl;
        }

        public void setLandTopLogoUrl(String landTopLogoUrl) {
            this.landTopLogoUrl = landTopLogoUrl;
        }

        public String getTopLogoUrl() {
            return topLogoUrl;
        }

        public void setTopLogoUrl(String topLogoUrl) {
            this.topLogoUrl = topLogoUrl;
        }

        public boolean isNonstandardGoodsEnable() {
            return nonstandardGoodsEnable;
        }

        public String getShopAndAliLogoUrl() {
            return shopAndAliLogoUrl;
        }

        public void setShopAndAliLogoUrl(String shopAndAliLogoUrl) {
            this.shopAndAliLogoUrl = shopAndAliLogoUrl;
        }

        public String getHomeBottomLogoUrl() {
            return homeBottomLogoUrl;
        }

        public void setHomeBottomLogoUrl(String homeBottomLogoUrl) {
            this.homeBottomLogoUrl = homeBottomLogoUrl;
        }

        public boolean getIsEnableModify() {
            return isEnableModify;
        }

        public void setIsEnableModify(boolean isEnableModify) {
            this.isEnableModify = isEnableModify;
        }

        public String getPayWayControl() {
            return payWayControl;
        }

        public void setPayWayControl(String payWayControl) {
            this.payWayControl = payWayControl;
        }

        public boolean isOfflineModeEnableWhenNetWorkError() {
            return offlineModeEnableWhenNetWorkError;
        }

        public void setOfflineModeEnableWhenNetWorkError(boolean offlineModeEnableWhenNetWorkError) {
            this.offlineModeEnableWhenNetWorkError = offlineModeEnableWhenNetWorkError;
        }

        public boolean isBindDeviceMacAddressEnbale() {
            return bindDeviceMacAddressEnbale;
        }

        public void setBindDeviceMacAddressEnbale(boolean bindDeviceMacAddressEnbale) {
            this.bindDeviceMacAddressEnbale = bindDeviceMacAddressEnbale;
        }

        public int getUsePayServiceTag() {
            return usePayServiceTag;
        }

        public void setUsePayServiceTag(int usePayServiceTag) {
            this.usePayServiceTag = usePayServiceTag;
        }

        public String getQueryNonstandardGoodsUrl() {
            return queryNonstandardGoodsUrl;
        }

        public void setQueryNonstandardGoodsUrl(String queryNonstandardGoodsUrl) {
            this.queryNonstandardGoodsUrl = queryNonstandardGoodsUrl;
        }

        public boolean isRegisterMemberEnable() {
            return registerMemberEnable;
        }

        public void setRegisterMemberEnable(boolean registerMemberEnable) {
            this.registerMemberEnable = registerMemberEnable;
        }

        public int getRegisterTypeDialog() {
            return registerTypeDialog;
        }

        public void setRegisterTypeDialog(int registerTypeDialog) {
            this.registerTypeDialog = registerTypeDialog;
        }

        public boolean isCheckMemberIdEnable() {
            return checkMemberIdEnable;
        }

        public void setCheckMemberIdEnable(boolean checkMemberIdEnable) {
            this.checkMemberIdEnable = checkMemberIdEnable;
        }

        public int getGoodsGroupNum() {
            return goodsGroupNum;
        }

        public void setGoodsGroupNum(int goodsGroupNum) {
            this.goodsGroupNum = goodsGroupNum;
        }

        public String getRequestRegisterMemberUrl() {
            return requestRegisterMemberUrl;
        }

        public void setRequestRegisterMemberUrl(String requestRegisterMemberUrl) {
            this.requestRegisterMemberUrl = requestRegisterMemberUrl;
        }

        public boolean isBindStaffIdEnable() {
            return bindStaffIdEnable;
        }

        public void setBindStaffIdEnable(boolean bindStaffIdEnable) {
            this.bindStaffIdEnable = bindStaffIdEnable;
        }

        public String getRequestBindStaffIdUrl() {
            return requestBindStaffIdUrl;
        }

        public void setRequestBindStaffIdUrl(String requestBindStaffIdUrl) {
            this.requestBindStaffIdUrl = requestBindStaffIdUrl;
        }

        public boolean isCouponEnable() {
            return couponEnable;
        }

        public void setCouponEnable(boolean couponEnable) {
            this.couponEnable = couponEnable;
        }

        public String getVerifyCouponUrl() {
            return verifyCouponUrl;
        }

        public void setVerifyCouponUrl(String verifyCouponUrl) {
            this.verifyCouponUrl = verifyCouponUrl;
        }

        public String getWxAppid() {
            return wxAppid;
        }

        public void setWxAppid(String wxAppid) {
            this.wxAppid = wxAppid;
        }

        public String getWxMchId() {
            return wxMchId;
        }

        public void setWxMchId(String wxMchId) {
            this.wxMchId = wxMchId;
        }

        public String getWxSubAppid() {
            return wxSubAppid;
        }

        public void setWxSubAppid(String wxSubAppid) {
            this.wxSubAppid = wxSubAppid;
        }

        public String getWxSubMchId() {
            return wxSubMchId;
        }

        public void setWxSubMchId(String wxSubMchId) {
            this.wxSubMchId = wxSubMchId;
        }

        public int getComponentProviderCategory() {
            return componentProviderCategory;
        }

        public void setComponentProviderCategory(int componentProviderCategory) {
            this.componentProviderCategory = componentProviderCategory;
        }

        public int getShoppingBagDataShowType() {
            return shoppingBagDataShowType;
        }

        public void setShoppingBagDataShowType(int shoppingBagDataShowType) {
            this.shoppingBagDataShowType = shoppingBagDataShowType;
        }

        public boolean getNonstandardGoodsEnable() {
            return nonstandardGoodsEnable;
        }

        public void setNonstandardGoodsEnable(boolean nonstandardGoodsEnable) {
            this.nonstandardGoodsEnable = nonstandardGoodsEnable;
        }

        public boolean isEnableReUpload() {
            return enableReUpload;
        }

        public ShopExtInfo setEnableReUpload(boolean enableReUpload) {
            this.enableReUpload = enableReUpload;
            return this;
        }

        public boolean isEnableWeighing() {
            return enableWeighing;
        }

        public ShopExtInfo setEnableWeighing(boolean enableWeighing) {
            this.enableWeighing = enableWeighing;
            return this;
        }

        public String getPlatformUrl() {
            return platformUrl;
        }

        public ShopExtInfo setPlatformUrl(String platformUrl) {
            this.platformUrl = platformUrl;
            return this;
        }

        public boolean isUseETicket() {
            return useETicket;
        }

        public boolean isShowMemberScore() {
            return isShowMemberScore;
        }

        public void setShowMemberScore(boolean showMemberScore) {
            isShowMemberScore = showMemberScore;
        }

        public void setUseETicket(boolean useETicket) {
            this.useETicket = useETicket;
        }

        public boolean isEnablePayZero() {
            return enablePayZero;
        }

        public ShopExtInfo setEnablePayZero(boolean enablePayZero) {
            this.enablePayZero = enablePayZero;
            return this;
        }

        public boolean isForbidManualInputBarcode() {
            return forbidManualInputBarcode;
        }

        public void setForbidManualInputBarcode(boolean forbidManualInputBarcode) {
            this.forbidManualInputBarcode = forbidManualInputBarcode;
        }
    }


    public SelfCashierTerminalConfig transformToSelfCashierTermianlConfig() {

        SelfCashierTerminalConfig selfCashierTermianlConfig = new SelfCashierTerminalConfig();


        SelfCashierTerminalConfig.ShopConfig shopConfig = new SelfCashierTerminalConfig.ShopConfig();


        //shopConfig
        shopConfig.setOperatorId(shopInfo.operatorId);
        shopConfig.setPosId(shopInfo.getPosId());
        if (shopInfo.getExtData() != null) {
            shopConfig.setStoreAddress(shopInfo.getExtData().getStoreAddress());
        }
        shopConfig.setStoreId(shopInfo.getStoreId());
        shopConfig.setStoreName(shopInfo.getStoreName());
        shopConfig.setMechantName(shopInfo.getMerchantName());
        shopConfig.setOfficialAccountUrl(shopInfo.getExtData().getOfficialAccountUrl());


        //runtimeConfig
        SelfCashierTerminalConfig.ScoRuntimeConfig runtimeConfig = new SelfCashierTerminalConfig.ScoRuntimeConfig();
        runtimeConfig.setNeedInitBeforeUse(shopInfo.isNeedInitBeforeUse());
        runtimeConfig.setErpIp(shopInfo.getDataSourceIp());
        runtimeConfig.setComponentProviderCategory(shopInfo.getComponentProviderCategory());
        runtimeConfig.setDataSourceClassName(shopInfo.getDataSourceName());
        runtimeConfig.setPrintDataSourceClassName(shopInfo.getPrinterSourceName());

        if (shopInfo.getExtData() != null) {
            runtimeConfig.setActionDispatcherClassName(shopInfo.getExtData().getActionDispatcherClassName());
            runtimeConfig.setUsePayServiceTag(shopInfo.getExtData().getUsePayServiceTag());
            runtimeConfig.setPlatformUrl(shopInfo.getExtData().getPlatformUrl());
            runtimeConfig.setUseETicket(shopInfo.getExtData().isUseETicket());

        }


        //scoFunctionConfig
        SelfCashierTerminalConfig.ScoFunctionConfig functionConfig = new SelfCashierTerminalConfig.ScoFunctionConfig();
        functionConfig.setRestrictGoods(shopInfo.getRestrictGoods());
        functionConfig.setNeedBalanceOrder(shopInfo.isNeedBalanceOrder());
        functionConfig.setMemberFeatureEnable(shopInfo.isMemberFeatureEnable());
        if (shopInfo.getExtData() != null) {
            functionConfig.setScanMemberHint(shopInfo.getExtData().getScanMemberHint());
            functionConfig.setOfflineModeEnableWhenNetWorkError(shopInfo.getExtData().isOfflineModeEnableWhenNetWorkError());
            functionConfig.setBindDeviceMacAddressEnable(shopInfo.getExtData().isBindDeviceMacAddressEnbale());
            functionConfig.setCallMemberApi(shopInfo.getExtData().isCallMemberApi());
            functionConfig.setEnableModifyGoodsNum(shopInfo.getExtData().getIsEnableModify());
            functionConfig.setPayWayControl(shopInfo.getExtData().getPayWayControl());
            functionConfig.setStaffLoginFeatureEnable(shopInfo.getExtData().isStaffLoginFeatureEnable());
            functionConfig.setOrderQueryFeatureEnable(shopInfo.getExtData().isOrderQueryFeatureEnable());
            functionConfig.setCouponEnable(shopInfo.getExtData().isCouponEnable());
            functionConfig.setNonstandardGoodsEnable(shopInfo.getExtData().isNonstandardGoodsEnable());
            functionConfig.setVerifyFeatureEnable(shopInfo.getExtData().isVerifyFeatureEnable());
            functionConfig.setVerifyUrl(shopInfo.getExtData().getVerifyUrl());
            functionConfig.setVerifyCouponUrl(shopInfo.getExtData().getVerifyCouponUrl());
            functionConfig.setBindStaffIdEnable(shopInfo.getExtData().isBindStaffIdEnable());
            functionConfig.setDailyCheckEnable(shopInfo.isDailyCheckEnable());
            functionConfig.setRequestBindStaffIdUrl(shopInfo.getExtData().getRequestBindStaffIdUrl());
            functionConfig.setRegisterMemberEnable(shopInfo.getExtData().isRegisterMemberEnable());
            functionConfig.setGoodsGroupNum(shopInfo.getExtData().getGoodsGroupNum());
            functionConfig.setRequestRegisterMemberUrl(shopInfo.getExtData().getRequestRegisterMemberUrl());
            functionConfig.setEnableReUpload(shopInfo.getExtData().isEnableReUpload());
            functionConfig.setEnableWeighing(shopInfo.getExtData().isEnableWeighing());
            functionConfig.setForceMemberIdAsPhone(shopInfo.getExtData().isCheckMemberIdEnable());
            functionConfig.setCouponDetailShowEnable(shopInfo.getExtData().isCouponDetailShowEnable());
            functionConfig.setCloseSelfCashierFeatureEnable(shopInfo.getExtData().isCloseSelfCashierFeatureEnable());
            functionConfig.setEnablePayZero(shopInfo.getExtData().isEnablePayZero());
            functionConfig.setOpenCredit(shopInfo.getExtData().isOpenCredit());
            functionConfig.setSilentCredit(shopInfo.getExtData().isSilentCredit);
            functionConfig.setPayWayControl(shopInfo.getExtData().getPayWayControl());
            functionConfig.setChangeGoodsInfoAfterInputMember(shopInfo.getExtData().isChangeGoodsInfoAfterInputMember());
            functionConfig.setHomeFeatureShowCategory(shopInfo.getExtData().getHomeFeatureShowCategory());
            functionConfig.setMemberFeatureShowScene(shopInfo.getExtData().getMemberFeatureShowScene());
            functionConfig.setAuthPrefix(shopInfo.getExtData().getAuthPrefix());
            functionConfig.setAuthCode(shopInfo.getExtData().getAuthCode());
        }


        //LogoAndVideoConfig

        SelfCashierTerminalConfig.LogoAndVideoConfig logoAndVideoConfig = new SelfCashierTerminalConfig.LogoAndVideoConfig();
        logoAndVideoConfig.setImageFolderName(shopInfo.getImageFolderName());
        List<SelfCashierTerminalConfig.ScoUrlParams> scoUrlParamsList = new ArrayList<>();
        //商户logo
        String logoUrl = shopInfo.getLogoUrl();
        scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.MERCHANT_LOGO, logoUrl));
        if (shopInfo.getExtData() != null) {
            if (!TextUtils.isEmpty(shopInfo.getExtData().getHomeBottomLogoUrl())) {
                scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.SCO_HOME_ALI_BOTTOM_PIC_URL, shopInfo.getExtData().getHomeBottomLogoUrl()));
            }
            if (!TextUtils.isEmpty(shopInfo.getExtData().getTopLogoUrl())) {
                scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.SCO_HOME_ALI_TOP_PIC_URL, shopInfo.getExtData().getTopLogoUrl()));
            }
            if (!TextUtils.isEmpty(shopInfo.getExtData().getLandHomeBottomLogoUrl())) {
                scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.SCO_LAND_HOME_ALI_BOTTOM_PIC_URL, shopInfo.getExtData().getLandHomeBottomLogoUrl()));
            }
            if (!TextUtils.isEmpty(shopInfo.getExtData().getLandTopLogoUrl())) {
                scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.SCO_LAND_HOME_ALI_TOP_PIC_URL, shopInfo.getExtData().getLandTopLogoUrl()));
            }
            if (!TextUtils.isEmpty(shopInfo.getExtData().getLandShopAndAliLogoUrl())) {
                scoUrlParamsList.add(createScoUrlParams(SelfCashierTerminalConfig.ScoUrlParams.LAND_MERCHANT_LOGO, shopInfo.getExtData().getLandShopAndAliLogoUrl()));
            }

        }
        logoAndVideoConfig.setScoUrlParams(scoUrlParamsList);
        logoAndVideoConfig.setDefaultGoodsImgUrl(shopInfo.getDefaultGoodsImgUrl());
        logoAndVideoConfig.setSdkPayDiscPosterShow(shopInfo.getExtData().isSdkPayDiscPosterShow);
        //logoAndVideoConfig.setVedio();


        //设置支付宝参数
        SelfCashierTerminalConfig.AlipayConfig alipayConfig = new SelfCashierTerminalConfig.AlipayConfig();
        alipayConfig.setAppId(shopInfo.getAppId());
        alipayConfig.setMerchantId(shopInfo.getMerchantId());
        alipayConfig.setAliPartnerId(shopInfo.getPartnerId());


        SelfCashierTerminalConfig.MiYaPayPlatformConfig miYaPayPlantformConfig = new SelfCashierTerminalConfig.MiYaPayPlatformConfig();
        miYaPayPlantformConfig.setCashierCode(shopInfo.getOperatorId());
        if (!TextUtils.isEmpty(shopInfo.getMarketid())) {
            miYaPayPlantformConfig.setMarketId(shopInfo.getMarketid());
        } else {
            miYaPayPlantformConfig.setMarketId(shopInfo.getStoreId());
        }
        miYaPayPlantformConfig.setMiyaPayApiVersion(shopInfo.getMiyaPayApiVersion());
        miYaPayPlantformConfig.setMiyaPayPlatformSignKey(shopInfo.getMiyaPayPlatformSignKey());
        miYaPayPlantformConfig.setPosId(shopInfo.getPosId());
        miYaPayPlantformConfig.setSaasId(shopInfo.getSaasid());
        miYaPayPlantformConfig.setMiyaPayPlatformUrl(shopInfo.getMiyaPayPlatformUrl());
        miYaPayPlantformConfig.setPayBillShowMsg(shopInfo.getCustomerShowTitle());

        SelfCashierTerminalConfig.WeiXinConfig weiXinConfig = new SelfCashierTerminalConfig.WeiXinConfig();
        if (shopInfo.getExtData() != null) {
            weiXinConfig.setWxAppid(shopInfo.getExtData().getWxAppid());
            weiXinConfig.setWxMchId(shopInfo.getExtData().getWxMchId());
            weiXinConfig.setWxSubAppid(shopInfo.getExtData().getWxSubAppid());
            weiXinConfig.setWxSubMchId(shopInfo.getExtData().getWxSubMchId());
            weiXinConfig.setWxProxyIp(shopInfo.getExtData().getWxProxyIp());
            weiXinConfig.setWxProxyPort(shopInfo.getExtData().getWxProxyPort());
            weiXinConfig.setWxAddSubAppid(shopInfo.getExtData().wxAddSubAppid);
            weiXinConfig.setKeepNullSubMchId(shopInfo.getExtData().isKeepNullSubMchId);
        }


        SelfCashierTerminalConfig.PrintConfig printConfig = new SelfCashierTerminalConfig.PrintConfig();
        printConfig.setPrintFooterMessage(shopInfo.getPrintFooterMessage());
        printConfig.setPrintHeaderMessage(shopInfo.getStoreName());


        //-------------------------3.0.0以下版本配置信息

        //设置商家独有的参数
        if (shopInfo.getExtData() != null)
            selfCashierTermianlConfig.setShopDiyParams(shopInfo.getExtData().getShopDiyParams());

        //设置会花参数
        SelfCashierTerminalConfig.HuihuaConfig huihuaConfig = new SelfCashierTerminalConfig.HuihuaConfig();
        huihuaConfig.setHhMerchant(shopInfo.getHhMerchant());
        huihuaConfig.setOperatorId(shopInfo.getOperatorId());
        huihuaConfig.setStoreId(shopInfo.getStoreId());
        huihuaConfig.setStoreName(shopInfo.getStoreName());
        huihuaConfig.setMechantName(shopInfo.getMerchantName());

        if (shopInfo.getExtData() != null)
            huihuaConfig.setStoreAddress(shopInfo.getExtData().getStoreAddress());
        //设置本地参数
        SelfCashierTerminalConfig.ScoFunctionConfig localConfig = new SelfCashierTerminalConfig.ScoFunctionConfig();
        localConfig.setDailyCheckEnable(shopInfo.isDailyCheckEnable());


        localConfig.setMemberFeatureEnable(shopInfo.isMemberFeatureEnable());
        localConfig.setNeedBalanceOrder(shopInfo.isNeedBalanceOrder());


        if (shopInfo.getExtData() != null) {
            localConfig.setOfflineModeEnableWhenNetWorkError(shopInfo.getExtData().isOfflineModeEnableWhenNetWorkError());
            localConfig.setBindDeviceMacAddressEnable(shopInfo.getExtData().isBindDeviceMacAddressEnbale());
            localConfig.setQueryNonstandardGoodsUrl(shopInfo.getExtData().getQueryNonstandardGoodsUrl());
            localConfig.setRegisterMemberEnable(shopInfo.getExtData().isRegisterMemberEnable());
            localConfig.setRequestRegisterMemberUrl(shopInfo.getExtData().getRequestRegisterMemberUrl());
            localConfig.setBindStaffIdEnable(shopInfo.getExtData().isBindStaffIdEnable());
            localConfig.setRequestBindStaffIdUrl(shopInfo.getExtData().getRequestBindStaffIdUrl());
            localConfig.setCouponEnable(shopInfo.getExtData().isCouponEnable());
            localConfig.setCouponDetailShowEnable(shopInfo.getExtData().isCouponDetailShowEnable());
            localConfig.setVerifyFeatureEnable(shopInfo.getExtData().isVerifyFeatureEnable());
            localConfig.setVerifyUrl(shopInfo.getExtData().getVerifyUrl());
            localConfig.setVerifyCouponUrl(shopInfo.getExtData().getVerifyCouponUrl());
            localConfig.setPayWayControl(shopInfo.getExtData().getPayWayControl());
            localConfig.setNonstandardGoodsEnable(shopInfo.getExtData().getNonstandardGoodsEnable());

            localConfig.setEnableModifyGoodsNum(shopInfo.getExtData().getIsEnableModify());
            localConfig.setCallMemberApi(shopInfo.getExtData().getCallMemberApi());

            localConfig.setForceMemberIdAsPhone(shopInfo.getExtData().isCheckMemberIdEnable());
            localConfig.setGoodsGroupNum(shopInfo.getExtData().getGoodsGroupNum());
            localConfig.setStaffLoginFeatureEnable(shopInfo.getExtData().isStaffLoginFeatureEnable());
            localConfig.setOrderQueryFeatureEnable(shopInfo.getExtData().isOrderQueryFeatureEnable());
            localConfig.setEnableReUpload(shopInfo.getExtData().isEnableReUpload());
            localConfig.setChangeGoodsInfoAfterInputMember(shopInfo.getExtData().isChangeGoodsInfoAfterInputMember());
            localConfig.setEnableWeighing(shopInfo.getExtData().isEnableWeighing());

            localConfig.setCloseSelfCashierFeatureEnable(shopInfo.getExtData().isCloseSelfCashierFeatureEnable());
            localConfig.setScanMemberHint(shopInfo.getExtData().getScanMemberHint());
            localConfig.setShowMemberScore(shopInfo.getExtData().isShowMemberScore);
            // localConfig.setForbidManualInputBarcode(shopInfo.getExtData().forbidManualInputBarcode);
        }


        //商户的特定参数

        selfCashierTermianlConfig.setAlipayConfig(alipayConfig);
        selfCashierTermianlConfig.setHuihuaConfig(huihuaConfig);
        selfCashierTermianlConfig.setShopConfig(shopConfig);
        selfCashierTermianlConfig.setMiYaPayPlantformConfig(miYaPayPlantformConfig);
        selfCashierTermianlConfig.setWeiXinConfig(weiXinConfig);
        selfCashierTermianlConfig.setLogoAndVideoConfig(logoAndVideoConfig);
        selfCashierTermianlConfig.setScoFunctionConfig(functionConfig);
        selfCashierTermianlConfig.setScoRuntimeConfig(runtimeConfig);
        selfCashierTermianlConfig.setPrintConfig(printConfig);
        return selfCashierTermianlConfig;
    }


    /**
     * 生成ScoUrlParams
     *
     * @param url
     * @param Type
     * @return
     */
    private SelfCashierTerminalConfig.ScoUrlParams createScoUrlParams(int Type, String url) {
        SelfCashierTerminalConfig.ScoUrlParams logoUrlParams = new SelfCashierTerminalConfig.ScoUrlParams();
        logoUrlParams.setUrl(url);
        logoUrlParams.setUrlType(Type);
        return logoUrlParams;
    }

}
