refactor(mqtt): 调整MQTT连接复用逻辑,先订阅主题再记录日志

refactor(qywx): 移除QyTemplateDTO中未使用的operator字段
This commit is contained in:
dzq 2025-05-19 17:14:12 +08:00
parent dc260dec0e
commit 97bf45987f
2 changed files with 2 additions and 9 deletions

View File

@ -64,8 +64,9 @@ public class MqttService implements MqttCallback {
.orElse(null); .orElse(null);
if (existingConfig != null) { if (existingConfig != null) {
log.info("复用已有MQTT连接{} 账号:{}", config.getServerUrl(), config.getUsername()); existingConfig.client.subscribe(config.getTopicFilter());
clientConfigs.add(new ClientConfig(existingConfig.client, config)); clientConfigs.add(new ClientConfig(existingConfig.client, config));
log.info("复用已有MQTT连接{} 账号:{}", config.getServerUrl(), config.getUsername());
continue; continue;
} }

View File

@ -18,11 +18,6 @@ public class QyTemplateDTO {
if (entity != null) { if (entity != null) {
BeanUtil.copyProperties(entity, this); BeanUtil.copyProperties(entity, this);
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}*/
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用"; this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
this.gettokenTimeStr = DateUtil.format(entity.getGettokenTime(), "yyyy-MM-dd HH:mm:ss"); this.gettokenTimeStr = DateUtil.format(entity.getGettokenTime(), "yyyy-MM-dd HH:mm:ss");
} }
@ -55,9 +50,6 @@ public class QyTemplateDTO {
@ExcelColumn(name = "凭证有效期(秒)") @ExcelColumn(name = "凭证有效期(秒)")
private Integer expiresIn; private Integer expiresIn;
@ExcelColumn(name = "操作人")
private String operator;
@ExcelColumn(name = "状态") @ExcelColumn(name = "状态")
private String enableStatus; private String enableStatus;