浏览代码

根据相机ID、是否解除 获取相机信息、未解除信息修改

gao.qiang 1 年之前
父节点
当前提交
fb7a8efbd5

+ 9 - 2
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -120,6 +120,7 @@ public class BaseCameraManagementController extends BaseController {
     @ApiOperation("根据相机ID、是否解除 获取相机信息、未解除信息")
     @Log(title = "相机台账管理", businessType = BusinessType.SELECT)
     public AjaxResult homeGetInfo(@RequestBody BaseCameraManagementHomeVo baseCameraManagementHomeVo) {
+        String endMile="";
         Integer isLock = baseCameraManagementHomeVo.getIsLock();
         Long id = baseCameraManagementHomeVo.getId();
         String cameraCode = baseCameraManagementHomeVo.getCameraCode();
@@ -164,12 +165,18 @@ public class BaseCameraManagementController extends BaseController {
             if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile()) && !ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
                 String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
                 String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-                String endMile = begin + "-" + end;
+                if (StringUtils.isNotEmpty(begin)&&StringUtils.isNotEmpty(end)) {
+                     endMile = begin + "-" + end;
+                }
                 msgAlarmResp.setBeginMile(endMile);
             }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
-            msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
+            if (StringUtils.isNotEmpty(baseCameraManagement.getInstallLongitude())&&StringUtils.isNotEmpty(baseCameraManagement.getInstallLatitude())) {
+                msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
+            }else {
+                msgAlarmResp.setInstallLongitude("");
+            }
             String[] split = msgAlarm.getImageUrl().split(";");
             ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
             msgAlarmResp.setImageUrls(objects);