|
|
@@ -78,8 +78,8 @@ public class IotDeviceServiceImpl implements IIotDeviceService {
|
|
|
public int addIotDevice(IotDeviceAddReqVo reqVo) {
|
|
|
String devconnBid = reqVo.getDevconnBid();
|
|
|
String[] devCodeList = reqVo.getDevCodeList();
|
|
|
- BigDecimal devLngalign = reqVo.getDevLngalign();
|
|
|
- BigDecimal devLatalign = reqVo.getDevLatalign();
|
|
|
+ BigDecimal devLngalign = null;
|
|
|
+ BigDecimal devLatalign = null;
|
|
|
|
|
|
if (devCodeList == null || devCodeList.length == 0) {
|
|
|
throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(), "设备编码不能为空");
|
|
|
@@ -100,11 +100,13 @@ public class IotDeviceServiceImpl implements IIotDeviceService {
|
|
|
if (iotDeviceconn == null) {
|
|
|
throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(), "设备连接不存在");
|
|
|
}
|
|
|
+ // 设备名称,单个设备时,使用设置的设备名称;多个设备时,使用设备连接的类型名称
|
|
|
+ // 批量添加时候 不设置经纬度
|
|
|
String devName = iotDeviceconn.getDevtypeName();
|
|
|
if (devCodeList.length == 1) {
|
|
|
devName = reqVo.getDevName();
|
|
|
- devLngalign = null;
|
|
|
- devLatalign = null;
|
|
|
+ devLngalign = reqVo.getDevLngalign();
|
|
|
+ devLatalign = reqVo.getDevLatalign();
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(devName)) {
|