|
|
|
@ -2,6 +2,7 @@ package com.shxy.xymanager_service.impl;
|
|
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.model.mqtt.MessageSend;
|
|
|
|
|
import com.shxy.xymanager_common.model.mqtt.ParamArray;
|
|
|
|
|
import com.shxy.xymanager_common.model.mqtt.Paras;
|
|
|
|
|
import com.shxy.xymanager_service.mqtt.MqttPublisherService;
|
|
|
|
|
import com.shxy.xymanager_service.service.MqttService;
|
|
|
|
@ -10,6 +11,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -72,6 +75,39 @@ public class MqttServiceImpl implements MqttService {
|
|
|
|
|
paras.setActionCommandParameter(preset);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "schedule":
|
|
|
|
|
Integer flag = Integer.parseInt(map.get("flag"));
|
|
|
|
|
Integer scheduleChannel = Integer.parseInt(map.get("channel"));
|
|
|
|
|
paras.setChannelNumber(scheduleChannel);
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
msg.setServiceId("PlatformQueryDataCommandLssueService");
|
|
|
|
|
msg.setCmd("getCaptureTimesTaskInformation");
|
|
|
|
|
} else {
|
|
|
|
|
msg.setServiceId("PlatformSettingParameterLssueService");
|
|
|
|
|
msg.setCmd("setCaptureTimesTaskParameter");
|
|
|
|
|
Integer group = Integer.parseInt(map.get("group"));
|
|
|
|
|
paras.setGroupNumber(group);
|
|
|
|
|
if (group == 3) {
|
|
|
|
|
List<ParamArray> paramArrayList = new ArrayList<>();
|
|
|
|
|
ParamArray paramArray1 = new ParamArray();
|
|
|
|
|
paramArray1.setHour(Integer.parseInt(map.get("hour1")));
|
|
|
|
|
paramArray1.setMinute(Integer.parseInt(map.get("min1")));
|
|
|
|
|
paramArray1.setPresetPosition(Integer.parseInt(map.get("preset1")));
|
|
|
|
|
paramArrayList.add(paramArray1);
|
|
|
|
|
ParamArray paramArray2 = new ParamArray();
|
|
|
|
|
paramArray2.setHour(Integer.parseInt(map.get("hour2")));
|
|
|
|
|
paramArray2.setMinute(Integer.parseInt(map.get("min2")));
|
|
|
|
|
paramArray2.setPresetPosition(Integer.parseInt(map.get("preset2")));
|
|
|
|
|
paramArrayList.add(paramArray2);
|
|
|
|
|
ParamArray paramArray3 = new ParamArray();
|
|
|
|
|
paramArray3.setHour(Integer.parseInt(map.get("hour3")));
|
|
|
|
|
paramArray3.setMinute(Integer.parseInt(map.get("min3")));
|
|
|
|
|
paramArray3.setPresetPosition(Integer.parseInt(map.get("preset3")));
|
|
|
|
|
paramArrayList.add(paramArray3);
|
|
|
|
|
paras.setParamArray(paramArrayList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new ApiException(act + "暂时无法处理");
|
|
|
|
|
}
|
|
|
|
|