|
@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.xy.annotation.LogOperate;
|
|
|
import com.xy.collections.list.JArrayList;
|
|
|
import com.xy.collections.list.JList;
|
|
|
import com.xy.collections.map.JHashMap;
|
|
@@ -98,6 +99,7 @@ public class MqttServiceImpl extends ServiceImpl<MqttCommandMapper, MqttCommand>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @LogOperate
|
|
|
@ApiOperation("指令发送")
|
|
|
public R<List<Tuple.Tuple3<Long, Long, Boolean>>> senCommand(List<CommandMqtt> commandMqtts) {
|
|
|
JList<CommandMqtt> commandMqttsList = new JArrayList<>(commandMqtts);
|
|
@@ -122,7 +124,13 @@ public class MqttServiceImpl extends ServiceImpl<MqttCommandMapper, MqttCommand>
|
|
|
list.addAll(data);
|
|
|
}
|
|
|
});
|
|
|
- return R.ok(list);
|
|
|
+ JList<JList<CommandMqtt>> values = jMap.getValues();
|
|
|
+ values.forEach(value -> value.forEach(commandMqtt -> {
|
|
|
+ JSONObject templet = commandMqtt.getTemplet();
|
|
|
+ templet.set("search", String.format("%s_%s", commandMqtt.getDeviceId(), templet.getJSONObject("data").getStr("type")));
|
|
|
+ commandMqtt.setTemplet(templet);
|
|
|
+ }));
|
|
|
+ return R.ok(list).setLogMsg(JSONUtil.parseArray(values).toString());
|
|
|
}
|
|
|
|
|
|
@ApiOperation("指令Ack")
|