From 83027cad5e5913f696343f18bc1d213de70f4ef9 Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期六, 04 四月 2026 00:27:01 +0800
Subject: [PATCH] mqtt
---
src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java b/src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java
index 314d3f8..2c88fba 100644
--- a/src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java
+++ b/src/main/java/com/zy/integration/iot/biz/impl/IotInstructionServiceImpl.java
@@ -18,6 +18,7 @@
import com.zy.iot.entity.IotFeedbackMessage;
import com.zy.iot.entity.IotInstructionMessage;
import com.zy.iot.entity.IotPublishRecord;
+import com.zy.iot.service.IotDbConfigService;
import com.zy.iot.service.IotPublishRecordService;
import com.zy.iot.util.IotInstructionIdGenerator;
import lombok.extern.slf4j.Slf4j;
@@ -45,6 +46,8 @@
private IotPublishRecordService iotPublishRecordService;
@Autowired
private IotProperties iotProperties;
+ @Autowired
+ private IotDbConfigService iotDbConfigService;
@Autowired
private ExternalTaskFacadeService externalTaskFacadeService;
@Autowired
@@ -120,7 +123,8 @@
}
String remoteDestination = extractFirstDestination(message.getDestinationLocationIds());
- Integer stationId = Cools.isEmpty(remoteDestination) ? null : iotProperties.getPickStationMappings().get(remoteDestination);
+// Integer stationId = Cools.isEmpty(remoteDestination) ? null : iotProperties.getPickStationMappings().get(remoteDestination);
+ Integer stationId =311;
if (stationId == null) {
return updateAsFailure(record, IotConstants.ERROR_CODE_STATION_MAPPING, "鏈壘鍒扮洰鏍囧嚭搴撳彛鏄犲皠");
}
@@ -181,7 +185,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public void queueWorkCompletion(WrkMast wrkMast) {
- if (!iotProperties.isEnabled() || wrkMast == null || wrkMast.getWrkNo() == null) {
+ if (!iotDbConfigService.isMqttEnabled() || wrkMast == null || wrkMast.getWrkNo() == null) {
return;
}
IotPublishRecord existed = iotPublishRecordService.selectOne(new EntityWrapper<IotPublishRecord>()
@@ -276,7 +280,7 @@
feedbackMessage.setCreationTime(System.currentTimeMillis());
record.setFeedbackStatus(status);
- record.setPublishTopic(iotProperties.getTopics().getIngressFeedback());
+ record.setPublishTopic(iotDbConfigService.getEffectiveTopics().getIngressFeedback());
record.setPublishPayload(JSON.toJSONString(feedbackMessage));
record.setPublishStatus(IotConstants.PUBLISH_STATUS_PENDING);
record.setUpdateTime(now);
@@ -340,7 +344,7 @@
payload.setReferenceId(wrkMast.getUserNo());
}
payload.setCreationTime(System.currentTimeMillis());
- return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_STOW, iotProperties.getTopics().getIngressStow(), payload);
+ return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_STOW, iotDbConfigService.getEffectiveTopics().getIngressStow(), payload);
}
private IotPublishRecord buildPickOutboundRecord(WrkMast wrkMast, String containerId) {
@@ -353,7 +357,7 @@
payload.setReferenceId(wrkMast.getUserNo());
}
payload.setCreationTime(System.currentTimeMillis());
- return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_PICK, iotProperties.getTopics().getIngressPick(), payload);
+ return initOutboundRecord(wrkMast, IotConstants.MESSAGE_TYPE_PICK, iotDbConfigService.getEffectiveTopics().getIngressPick(), payload);
}
private IotPublishRecord initOutboundRecord(WrkMast wrkMast, String messageType, String publishTopic, IotInstructionMessage payload) {
--
Gitblit v1.9.1