hblastregrecord.cpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #include "hblastregrecord.h"
  2. #include <QJsonArray>
  3. HBlastEquipmentRecord::HBlastEquipmentRecord(QObject *parent) : QObject(parent) {}
  4. qint64 HBlastEquipmentRecord::getId() const { return id; }
  5. void HBlastEquipmentRecord::setId(qint64 newId) { id = newId; }
  6. QString HBlastEquipmentRecord::getUuid() const { return uuid; }
  7. void HBlastEquipmentRecord::setUuid(const QString &newUuid) { uuid = newUuid; }
  8. QString HBlastEquipmentRecord::getEquipSn() const { return equipSn; }
  9. void HBlastEquipmentRecord::setEquipSn(const QString &newEquipSn) { equipSn = newEquipSn; }
  10. QString HBlastEquipmentRecord::getEquipVersion() const { return equipVersion; }
  11. void HBlastEquipmentRecord::setEquipVersion(const QString &newEquipVersion) {
  12. equipVersion = newEquipVersion;
  13. }
  14. int HBlastEquipmentRecord::getRegDetoCount() const { return regDetoCount; }
  15. void HBlastEquipmentRecord::setRegDetoCount(int newRegDetoCount) { regDetoCount = newRegDetoCount; }
  16. int HBlastEquipmentRecord::getErrorDetoCount() const { return errorDetoCount; }
  17. void HBlastEquipmentRecord::setErrorDetoCount(int newErrorDetoCount) {
  18. errorDetoCount = newErrorDetoCount;
  19. }
  20. QString HBlastEquipmentRecord::getAfterTestBusV() const { return afterTestBusV; }
  21. void HBlastEquipmentRecord::setAfterTestBusV(const QString &newAfterTestBusV) {
  22. afterTestBusV = newAfterTestBusV;
  23. }
  24. QString HBlastEquipmentRecord::getAfterTestBusI() const { return afterTestBusI; }
  25. void HBlastEquipmentRecord::setAfterTestBusI(const QString &newAfterTestBusI) {
  26. afterTestBusI = newAfterTestBusI;
  27. }
  28. QString HBlastEquipmentRecord::getBusLeakageCurrentI() const { return busLeakageCurrentI; }
  29. void HBlastEquipmentRecord::setBusLeakageCurrentI(const QString &newBusLeakageCurrentI) {
  30. busLeakageCurrentI = newBusLeakageCurrentI;
  31. }
  32. QString HBlastEquipmentRecord::getNetChargedV() const { return netChargedV; }
  33. void HBlastEquipmentRecord::setNetChargedV(const QString &newNetChargedV) {
  34. netChargedV = newNetChargedV;
  35. }
  36. QString HBlastEquipmentRecord::getNetChargedI() const { return netChargedI; }
  37. void HBlastEquipmentRecord::setNetChargedI(const QString &newNetChargedI) {
  38. netChargedI = newNetChargedI;
  39. }
  40. QString HBlastEquipmentRecord::getBeforeBlastingV() const { return beforeBlastingV; }
  41. void HBlastEquipmentRecord::setBeforeBlastingV(const QString &newBeforeBlastingV) {
  42. beforeBlastingV = newBeforeBlastingV;
  43. }
  44. QString HBlastEquipmentRecord::getBeforeBlastingI() const { return beforeBlastingI; }
  45. void HBlastEquipmentRecord::setBeforeBlastingI(const QString &newBeforeBlastingI) {
  46. beforeBlastingI = newBeforeBlastingI;
  47. }
  48. QString HBlastEquipmentRecord::getRecordUUID() const { return recordUuid; }
  49. void HBlastEquipmentRecord::setRecordUuid(const QString &newRecordUuid) {
  50. recordUuid = newRecordUuid;
  51. }
  52. QDateTime HBlastEquipmentRecord::getCreatedAt() const { return createdAt; }
  53. void HBlastEquipmentRecord::setCreatedAt(const QDateTime &newCreatedAt) {
  54. createdAt = newCreatedAt;
  55. }
  56. QDateTime HBlastEquipmentRecord::getUpdatedAt() const { return updatedAt; }
  57. void HBlastEquipmentRecord::setUpdatedAt(const QDateTime &newUpdatedAt) {
  58. updatedAt = newUpdatedAt;
  59. }
  60. QDateTime HBlastEquipmentRecord::getDeletedAt() const { return deletedAt; }
  61. void HBlastEquipmentRecord::setDeletedAt(const QDateTime &newDeletedAt) {
  62. deletedAt = newDeletedAt;
  63. }
  64. qint64 HBlastEquipmentRecord::getCreateBy() const { return createBy; }
  65. void HBlastEquipmentRecord::setCreateBy(qint64 newCreateBy) { createBy = newCreateBy; }
  66. qint64 HBlastEquipmentRecord::getUpdateBy() const { return updateBy; }
  67. void HBlastEquipmentRecord::setUpdateBy(qint64 newUpdateBy) { updateBy = newUpdateBy; }
  68. void HBlastEquipmentRecord::setDetRecords(QList<HBlastRecordDet *> data) { detRecords = data; }
  69. QList<HBlastRecordDet *> HBlastEquipmentRecord::getDetRecords() const { return detRecords; }
  70. QJsonObject HBlastEquipmentRecord::ToJson() {
  71. QJsonObject json;
  72. // json["id"] = this->getId();
  73. json["uuid"] = this->getUuid();
  74. json["equipment_sn"] = this->getEquipSn();
  75. json["equipment_version"] = this->getEquipVersion();
  76. json["reg_deto_count"] = QString::number(this->getRegDetoCount());
  77. json["error_deto_count"] = QString::number(this->getErrorDetoCount());
  78. json["after_test_bus_v"] = this->getAfterTestBusV();
  79. json["after_test_bus_i"] = this->getAfterTestBusI();
  80. json["bus_leakage_current_i"] = this->getBusLeakageCurrentI();
  81. json["net_charged_v"] = this->getNetChargedV();
  82. json["net_charged_i"] = this->getNetChargedI();
  83. json["before_blasting_v"] = this->getBeforeBlastingV();
  84. json["before_blasting_i"] = this->getBeforeBlastingI();
  85. json["record_uuid"] = this->getRecordUUID();
  86. json["created_at"] = this->getCreatedAt().toString(Qt::ISODateWithMs);
  87. json["updated_at"] = this->getUpdatedAt().toString(Qt::ISODateWithMs);
  88. json["deleted_at"] = this->getDeletedAt().toString(Qt::ISODateWithMs);
  89. json["create_by"] = this->getCreateBy();
  90. json["update_by"] = this->getUpdateBy();
  91. QJsonArray detArray;
  92. for (const auto &det : this->getDetRecords()) {
  93. if (det) {
  94. detArray.append(det->ToJson());
  95. }
  96. }
  97. json["dets"] = detArray;
  98. return json;
  99. }