packinfoseed2server.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef PACKINFOSEED2SERVER_H
  2. #define PACKINFOSEED2SERVER_H
  3. #include <QObject>
  4. #include "httprequest.h"
  5. #include "struct_/packinfo.h"
  6. #include <QQueue>
  7. #include "packinfomanger.h"
  8. #include <pqQtlib/log/pqlog.h>
  9. // 码单的上传
  10. class PackInfoSeed2Server : public QObject
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit PackInfoSeed2Server(PackInfoManger * manger,QObject *parent = nullptr,bool autoSync = false);
  15. signals:
  16. void syncEnd();
  17. public slots:
  18. void send(QSharedPointer<PackInfo> & info);
  19. void sendList(QList<QSharedPointer<PackInfo>> & infos);
  20. private slots:
  21. void doSend();
  22. void result(int code, const QJsonObject & body);
  23. private:
  24. uint _netErrorCount;
  25. QQueue<QSharedPointer<PackInfo>> _queue;
  26. QQueue<RuKuInfo> _rukuQueue;
  27. QSharedPointer<PackInfo> _current;
  28. RuKuInfo _rukuCurrent;
  29. PackInfoManger * _manger;
  30. HttpRequest _requst;
  31. HttpRequest _rukuRequest;//获取最近一次产品入库里的product_details_id
  32. HttpRequest _rukurequest;//把产品入库
  33. bool _autoSync;
  34. uint _oneSyncError;
  35. PQ::PQLog * log;
  36. bool isRuKu;
  37. };
  38. #endif // PACKINFOSEED2SERVER_H