packinfo.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef PACKINFO_H
  2. #define PACKINFO_H
  3. #include <QString>
  4. #include <QSharedPointer>
  5. #include "configinfo.h"
  6. class PackInfo;
  7. struct BoxInfo
  8. {
  9. inline QSharedPointer<PackInfo> parentPack() {
  10. return parent.toStrongRef();
  11. }
  12. inline QString caseNumber() {return case_number;}
  13. int box_weight = 0;// 是 int 皮重 单位:克
  14. int tube_number = 0;// 是 int 筒数
  15. int bucket_weight = 0;// 是 int 总筒重 单位:克
  16. int gross_weight = 0;// 是 int 毛重 单位:克
  17. int net_weight = 0;// 是 int 净重 单位:克
  18. QString sort;// 是 string 排序
  19. QString remark;// 否 string 备注
  20. private:
  21. BoxInfo(QSharedPointer<PackInfo> pack,QString code);
  22. QString case_number;// 是 string 箱号
  23. QWeakPointer<PackInfo> parent;
  24. friend class PackInfo;
  25. };
  26. class PackInfo : public QEnableSharedFromThis<PackInfo>
  27. {
  28. public:
  29. PackInfo(const ProjectInfo & info);
  30. //QString code_single 是 string 码单
  31. int quantity = 0;// 是 int 箱数
  32. int level_id = 0;// 是 int 等级ID
  33. QString level;
  34. // int tube_number;// 是 int 筒数
  35. // int gross_weight;// 是 int 毛重 单位:克
  36. // int net_weight;// 是 int 净重 单位:克
  37. int machine_no = 0;// 是 string 机台
  38. int packing_time = 0;// 是 string 打包时间
  39. int packing_type = 0;// 是 string 打包类型
  40. QString carton_type;// 是 string 纸箱
  41. int operator_id = 0;// 是 int 操作员ID
  42. // details 是 array 成品详情
  43. QString remark;// 否 string
  44. inline const QList<QSharedPointer<BoxInfo>> & boxes() const {return _boxes;}
  45. inline const ProjectInfo & info() const {return _info;}
  46. int tube_number();
  47. int gross_weight();
  48. int net_weight();
  49. QSharedPointer<BoxInfo> addBoxInfo();
  50. private:
  51. QString buildPackId();
  52. QString buildBoxId();
  53. private:
  54. QList<QSharedPointer<BoxInfo>> _boxes;
  55. ProjectInfo _info;
  56. QString code_single;
  57. int goods_id;
  58. static int lastMin;
  59. static int lastNum;
  60. };
  61. #endif // PACKINFO_H