소스 검색

修复 物联网添加设备经纬度后首页不显示的问题

zhaiyifei 8 달 전
부모
커밋
602136dc2f
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotDeviceServiceImpl.java

+ 6 - 4
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotDeviceServiceImpl.java

@@ -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)) {