|
|
@@ -65,7 +65,14 @@ public class DeviceBindServiceImpl extends SuperService implements DeviceBindSer
|
|
|
String oid = param.getOid();
|
|
|
String deviceId = param.getDeviceId();
|
|
|
DeviceBind deviceBind = null;
|
|
|
- DeviceBind temp = deviceBindDao.findTopByDeviceIdAndOid(deviceId, oid);
|
|
|
+
|
|
|
+ DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
+ if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
+ return ResultContent.buildFail(String.format("设备不存在:%s", deviceId));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 一个设备是否可以绑定到多个学校?!
|
|
|
+ DeviceBind temp = deviceBindDao.findTopByDeviceId(deviceId);
|
|
|
if (StringUtils.isNotEmpty(param.getId())) {
|
|
|
deviceBind = deviceBindDao.findTopById(param.getId());
|
|
|
if (ObjectUtils.isEmpty(deviceBind)) {
|
|
|
@@ -81,10 +88,6 @@ public class DeviceBindServiceImpl extends SuperService implements DeviceBindSer
|
|
|
}
|
|
|
}
|
|
|
BeanUtils.copyProperties(param, deviceBind);
|
|
|
- DeviceInfo deviceInfo = deviceInfoDao.findTopByDeviceId(deviceId);
|
|
|
- if (ObjectUtils.isEmpty(deviceInfo)) {
|
|
|
- return ResultContent.buildFail(String.format("设备不存在:%s", deviceId));
|
|
|
- }
|
|
|
|
|
|
deviceBind.setDeviceId(deviceId);
|
|
|
deviceBind.setDeviceName(deviceInfo.getDeviceName());
|