hblastrecord.cpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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) {
  16. operatorName = newOperatorName;
  17. }
  18. QString HBlastRecord::getPhone() const { return phone; }
  19. void HBlastRecord::setPhone(const QString &newPhone) { phone = newPhone; }
  20. QString HBlastRecord::getOperatorIdentity() const { return operatorIdentity; }
  21. void HBlastRecord::setOperatorIdentity(const QString &newOperatorIdentity) {
  22. operatorIdentity = newOperatorIdentity;
  23. }
  24. QString HBlastRecord::getEquipmentSn() const { return equipmentSn; }
  25. void HBlastRecord::setEquipmentSn(const QString &newEquipmentSn) { equipmentSn = newEquipmentSn; }
  26. QString HBlastRecord::getCompanyCode() const { return companyCode; }
  27. void HBlastRecord::setCompanyCode(const QString &newCompanyCode) { companyCode = newCompanyCode; }
  28. QString HBlastRecord::getAppVersion() const { return appVersion; }
  29. void HBlastRecord::setAppVersion(const QString &newAppVersion) { appVersion = newAppVersion; }
  30. QString HBlastRecord::getLongitude() const { return longitude; }
  31. void HBlastRecord::setLongitude(const QString &newLongitude) { longitude = newLongitude; }
  32. QString HBlastRecord::getLatitude() const { return latitude; }
  33. void HBlastRecord::setLatitude(const QString &newLatitude) { latitude = newLatitude; }
  34. int HBlastRecord::getEquipmentCount() const { return equipmentCount; }
  35. void HBlastRecord::setEquipmentCount(const int newEquipmentCount) {
  36. equipmentCount = newEquipmentCount;
  37. }
  38. int HBlastRecord::getRegDetCount() const { return regDetCount; }
  39. void HBlastRecord::setRegDetCount(int newRegDetCount) { regDetCount = newRegDetCount; }
  40. int HBlastRecord::getErrorDetCount() const { return errorDetCount; }
  41. void HBlastRecord::setErrorDetCount(const int newErrorDetCount) {
  42. errorDetCount = newErrorDetCount;
  43. }
  44. QDateTime HBlastRecord::getBlastAt() const { return blastAt; }
  45. void HBlastRecord::setBlastAt(const QDateTime &newBlastAt) { blastAt = newBlastAt; }
  46. QDateTime HBlastRecord::getCreatedAt() const { return createdAt; }
  47. void HBlastRecord::setCreatedAt(const QDateTime &newCreatedAt) { createdAt = newCreatedAt; }
  48. QDateTime HBlastRecord::getUpdatedAt() const { return updatedAt; }
  49. void HBlastRecord::setUpdatedAt(const QDateTime &newUpdatedAt) { updatedAt = newUpdatedAt; }
  50. QDateTime HBlastRecord::getDeletedAt() const { return deletedAt; }
  51. void HBlastRecord::setDeletedAt(const QDateTime &newDeletedAt) { deletedAt = newDeletedAt; }
  52. void HBlastRecord::setIsOfflineBlast(bool isOfflineBlast) { isOfflineBlast = isOfflineBlast; }
  53. bool HBlastRecord::getIsOfflineBlast() const { return isOfflineBlast; }
  54. qint64 HBlastRecord::getCreateBy() const { return createBy; }
  55. void HBlastRecord::setCreateBy(qint64 newCreateBy) { createBy = newCreateBy; }
  56. qint64 HBlastRecord::getUpdateBy() const { return updateBy; }
  57. void HBlastRecord::setUpdateBy(qint64 newUpdateBy) { updateBy = newUpdateBy; }
  58. void HBlastRecord::setEquipmentRecords(const QList<HBlastEquipmentRecord *> records) {
  59. equipmentRecords = records;
  60. }
  61. QList<HBlastEquipmentRecord *> HBlastRecord::getEquipmentRecords() const {
  62. return equipmentRecords;
  63. }
  64. QJsonObject HBlastRecord::ToJson() {
  65. QJsonObject json;
  66. json["uuid"] = this->getUuid();
  67. json["project_name"] = this->getProjectName();
  68. json["project_htid"] = this->getProjectHtid();
  69. json["project_xmbh"] = this->getProjectXmbh();
  70. json["operator_name"] = this->getOperatorName();
  71. json["phone"] = this->getPhone();
  72. json["operator_identity"] = this->getOperatorIdentity();
  73. json["equipment_sn"] = this->getEquipmentSn();
  74. json["company_code"] = this->getCompanyCode();
  75. json["app_version"] = this->getAppVersion();
  76. json["blast_longitude"] = this->getLongitude();
  77. json["blast_latitude"] = this->getLatitude();
  78. json["equipment_count"] = QString::number(this->getEquipmentCount());
  79. json["reg_deto_count"] = QString::number(this->getRegDetCount());
  80. json["error_deto_count"] = QString::number(this->getErrorDetCount());
  81. json["blast_time"] = this->getBlastAt().toString(Qt::ISODateWithMs);
  82. json["created_at"] = this->getCreatedAt().toString(Qt::ISODateWithMs);
  83. json["updated_at"] = this->getUpdatedAt().toString(Qt::ISODateWithMs);
  84. json["deleted_at"] = this->getDeletedAt().toString(Qt::ISODateWithMs);
  85. json["create_by"] = this->getCreateBy();
  86. json["update_by"] = this->getUpdateBy();
  87. QJsonArray equipmentArray;
  88. for (const auto &record : this->getEquipmentRecords()) {
  89. if (record) {
  90. equipmentArray.append(record->ToJson());
  91. }
  92. }
  93. json["regs"] = equipmentArray;
  94. return json;
  95. }