hblastregrecord.cpp 5.1 KB

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