|
@@ -19,6 +19,7 @@ import com.zhongshu.iot.server.core.service.iot.IotServiceImpl;
|
|
|
import com.zhongshu.iot.server.core.service.sync.DeviceSyncFullCardService;
|
|
import com.zhongshu.iot.server.core.service.sync.DeviceSyncFullCardService;
|
|
|
import com.zhongshu.iot.server.core.util.CommonUtil;
|
|
import com.zhongshu.iot.server.core.util.CommonUtil;
|
|
|
import com.zhongshu.iot.server.core.util.DateUtils;
|
|
import com.zhongshu.iot.server.core.util.DateUtils;
|
|
|
|
|
+import com.zhongshu.iot.server.core.util.JMXUtil;
|
|
|
import com.zhongshu.iot.server.core.util.bean.BeanUtils;
|
|
import com.zhongshu.iot.server.core.util.bean.BeanUtils;
|
|
|
import com.zhongshu.iot.server.core.util.mqtt.MqttTopicUtils;
|
|
import com.zhongshu.iot.server.core.util.mqtt.MqttTopicUtils;
|
|
|
import com.zhongshu.iot.server.core.util.page.PageEntityUtil;
|
|
import com.zhongshu.iot.server.core.util.page.PageEntityUtil;
|
|
@@ -158,6 +159,16 @@ public class GateWayInfoService extends SuperService {
|
|
|
if (param.getHbInterval() != null && param.getHbInterval() <= 0) {
|
|
if (param.getHbInterval() != null && param.getHbInterval() <= 0) {
|
|
|
return ResultContent.buildFail("hbInterval不符合规范");
|
|
return ResultContent.buildFail("hbInterval不符合规范");
|
|
|
}
|
|
}
|
|
|
|
|
+ ResultContent checkIdContent = JMXUtil.checkDeviceIdLength(param.getGateWayId(), "gateWayId");
|
|
|
|
|
+ if (checkIdContent.isFailed()) {
|
|
|
|
|
+ return ResultContent.buildFail(checkIdContent.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+ ResultContent checkNameContent = JMXUtil.checkDeviceIdLength(param.getGateWayName(), "gateWayName");
|
|
|
|
|
+ if (checkNameContent.isFailed()) {
|
|
|
|
|
+ return ResultContent.buildFail(checkNameContent.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
ProjectInfo projectInfo = null;
|
|
ProjectInfo projectInfo = null;
|
|
|
if (StringUtils.isNotEmpty(param.getProjectInfoCode())) {
|
|
if (StringUtils.isNotEmpty(param.getProjectInfoCode())) {
|
|
|
projectInfo = projectInfoDao.findTopByCode(param.getProjectInfoCode());
|
|
projectInfo = projectInfoDao.findTopByCode(param.getProjectInfoCode());
|
|
@@ -262,6 +273,15 @@ public class GateWayInfoService extends SuperService {
|
|
|
if (StringUtils.isEmpty(param.getProjectInfoCode())) {
|
|
if (StringUtils.isEmpty(param.getProjectInfoCode())) {
|
|
|
return ResultContent.buildFail("projectInfoCode不能为空");
|
|
return ResultContent.buildFail("projectInfoCode不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ ResultContent checkIdContent = JMXUtil.checkDeviceIdLength(param.getDeviceId(), "deviceId");
|
|
|
|
|
+ if (checkIdContent.isFailed()) {
|
|
|
|
|
+ return ResultContent.buildFail(checkIdContent.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+ ResultContent checkNameContent = JMXUtil.checkDeviceIdLength(param.getDeviceName(), "deviceName");
|
|
|
|
|
+ if (checkNameContent.isFailed()) {
|
|
|
|
|
+ return ResultContent.buildFail(checkNameContent.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ProjectInfo projectInfo = projectInfoDao.findTopByCode(param.getProjectInfoCode());
|
|
ProjectInfo projectInfo = projectInfoDao.findTopByCode(param.getProjectInfoCode());
|
|
|
if (ObjectUtils.isEmpty(projectInfo)) {
|
|
if (ObjectUtils.isEmpty(projectInfo)) {
|
|
|
return ResultContent.buildFail("projectInfoCode不存在");
|
|
return ResultContent.buildFail("projectInfoCode不存在");
|