#ifndef PACKINFOMANGER_H #define PACKINFOMANGER_H #include #include #include #include #include "struct_/packinfo.h" #include "struct_/modelinfo.h" // 管理本地码单(箱单) 的类 // 管理本地批号的类 struct PackSaveInfo { QSharedPointer packInfo; QString absPath; inline bool isSync() const{ return !absPath.contains("_sync"); } }; struct BoxModelSaveInfo { QSharedPointer boxModel; }; class PackInfoManger : public QObject { Q_OBJECT public: explicit PackInfoManger(QObject *parent = nullptr); QList getPackInfo(const QDate & tm,bool noSync = false); QList getPackInfoSync(const QDate & tm); QDate lastSyncDate(); QList> getLocalProjectInfo(); signals: public slots: QString savePackInfo(const QSharedPointer & info); QString setPackInfoSync(const QString & code, qint64 time = -1,bool autoSync = false); bool syncLocalProjectInfo(QList> & projects); QList> getBoxModel(); QList> getPackModel(); private: QDir getDir(const QDate & tm,bool create = false); private: QDir _dataDir; }; #endif // PACKINFOMANGER_H