package com.fastcashier.lib_common.function.account

import android.text.TextUtils
import com.fastcashier.lib_common.base.BaseBean
import com.fastcashier.lib_common.function.account.SelfCashierTerminalConfig.*
import com.google.gson.annotations.SerializedName
import java.util.*

/**
 * 类描述：基础信息类
 * 概述：非米雅渠道  自助结算终端用户信息类
 * 创建人：zpxiang
 * 创建时间：2022/6/1
 * 修改人：
 * 修改时间：
 */
class SelfCashierAccountInfo : BaseBean() {
    @SerializedName("store")
    var shopInfo: ShopInfo? = null

    @SerializedName("accessToken")
    var accessToken: AccessToken? = null

    class ShopInfo {
        var name: String? = null
        var code: String? = null
        var merchant: String? = null
        var banners: String? = null

        //店铺id
        var storeId: String? = null

        //店铺名称
        var storeName: String? = null

        //数据源类名
        var dataSourceName: String? = null

        //图片 文件夹名称
        var imageFolderName: String? = null
        var logoUrl: String? = null

        //横屏 初始页url
        @SerializedName("welcomeLogoUrl")
        var landWelcomeLogoUrl: String? = null

        //竖版屏 初始页url
        var portraitWelcomeLogoUrl: String? = null

        //没商品图片时 默认图片地址
        var defaultGoodsImgUrl: String? = null

        //  ip地址
        var dataSourceIp: String? = null

        //米雅isv pid
        var partnerId: String? = null

        //商户 pid
        @SerializedName("pid")
        var merchantId: String? = null

        //商户appip
        var appId: String? = null

        //posId
        var posId: String? = null

        //支付宝账单显示信息
        var customerShowTitle: String? = null
        var saasid: String? = null
        var marketid: String? = null

        //米雅支付平台 签名key
        var miyaPayPlatformSignKey: String? = null

        //米雅支付平台 支付版本
        var miyaPayApiVersion: String? = null

        //打印提供者类名
        @SerializedName("printDataSourceName")
        var printerSourceName: String? = null

        //會花 hhMerchant
        var hhMerchant: String? = null

        //打印小票页尾显示信息
        var printFooterMessage: String? = null

        //是否需要 初始化
        var isNeedInitBeforeUse = false

        //是否需要 释放资源
        var isNeedReleaseLogout = false

        //会员功能是否启用
        var isMemberFeatureEnable = false

        //是否需要结算订单
        var isNeedBalanceOrder = false

        //是否开启日结功能
        var isDailyCheckEnable = false

        //presenter类名
        @SerializedName("presentCategory")
        var presenterSourceName: String? = null

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

        /**
         * 商户名称
         */
        var merchantName: String? = null

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

        /**
         * 支持的支付方式 1.只有微信 2.只有支付宝 3.全渠道
         */
        var supportPayWayType = 0

        /**
         * 支付平台集群地址
         */
        var miyaPayPlatformUrl: String? = null

        /**
         * 是否限制档口商品，0：不限制，1：限制
         */
        var restrictGoods = 0
            private set

        /**
         * 收银员Id
         */
        var operatorId: String? = null

        /**
         * 组件提供者标示
         */
        var componentProviderCategory = 0

        /**
         * 购物袋信息
         */
        var shoppingBagData: String? = null

        /**
         * 扩展信息
         */
        var extData: ShopExtInfo? = null
        fun setRestrictGoods(restrictGoods: Int): ShopInfo {
            this.restrictGoods = restrictGoods
            return this
        }

        fun setMerchantName(merchantName: String?): ShopInfo {
            this.merchantName = merchantName
            return this
        }
    }

    inner class AccessToken {
        @SerializedName("access_token")
        var accessToken: String? = null

        @SerializedName("token_type")
        var tokenType: String? = null

        @SerializedName("refresh_token")
        var refreshToken: String? = null
        var scope: String? = null
    }

    /**
     * 商户账户扩展信息
     */
    class ShopExtInfo {
        /**
         * 公众号url，规则：以"|"分隔
         */
        var officialAccountUrl: String? = null
            private set

        /**
         * 扫描会员引导提示框文案
         */
        var scanMemberHint: String? = null

        /**
         * 是否支持0元支付
         */
        var isEnablePayZero = false

        /**
         * 是否开启信用防损功能
         */
        var isOpenCredit = false

        /**
         * 是否静默授权
         */
        var isSilentCredit = false
        var storeAddress: String? = null

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

        /**
         * 是否开启称重
         */
        var isEnableWeighing = false
            private set

        /**
         * 是否开启重传组件
         */
        var isEnableReUpload = false
            private set

        /**
         * 组件提供者标示 0:支付宝 1：微信
         */
        var componentProviderCategory = 0

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

        /**
         * 微信公众号
         */
        var wxAppid: String? = null

        /**
         * 微信商户号
         */
        var wxMchId: String? = null

        /**
         * 微信子商户公众账号ID(服务商模式)
         */
        var wxSubAppid: String? = null

        /**
         * 微信子商户号(服务商模式)
         */
        var wxSubMchId: String? = null

        /**
         * 微信代理IP
         */
        var wxProxyIp: String? = null

        /**
         * 微信代理端口
         */
        var wxProxyPort: String? = null

        /**
         * 是否上传sub_appid
         */
        var isWxAddSubAppid = false

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

        /**
         * 登录接口错误时，在本地有配置信息的情况下，直接用本地配置信息进入
         */
        var isOfflineModeEnableWhenNetWorkError = false

        /**
         * 开启绑定Mac 地址
         */
        var isBindDeviceMacAddressEnbale = false

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

        /**
         * 是否开启非标准商品
         */
        var isNonstandardGoodsEnable = false

        /**
         * 获取非标准商品的请求地址
         */
        var queryNonstandardGoodsUrl: String? = null

        /**
         * 是否开启会员注册
         */
        var isRegisterMemberEnable = false

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

        /**
         * 是否需要检验会员号
         */
        var isCheckMemberIdEnable = false

        /**
         * 商品列表分组显示个数，0表示不分组
         */
        var goodsGroupNum = 0

        /**
         * 注册会员请求地址
         */
        var requestRegisterMemberUrl: String? = null

        /**
         * 是否开启绑定员工卡
         */
        var isBindStaffIdEnable = false

        /**
         * 请求绑定员工卡地址
         */
        var requestBindStaffIdUrl: String? = null

        /**
         * 是否启用优惠券
         */
        var isCouponEnable = false

        /**
         * 核验优惠券的地址
         */
        var verifyCouponUrl: String? = null

        /**
         * 是否关闭开启自助收银
         */
        var isCloseSelfCashierFeatureEnable = false

        /**
         * 是否开启核验
         */
        var isVerifyFeatureEnable = false

        //是否开启优惠明细显示
        var isCouponDetailShowEnable = false

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

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

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

        //是否使用单独的页面进行结算
        var isUsePageToBalanceOrder = false

        //是否开启订单查询
        var isOrderQueryFeatureEnable = false

        //是否开启员工登陆
        var isStaffLoginFeatureEnable = false

        /**
         * 核验地址
         */
        var verifyUrl: String? = null

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

        /**
         * 商户的自定义参数
         */
        var shopDiyParams: String? = null

        /**
         * 是否通过接口验证会员
         *
         * @return
         */
        var isCallMemberApi = false

        /**
         * 使用电子小票
         */
        var isUseETicket = false

        //是否展示会员积分
        var isShowMemberScore = false

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

        /**
         * 首页 中间 商户和支付宝 logo图
         */
        var shopAndAliLogoUrl: String? = null

        /**
         * 首页 底部 logo图
         */
        var homeBottomLogoUrl: String? = null

        /**
         * 是否开启手动输入数量功能
         */
        var isEnableModify = false

        /**
         * 顶部logo图
         */
        var topLogoUrl: String? = null

        /**
         * 横版-首页 中间 商户和支付宝 logo图
         */
        var landShopAndAliLogoUrl: String? = null

        /**
         * 横版-首页 底部 logo图
         */
        var landHomeBottomLogoUrl: String? = null

        /**
         * 横版-顶部logo图
         */
        var landTopLogoUrl: String? = null

        /**
         * 禁止手动输入商品条码
         */
        var isForbidManualInputBarcode = false

        /**
         * 授权配置
         *
         *
         * 从低到高，减少商品，删除商品，退出交易，进入功能中心，进入购物车
         * 需要的话填1，不需要的话填0，高位有1的话，那么中间某功能不需要授权的话也要填0
         * 如：只需要进入功能中心授权，配置1000
         * 只需要退出交易授权：配置100
         * 需要退出交易，减少商品，删除商品，进入购物车授权，配置10111
         */
        var authConfig: String? = null

        /**
         * 授权码前缀 - 结合本地一些动态规则，更加保密
         */
        var authPrefix: String? = null

        /**
         * 服务端配置的授权码 - 如果服务端配置了  就以服务端为准
         */
        var authCode: String? = null

        /**
         * 微信（微信）支付活动海报功能展示
         *
         * @return
         */
        var isSdkPayDiscPosterShow = true
        fun setOfficialAccountUrl(officialAccountUrl: String?): ShopExtInfo {
            this.officialAccountUrl = officialAccountUrl
            return this
        }

        fun setScanMemberHint(scanMemberHint: String?): ShopExtInfo {
            this.scanMemberHint = scanMemberHint
            return this
        }

        fun setOpenCredit(openCredit: Boolean): ShopExtInfo {
            isOpenCredit = openCredit
            return this
        }

        fun setSilentCredit(silentCredit: Boolean): ShopExtInfo {
            isSilentCredit = silentCredit
            return this
        }

        fun getWxAddSubAppid(): Boolean {
            return isWxAddSubAppid
        }

        fun setStarfLoginFeatureEnable(starffLoginFeatureEnable: Boolean) {
            isStaffLoginFeatureEnable = starffLoginFeatureEnable
        }

        fun getCallMemberApi(): Boolean {
            return isCallMemberApi
        }

        fun getIsEnableModify(): Boolean {
            return isEnableModify
        }

        fun setIsEnableModify(isEnableModify: Boolean) {
            this.isEnableModify = isEnableModify
        }

        fun getNonstandardGoodsEnable(): Boolean {
            return isNonstandardGoodsEnable
        }

        fun setEnableReUpload(enableReUpload: Boolean): ShopExtInfo {
            isEnableReUpload = enableReUpload
            return this
        }

        fun setEnableWeighing(enableWeighing: Boolean): ShopExtInfo {
            isEnableWeighing = enableWeighing
            return this
        }

        fun setPlatformUrl(platformUrl: String?): ShopExtInfo {
            this.platformUrl = platformUrl
            return this
        }

        fun setEnablePayZero(enablePayZero: Boolean): ShopExtInfo {
            isEnablePayZero = enablePayZero
            return this
        }
    }

    fun transformToSelfCashierTermianlConfig(): SelfCashierTerminalConfig {
        val selfCashierTermianlConfig = SelfCashierTerminalConfig()
        val shopConfig = ShopConfig()


        //shopConfig
        shopConfig.operatorId = shopInfo!!.operatorId
        shopConfig.posId = shopInfo!!.posId
        if (shopInfo!!.extData != null) {
            shopConfig.storeAddress = shopInfo!!.extData!!.storeAddress
        }
        shopConfig.storeId = shopInfo!!.storeId
        shopConfig.storeName = shopInfo!!.storeName
        shopConfig.setMechantName(shopInfo!!.merchantName)
        shopConfig.officialAccountUrl = shopInfo!!.extData!!.officialAccountUrl


        //runtimeConfig
        val runtimeConfig = ScoRuntimeConfig()
        runtimeConfig.isNeedInitBeforeUse = shopInfo!!.isNeedInitBeforeUse
        runtimeConfig.erpIp = shopInfo!!.dataSourceIp
        runtimeConfig.componentProviderCategory = shopInfo!!.componentProviderCategory
        runtimeConfig.dataSourceClassName = shopInfo!!.dataSourceName
        runtimeConfig.printDataSourceClassName = shopInfo!!.printerSourceName
        if (shopInfo!!.extData != null) {
            runtimeConfig.actionDispatcherClassName = shopInfo!!.extData!!.actionDispatcherClassName
            runtimeConfig.usePayServiceTag = shopInfo!!.extData!!.usePayServiceTag
            runtimeConfig.platformUrl = shopInfo!!.extData!!.platformUrl
            runtimeConfig.isUseETicket = shopInfo!!.extData!!.isUseETicket
        }


        //scoFunctionConfig
        val functionConfig = ScoFunctionConfig()
        functionConfig.restrictGoods = shopInfo!!.restrictGoods
        functionConfig.isNeedBalanceOrder = shopInfo!!.isNeedBalanceOrder
        functionConfig.isMemberFeatureEnable = shopInfo!!.isMemberFeatureEnable
        if (shopInfo!!.extData != null) {
            functionConfig.scanMemberHint = shopInfo!!.extData!!.scanMemberHint
            functionConfig.isOfflineModeEnableWhenNetWorkError =
                shopInfo!!.extData!!.isOfflineModeEnableWhenNetWorkError
            functionConfig.isBindDeviceMacAddressEnable =
                shopInfo!!.extData!!.isBindDeviceMacAddressEnbale
            functionConfig.isCallMemberApi = shopInfo!!.extData!!.isCallMemberApi
            functionConfig.isEnableModifyGoodsNum = shopInfo!!.extData!!.getIsEnableModify()
            functionConfig.payWayControl = shopInfo!!.extData!!.payWayControl
            functionConfig.isStaffLoginFeatureEnable =
                shopInfo!!.extData!!.isStaffLoginFeatureEnable
            functionConfig.isOrderQueryFeatureEnable =
                shopInfo!!.extData!!.isOrderQueryFeatureEnable
            functionConfig.isCouponEnable = shopInfo!!.extData!!.isCouponEnable
            functionConfig.isNonstandardGoodsEnable = shopInfo!!.extData!!.isNonstandardGoodsEnable
            functionConfig.isVerifyFeatureEnable = shopInfo!!.extData!!.isVerifyFeatureEnable
            functionConfig.verifyUrl = shopInfo!!.extData!!.verifyUrl
            functionConfig.verifyCouponUrl = shopInfo!!.extData!!.verifyCouponUrl
            functionConfig.isBindStaffIdEnable = shopInfo!!.extData!!.isBindStaffIdEnable
            functionConfig.isDailyCheckEnable = shopInfo!!.isDailyCheckEnable
            functionConfig.requestBindStaffIdUrl = shopInfo!!.extData!!.requestBindStaffIdUrl
            functionConfig.isRegisterMemberEnable = shopInfo!!.extData!!.isRegisterMemberEnable
            functionConfig.goodsGroupNum = shopInfo!!.extData!!.goodsGroupNum
            functionConfig.requestRegisterMemberUrl = shopInfo!!.extData!!.requestRegisterMemberUrl
            functionConfig.isEnableReUpload = shopInfo!!.extData!!.isEnableReUpload
            functionConfig.isEnableWeighing = shopInfo!!.extData!!.isEnableWeighing
            functionConfig.isForceMemberIdAsPhone = shopInfo!!.extData!!.isCheckMemberIdEnable
            functionConfig.isCouponDetailShowEnable = shopInfo!!.extData!!.isCouponDetailShowEnable
            functionConfig.isCloseSelfCashierFeatureEnable =
                shopInfo!!.extData!!.isCloseSelfCashierFeatureEnable
            functionConfig.isEnablePayZero = shopInfo!!.extData!!.isEnablePayZero
//            functionConfig.setOpenCredit(shopInfo!!.extData!!.isOpenCredit)
            functionConfig.isOpenCredit = shopInfo!!.extData!!.isOpenCredit
//            functionConfig.setSilentCredit(shopInfo!!.extData!!.isSilentCredit)
            functionConfig.isSilentCredit = shopInfo!!.extData!!.isSilentCredit
            functionConfig.payWayControl = shopInfo!!.extData!!.payWayControl
            functionConfig.isChangeGoodsInfoAfterInputMember =
                shopInfo!!.extData!!.isChangeGoodsInfoAfterInputMember
            functionConfig.homeFeatureShowCategory = shopInfo!!.extData!!.homeFeatureShowCategory
            functionConfig.memberFeatureShowScene = shopInfo!!.extData!!.memberFeatureShowScene
            functionConfig.authPrefix = shopInfo!!.extData!!.authPrefix
            functionConfig.authCode = shopInfo!!.extData!!.authCode
        }


        //LogoAndVideoConfig
        val logoAndVideoConfig = LogoAndVideoConfig()
        logoAndVideoConfig.imageFolderName = shopInfo!!.imageFolderName
        val scoUrlParamsList: MutableList<ScoUrlParams> = ArrayList()
        //商户logo
        val logoUrl = shopInfo!!.logoUrl
        scoUrlParamsList.add(createScoUrlParams(ScoUrlParams.MERCHANT_LOGO, logoUrl))
        if (shopInfo!!.extData != null) {
            if (!TextUtils.isEmpty(shopInfo!!.extData!!.homeBottomLogoUrl)) {
                scoUrlParamsList.add(
                    createScoUrlParams(
                        ScoUrlParams.SCO_HOME_ALI_BOTTOM_PIC_URL,
                        shopInfo!!.extData!!.homeBottomLogoUrl
                    )
                )
            }
            if (!TextUtils.isEmpty(shopInfo!!.extData!!.topLogoUrl)) {
                scoUrlParamsList.add(
                    createScoUrlParams(
                        ScoUrlParams.SCO_HOME_ALI_TOP_PIC_URL,
                        shopInfo!!.extData!!.topLogoUrl
                    )
                )
            }
            if (!TextUtils.isEmpty(shopInfo!!.extData!!.landHomeBottomLogoUrl)) {
                scoUrlParamsList.add(
                    createScoUrlParams(
                        ScoUrlParams.SCO_LAND_HOME_ALI_BOTTOM_PIC_URL,
                        shopInfo!!.extData!!.landHomeBottomLogoUrl
                    )
                )
            }
            if (!TextUtils.isEmpty(shopInfo!!.extData!!.landTopLogoUrl)) {
                scoUrlParamsList.add(
                    createScoUrlParams(
                        ScoUrlParams.SCO_LAND_HOME_ALI_TOP_PIC_URL,
                        shopInfo!!.extData!!.landTopLogoUrl
                    )
                )
            }
            if (!TextUtils.isEmpty(shopInfo!!.extData!!.landShopAndAliLogoUrl)) {
                scoUrlParamsList.add(
                    createScoUrlParams(
                        ScoUrlParams.LAND_MERCHANT_LOGO,
                        shopInfo!!.extData!!.landShopAndAliLogoUrl
                    )
                )
            }
        }
        logoAndVideoConfig.scoUrlParams = scoUrlParamsList
        logoAndVideoConfig.defaultGoodsImgUrl = shopInfo!!.defaultGoodsImgUrl
        logoAndVideoConfig.isSdkPayDiscPosterShow = shopInfo!!.extData!!.isSdkPayDiscPosterShow
        //logoAndVideoConfig.setVedio();


        //设置支付宝参数
        val alipayConfig = AlipayConfig()
        alipayConfig.appId = shopInfo!!.appId
        alipayConfig.merchantId = shopInfo!!.merchantId
        alipayConfig.aliPartnerId = shopInfo!!.partnerId
        val miYaPayPlantformConfig = MiYaPayPlatformConfig()
        miYaPayPlantformConfig.cashierCode = shopInfo!!.operatorId
        if (!TextUtils.isEmpty(shopInfo!!.marketid)) {
            miYaPayPlantformConfig.marketId = shopInfo!!.marketid
        } else {
            miYaPayPlantformConfig.marketId = shopInfo!!.storeId
        }
        miYaPayPlantformConfig.miyaPayApiVersion = shopInfo!!.miyaPayApiVersion
        miYaPayPlantformConfig.miyaPayPlatformSignKey = shopInfo!!.miyaPayPlatformSignKey
        miYaPayPlantformConfig.posId = shopInfo!!.posId
        miYaPayPlantformConfig.saasId = shopInfo!!.saasid
        miYaPayPlantformConfig.miyaPayPlatformUrl = shopInfo!!.miyaPayPlatformUrl
        miYaPayPlantformConfig.payBillShowMsg = shopInfo!!.customerShowTitle
        val weiXinConfig = WeiXinConfig()
        if (shopInfo!!.extData != null) {
            weiXinConfig.wxAppid = shopInfo!!.extData!!.wxAppid
            weiXinConfig.wxMchId = shopInfo!!.extData!!.wxMchId
            weiXinConfig.wxSubAppid = shopInfo!!.extData!!.wxSubAppid
            weiXinConfig.wxSubMchId = shopInfo!!.extData!!.wxSubMchId
            weiXinConfig.wxProxyIp = shopInfo!!.extData!!.wxProxyIp
            weiXinConfig.wxProxyPort = shopInfo!!.extData!!.wxProxyPort
            weiXinConfig.isWxAddSubAppid = shopInfo!!.extData!!.isWxAddSubAppid
            weiXinConfig.isKeepNullSubMchId = shopInfo!!.extData!!.isKeepNullSubMchId
        }
        val printConfig = PrintConfig()
        printConfig.printFooterMessage = shopInfo!!.printFooterMessage
        printConfig.printHeaderMessage = shopInfo!!.storeName


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

        //设置商家独有的参数
        if (shopInfo!!.extData != null) selfCashierTermianlConfig.shopDiyParams =
            shopInfo!!.extData!!.shopDiyParams

        //设置会花参数
        val huihuaConfig = HuihuaConfig()
        huihuaConfig.hhMerchant = shopInfo!!.hhMerchant
        huihuaConfig.operatorId = shopInfo!!.operatorId
        huihuaConfig.storeId = shopInfo!!.storeId
        huihuaConfig.storeName = shopInfo!!.storeName
        huihuaConfig.setMechantName(shopInfo!!.merchantName)
        if (shopInfo!!.extData != null) huihuaConfig.storeAddress =
            shopInfo!!.extData!!.storeAddress
        //设置本地参数
        val localConfig = ScoFunctionConfig()
        localConfig.isDailyCheckEnable = shopInfo!!.isDailyCheckEnable
        localConfig.isMemberFeatureEnable = shopInfo!!.isMemberFeatureEnable
        localConfig.isNeedBalanceOrder = shopInfo!!.isNeedBalanceOrder
        if (shopInfo!!.extData != null) {
            localConfig.isOfflineModeEnableWhenNetWorkError =
                shopInfo!!.extData!!.isOfflineModeEnableWhenNetWorkError
            localConfig.isBindDeviceMacAddressEnable =
                shopInfo!!.extData!!.isBindDeviceMacAddressEnbale
            localConfig.queryNonstandardGoodsUrl = shopInfo!!.extData!!.queryNonstandardGoodsUrl
            localConfig.isRegisterMemberEnable = shopInfo!!.extData!!.isRegisterMemberEnable
            localConfig.requestRegisterMemberUrl = shopInfo!!.extData!!.requestRegisterMemberUrl
            localConfig.isBindStaffIdEnable = shopInfo!!.extData!!.isBindStaffIdEnable
            localConfig.requestBindStaffIdUrl = shopInfo!!.extData!!.requestBindStaffIdUrl
            localConfig.isCouponEnable = shopInfo!!.extData!!.isCouponEnable
            localConfig.isCouponDetailShowEnable = shopInfo!!.extData!!.isCouponDetailShowEnable
            localConfig.isVerifyFeatureEnable = shopInfo!!.extData!!.isVerifyFeatureEnable
            localConfig.verifyUrl = shopInfo!!.extData!!.verifyUrl
            localConfig.verifyCouponUrl = shopInfo!!.extData!!.verifyCouponUrl
            localConfig.payWayControl = shopInfo!!.extData!!.payWayControl
            localConfig.isNonstandardGoodsEnable = shopInfo!!.extData!!.getNonstandardGoodsEnable()
            localConfig.isEnableModifyGoodsNum = shopInfo!!.extData!!.getIsEnableModify()
            localConfig.isCallMemberApi = shopInfo!!.extData!!.getCallMemberApi()
            localConfig.isForceMemberIdAsPhone = shopInfo!!.extData!!.isCheckMemberIdEnable
            localConfig.goodsGroupNum = shopInfo!!.extData!!.goodsGroupNum
            localConfig.isStaffLoginFeatureEnable = shopInfo!!.extData!!.isStaffLoginFeatureEnable
            localConfig.isOrderQueryFeatureEnable = shopInfo!!.extData!!.isOrderQueryFeatureEnable
            localConfig.isEnableReUpload = shopInfo!!.extData!!.isEnableReUpload
            localConfig.isChangeGoodsInfoAfterInputMember =
                shopInfo!!.extData!!.isChangeGoodsInfoAfterInputMember
            localConfig.isEnableWeighing = shopInfo!!.extData!!.isEnableWeighing
            localConfig.isCloseSelfCashierFeatureEnable =
                shopInfo!!.extData!!.isCloseSelfCashierFeatureEnable
            localConfig.scanMemberHint = shopInfo!!.extData!!.scanMemberHint
            localConfig.isShowMemberScore = shopInfo!!.extData!!.isShowMemberScore
            // localConfig.setForbidManualInputBarcode(shopInfo.getExtData().forbidManualInputBarcode);
        }


        //商户的特定参数
        selfCashierTermianlConfig.alipayConfig = alipayConfig
        selfCashierTermianlConfig.huihuaConfig = huihuaConfig
        selfCashierTermianlConfig.shopConfig = shopConfig
        selfCashierTermianlConfig.miYaPayPlantformConfig = miYaPayPlantformConfig
        selfCashierTermianlConfig.weiXinConfig = weiXinConfig
        selfCashierTermianlConfig.logoAndVideoConfig = logoAndVideoConfig
        selfCashierTermianlConfig.scoFunctionConfig = functionConfig
        selfCashierTermianlConfig.scoRuntimeConfig = runtimeConfig
        selfCashierTermianlConfig.printConfig = printConfig
        return selfCashierTermianlConfig
    }

    /**
     * 生成ScoUrlParams
     *
     * @param url
     * @param Type
     * @return
     */
    private fun createScoUrlParams(Type: Int, url: String?): ScoUrlParams {
        val logoUrlParams = ScoUrlParams()
        logoUrlParams.url = url
        logoUrlParams.urlType = Type
        return logoUrlParams
    }
}