gao.qiang 2 місяців тому
батько
коміт
31d9cf3cdd

+ 0 - 9
business-service/src/main/java/com/ozs/service/entity/BaseDeviceDynamicManagement.java

@@ -75,13 +75,4 @@ public class BaseDeviceDynamicManagement extends BaseEntity implements Serializa
      */
     private Integer isDisable;
 
-    /**
-     *设备状态信息(1已读2未读)
-     */
-    private  Integer facilityState;
-
-    /**
-     *设备电量信息(1已读2未读)
-     */
-    private  Integer electricityState;
 }

+ 0 - 12
business-service/src/main/java/com/ozs/service/entity/vo/DeviceStateResp.java

@@ -47,17 +47,5 @@ public class DeviceStateResp extends PageVo implements Serializable {
     private Integer railwayType;
     private String railwayCode;
     private String deptId;
-    /**
-     * 设备状态信息(1已读2未读)
-     */
-    private  Integer facilityState;
 
-    /**
-     *设备电量信息(1已读2未读)
-     */
-    private  Integer electricityState;
-    /**
-     * 1电量2设备状态
-     */
-    private Integer category;
 }

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

@@ -53,4 +53,6 @@ public interface BaseCameraManagementService extends IService<BaseCameraManageme
     AjaxResult cameraStateList();
 
     AjaxResult updateStateAll(Integer state);
+
+    deviceStateList(DeviceStateResp deviceStateResp);
 }

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

@@ -408,11 +408,6 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     @Override
     public AjaxResult updateStateAll(Integer state) {
         BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
-        if (state==1){
-            baseDeviceDynamicManagement.setFacilityState(1);
-        }else {
-            baseDeviceDynamicManagement.setElectricityState(1);
-        }
         baseDeviceDynamicManagementMapper.update(baseDeviceDynamicManagement,null);
         return AjaxResult.success();
     }

+ 2 - 10
business-service/src/main/resources/mapper/service/BaseCameraManagementMapper.xml

@@ -147,9 +147,7 @@
         man.electricity,
         ca.camera_code AS cameraCode,
         ca.camera_sn AS cameraSn,
-        man.update_time AS updateTime,
-        man.facility_state AS facilityState,
-        man.electricity_state AS electricityState
+        man.update_time AS updateTime
         FROM
         base_camera_management AS ca
         LEFT JOIN base_railway_management AS ra ON ca.railway_code = ra.railway_code
@@ -165,12 +163,6 @@
             <if test="electricity != null and electricity != ''">
                 and man.electricity &lt;=#{electricity}
             </if>
-            <if test="facilityState != null and facilityState != 0">
-                and man.facility_state =#{facilityState}
-            </if>
-            <if test="electricityState != null and electricityState != 0">
-                and man.electricity_state =#{electricityState}
-            </if>
             <if test="lineDir != null and lineDir != 0">
                 and ca.line_dir =#{lineDir}
             </if>
@@ -199,7 +191,7 @@
             </if>
         </where>
         ORDER BY man.is_disable DESC,
-        man.electricity
+        man.update_time DESC
     </select>
     <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

+ 1 - 1
business-service/src/main/resources/mapper/service/MsgWebPushMapper.xml

@@ -55,7 +55,7 @@
         </where>
     </select>
 
-    <select id="messageMoreNum" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.util.Map">
+    <select id="messageMoreNum" parameterType="java.lang.String" resultType="java.util.Map">
         select count(1) count, SUM(CASE status WHEN '1' THEN 1 ELSE 0 end) AS 'noCount' from msg_web_push
         <where>
             <if test="userId != null and userId != ''">

+ 27 - 35
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -1114,45 +1114,36 @@ public class BaseCameraManagementController extends BaseController {
     @GetMapping("/getMalfunctionAndLowCameraManagement")
     public AjaxResult getMalfunctionAndLowCameraManagement() {
         HashMap<String, Integer> map = new HashMap<>();
-        LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(BaseDeviceDynamicManagement::getIsDisable, 2);
-        List<BaseDeviceDynamicManagement> isDisable = baseDeviceDynamicManagementService.list(wrapper);
-        List<BaseDeviceDynamicManagement> collect = isDisable.stream().filter(f -> f.getFacilityState()==2).collect(Collectors.toList());
-        map.put("isDisable", collect.size());
+        DeviceStateResp deviceStateResp1 = new DeviceStateResp();
+        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());
+        map.put("isDisable", isDisable.size());
         LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.le(BaseDeviceDynamicManagement::getElectricity, 10);
-        List<BaseDeviceDynamicManagement> electricity = baseDeviceDynamicManagementService.list(queryWrapper);
-
-        List<BaseDeviceDynamicManagement> collect1 = electricity.stream().filter(f -> f.getElectricityState()==2).collect(Collectors.toList());
-
-
-        map.put("electricity", collect1.size());
+        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", collect.size()+collect1.size());
+        map.put("readCount", isDisable.size()+electricity.size());
         return AjaxResult.success(map);
     }
 
     /**
      * 修改设备状态信息(1已读2未读)
+     * 废弃
      */
-    @PostMapping("/updateState")
-    public AjaxResult updateState(@RequestBody List<DeviceStateResp> deviceStateRespList) {
-        List<String> list = deviceStateRespList.stream().map(DeviceStateResp::getCameraCode).collect(Collectors.toList());
-        BaseDeviceDynamicManagement dynamicManagement = new BaseDeviceDynamicManagement();
-        LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
-        wrapper.in(BaseDeviceDynamicManagement::getCameraCode, list);
-        if (deviceStateRespList.get(0).getCategory()==1){
-            dynamicManagement.setElectricityState(1);
-        }else {
-            dynamicManagement.setFacilityState(1);
-        }
-        boolean update = baseDeviceDynamicManagementService.update(dynamicManagement, wrapper);
-        if (update) {
-            return AjaxResult.success();
-        } else {
-            return AjaxResult.error();
-        }
-    }
+//    @PostMapping("/updateState")
+//    public AjaxResult updateState(@RequestBody List<DeviceStateResp> deviceStateRespList) {
+//        List<String> list = deviceStateRespList.stream().map(DeviceStateResp::getCameraCode).collect(Collectors.toList());
+//        BaseDeviceDynamicManagement dynamicManagement = new BaseDeviceDynamicManagement();
+//        LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
+//        wrapper.in(BaseDeviceDynamicManagement::getCameraCode, list);
+//        boolean update = baseDeviceDynamicManagementService.update(dynamicManagement, wrapper);
+//        if (update) {
+//            return AjaxResult.success();
+//        } else {
+//            return AjaxResult.error();
+//        }
+//    }
 
 
 
@@ -1178,11 +1169,12 @@ public class BaseCameraManagementController extends BaseController {
 
     /**
      * 批量修改相机已读未读状态
+     * 废弃
      * @return
      */
-    @GetMapping("updateStateAll/{state}")
-    public AjaxResult updateStateAll(@PathVariable Integer state) {
-        return baseCameraManagementService.updateStateAll(state);
-    }
+//    @GetMapping("updateStateAll/{state}")
+//    public AjaxResult updateStateAll(@PathVariable Integer state) {
+//        return baseCameraManagementService.updateStateAll(state);
+//    }
 }
 

+ 0 - 2
hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -1121,7 +1121,6 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
             // 执行批量修改操作
             BaseDeviceDynamicManagement update = new BaseDeviceDynamicManagement();
             update.setIsDisable(2);
-            update.setFacilityState(2);
             baseDeviceDynamicManagementService.update(update, updateWrapper);
         }
 
@@ -1134,7 +1133,6 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         // 执行批量修改操作
         BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
         baseDeviceDynamicManagement.setIsDisable(1);
-        baseDeviceDynamicManagement.setFacilityState(2);
         baseDeviceDynamicManagementService.update(baseDeviceDynamicManagement, wrapper);
     }
 

+ 0 - 1
hazard-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -323,7 +323,6 @@ public class GeoHazardMonitorTokenController {
             }
             baseDynamicManagement.setUpdateTime(new Date(reqDeviceVo.getTime()));
             baseDynamicManagement.setUpdateBy(admin.getUserId());
-            baseDynamicManagement.setElectricityState(2);
             log.info("reqDeviceVo:{}", baseDynamicManagement);
             if (baseDeviceDynamicManagementService.updateById(baseDynamicManagement)) {
                 jsonObject.put("resultCode", 1);