#ifndef ROLLBACK_H
#define ROLLBACK_H

#include <QString>
#include <QMAp>
#include <QMutex>
#include <QThread>
#include <QPointer>
#include <QSemaphore>
#include "fmp_settings.h"
#include "requestmodel.h"

class QSqlDatabase;
class QSqlQuery;

class RollBack : public QThread
{
    Q_OBJECT
public:
    RollBack(QObject *parent = 0);
    ~RollBack();

    void RollWiteQuery(QSqlDatabase &_db, QSqlQuery &query);

    void run();

    static void SetRollOrder(QString orderid, QString request);

private:
    void InsertRollOrder(QSqlQuery &query);

private:
    //FMPDataBase *_db;
    //QSemaphore _spr;
    static QMap<QString, QString> s_rollorder;
    static QMutex s_rollorder_lock;
    FMPSettings _setting;
    POSType _posType;
};

#endif // ROLLBACK_H
