|
|
@@ -191,7 +191,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
deviceInfo.setDeviceName(req.getDeviceName());
|
|
|
deviceInfo.setDeviceType(BaseDeviceTypeEnum.Dvs.getCode());
|
|
|
deviceInfo.setDeviceProduct(req.getDeviceProduct());
|
|
|
- if (ObjectUtil.isEmpty(deviceInfo.getDeviceCode())){
|
|
|
+ if (ObjectUtil.isEmpty(deviceInfo.getDeviceCode())) {
|
|
|
deviceInfo.setDeviceCode(generalDeviceCode(BaseDeviceTypeEnum.Dvs, null));
|
|
|
}
|
|
|
deviceInfo.setDeviceModel(req.getModels());
|
|
|
@@ -218,14 +218,16 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
}
|
|
|
|
|
|
private void addAlarmHostDevice(EditAlarmHostDeviceDto req, SysOrg sysOrg) {
|
|
|
+ //主机信息
|
|
|
final IotDeviceInfo deviceInfo = new IotDeviceInfo();
|
|
|
+ deviceInfo.setId(IdWorker.getId());
|
|
|
deviceInfo.setDeviceName(req.getDeviceName());
|
|
|
deviceInfo.setDeviceType(BaseDeviceTypeEnum.AlarmHost.getCode());
|
|
|
deviceInfo.setDeviceProduct(req.getDeviceProduct());
|
|
|
- if (ObjectUtil.isEmpty(deviceInfo.getDeviceCode())){
|
|
|
+ if (ObjectUtil.isEmpty(deviceInfo.getDeviceCode())) {
|
|
|
final JSONObject object = new JSONObject();
|
|
|
- object.put("deviceProduct", req.getDeviceProduct()+"_");
|
|
|
- deviceInfo.setDeviceCode(generalDeviceCode(BaseDeviceTypeEnum.AlarmHost,object));
|
|
|
+ object.put("deviceProduct", req.getDeviceProduct());
|
|
|
+ deviceInfo.setDeviceCode(generalDeviceCode(BaseDeviceTypeEnum.AlarmHost, object));
|
|
|
}
|
|
|
deviceInfo.setDeviceModel(req.getModels());
|
|
|
deviceInfo.setIotToken(req.getIotCode());
|
|
|
@@ -236,6 +238,9 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
|
|
|
deviceInfo.setUpdateBy(SecurityUtils.getLoginUser().getSysUser().getName());
|
|
|
deviceInfo.setOrgName(sysOrg.getShortName());
|
|
|
deviceInfo.setOrgPath(sysOrg.getPath());
|
|
|
+ //扩展信息
|
|
|
+ extendService.updateAlarmHostExtendByDeviceId(deviceInfo.getId(), req);
|
|
|
+ //子系统 传感器
|
|
|
|
|
|
}
|
|
|
}
|