|
|
|
@ -49,18 +49,28 @@ public class MqttServiceImpl implements MqttService {
|
|
|
|
|
private MessageSend buildMessage(Map<String, String> map) {
|
|
|
|
|
MessageSend msg = new MessageSend();
|
|
|
|
|
Paras paras = msg.getParas();
|
|
|
|
|
Integer channel, preset, ctrl, flag, group;
|
|
|
|
|
Integer channel = null, preset = null, ctrl = null, flag = null, group = null;
|
|
|
|
|
Long time;
|
|
|
|
|
String str;
|
|
|
|
|
if (map.containsKey("channel")) {
|
|
|
|
|
channel = Integer.parseInt(map.get("channel"));
|
|
|
|
|
}
|
|
|
|
|
if (map.containsKey("preset")) {
|
|
|
|
|
preset = Integer.parseInt(map.get("preset"));
|
|
|
|
|
}
|
|
|
|
|
if (map.containsKey("flag")) {
|
|
|
|
|
flag = Integer.parseInt(map.get("flag"));
|
|
|
|
|
}
|
|
|
|
|
if (map.containsKey("ctrl")) {
|
|
|
|
|
ctrl = Integer.parseInt(map.get("ctrl"));
|
|
|
|
|
}
|
|
|
|
|
String act = map.get("act");
|
|
|
|
|
switch (act) {
|
|
|
|
|
case "capture":
|
|
|
|
|
msg.setServiceId("PlatformControlDeviceCommandLssueService");
|
|
|
|
|
msg.setCmd("manualCapturePicture");
|
|
|
|
|
paras.setPassword("");
|
|
|
|
|
channel = Integer.parseInt(map.get("channel"));
|
|
|
|
|
paras.setChannelNumber(channel);
|
|
|
|
|
preset = Integer.parseInt(map.get("preset"));
|
|
|
|
|
paras.setPresetPosition(preset);
|
|
|
|
|
break;
|
|
|
|
|
case "cameractrl":
|
|
|
|
@ -69,19 +79,14 @@ public class MqttServiceImpl implements MqttService {
|
|
|
|
|
paras.setPassword("");
|
|
|
|
|
paras.setActionCommandParameter(0);
|
|
|
|
|
paras.setActionCommandParameter2("");
|
|
|
|
|
channel = Integer.parseInt(map.get("channel"));
|
|
|
|
|
paras.setChannelNumber(channel);
|
|
|
|
|
paras.setChannelId(String.valueOf(channel));
|
|
|
|
|
ctrl = Integer.parseInt(map.get("ctrl"));
|
|
|
|
|
paras.setActionCommand(ctrl);
|
|
|
|
|
if (ctrl == 1 || ctrl == 2 || ctrl == 8 || ctrl == 9) {
|
|
|
|
|
preset = Integer.parseInt(map.get("preset"));
|
|
|
|
|
paras.setActionCommandParameter(preset);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "schedule":
|
|
|
|
|
flag = Integer.parseInt(map.get("flag"));
|
|
|
|
|
channel = Integer.parseInt(map.get("channel"));
|
|
|
|
|
paras.setChannelNumber(channel);
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
msg.setServiceId("PlatformQueryDataCommandLssueService");
|
|
|
|
@ -103,7 +108,6 @@ public class MqttServiceImpl implements MqttService {
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "time":
|
|
|
|
|
flag = Integer.parseInt(map.get("flag"));
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
msg.setServiceId("PlatformQueryDataCommandLssueService");
|
|
|
|
|
msg.setCmd("getDeviceTime");
|
|
|
|
|