#ifndef XEXCELTOMYSQ_H
#define XEXCELTOMYSQ_H

#include <QObject>
#include <QMap>
#include "db/xwholestocks.h"
#include "db/xwholestockindexs.h"
#include "db/structs.h"

class XStocksDataParser : public QObject
{
    Q_OBJECT
public:
    explicit XStocksDataParser(QObject *parent = nullptr);

    QList<_WholeStocksParam> parseWholeStocks(QList<QList<QVariant> > datas);

    QList<XWholeStockIndexs::_WholeStockIndexsParam> parseWholeStockIndexs(QList<QList<QVariant> > datas);

    QList<_HighStocksParam> parseHightStocks(QList<QList<QVariant> > datas);

    QList<_HighStockIndexsParam> parseHightStockIndexs(QList<QList<QVariant> > datas);

signals:

private:
    //返回交易日期，从头中能解析出交易日期
    QString parseWholeStockHead(QList<QVariant> head);
    QString parseWholeStockIndexHead(QList<QVariant> head);
    QString parseHighStockHead(QList<QVariant> head);
    QString parseHighStockIndexHead(QList<QVariant> head);
    void addValueToWholeStockParam(_WholeStocksParam &param ,int index,QString value);
    void addValueToWholeStockIndexParam(XWholeStockIndexs::_WholeStockIndexsParam &param ,int index,QString value);
    void addValueToHighStockParam(_HighStocksParam &param ,int index,QString value);
    void addValueToHighStockIndexParam(_HighStockIndexsParam &param ,int index,QString value);

private:
    QMap<int,QString> m_wholeStocksKeyIndexs;

};

#endif // XEXCELTOMYSQ_H
