package cn.muchinfo.rma.global.data;



import androidx.room.ColumnInfo;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.util.ArrayList;

import cn.muchinfo.rma.view.autoWidget.utils.WordUtil;


/**
 * Created by simonzhou on 18/3/22.
 * 商品信息
 * ***** 如果要加字段，凡不是商品信息中的字段，都加在他的子类里面，要不容会启动不来咯；如果一定要加请更新room的版本。嘿嘿
 */
public class GoodsInfoDataBase {
    @PrimaryKey
    private int GoodsId; // 商品Id
    private String GoodsCode; // 商品代码
    private String GoodsName; // 商品名称
    private int MarketID; // 商品所属市场ID
    private String ListingDate; // 上市时间
    private String LastTradeDate; // 最后交易日期
    private String DelistingDate; // 商品退市时间
    private int DecimalPlace; // 价格小数位
    private String Currency; // 报价货币
    private Double AgreeUnit; // 每手乘数(合约单位)
    private String GoodsUnit; // 商品单位，直接返回单位值
    private int DeliveryFlag; // 交割标志0：不交割1：要交割
    private int DeliveryGoodsId; // 交割商品Id
    private String DeliveryGoodsCode; // 交割商品代码
    private String DeliveryGoodsName; // 交割商品名称
    private String DeliveryGoodsUnit; // 交割商品单位
    private int XDeliveryRatio; // 主辅商品比的主商品手数
    private int PDeliveryRatio1; // 主辅商品比的辅助商品手数1
    private int PDeliveryRatio2; // 主辅商品比的辅助商品手数2
    private int MinDeliveryQty; // 最小交割手数
    private int P1Type; // 1-商品价格（goodsid有值）2-固定值（value填值）
    private int P2Type; // 辅助合约2价格方式
    private double P1value; // 辅助合约价格
    private double P2value; // 辅助合约2价格
    private int PGoodsID1; // 辅助交易商品ID
    private int PGoodsID2; // 辅助商品2
    private String BeginDate; // 交割起始日期
    private String EndDate; // 交割结束日期
    private int Deliverymode; // 交割方式
    private int Performancemode; // 履约方式
    private int Optiontype; // 期权类型
    private long Pricefator; // 价格取整系数
    private long Stepvalue; // 档位间矩
    private int Cuppricegear; // 看涨向上档位
    private int Cdownpricegear; // 看涨向下档位
    private int Puppricegear; // 看跌向上档位
    private int Pdownpricegear; // 看跌向下档位
    private int Expiretype; // 行权日类型
    private int Expirecycle; // 行权周期
    private String Expiredate; // 行权日
    @Ignore
    private ArrayList<GoodsRuleData> GoodsRuleList; // 商品规则列表
    @Ignore
    private ArrayList<GoodsMarginConfigData> GoodsMarginConfigList; // 分类保证金列表
    @Ignore
    private ArrayList<PriceMoveData> GoodsPMList; // 商品包含要素列表
    @Ignore
    private AuctionOrderData auctionData;  //竞拍商品信息
    @Ignore
    private PresellListingData presellListingData;  //预售集采信息

    private int ratio = 0;//// 兑换系数
    private int deliveryPriceRule = 0;// 1申报时价格 2成交时价格
    private int delistingMode = 0;// 1退市平仓、2退市交收 3、不处理（仅期权使用）
    private int goodsStatus = 0;// 商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
    private int quoteMinUnit; // 行情最小变动单位
    private int premiumAutoMode; // 权利金自动方式1:比率2.固定
    private double premiumAutoValue; // 权利金自动值
    private int IsBuyLimited;//是否限制建仓量 0:不限制 1：限制
    @ColumnInfo(name = "chinese_initials")
    private String chineseInitials = "";//中文首字母
    private int currencyId;// 币种id
    private int Lotsize;  //资管最小交易手数
    private int goodsType;// 商品类型，
    private int showBrokerFlag;// 是否显示买卖经济盘 0不显示 1显示
    private int quoteGear;// 行情档位(1-10)
    private int innerDealMode;// 内部成交方式 1 净头寸，2开平，3平今


    //visitor goods info
    @Ignore
    private String ExchHqCode = "";  //交易所行情编码
    @Ignore
    private String GoodsHqCode = ""; //商品行情编码
    @Ignore
    private int MarketTypeID;   //市场类型
    @Ignore
    private long GoodsGroupID;  //所属商品组

    @Ignore
    private int RunStep;   //所处阶段
    @Ignore
    private double IssuePrice;  //基准价（发行价）
    @Ignore
    private int GroupMarketId;


    private int groupId;  //分组id  用于99行情筛选

    public int getGroupMarketId() {
        return GroupMarketId;
    }

    public void setGroupMarketId(int groupMarketId) {
        GroupMarketId = groupMarketId;
    }



    public int getGoodsId() {
        return GoodsId;
    }

    public void setGoodsId(int goodsId) {
        GoodsId = goodsId;
    }

    public String getGoodsCode() {
        return GoodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        GoodsCode = goodsCode;
    }

    public String getGoodsName() {
        return GoodsName;
    }

    public void setGoodsName(String goodsName) {
        GoodsName = goodsName;
    }

    public int getMarketID() {
        return MarketID;
    }

    public void setMarketID(int marketID) {
        MarketID = marketID;
    }

    public String getListingDate() {
        return ListingDate;
    }

    public void setListingDate(String listingDate) {
        ListingDate = listingDate;
    }

    public String getLastTradeDate() {
        return LastTradeDate;
    }

    public void setLastTradeDate(String lastTradeDate) {
        LastTradeDate = lastTradeDate;
    }

    public String getDelistingDate() {
        return DelistingDate;
    }

    public void setDelistingDate(String delistingDate) {
        DelistingDate = delistingDate;
    }

    public int getDecimalPlace() {
        return DecimalPlace;
    }

    public void setDecimalPlace(int decimalPlace) {
        DecimalPlace = decimalPlace;
    }

    public String getCurrency() {
        return Currency;
    }

    public void setCurrency(String currency) {
        Currency = currency;
    }

    public Double getAgreeUnit() {
        return AgreeUnit;
    }

    public void setAgreeUnit(Double agreeUnit) {
        AgreeUnit = agreeUnit;
    }

    public String getGoodsUnit() {
        return GoodsUnit;
    }

    public void setGoodsUnit(String goodsUnit) {
        GoodsUnit = goodsUnit;
    }

    public int getDeliveryFlag() {
        return DeliveryFlag;
    }

    public void setDeliveryFlag(int deliveryFlag) {
        DeliveryFlag = deliveryFlag;
    }

    public int getDeliveryGoodsId() {
        return DeliveryGoodsId;
    }

    public void setDeliveryGoodsId(int deliveryGoodsId) {
        DeliveryGoodsId = deliveryGoodsId;
    }

    public String getDeliveryGoodsCode() {
        return DeliveryGoodsCode;
    }

    public void setDeliveryGoodsCode(String deliveryGoodsCode) {
        DeliveryGoodsCode = deliveryGoodsCode;
    }

    public String getDeliveryGoodsName() {
        return DeliveryGoodsName;
    }

    public void setDeliveryGoodsName(String deliveryGoodsName) {
        DeliveryGoodsName = deliveryGoodsName;
    }

    public String getDeliveryGoodsUnit() {
        return DeliveryGoodsUnit;
    }

    public void setDeliveryGoodsUnit(String deliveryGoodsUnit) {
        DeliveryGoodsUnit = deliveryGoodsUnit;
    }

    public int getXDeliveryRatio() {
        return XDeliveryRatio;
    }

    public void setXDeliveryRatio(int XDeliveryRatio) {
        this.XDeliveryRatio = XDeliveryRatio;
    }

    public int getPDeliveryRatio1() {
        return PDeliveryRatio1;
    }

    public void setPDeliveryRatio1(int PDeliveryRatio1) {
        this.PDeliveryRatio1 = PDeliveryRatio1;
    }

    public int getPDeliveryRatio2() {
        return PDeliveryRatio2;
    }

    public void setPDeliveryRatio2(int PDeliveryRatio2) {
        this.PDeliveryRatio2 = PDeliveryRatio2;
    }

    public int getMinDeliveryQty() {
        return MinDeliveryQty;
    }

    public void setMinDeliveryQty(int minDeliveryQty) {
        MinDeliveryQty = minDeliveryQty;
    }

    public int getP1Type() {
        return P1Type;
    }

    public void setP1Type(int p1Type) {
        P1Type = p1Type;
    }

    public int getP2Type() {
        return P2Type;
    }

    public void setP2Type(int p2Type) {
        P2Type = p2Type;
    }

    public double getP1value() {
        return P1value;
    }

    public void setP1value(double p1value) {
        P1value = p1value;
    }

    public double getP2value() {
        return P2value;
    }

    public void setP2value(double p2value) {
        P2value = p2value;
    }

    public int getPGoodsID1() {
        return PGoodsID1;
    }

    public void setPGoodsID1(int PGoodsID1) {
        this.PGoodsID1 = PGoodsID1;
    }

    public int getPGoodsID2() {
        return PGoodsID2;
    }

    public void setPGoodsID2(int PGoodsID2) {
        this.PGoodsID2 = PGoodsID2;
    }

    public String getBeginDate() {
        return BeginDate;
    }

    public void setBeginDate(String beginDate) {
        BeginDate = beginDate;
    }

    public String getEndDate() {
        return EndDate;
    }

    public void setEndDate(String endDate) {
        EndDate = endDate;
    }

    public ArrayList<GoodsRuleData> getGoodsRuleList() {
        if (GoodsRuleList == null) {
            GoodsRuleList = new ArrayList<>();
        }
        return GoodsRuleList;
    }

    public void setGoodsRuleList(ArrayList<GoodsRuleData> goodsRuleList) {
        GoodsRuleList = goodsRuleList;
    }

    public ArrayList<GoodsMarginConfigData> getGoodsMarginConfigList() {
        if (GoodsMarginConfigList == null) {
            GoodsMarginConfigList = new ArrayList<>();
        }
        return GoodsMarginConfigList;
    }

    public void setGoodsMarginConfigList(ArrayList<GoodsMarginConfigData> goodsMarginConfigList) {
        GoodsMarginConfigList = goodsMarginConfigList;
    }

    public ArrayList<PriceMoveData> getGoodsPMList() {
        if (GoodsPMList == null) {
            GoodsPMList = new ArrayList<>();
        }
        return GoodsPMList;
    }

    public void setGoodsPMList(ArrayList<PriceMoveData> goodsPMList) {
        GoodsPMList = goodsPMList;
    }

    public int getDeliverymode() {
        return Deliverymode;
    }

    public void setDeliverymode(int deliverymode) {
        Deliverymode = deliverymode;
    }

    public int getPerformancemode() {
        return Performancemode;
    }

    public void setPerformancemode(int performancemode) {
        Performancemode = performancemode;
    }

    public int getOptiontype() {
        return Optiontype;
    }

    public void setOptiontype(int optiontype) {
        Optiontype = optiontype;
    }

    public long getPricefator() {
        return Pricefator;
    }

    public void setPricefator(long pricefator) {
        Pricefator = pricefator;
    }

    public long getStepvalue() {
        return Stepvalue;
    }

    public void setStepvalue(long stepvalue) {
        Stepvalue = stepvalue;
    }

    public int getCuppricegear() {
        return Cuppricegear;
    }

    public void setCuppricegear(int cuppricegear) {
        Cuppricegear = cuppricegear;
    }

    public int getCdownpricegear() {
        return Cdownpricegear;
    }

    public void setCdownpricegear(int cdownpricegear) {
        Cdownpricegear = cdownpricegear;
    }

    public int getPuppricegear() {
        return Puppricegear;
    }

    public void setPuppricegear(int puppricegear) {
        Puppricegear = puppricegear;
    }

    public int getPdownpricegear() {
        return Pdownpricegear;
    }

    public void setPdownpricegear(int pdownpricegear) {
        Pdownpricegear = pdownpricegear;
    }

    public int getExpiretype() {
        return Expiretype;
    }

    public void setExpiretype(int expiretype) {
        Expiretype = expiretype;
    }

    public int getExpirecycle() {
        return Expirecycle;
    }

    public void setExpirecycle(int expirecycle) {
        Expirecycle = expirecycle;
    }

    public String getExpiredate() {
        return Expiredate;
    }

    public void setExpiredate(String expiredate) {
        Expiredate = expiredate;
    }

    public AuctionOrderData getAuctionData() {
        return auctionData;
    }

    public void setAuctionData(AuctionOrderData auctionData) {
        this.auctionData = auctionData;
    }

    public PresellListingData getPresellListingData() {
        return presellListingData;
    }

    public void setPresellListingData(PresellListingData presellListingData) {
        this.presellListingData = presellListingData;
    }

    public int getRatio() {
        return ratio;
    }

    public void setRatio(int ratio) {
        this.ratio = ratio;
    }

    public int getDeliveryPriceRule() {
        return deliveryPriceRule;
    }

    public void setDeliveryPriceRule(int deliveryPriceRule) {
        this.deliveryPriceRule = deliveryPriceRule;
    }

    public int getDelistingMode() {
        return delistingMode;
    }

    public void setDelistingMode(int delistingMode) {
        this.delistingMode = delistingMode;
    }

    public int getGoodsStatus() {
        return goodsStatus;
    }

    public void setGoodsStatus(int goodsStatus) {
        this.goodsStatus = goodsStatus;
    }

    public int getQuoteMinUnit() {
        return quoteMinUnit;
    }

    public void setQuoteMinUnit(int quoteMinUnit) {
        this.quoteMinUnit = quoteMinUnit;
    }

    public int getPremiumAutoMode() {
        return premiumAutoMode;
    }

    public void setPremiumAutoMode(int premiumAutoMode) {
        this.premiumAutoMode = premiumAutoMode;
    }

    public double getPremiumAutoValue() {
        return premiumAutoValue;
    }

    public void setPremiumAutoValue(double premiumAutoValue) {
        this.premiumAutoValue = premiumAutoValue;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public String getExchHqCode() {
        return ExchHqCode;
    }

    public void setExchHqCode(String exchHqCode) {
        ExchHqCode = exchHqCode;
    }

    public String getGoodsHqCode() {
        return GoodsHqCode;
    }

    public void setGoodsHqCode(String goodsHqCode) {
        GoodsHqCode = goodsHqCode;
    }

    public int getMarketTypeID() {
        return MarketTypeID;
    }

    public void setMarketTypeID(int marketTypeID) {
        MarketTypeID = marketTypeID;
    }

    public long getGoodsGroupID() {
        return GoodsGroupID;
    }

    public void setGoodsGroupID(long goodsGroupID) {
        GoodsGroupID = goodsGroupID;
    }


    public int getRunStep() {
        return RunStep;
    }

    public void setRunStep(int runStep) {
        RunStep = runStep;
    }

    public double getIssuePrice() {
        return IssuePrice;
    }

    public void setIssuePrice(double issuePrice) {
        IssuePrice = issuePrice;
    }

    public int getIsBuyLimited() {
        return IsBuyLimited;
    }

    public void setIsBuyLimited(int isBuyLimited) {
        IsBuyLimited = isBuyLimited;
    }

    public String getChineseInitials() {
        if (WordUtil.isChinese(getGoodsName())) { // 是否是中文
            chineseInitials = WordUtil.getSpells(getGoodsName());
        }
        return chineseInitials;
    }

    public void setChineseInitials(String chineseInitials) {
        this.chineseInitials = chineseInitials;
    }

    public int getLotsize() {
        return Lotsize;
    }

    public void setLotsize(int lotsize) {
        Lotsize = lotsize;
    }

    public int getCurrencyId() {
        return currencyId;
    }

    public void setCurrencyId(int currencyId) {
        this.currencyId = currencyId;
    }

    public int getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }

    public int getShowBrokerFlag() {
        return showBrokerFlag;
    }

    public void setShowBrokerFlag(int showBrokerFlag) {
        this.showBrokerFlag = showBrokerFlag;
    }

    public int getQuoteGear() {
        return quoteGear;
    }

    public void setQuoteGear(int quoteGear) {
        this.quoteGear = quoteGear;
    }


    public int getInnerDealMode() {
        return innerDealMode;
    }

    public void setInnerDealMode(int innerDealMode) {
        this.innerDealMode = innerDealMode;
    }
}
