Quellcode durchsuchen

相机树开发

gao.qiang vor 2 Monaten
Ursprung
Commit
8e9da75685

+ 4 - 0
business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementVo.java

@@ -62,4 +62,8 @@ public class BaseCameraManagementVo extends PageVo implements Serializable {
 
     private List<Long> ids;
     private String cameraCode;
+    /**
+     * 相机状态(1在线2离线)
+     */
+    private Integer isDisable;
 }

+ 1 - 1
business-service/src/main/java/com/ozs/service/mapper/BaseCameraManagementMapper.java

@@ -30,5 +30,5 @@ public interface BaseCameraManagementMapper extends BaseMapper<BaseCameraManagem
 
     List<DeviceStateResp> deviceStatePage(DeviceStateResp deviceStateResp);
 
-    List<AlarmCountSortVo> alarmCountSort();
+    List<AlarmCountSortVo> alarmCountSort(MsgAlarmVo msgAlarmVo);
 }

+ 2 - 1
business-service/src/main/java/com/ozs/service/mapper/BaseRailwayManagementMapper.java

@@ -2,6 +2,7 @@ package com.ozs.service.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.service.entity.BaseRailwayManagement;
+import com.ozs.service.entity.vo.BaseCameraManagementVo;
 import com.ozs.service.entity.vo.CameraStateList;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -23,5 +24,5 @@ public interface BaseRailwayManagementMapper extends BaseMapper<BaseRailwayManag
 
     List<BaseRailwayManagement> listRailway();
 
-    List<CameraStateList> cameraStateList();
+    List<CameraStateList> cameraStateList(BaseCameraManagementVo baseCameraManagementVo);
 }

+ 2 - 2
business-service/src/main/java/com/ozs/service/service/BaseCameraManagementService.java

@@ -48,9 +48,9 @@ public interface BaseCameraManagementService extends IService<BaseCameraManageme
 
     List<DeviceStateResp> deviceStateRespList(DeviceStateResp deviceStateResp);
 
-    AjaxResult cameraStateTotal();
+    AjaxResult cameraStateTotal(BaseCameraManagementVo baseCameraManagementVo);
 
-    AjaxResult cameraStateList();
+    AjaxResult cameraStateList(BaseCameraManagementVo baseCameraManagementVo);
 
     AjaxResult updateStateAll(Integer state);
 }

+ 2 - 2
business-service/src/main/java/com/ozs/service/service/MsgAlarmService.java

@@ -62,7 +62,7 @@ public interface MsgAlarmService extends IService<MsgAlarm> {
 
     BaseCameraManagement getBaseCameraManagementByCamereCode(String camereCode);
 
-    AjaxResult alarmStatistics();
+    AjaxResult alarmStatistics(MsgAlarmVo msgAlarmVo1);
 
-    AjaxResult alarmCountSort();
+    AjaxResult alarmCountSort(MsgAlarmVo msgAlarmVo);
 }

+ 6 - 6
business-service/src/main/java/com/ozs/service/service/impl/BaseCameraManagementServiceImpl.java

@@ -351,14 +351,14 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     }
 
     @Override
-    public AjaxResult cameraStateTotal() {
+    public AjaxResult cameraStateTotal(BaseCameraManagementVo baseCameraManagementVo) {
         int count;
         int unresolvedCount;
         //找出所有相机数据
-        List<BaseCameraManagement> list = this.list();
+        List<BaseCameraManagement> list =baseCameraManagementMapper.selectCameraManagementList(baseCameraManagementVo);
         //异常的相机
-        List<BaseDeviceDynamicManagement> alarmList = baseDeviceDynamicManagementMapper.selectList(new LambdaQueryWrapper<BaseDeviceDynamicManagement>()
-                .eq(BaseDeviceDynamicManagement::getIsDisable, 2));
+        baseCameraManagementVo.setIsDisable(2);
+        List<BaseCameraManagement> alarmList = baseCameraManagementMapper.selectCameraManagementList(baseCameraManagementVo);
         HashMap<String, Integer> map = new HashMap<>();
         if (!ObjectUtils.isEmpty(list)) {
             //找出所有相机数据
@@ -401,8 +401,8 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     }
 
     @Override
-    public AjaxResult cameraStateList() {
-        return AjaxResult.success(baseRailwayManagementMapper.cameraStateList());
+    public AjaxResult cameraStateList(BaseCameraManagementVo baseCameraManagementVo) {
+        return AjaxResult.success(baseRailwayManagementMapper.cameraStateList(baseCameraManagementVo));
     }
 
     @Override

+ 24 - 24
business-service/src/main/java/com/ozs/service/service/impl/MsgAlarmServiceImpl.java

@@ -166,21 +166,21 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
 
     @Override
     public void getNormalBaseCameraManagementsCache(String setType) {
-        log.info("-----------setType------"+setType);
+        log.info("-----------setType------" + setType);
         Set<BaseCameraVO> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
-        log.info("-----------alarmSet------"+alarmSet);
-        if(!CollectionUtils.isEmpty(alarmSet)) {
+        log.info("-----------alarmSet------" + alarmSet);
+        if (!CollectionUtils.isEmpty(alarmSet)) {
             Set<String> cameraCodeSet = alarmSet.stream()
                     .map(BaseCameraVO::getCameraCode)
                     .collect(Collectors.toSet());
-            log.info("-----------cameraCodeSet------"+cameraCodeSet);
+            log.info("-----------cameraCodeSet------" + cameraCodeSet);
             QueryWrapper<BaseCameraManagement> queryWrapper = new QueryWrapper<>();
-            log.info("-----------Constants.ALARM_SET------"+Constants.ALARM_SET);
+            log.info("-----------Constants.ALARM_SET------" + Constants.ALARM_SET);
             if (Constants.ALARM_SET.equals(setType)) {
                 // 使用QueryWrapper和notin方法根据cameraCode列表查询BaseCameraManagement数据
                 queryWrapper.notIn("camera_code", cameraCodeSet);
                 Set<BaseCameraManagement> set = baseCameraManagementMapper.selectList(queryWrapper).stream().collect(Collectors.toSet());
-                log.info("-----------set------"+set);
+                log.info("-----------set------" + set);
                 set.forEach(item -> {
                     BaseCameraVO baseCameraVO = new BaseCameraVO();
                     baseCameraVO.setCameraCode(item.getCameraCode());
@@ -196,21 +196,21 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
         List<MsgAlarm> lockedMsgAlarms = msgAlarmMapper.selectList(new QueryWrapper<MsgAlarm>().eq("is_lock", 2));
         if (lockedMsgAlarms.isEmpty()) {
             Set<BaseCameraManagement> normalSet = baseCameraManagementMapper.selectList(null).stream().collect(Collectors.toSet());
-            normalSet.forEach(item ->{
-                BaseCameraVO  baseCameraVO=new BaseCameraVO();
+            normalSet.forEach(item -> {
+                BaseCameraVO baseCameraVO = new BaseCameraVO();
                 baseCameraVO.setCameraCode(item.getCameraCode());
                 baseCameraVO.setChannel(item.getChannel());
-                redisService.addToSet(Constants.NORMAL_SET,baseCameraVO);
+                redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
             });
-            redisService.addToSet(Constants.ALARM_SET,null);
+            redisService.addToSet(Constants.ALARM_SET, null);
         }
         // 提取cameraCode列表
         Set<String> cameraCodeSet = lockedMsgAlarms.stream().map(MsgAlarm::getCameraCode).collect(Collectors.toSet());
         QueryWrapper<BaseCameraManagement> queryWrapperAlarm = new QueryWrapper<>();
         queryWrapperAlarm.in("camera_code", cameraCodeSet);
         Set<BaseCameraManagement> alarmSet = baseCameraManagementMapper.selectList(queryWrapperAlarm).stream().collect(Collectors.toSet());
-        alarmSet.forEach(item->{
-            BaseCameraVO  baseCameraVO=new BaseCameraVO();
+        alarmSet.forEach(item -> {
+            BaseCameraVO baseCameraVO = new BaseCameraVO();
             baseCameraVO.setCameraCode(item.getCameraCode());
             baseCameraVO.setChannel(item.getChannel());
             redisService.addToSet(Constants.ALARM_SET, baseCameraVO);
@@ -218,8 +218,8 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
         QueryWrapper<BaseCameraManagement> queryWrapperNormal = new QueryWrapper<>();
         queryWrapperNormal.notIn("camera_code", cameraCodeSet);
         Set<BaseCameraManagement> normalSet = baseCameraManagementMapper.selectList(queryWrapperNormal).stream().collect(Collectors.toSet());
-        normalSet.forEach(item->{
-            BaseCameraVO  baseCameraVO=new BaseCameraVO();
+        normalSet.forEach(item -> {
+            BaseCameraVO baseCameraVO = new BaseCameraVO();
             baseCameraVO.setCameraCode(item.getCameraCode());
             baseCameraVO.setChannel(item.getChannel());
             redisService.addToSet(Constants.NORMAL_SET, baseCameraVO);
@@ -235,14 +235,14 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
     }
 
     @Override
-    public AjaxResult alarmStatistics() {
-        int count=0;
-        int unresolvedCount=0;
+    public AjaxResult alarmStatistics(MsgAlarmVo msgAlarmVo1) {
+        int count = 0;
+        int unresolvedCount = 0;
         //找出所有报警数据
-        List<MsgAlarm> list = this.list();
+        List<MsgAlarm> list = msgAlarmMapper.selectMsgAlarmList(msgAlarmVo1);
         //未解除的报警
-        List<MsgAlarm> alarmList = this.list(new LambdaQueryWrapper<MsgAlarm>()
-                .eq(MsgAlarm::getIsLock, 2));
+        msgAlarmVo1.setIsLock(2);
+        List<MsgAlarm> alarmList = msgAlarmMapper.selectMsgAlarmList(msgAlarmVo1);
         HashMap<String, Integer> map = new HashMap<>();
         if (!ObjectUtils.isEmpty(list)) {
             //获取所有报警的相机编码
@@ -260,7 +260,7 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
             int pu = list.size() - count;
             map.put("highAlarmCount", count);
             map.put("puAlarmCount", pu);
-        }else {
+        } else {
             map.put("highAlarmCount", 0);
             map.put("puAlarmCount", 0);
         }
@@ -280,7 +280,7 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
             int puUnresolvedCount = alarmList.size() - unresolvedCount;
             map.put("highUnresolvedCount", unresolvedCount);
             map.put("puUnresolvedCount", puUnresolvedCount);
-        }else {
+        } else {
             map.put("highUnresolvedCount", 0);
             map.put("puUnresolvedCount", 0);
         }
@@ -288,7 +288,7 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
     }
 
     @Override
-    public AjaxResult alarmCountSort() {
-        return AjaxResult.success(baseCameraManagementMapper.alarmCountSort());
+    public AjaxResult alarmCountSort(MsgAlarmVo msgAlarmVo) {
+        return AjaxResult.success(baseCameraManagementMapper.alarmCountSort(msgAlarmVo));
     }
 }

+ 28 - 0
business-service/src/main/resources/mapper/service/BaseCameraManagementMapper.xml

@@ -37,6 +37,9 @@
             <if test="railwayCode != null and railwayCode != ''">
                 and a.railway_code=#{railwayCode}
             </if>
+            <if test="isDisable != null and isDisable != 0">
+                and man.is_disable=#{isDisable}
+            </if>
             <if test="cameraCode != null and cameraCode != ''">
                 and a.camera_code like concat('%', #{cameraCode}, '%')
             </if>
@@ -196,6 +199,31 @@
     <select id="alarmCountSort" resultType="com.ozs.service.entity.vo.AlarmCountSortVo">
         SELECT COUNT(m.camera_code) AS cameraCount,c.camera_code AS cameraCode,c.measure_point_name AS measurePointName
         FROM msg_alarm  m JOIN base_camera_management  c ON m.camera_code=c.camera_code
+        <where>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
+            </if>
+        </where>
         GROUP BY m.camera_code
         ORDER BY cameraCount DESC
     </select>

+ 39 - 14
business-service/src/main/resources/mapper/service/BaseRailwayManagementMapper.xml

@@ -14,19 +14,44 @@
         group by c.railway_code, a.dept_id
     </select>
     <select id="cameraStateList" resultType="com.ozs.service.entity.vo.CameraStateList">
-    SELECT
-    s.dept_name AS deptName,
-    COUNT(c.dept_id) AS totalCameraCount,
-    COUNT(CASE
-    WHEN b.is_disable = 2  THEN 1
-    END) AS filteredCameraCount
-    FROM
-    base_camera_management c
-    JOIN
-    sys_dept s ON c.dept_id = s.dept_id
-    LEFT JOIN
-    base_device_dynamic_management b ON c.camera_code = b.camera_code
-    GROUP BY
-    c.dept_id, s.dept_name;
+        SELECT
+        s.dept_name AS deptName,
+        COUNT(c.dept_id) AS totalCameraCount,
+        COUNT(CASE
+        WHEN b.is_disable = 2 THEN 1
+        END) AS filteredCameraCount
+        FROM
+        base_camera_management c
+        JOIN
+        sys_dept s ON c.dept_id = s.dept_id
+        LEFT JOIN
+        base_device_dynamic_management b ON c.camera_code = b.camera_code
+        <where>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or a.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or a.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
+            </if>
+        </where>
+        GROUP BY
+        c.dept_id, s.dept_name;
     </select>
 </mapper>

+ 47 - 40
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -139,7 +139,7 @@ public class BaseCameraManagementController extends BaseController {
             BaseDeviceDynamicManagement deviceDynamicManagement = baseDeviceDynamicManagementService.getOne(new LambdaQueryWrapper<BaseDeviceDynamicManagement>()
                     .eq(BaseDeviceDynamicManagement::getCameraCode, cameraCode));
             baseCameraManagement.setIsDisable(deviceDynamicManagement.getIsDisable());
-            baseCameraManagement.setElectricity(deviceDynamicManagement.getElectricity()+"%");
+            baseCameraManagement.setElectricity(deviceDynamicManagement.getElectricity() + "%");
             List<MqLog> list = mqLogService.list(new LambdaQueryWrapper<MqLog>()
                     .eq(MqLog::getCameraCode, cameraCode));
             if (!ObjectUtils.isEmpty(list)) {
@@ -190,7 +190,7 @@ public class BaseCameraManagementController extends BaseController {
             BaseDeviceDynamicManagement deviceDynamicManagement = baseDeviceDynamicManagementService.getOne(new LambdaQueryWrapper<BaseDeviceDynamicManagement>()
                     .eq(BaseDeviceDynamicManagement::getCameraCode, cameraCode));
             msgAlarmResp.setIsDisable(deviceDynamicManagement.getIsDisable());
-            msgAlarmResp.setElectricity(deviceDynamicManagement.getElectricity()+"%");
+            msgAlarmResp.setElectricity(deviceDynamicManagement.getElectricity() + "%");
             List<MqLog> list = mqLogService.list(new LambdaQueryWrapper<MqLog>()
                     .eq(MqLog::getCameraCode, cameraCode));
             if (!ObjectUtils.isEmpty(list)) {
@@ -395,7 +395,7 @@ public class BaseCameraManagementController extends BaseController {
                 BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
                 baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
             }
-        }else {
+        } else {
             baseCameraManagement.setBeginMile(null);
         }
         if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
@@ -411,7 +411,7 @@ public class BaseCameraManagementController extends BaseController {
                 BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
                 baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
             }
-        }else {
+        } else {
             baseCameraManagement.setEndMile(null);
         }
         BaseCameraManagement management = baseCameraManagementService.getById(baseCameraManagement.getId());
@@ -428,8 +428,8 @@ public class BaseCameraManagementController extends BaseController {
         }
         one.setCameraCode(baseCameraManagement.getCameraCode());
         LambdaUpdateWrapper<BaseCameraManagement> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(BaseCameraManagement::getId,baseCameraManagement.getId());
-        if (baseCameraManagementService.update(baseCameraManagement,wrapper) && baseDeviceDynamicManagementService.updateById(one)) {
+        wrapper.eq(BaseCameraManagement::getId, baseCameraManagement.getId());
+        if (baseCameraManagementService.update(baseCameraManagement, wrapper) && baseDeviceDynamicManagementService.updateById(one)) {
             return AjaxResult.success();
         }
         return AjaxResult.error();
@@ -554,19 +554,19 @@ public class BaseCameraManagementController extends BaseController {
             ExcelUtil<BaseCameraManagementVos> util = new ExcelUtil<BaseCameraManagementVos>(BaseCameraManagementVos.class);
             ExcelUtil<String> utils = new ExcelUtil<String>(String.class);
             InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/baseCameraManagement.xlsx");
-            List<String> accountManage = utils.importExcels(StringUtils.EMPTY, file.getInputStream(),0);
-            List<String> accountManageLists = utils.importExcels(StringUtils.EMPTY, resourceAsStream,0);
+            List<String> accountManage = utils.importExcels(StringUtils.EMPTY, file.getInputStream(), 0);
+            List<String> accountManageLists = utils.importExcels(StringUtils.EMPTY, resourceAsStream, 0);
             boolean stats = accountManage.stream().sorted().collect(Collectors.joining())
                     .equals(accountManageLists.stream().sorted().collect(Collectors.joining()));
             if (stats) {
-                 accountManageList = util.importExcel(file.getInputStream());
-            }else {
+                accountManageList = util.importExcel(file.getInputStream());
+            } else {
                 return AjaxResult.error("表头格式不正确,请按照模板样式编写");
             }
             String message = baseCameraManagementService.importBaseAccountManagement(accountManageList, updateSupport, getUserId());
             return AjaxResult.success(message);
         } catch (Exception exception) {
-           return AjaxResult.error(exception.getMessage());
+            return AjaxResult.error(exception.getMessage());
         }
     }
 
@@ -682,7 +682,7 @@ public class BaseCameraManagementController extends BaseController {
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecordsList(@RequestBody
                                      @NotNull(message = "相机编码不能为空")
-                                             List<String> cameraCodes) {
+                                     List<String> cameraCodes) {
         List<String> list = new ArrayList<>();
         for (String cameraCode : cameraCodes) {
             LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -761,7 +761,7 @@ public class BaseCameraManagementController extends BaseController {
         children.sort(new Comparator<CameraTree>() {
             @Override
             public int compare(CameraTree o1, CameraTree o2) {
-                if (!ObjectUtils.isEmpty(o1.getNumber())&& !ObjectUtils.isEmpty(o2.getNumber())) {
+                if (!ObjectUtils.isEmpty(o1.getNumber()) && !ObjectUtils.isEmpty(o2.getNumber())) {
                     int mileageDiff = o1.getNumber() - o2.getNumber();
                     if (mileageDiff == 0) {
                         String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
@@ -772,7 +772,7 @@ public class BaseCameraManagementController extends BaseController {
                     } else {
                         return mileageDiff;
                     }
-                }else {
+                } else {
                     String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
                     String substring1 = name1.substring(0, 1);
                     String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getRailwayName());
@@ -798,7 +798,7 @@ public class BaseCameraManagementController extends BaseController {
                 cameraTreeList.sort(new Comparator<CameraTree>() {
                     @Override
                     public int compare(CameraTree o1, CameraTree o2) {
-                        int mileageDiff  = o1.getMileage() - o2.getMileage();
+                        int mileageDiff = o1.getMileage() - o2.getMileage();
                         // 如果里程相同,则比较方向
                         if (mileageDiff == 0) {
                             String[] split1 = o1.getName().split("-");
@@ -872,7 +872,7 @@ public class BaseCameraManagementController extends BaseController {
                 return success();
             }
             return error();
-        }else {
+        } else {
             return error("已自动开启录制,关闭按钮已失效");
         }
     }
@@ -905,7 +905,7 @@ public class BaseCameraManagementController extends BaseController {
             } else {
                 return error("开启视频录制失败");
             }
-        }else {
+        } else {
             return error("已自动开启录制,无需按钮再次开启录制");
         }
     }
@@ -968,17 +968,17 @@ public class BaseCameraManagementController extends BaseController {
             BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
             msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
             msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+            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 ;
+                String endMile = begin + "~" + end;
                 msgAlarmResp.setBeginMile(endMile);
             }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
-            if (!ObjectUtils.isEmpty(baseCameraManagement.getInstallLongitude())&&!ObjectUtils.isEmpty(baseCameraManagement.getInstallLatitude())) {
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getInstallLongitude()) && !ObjectUtils.isEmpty(baseCameraManagement.getInstallLatitude())) {
                 msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
-            }else {
+            } else {
                 msgAlarmResp.setInstallLongitude(null);
             }
             msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
@@ -1004,9 +1004,9 @@ public class BaseCameraManagementController extends BaseController {
         }
         String recordUrl = CameraUtil.getRecordUrl(one.getCameraCode(), one.getChannel(), vo.getStartTime(), vo.getEntTime());
         if (recordUrl.contains("当前相机暂无回放视频")) {
-            return  AjaxResult.error(recordUrl);
-        }else {
-            return AjaxResult.success("ok",recordUrl);
+            return AjaxResult.error(recordUrl);
+        } else {
+            return AjaxResult.success("ok", recordUrl);
         }
     }
 
@@ -1030,37 +1030,39 @@ public class BaseCameraManagementController extends BaseController {
      * @return
      */
     @GetMapping("/removePrice")
-    public AjaxResult removePrice(@RequestParam("number") Integer number,@RequestParam("path") String path) {
+    public AjaxResult removePrice(@RequestParam("number") Integer number, @RequestParam("path") String path) {
         log.info("-----------------------removePrice");
-        log.info("-----------------------removePrice"+"--number-----"+number);
-        log.info("-----------------------removePrice"+"--path-----"+path);
-        cameraUtil.removePrice(number,path);
+        log.info("-----------------------removePrice" + "--number-----" + number);
+        log.info("-----------------------removePrice" + "--path-----" + path);
+        cameraUtil.removePrice(number, path);
         return success();
     }
 
     /**
      * 夜视
+     *
      * @param deviceStateResp
      * @return
      */
     @GetMapping("/nightVision/{code}/{mode}")
-    public AjaxResult nightVision(@PathVariable String code,Integer mode){
+    public AjaxResult nightVision(@PathVariable String code, Integer mode) {
         BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(new LambdaQueryWrapper<BaseCameraManagement>()
                 .eq(BaseCameraManagement::getCameraCode, code));
-        PublishClient.configFrameRate(baseCameraManagement,mode);
+        PublishClient.configFrameRate(baseCameraManagement, mode);
         return success();
     }
 
     /**
      * 切换帧率
+     *
      * @param code
      * @return
      */
     @GetMapping("/switchFrameRate")
-    public AjaxResult switchFrameRate(@RequestParam("code") String code,@RequestParam("fps") String fps){
+    public AjaxResult switchFrameRate(@RequestParam("code") String code, @RequestParam("fps") String fps) {
         BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(new LambdaQueryWrapper<BaseCameraManagement>()
                 .eq(BaseCameraManagement::getCameraCode, code));
-        PublishClient.confidenceCoefficient(baseCameraManagement,fps);
+        PublishClient.confidenceCoefficient(baseCameraManagement, fps);
         return success();
     }
 
@@ -1115,15 +1117,16 @@ public class BaseCameraManagementController extends BaseController {
     public AjaxResult getMalfunctionAndLowCameraManagement() {
         HashMap<String, Integer> map = new HashMap<>();
         DeviceStateResp deviceStateResp1 = new DeviceStateResp();
-        DeviceStateResp deviceStateResp = (DeviceStateResp) dataScoreUtil.setDataScore(getUserId(),deviceStateResp1);
+        DeviceStateResp deviceStateResp = (DeviceStateResp) dataScoreUtil.setDataScore(getUserId(), deviceStateResp1);
         List<DeviceStateResp> deviceStateRespList = baseCameraManagementService.deviceStateRespList(deviceStateResp);
-        List<DeviceStateResp> isDisable = deviceStateRespList.stream().filter(f -> f.getIsDisable().equals("2")).collect(Collectors.toList());
+        log.info("getMalfunctionAndLowCameraManagement------------------------" + deviceStateRespList.toString());
+        List<DeviceStateResp> isDisable = deviceStateRespList.stream().filter(f -> f.getIsDisable().equals(2)).collect(Collectors.toList());
         map.put("isDisable", isDisable.size());
         LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
-        List<DeviceStateResp> electricity = deviceStateRespList.stream().filter(f -> f.getElectricity()<=10).collect(Collectors.toList());
+        List<DeviceStateResp> electricity = deviceStateRespList.stream().filter(f -> f.getElectricity() <= 10).collect(Collectors.toList());
         map.put("electricity", electricity.size());
         map.put("count", isDisable.size() + electricity.size());
-        map.put("readCount", isDisable.size()+electricity.size());
+        map.put("readCount", isDisable.size() + electricity.size());
         return AjaxResult.success(map);
     }
 
@@ -1146,24 +1149,28 @@ public class BaseCameraManagementController extends BaseController {
 //    }
 
 
-
-
     /**
      * 首页设备状态
+     *
      * @return
      */
     @GetMapping("cameraStateTotal")
     public AjaxResult cameraStateTotal() {
-     return baseCameraManagementService.cameraStateTotal();
+        BaseCameraManagementVo baseCameraManagementVo = new BaseCameraManagementVo();
+        BaseCameraManagementVo baseCameraManagementVos = (BaseCameraManagementVo) dataScoreUtil.setDataScore(getUserId(), baseCameraManagementVo);
+        return baseCameraManagementService.cameraStateTotal(baseCameraManagementVos);
     }
 
     /**
      * 首页设备状态列表
+     *
      * @return
      */
     @GetMapping("cameraStateList")
     public AjaxResult cameraStateList() {
-        return baseCameraManagementService.cameraStateList();
+        BaseCameraManagementVo baseCameraManagementVo = new BaseCameraManagementVo();
+        BaseCameraManagementVo baseCameraManagementVos = (BaseCameraManagementVo) dataScoreUtil.setDataScore(getUserId(), baseCameraManagementVo);
+        return baseCameraManagementService.cameraStateList(baseCameraManagementVos);
     }
 
 

+ 6 - 2
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -833,13 +833,17 @@ public class MsgAlarmController extends BaseController {
     @GetMapping(value = "/alarmStatistics")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult alarmStatistics() {
-      return   msgAlarmService.alarmStatistics();
+        MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
+        MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo1);
+      return   msgAlarmService.alarmStatistics(msgAlarmVo);
     }
 
     @GetMapping(value = "/alarmCountSort")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult alarmCountSort() {
-        return   msgAlarmService.alarmCountSort();
+        MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
+        MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo1);
+        return   msgAlarmService.alarmCountSort(msgAlarmVo);
     }
 
 }