Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+18
-18
@@ -46,9 +46,9 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataNotificationObject.id(dbDataNotification.id);
|
||||
DEBUG_LOG() << "New NotificationId: " << dbDataNotification.id;
|
||||
DEBUG_LOG(m_logger) << "New NotificationId: " << dbDataNotification.id;
|
||||
|
||||
DEBUG_LOG() << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds().size();
|
||||
DEBUG_LOG(m_logger) << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds().size();
|
||||
|
||||
// Behandlung von Recipients
|
||||
for (size_t i = 0; i < data.recipientIds().size(); ++i)
|
||||
@@ -98,7 +98,7 @@ QString ObjectNotification::contentArgsToJson()
|
||||
|
||||
for (const std::string& arg : std::as_const(m_dataNotificationObject.contentArgs()))
|
||||
{
|
||||
DEBUG_LOG() << ".arg() ersetzt immer den kleinsten freien Platzhalter"
|
||||
DEBUG_LOG(m_logger) << ".arg() ersetzt immer den kleinsten freien Platzhalter"
|
||||
<< ", arg=" << arg;
|
||||
QJsonObject argObj;
|
||||
argObj[CONTENT_ID] = i;
|
||||
@@ -110,18 +110,18 @@ QString ObjectNotification::contentArgsToJson()
|
||||
mainObject[TRANSLATION_ARGS] = jsonArray;
|
||||
|
||||
QJsonDocument doc(mainObject);
|
||||
DEBUG_LOG() << "ObjectNotification::contentArgsToJson properties=" << QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
DEBUG_LOG(m_logger) << "ObjectNotification::contentArgsToJson properties=" << QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
return QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
}
|
||||
|
||||
std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &jsonString)
|
||||
{
|
||||
//DEBUG_LOG() << "jsonToContentArgs jsonString=" << jsonString;
|
||||
//DEBUG_LOG(m_logger) << "jsonToContentArgs jsonString=" << jsonString;
|
||||
std::vector<std::string> result;
|
||||
// 1. String parsen
|
||||
QJsonDocument doc = QJsonDocument::fromJson(jsonString.toUtf8());
|
||||
if (!doc.isObject()) {
|
||||
//WARNING_LOG() << "properties: Invalid JSON-Object";
|
||||
//WARNING_LOG(m_logger) << "properties: Invalid JSON-Object";
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &js
|
||||
|
||||
// 2. Das Array aus "translationsArgs" herausholen
|
||||
if (!hauptObjekt.contains(TRANSLATION_ARGS) || !hauptObjekt[TRANSLATION_ARGS].isArray()) {
|
||||
//WARNING_LOG() << "Missing or invalid 'translationsArgs' key (must be an array).";
|
||||
//WARNING_LOG(m_logger) << "Missing or invalid 'translationsArgs' key (must be an array).";
|
||||
return result;
|
||||
}
|
||||
QJsonArray jsonArray = hauptObjekt[TRANSLATION_ARGS].toArray();
|
||||
@@ -148,8 +148,8 @@ std::vector<std::string> ObjectNotification::jsonToContentArgs(const QString &js
|
||||
// 4. Zugriff über die ID testen
|
||||
if (sucheMap.contains(gesuchteId)) {
|
||||
QJsonObject treffer = sucheMap[gesuchteId];
|
||||
//DEBUG_LOG() << "ID" << gesuchteId << "gefunden!";
|
||||
//DEBUG_LOG() << "Inhalt:" << treffer[CONTENT_ARG].toString();
|
||||
//DEBUG_LOG(m_logger) << "ID" << gesuchteId << "gefunden!";
|
||||
//DEBUG_LOG(m_logger) << "Inhalt:" << treffer[CONTENT_ARG].toString();
|
||||
QString contentStr = treffer[CONTENT_ARG].toString();
|
||||
result.emplace_back(contentStr.toStdString());
|
||||
} else {
|
||||
@@ -177,7 +177,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
continue;
|
||||
|
||||
dbDataAddr = toDbData(recipientAddr);
|
||||
DEBUG_LOG() << "Found Operator " << data.operatorId() << " with repicpentID " << dbDataAddr.id;
|
||||
DEBUG_LOG(m_logger) << "Found Operator " << data.operatorId() << " with repicpentID " << dbDataAddr.id;
|
||||
dbDataAddr.notificationId = dbDataNotification.id;
|
||||
|
||||
break;
|
||||
@@ -206,7 +206,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Notification already processed id=" << notificationId;
|
||||
DEBUG_LOG(m_logger) << "Notification already processed id=" << notificationId;
|
||||
return Core::FunctionReplyObject(dbDataNotification.processed, {}, {}, tr_lts("dds", "Notification already processed"));
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG() << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
|
||||
const std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
const Address sender = m_dataNotificationObject.sender();
|
||||
@@ -249,7 +249,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
for (const Address &recipientAddr : std::as_const(m_dataNotificationObject.recipientIds()))
|
||||
{
|
||||
DEBUG_LOG() << "recipientAddr="
|
||||
DEBUG_LOG(m_logger) << "recipientAddr="
|
||||
<< ", id: " << recipientAddr.id() << ", addressId: " << recipientAddr.addressId() << ", isDeleted: " << recipientAddr.isDeleted();
|
||||
if (data.operatorId() > 0 && recipientAddr.addressType() == AddressType_def::Operator && recipientAddr.addressId() != data.operatorId())
|
||||
continue;
|
||||
@@ -275,7 +275,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG() << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
|
||||
std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
Address sender = m_dataNotificationObject.sender();
|
||||
@@ -284,7 +284,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
for (const Address &addr : std::as_const(recipients))
|
||||
{
|
||||
DEBUG_LOG() << "addr="
|
||||
DEBUG_LOG(m_logger) << "addr="
|
||||
<< ", id: " << addr.id() << ", addressId: " << addr.addressId() << ", isDeleted: " << addr.isDeleted();
|
||||
|
||||
if (addr.id() == dbDataAddr.id)
|
||||
@@ -302,7 +302,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
Core::FunctionReplyObject ObjectNotification::deleteObject(const DeleteMessage &data, int notificationId)
|
||||
{
|
||||
DEBUG_LOG() << "ObjectNotification::deleteObject"
|
||||
DEBUG_LOG(m_logger) << "ObjectNotification::deleteObject"
|
||||
<< ", notificationId: " << notificationId << ", addressId: " << data.addressId() << ", operatorId: " << data.operatorId()
|
||||
<< ", workstationId: " << data.workstationId();
|
||||
deleteMessage(data, notificationId);
|
||||
@@ -328,10 +328,10 @@ bool ObjectNotification::isValid() const { return m_dataNotificationObject.id()
|
||||
|
||||
void ObjectNotification::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id();
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataNotificationObject))
|
||||
WARNING_LOG() << "Error publishing NomNotification-data to dds";
|
||||
WARNING_LOG(m_logger) << "Error publishing NomNotification-data to dds";
|
||||
|
||||
} // end of onPublishData()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user