增加mqt的查询发送延迟

This commit is contained in:
zhangyue 2026-08-17 11:55:57 +08:00
parent b35c9e2038
commit 1ce2d1a724
2 changed files with 5 additions and 5 deletions

View File

@ -441,7 +441,7 @@ public class SurvDeviceDeployController extends JeecgController<SurvDeviceDeploy
List<String> fianlVariables = variables.stream()
.distinct()
.collect(Collectors.toList());
boolean b = p3Service.sendMqttDeviceQuery(deploy, fianlVariables);
p3Service.sendMqttDeviceQuery(deploy, fianlVariables);
}
break;
default:

View File

@ -22,6 +22,7 @@ import org.jeecg.modules.appmana.utils.Iotutils;
import org.jeecg.modules.mqtt.service.MqttService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
@ -32,6 +33,7 @@ import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@Service
@Slf4j
@ -733,9 +735,8 @@ public class IotCommonP3ServiceImpl {
}
return true;
}
public boolean sendMqttDeviceQuery(SurvDeviceDeploy deploy, List<String> variables) {
boolean result = true;
@Async
public void sendMqttDeviceQuery(SurvDeviceDeploy deploy, List<String> variables) {
try{
log.error("===========预发送指令========={}============", variables.size());
if (deploy != null && variables != null && !variables.isEmpty()) {
@ -760,6 +761,5 @@ public class IotCommonP3ServiceImpl {
//抛出未注入时的报错
e.printStackTrace();
}
return result;
}
}