hblastrecord.cpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #include "hblastrecord.h"
  2. #include <QJsonArray>
  3. HBlastRecord::HBlastRecord(QObject *parent) : QObject(parent) {}
  4. qint64 HBlastRecord::getId() const { return id; }
  5. void HBlastRecord::setId(qint64 newId) { id = newId; }
  6. QString HBlastRecord::getUuid() const { return uuid; }
  7. void HBlastRecord::setUuid(const QString &newUuid) { uuid = newUuid; }
  8. QString HBlastRecord::getProjectName() const { return projectName; }
  9. void HBlastRecord::setProjectName(const QString &newProjectName) { projectName = newProjectName; }
  10. QString HBlastRecord::getProjectHtid() const { return projectHtid; }
  11. void HBlastRecord::setProjectHtid(const QString &newProjectHtid) { projectHtid = newProjectHtid; }
  12. QString HBlastRecord::getProjectXmbh() const { return projectXmbh; }
  13. void HBlastRecord::setProjectXmbh(const QString &newProjectXmbh) { projectXmbh = newProjectXmbh; }
  14. QString HBlastRecord::getOperatorName() const { return operatorName; }
  15. void HBlastRecord::setOperatorName(const QString &newOperatorName) { operatorName = newOperatorName; }
  16. QString HBlastRecord::getPhone() const { return phone; }
  17. void HBlastRecord::setPhone(const QString &newPhone) { phone = newPhone; }
  18. QString HBlastRecord::getOperatorIdentity() const { return operatorIdentity; }
  19. void HBlastRecord::setOperatorIdentity(const QString &newOperatorIdentity) { operatorIdentity = newOperatorIdentity; }
  20. QString HBlastRecord::getEquipmentSn() const { return equipmentSn; }
  21. void HBlastRecord::setEquipmentSn(const QString &newEquipmentSn) { equipmentSn = newEquipmentSn; }
  22. QString HBlastRecord::getCompanyCode() const { return companyCode; }
  23. void HBlastRecord::setCompanyCode(const QString &newCompanyCode) { companyCode = newCompanyCode; }
  24. QString HBlastRecord::getAppVersion() const { return appVersion; }
  25. void HBlastRecord::setAppVersion(const QString &newAppVersion) { appVersion = newAppVersion; }
  26. QString HBlastRecord::getLongitude() const { return longitude; }
  27. void HBlastRecord::setLongitude(const QString &newLongitude) { longitude = newLongitude; }
  28. QString HBlastRecord::getLatitude() const { return latitude; }
  29. void HBlastRecord::setLatitude(const QString &newLatitude) { latitude = newLatitude; }
  30. int HBlastRecord::getEquipmentCount() const { return equipmentCount; }
  31. void HBlastRecord::setEquipmentCount(const int newEquipmentCount) { equipmentCount = newEquipmentCount; }
  32. int HBlastRecord::getRegDetCount() const { return regDetCount; }
  33. void HBlastRecord::setRegDetCount(int newRegDetCount) { regDetCount = newRegDetCount; }
  34. int HBlastRecord::getErrorDetCount() const { return errorDetCount; }
  35. void HBlastRecord::setErrorDetCount(const int newErrorDetCount) { errorDetCount = newErrorDetCount; }
  36. QDateTime HBlastRecord::getBlastAt() const { return blastAt; }
  37. void HBlastRecord::setBlastAt(const QDateTime &newBlastAt) { blastAt = newBlastAt; }
  38. QDateTime HBlastRecord::getCreatedAt() const { return createdAt; }
  39. void HBlastRecord::setCreatedAt(const QDateTime &newCreatedAt) { createdAt = newCreatedAt; }
  40. QDateTime HBlastRecord::getUpdatedAt() const { return updatedAt; }
  41. void HBlastRecord::setUpdatedAt(const QDateTime &newUpdatedAt) { updatedAt = newUpdatedAt; }
  42. QDateTime HBlastRecord::getDeletedAt() const { return deletedAt; }
  43. void HBlastRecord::setDeletedAt(const QDateTime &newDeletedAt) { deletedAt = newDeletedAt; }
  44. void HBlastRecord::setIsOfflineBlast(bool isOfflineBlast) { isOfflineBlast = isOfflineBlast; }
  45. bool HBlastRecord::getIsOfflineBlast() const { return isOfflineBlast; }
  46. qint64 HBlastRecord::getCreateBy() const { return createBy; }
  47. void HBlastRecord::setCreateBy(qint64 newCreateBy) { createBy = newCreateBy; }
  48. qint64 HBlastRecord::getUpdateBy() const { return updateBy; }
  49. void HBlastRecord::setUpdateBy(qint64 newUpdateBy) { updateBy = newUpdateBy; }
  50. void HBlastRecord::setEquipmentRecords(const QList<HBlastEquipmentRecord *> records) { equipmentRecords = records; }
  51. QList<HBlastEquipmentRecord *> HBlastRecord::getEquipmentRecords() const { return equipmentRecords; }
  52. QJsonObject HBlastRecord::ToJson() {
  53. QJsonObject json;
  54. json["uuid"] = this->getUuid();
  55. json["project_name"] = this->getProjectName();
  56. json["project_htid"] = this->getProjectHtid();
  57. json["project_xmbh"] = this->getProjectXmbh();
  58. json["operator_name"] = this->getOperatorName();
  59. json["phone"] = this->getPhone();
  60. json["operator_identity"] = this->getOperatorIdentity();
  61. json["equipment_sn"] = this->getEquipmentSn();
  62. json["company_code"] = this->getCompanyCode();
  63. json["app_version"] = this->getAppVersion();
  64. json["blast_longitude"] = this->getLongitude();
  65. json["blast_latitude"] = this->getLatitude();
  66. json["equipment_count"] = QString::number(this->getEquipmentCount());
  67. json["reg_deto_count"] = QString::number(this->getRegDetCount());
  68. json["error_deto_count"] = QString::number(this->getErrorDetCount());
  69. json["blast_time"] = this->getBlastAt().toString(Qt::ISODateWithMs);
  70. json["created_at"] = this->getCreatedAt().toString(Qt::ISODateWithMs);
  71. json["updated_at"] = this->getUpdatedAt().toString(Qt::ISODateWithMs);
  72. json["deleted_at"] = this->getDeletedAt().toString(Qt::ISODateWithMs);
  73. json["create_by"] = this->getCreateBy();
  74. json["update_by"] = this->getUpdateBy();
  75. QJsonArray equipmentArray;
  76. for (const auto &record : this->getEquipmentRecords()) {
  77. if (record) {
  78. equipmentArray.append(record->ToJson());
  79. }
  80. }
  81. json["regs"] = equipmentArray;
  82. return json;
  83. }