Revert "change getOrNull() to getByInventoryIdOrNull() to get equipment"

This reverts commit 2aa51afe9d.
This commit is contained in:
Mike Hansen
2021-07-06 16:28:02 -04:00
parent 2aa51afe9d
commit c287f7cdc6

View File

@@ -156,15 +156,19 @@ public class MqttStatsPublisher {
public void processMqttMessage(String topic, Report report) { public void processMqttMessage(String topic, Report report) {
LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID()); LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID());
int customerId = extractCustomerIdFromTopic(topic);
String apId = extractApIdFromTopic(topic); String apId = extractApIdFromTopic(topic);
Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId); long equipmentId = extractEquipmentIdFromTopic(topic);
if ((equipmentId <= 0) || (customerId <= 0)) {
LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, equipmentId);
return;
}
Equipment ce = equipmentServiceInterface.getOrNull(equipmentId);
if (ce == null) { if (ce == null) {
LOG.warn("Cannot read equipment {}", apId); LOG.warn("Cannot read equipment {}", apId);
return; return;
} }
int customerId = ce.getCustomerId();
long equipmentId = ce.getId();
long locationId = ce.getLocationId(); long locationId = ce.getLocationId();
long profileId = ce.getProfileId(); long profileId = ce.getProfileId();