|
@@ -1,14 +1,17 @@
|
|
|
package com.zswl.dataservice.service.iot;
|
|
package com.zswl.dataservice.service.iot;
|
|
|
|
|
|
|
|
|
|
+import ch.qos.logback.core.model.NamedModel;
|
|
|
import com.zswl.dataservice.dao.UserDao;
|
|
import com.zswl.dataservice.dao.UserDao;
|
|
|
import com.zswl.dataservice.dao.iot.IotMainDao;
|
|
import com.zswl.dataservice.dao.iot.IotMainDao;
|
|
|
import com.zswl.dataservice.dao.iot.IotTemplateDao;
|
|
import com.zswl.dataservice.dao.iot.IotTemplateDao;
|
|
|
import com.zswl.dataservice.dao.iot.IotTopicDao;
|
|
import com.zswl.dataservice.dao.iot.IotTopicDao;
|
|
|
|
|
+import com.zswl.dataservice.dao.mqtt.DeviceInfoDao;
|
|
|
import com.zswl.dataservice.dataConfig.ResultMessage;
|
|
import com.zswl.dataservice.dataConfig.ResultMessage;
|
|
|
import com.zswl.dataservice.domain.iot.IotMain;
|
|
import com.zswl.dataservice.domain.iot.IotMain;
|
|
|
import com.zswl.dataservice.domain.iot.IotTemplate;
|
|
import com.zswl.dataservice.domain.iot.IotTemplate;
|
|
|
import com.zswl.dataservice.domain.iot.IotTopic;
|
|
import com.zswl.dataservice.domain.iot.IotTopic;
|
|
|
import com.zswl.dataservice.domain.mqtt.DeviceInfo;
|
|
import com.zswl.dataservice.domain.mqtt.DeviceInfo;
|
|
|
|
|
+import com.zswl.dataservice.model.baseParam.NameModel;
|
|
|
import com.zswl.dataservice.model.iot.*;
|
|
import com.zswl.dataservice.model.iot.*;
|
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoModel;
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoModel;
|
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoSearchParam;
|
|
import com.zswl.dataservice.model.mqtt.DeviceInfoSearchParam;
|
|
@@ -27,9 +30,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -52,31 +58,48 @@ public class IotServiceImpl extends SuperService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
UserDao userDao;
|
|
UserDao userDao;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ DeviceInfoDao deviceInfoDao;
|
|
|
|
|
+
|
|
|
//----------------------------- 模版 start----------------------------
|
|
//----------------------------- 模版 start----------------------------
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 添加模版
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
public ResultContent addIotTemplate(IotTemplateParam param) {
|
|
public ResultContent addIotTemplate(IotTemplateParam param) {
|
|
|
IotTemplate template = null;
|
|
IotTemplate template = null;
|
|
|
initDefaultUser(param);
|
|
initDefaultUser(param);
|
|
|
|
|
+
|
|
|
|
|
+ IotTemplate temp = iotTemplateDao.findTopByNameAndIotDataType(param.getName(), IotDataType.IotTemplate);
|
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
|
template = iotTemplateDao.findTopById(param.getId());
|
|
template = iotTemplateDao.findTopById(param.getId());
|
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, param.getId()));
|
|
return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, param.getId()));
|
|
|
}
|
|
}
|
|
|
- IotTemplate temp = iotTemplateDao.findTopByName(param.getName());
|
|
|
|
|
if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(param.getId())) {
|
|
if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(param.getId())) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
template = new IotTemplate();
|
|
template = new IotTemplate();
|
|
|
- IotTemplate temp = iotTemplateDao.findTopByName(param.getName());
|
|
|
|
|
if (ObjectUtils.isNotEmpty(temp)) {
|
|
if (ObjectUtils.isNotEmpty(temp)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
}
|
|
}
|
|
|
|
|
+ template.setIotDataType(IotDataType.IotTemplate);
|
|
|
}
|
|
}
|
|
|
BeanUtils.copyProperties(param, template);
|
|
BeanUtils.copyProperties(param, template);
|
|
|
iotTemplateDao.save(template);
|
|
iotTemplateDao.save(template);
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除模版
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
public ResultContent deleteTemplate(String id) {
|
|
public ResultContent deleteTemplate(String id) {
|
|
|
IotTemplate template = iotTemplateDao.findTopById(id);
|
|
IotTemplate template = iotTemplateDao.findTopById(id);
|
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
@@ -86,6 +109,12 @@ public class IotServiceImpl extends SuperService {
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询模版详情
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
public ResultContent<IotTemplateModel> getIotTemplate(String id) {
|
|
public ResultContent<IotTemplateModel> getIotTemplate(String id) {
|
|
|
IotTemplate template = iotTemplateDao.findTopById(id);
|
|
IotTemplate template = iotTemplateDao.findTopById(id);
|
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
if (ObjectUtils.isEmpty(template)) {
|
|
@@ -94,13 +123,73 @@ public class IotServiceImpl extends SuperService {
|
|
|
return ResultContent.buildSuccess(toModel(template));
|
|
return ResultContent.buildSuccess(toModel(template));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 模版分页
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param pageable
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
public ResultContent<Page<IotTemplateModel>> pageTemplate(Pageable pageable, IotTemplateSearch param) {
|
|
public ResultContent<Page<IotTemplateModel>> pageTemplate(Pageable pageable, IotTemplateSearch param) {
|
|
|
initSearchParam(param);
|
|
initSearchParam(param);
|
|
|
|
|
+ param.setIotDataType(IotDataType.IotTemplate);
|
|
|
Page<IotTemplate> page = iotTemplateDao.page(pageable, param);
|
|
Page<IotTemplate> page = iotTemplateDao.page(pageable, param);
|
|
|
return ResultContent.buildSuccess(PageEntityUtil.toPageModel(page, this::toModel));
|
|
return ResultContent.buildSuccess(PageEntityUtil.toPageModel(page, this::toModel));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询设备的物模型列表
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param deviceId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent<List<IotTemplateModel>> getDeviceTemplateList(String deviceId) {
|
|
|
|
|
+ List<IotTemplate> list = iotTemplateDao.findByDeviceIdAndIotDataTypeOrderByCreateTimeAsc(deviceId, IotDataType.Device);
|
|
|
|
|
+ List<IotTemplateModel> models = new ArrayList<>();
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(list)) {
|
|
|
|
|
+ models = list.stream().map(this::toModel).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultContent.buildSuccess(models);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改名称
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent updateIotTemplateName(NameModel param) {
|
|
|
|
|
+ Assert.hasText(param.getName(), "name不能为空");
|
|
|
|
|
+ IotTemplate template = iotTemplateDao.findTopById(param.getId());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(template)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, param.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查名称是否重复
|
|
|
|
|
+ if (template.getIotDataType() == IotDataType.IotTemplate) {
|
|
|
|
|
+ // 模版
|
|
|
|
|
+ IotTemplate temp = iotTemplateDao.findTopByNameAndIotDataType(param.getName(), IotDataType.IotTemplate);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(template.getId())) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (template.getIotDataType() == IotDataType.Device) {
|
|
|
|
|
+ // 物模型
|
|
|
|
|
+ IotTemplate temp = iotTemplateDao.findTopByNameAndDeviceIdAndIotDataType(
|
|
|
|
|
+ param.getName(),
|
|
|
|
|
+ template.getDeviceId(),
|
|
|
|
|
+ IotDataType.Device);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(template.getId())) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ BeanUtils.copyProperties(param, template);
|
|
|
|
|
+ iotTemplateDao.save(template);
|
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//----------------------------- 模版 end------------------------------
|
|
//----------------------------- 模版 end------------------------------
|
|
|
|
|
|
|
|
|
|
+
|
|
|
//----------------------------- Topic start----------------------------
|
|
//----------------------------- Topic start----------------------------
|
|
|
public ResultContent addIotTopic(IotTopicParam param) {
|
|
public ResultContent addIotTopic(IotTopicParam param) {
|
|
|
initDefaultUser(param);
|
|
initDefaultUser(param);
|
|
@@ -166,6 +255,59 @@ public class IotServiceImpl extends SuperService {
|
|
|
|
|
|
|
|
//----------------------------- 物模型 start----------------------------
|
|
//----------------------------- 物模型 start----------------------------
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 设备绑定模版
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional
|
|
|
|
|
+ public ResultContent deviceBindIotTemplate(DeviceBindIotTemplate param) {
|
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceIdAndProjectInfoCode(param.getDeviceId(), param.getProjectInfoCode());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format(ResultMessage.DATA_NOT_EXIST, param.getDeviceId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 模版信息
|
|
|
|
|
+ IotTemplate iotTemplate = iotTemplateDao.findTopById(param.getTemplateId());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(iotTemplate)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("模版ID不存在", param.getTemplateId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断该设备是否已绑定该模版
|
|
|
|
|
+ IotTemplate temp = iotTemplateDao.findTopByDeviceIdAndIotTemplateIdAndIotDataType(param.getDeviceId(),
|
|
|
|
|
+ iotTemplate.getId(),
|
|
|
|
|
+ IotDataType.Device);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(temp)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("设备【%s】已绑定模版%s", deviceInfo.getDeviceName(), iotTemplate.getName()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ IotTemplate newIotTemplate = new IotTemplate();
|
|
|
|
|
+ BeanUtils.copyProperties(param, newIotTemplate, "id", "createTime", "updateTime");
|
|
|
|
|
+ newIotTemplate.setIotDataType(IotDataType.Device);
|
|
|
|
|
+ newIotTemplate.setIotTemplateId(param.getTemplateId());
|
|
|
|
|
+ newIotTemplate.setDeviceId(deviceInfo.getDeviceId());
|
|
|
|
|
+ newIotTemplate.setProjectCode(deviceInfo.getProjectInfoCode());
|
|
|
|
|
+ iotTemplateDao.save(newIotTemplate);
|
|
|
|
|
+
|
|
|
|
|
+ // 属性等数据
|
|
|
|
|
+ List<IotMain> saveList = new ArrayList<>();
|
|
|
|
|
+ List<IotMain> list = iotMainDao.findByIotTemplateOrderByCreateTimeAsc(iotTemplate);
|
|
|
|
|
+ if (list != null) {
|
|
|
|
|
+ list.stream().forEach(it -> {
|
|
|
|
|
+ IotMain main = new IotMain();
|
|
|
|
|
+ BeanUtils.copyProperties(it, main, "id", "createTime", "updateTime");
|
|
|
|
|
+ main.setIotTemplate(newIotTemplate);
|
|
|
|
|
+ main.setIotDataType(IotDataType.Device);
|
|
|
|
|
+ main.setDeviceId(deviceInfo.getDeviceId());
|
|
|
|
|
+ main.setProjectCode(deviceInfo.getProjectInfoCode());
|
|
|
|
|
+ main.setAddTime(System.currentTimeMillis());
|
|
|
|
|
+ initRealTopic(main);
|
|
|
|
|
+ saveList.add(main);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ iotMainDao.saveAll(saveList);
|
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 添加属性 事件
|
|
* 添加属性 事件
|
|
|
*
|
|
*
|
|
@@ -174,6 +316,12 @@ public class IotServiceImpl extends SuperService {
|
|
|
*/
|
|
*/
|
|
|
public ResultContent addIotMain(IotMainParam param) {
|
|
public ResultContent addIotMain(IotMainParam param) {
|
|
|
initDefaultUser(param);
|
|
initDefaultUser(param);
|
|
|
|
|
+ if (param.getFunctionType() == null) {
|
|
|
|
|
+ return ResultContent.buildFail("functionType 不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ Assert.hasText(param.getName(), "name不能为空");
|
|
|
|
|
+ Assert.hasText(param.getIdentifier(), "identifier不能为空");
|
|
|
|
|
+ Assert.hasText(param.getIotTopic(), "iotTopic不能为空");
|
|
|
|
|
|
|
|
String iotTemplateId = param.getIotTemplateId();
|
|
String iotTemplateId = param.getIotTemplateId();
|
|
|
IotTemplate iotTemplate = iotTemplateDao.findTopById(iotTemplateId);
|
|
IotTemplate iotTemplate = iotTemplateDao.findTopById(iotTemplateId);
|
|
@@ -183,7 +331,8 @@ public class IotServiceImpl extends SuperService {
|
|
|
|
|
|
|
|
IotMain entity = null;
|
|
IotMain entity = null;
|
|
|
// 判断名称是否重复
|
|
// 判断名称是否重复
|
|
|
- IotTopic nameTemp = iotTopicDao.findTopByTopicAndIotTemplate(param.getName(), iotTemplate);
|
|
|
|
|
|
|
+ IotMain nameTemp = iotMainDao.findTopByNameAndIotTemplate(param.getName(), iotTemplate);
|
|
|
|
|
+ IotMain topicTemp = iotMainDao.findTopByIotTopicAndIotTemplate(param.getIotTopic(), iotTemplate);
|
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
|
entity = iotMainDao.findTopById(param.getId());
|
|
entity = iotMainDao.findTopById(param.getId());
|
|
|
if (ObjectUtils.isEmpty(entity)) {
|
|
if (ObjectUtils.isEmpty(entity)) {
|
|
@@ -192,27 +341,43 @@ public class IotServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isNotEmpty(nameTemp) && !nameTemp.getId().equals(param.getId())) {
|
|
if (ObjectUtils.isNotEmpty(nameTemp) && !nameTemp.getId().equals(param.getId())) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
}
|
|
}
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(topicTemp) && !topicTemp.getId().equals(param.getId())) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("iotTopic已存在:%s", param.getIotTopic()));
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
entity = new IotMain();
|
|
entity = new IotMain();
|
|
|
if (ObjectUtils.isNotEmpty(nameTemp)) {
|
|
if (ObjectUtils.isNotEmpty(nameTemp)) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIT, param.getName()));
|
|
|
}
|
|
}
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(topicTemp)) {
|
|
|
|
|
+ return ResultContent.buildFail(String.format("iotTopic已存在:%s", param.getIotTopic()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
+ // 设备所属模型
|
|
|
entity.setIotTemplate(iotTemplate);
|
|
entity.setIotTemplate(iotTemplate);
|
|
|
|
|
+ entity.setIotDataType(iotTemplate.getIotDataType());
|
|
|
if (iotTemplate.getIotDataType() == IotDataType.Device) {
|
|
if (iotTemplate.getIotDataType() == IotDataType.Device) {
|
|
|
|
|
+ entity.setDeviceId(iotTemplate.getDeviceId());
|
|
|
|
|
+ entity.setProjectCode(iotTemplate.getProjectCode());
|
|
|
|
|
+ initRealTopic(entity);
|
|
|
|
|
+ }
|
|
|
|
|
+ iotMainDao.save(entity);
|
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void initRealTopic(IotMain iotMain) {
|
|
|
|
|
+ if (iotMain != null && iotMain.getIotDataType() == IotDataType.Device) {
|
|
|
// 把 topic有占位符的换为具体的值
|
|
// 把 topic有占位符的换为具体的值
|
|
|
- String deviceId = iotTemplate.getDeviceId();
|
|
|
|
|
- String iotTopic = entity.getIotTopic();
|
|
|
|
|
|
|
+ String deviceId = iotMain.getDeviceId();
|
|
|
|
|
+ String iotTopic = iotMain.getIotTopic();
|
|
|
String realIotTopic = "";
|
|
String realIotTopic = "";
|
|
|
if (StringUtils.isNotEmpty(iotTopic)) {
|
|
if (StringUtils.isNotEmpty(iotTopic)) {
|
|
|
- realIotTopic = iotTopic.replaceAll("$\\{deviceId\\}", deviceId);
|
|
|
|
|
|
|
+ realIotTopic = iotTopic.replaceAll(Pattern.quote("${deviceId}"), deviceId);
|
|
|
}
|
|
}
|
|
|
- entity.setRealIotTopic(realIotTopic);
|
|
|
|
|
|
|
+ iotMain.setRealIotTopic(realIotTopic);
|
|
|
}
|
|
}
|
|
|
- iotMainDao.save(entity);
|
|
|
|
|
- return ResultContent.buildSuccess();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public ResultContent deleteIotMain(String id) {
|
|
public ResultContent deleteIotMain(String id) {
|
|
@@ -234,6 +399,9 @@ public class IotServiceImpl extends SuperService {
|
|
|
|
|
|
|
|
public ResultContent<Page<IotMainModel>> pageIotMain(Pageable pageable, IotMainSearch param) {
|
|
public ResultContent<Page<IotMainModel>> pageIotMain(Pageable pageable, IotMainSearch param) {
|
|
|
initSearchParam(param);
|
|
initSearchParam(param);
|
|
|
|
|
+ if (StringUtils.isEmpty(param.getIotTemplateId())) {
|
|
|
|
|
+ return ResultContent.buildFail("iotTemplateId不能为空");
|
|
|
|
|
+ }
|
|
|
Page<IotMain> page = iotMainDao.page(pageable, param);
|
|
Page<IotMain> page = iotMainDao.page(pageable, param);
|
|
|
return ResultContent.buildSuccess(PageEntityUtil.toPageModel(page, this::toModel));
|
|
return ResultContent.buildSuccess(PageEntityUtil.toPageModel(page, this::toModel));
|
|
|
}
|
|
}
|