Browse Source

事件管理-隐患管理-自动喷水灭火系统相关接口开发

jichaobo 2 years ago
parent
commit
b6124dca5c

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("fire_alarm");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("alarm_detector");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 117 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AlarmDetectorController.java

@@ -0,0 +1,117 @@
+package com.usky.fire.controller.web;
+
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.fire.domain.AlarmDetector;
+import com.usky.fire.service.AlarmDetectorService;
+import com.usky.fire.service.vo.AlarmDetectorVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 独立式无线探测器告警 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+@RestController
+@RequestMapping("/alarmDetector")
+public class AlarmDetectorController {
+
+    @Autowired
+    private AlarmDetectorService alarmDetectorService;
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-列表查询
+     *
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param pageNum        当前页
+     * @param pageSize       每页条数
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+
+    @GetMapping("alarmDetectorLowerList")
+    public ApiResult<CommonPage<AlarmDetectorVo>> alarmDetectorLowerList(@RequestParam(value = "handlingStatus", required = false) Integer handlingStatus,
+                                                                         @RequestParam(value = "systemType", required = false) Integer systemType,
+                                                                         @RequestParam(value = "startDate", required = false) String startDate,
+                                                                         @RequestParam(value = "endDate", required = false) String endDate,
+                                                                         @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
+                                                                         @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+        return ApiResult.success(alarmDetectorService.alarmDetectorLowerList(handlingStatus, startDate, endDate, pageNum, pageSize, systemType));
+    }
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-左侧数据统计
+     *
+     * @param systemType 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    @GetMapping("detectorStatistics")
+    public ApiResult<Map<String, Object>> detectorStatistics(@RequestParam(value = "systemType", required = false) Integer systemType) {
+        return ApiResult.success(alarmDetectorService.detectorStatistics(systemType));
+    }
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-数据统计图
+     *
+     * @param systemType 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @param startDate  开始时间  格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate    结束时间  格式:yyyy-MM-dd HH:mm:ss
+     * @return
+     */
+    @GetMapping("detectorStatisticalChart")
+    public ApiResult<Map<String, Object>> detectorStatisticalChart(@RequestParam(value = "systemType", required = false) Integer systemType,
+                                                                   @RequestParam(value = "startDate", required = false) String startDate,
+                                                                   @RequestParam(value = "endDate", required = false) String endDate) {
+        return ApiResult.success(alarmDetectorService.detectorStatisticalChart(systemType, startDate, endDate));
+    }
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-告警处理
+     *
+     * @param alarmDetector
+     * @return
+     */
+    @PostMapping("updateAlarmDetector")
+    public ApiResult<Void> updateAlarmDetector(@RequestBody AlarmDetector alarmDetector) {
+        alarmDetectorService.updateAlarmDetector(alarmDetector);
+        return ApiResult.success();
+    }
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-导出
+     *
+     * @param response
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param exportTitle    导出标题
+     * @throws IOException
+     */
+    @GetMapping("alarmDetectorLowerListExport")
+    public void export(HttpServletResponse response,
+                       @RequestParam(value = "handlingStatus", required = false) Integer handlingStatus,
+                       @RequestParam(value = "systemType", required = false) Integer systemType,
+                       @RequestParam(value = "startDate", required = false) String startDate,
+                       @RequestParam(value = "endDate", required = false) String endDate,
+                       @RequestParam(value = "exportTitle") String exportTitle) throws IOException {
+        List<AlarmDetectorVo> list = alarmDetectorService.alarmDetectorLowerListExport(handlingStatus, startDate, endDate, systemType);
+        ExcelUtil<AlarmDetectorVo> util = new ExcelUtil<AlarmDetectorVo>(AlarmDetectorVo.class);
+        util.exportExcel(response, list, exportTitle, exportTitle);
+    }
+
+}
+

+ 115 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/AlarmDetector.java

@@ -0,0 +1,115 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 独立式无线探测器告警
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class AlarmDetector implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据来源
+     */
+    private String dataSources;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 数据上报时间
+     */
+    private LocalDateTime dataTime;
+
+    /**
+     * 设备状态
+     */
+    private Integer deviceStatus;
+
+    /**
+     * 上报地址
+     */
+    private String address;
+
+    /**
+     * 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     */
+    private Integer systemType;
+
+    /**
+     * 告警类型(如WP1、WP2)
+     */
+    private String alarmType;
+
+    /**
+     * 电池电量
+     */
+    private Integer batteryLevel;
+
+    /**
+     * 信号强度
+     */
+    private String signalIntensity;
+
+    /**
+     * 告警值
+     */
+    private Double alarmValue;
+
+    /**
+     * 处理人
+     */
+    private String handler;
+
+    /**
+     * 处理时间
+     */
+    private LocalDateTime handlingTime;
+
+    /**
+     * 处理内容
+     */
+    private String handlingContent;
+
+    /**
+     * 处理人电话
+     */
+    private String handlerPhone;
+
+    /**
+     * 处理状态(0、未处理 1、已处理)
+     */
+    private Integer handlingStatus;
+
+    /**
+     * 是否误报(0、非误报 1、误报)
+     */
+    private Integer falseAlarm;
+
+    /**
+     * 现场照片
+     */
+    private String sitePhoto;
+
+
+}

+ 24 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/AlarmDetectorMapper.java

@@ -0,0 +1,24 @@
+package com.usky.fire.mapper;
+
+import com.usky.common.mybatis.core.CrudMapper;
+import com.usky.fire.domain.AlarmDetector;
+import com.usky.fire.service.vo.AlarmFireStatisticalVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 独立式无线探测器告警 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+public interface AlarmDetectorMapper extends CrudMapper<AlarmDetector> {
+
+    List<AlarmFireStatisticalVo> selectAlarmDetectorStatistical(@Param("deviceList") List<String> deviceList,
+                                                                @Param("systemType") Integer systemType,
+                                                                @Param("startDate") String startDate,
+                                                                @Param("endDate") String endDate);
+}

+ 96 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/AlarmDetectorService.java

@@ -0,0 +1,96 @@
+package com.usky.fire.service;
+
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.mybatis.core.CrudService;
+import com.usky.fire.domain.AlarmDetector;
+import com.usky.fire.service.vo.AlarmDetectorVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 独立式无线探测器告警 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+public interface AlarmDetectorService extends CrudService<AlarmDetector> {
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-列表查询
+     *
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param pageNum        当前页
+     * @param pageSize       每页条数
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    CommonPage<AlarmDetectorVo> alarmDetectorLowerList(Integer handlingStatus, String startDate, String endDate,
+                                                       Integer pageNum, Integer pageSize, Integer systemType);
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-左侧统计
+     *
+     * @param systemType 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    Map<String, Object> detectorStatistics(Integer systemType);
+
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-数据统计图
+     *
+     * @param systemType 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @param startDate  开始时间  格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate    结束时间  格式:yyyy-MM-dd HH:mm:ss
+     * @return
+     */
+    Map<String, Object> detectorStatisticalChart(Integer systemType, String startDate, String endDate);
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-告警处理
+     *
+     * @param alarmDetector
+     * @return
+     */
+    void updateAlarmDetector(AlarmDetector alarmDetector);
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-导出数据查询
+     *
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    List<AlarmDetectorVo> alarmDetectorLowerListExport(Integer handlingStatus, String startDate, String endDate, Integer systemType);
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-数量统计
+     *
+     * @param deviceCodeList 设备编号
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    Integer detectorCount(List<String> deviceCodeList, Integer handlingStatus, Integer systemType);
+
+    /**
+     * 事件管理-隐患管理-自动喷水灭火系统-列表查询一
+     *
+     * @param deviceCodeList 设备编号
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param pageNum        当前页
+     * @param pageSize       每页条数
+     * @param systemType     系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     * @return
+     */
+    CommonPage<AlarmDetector> alarDetectorList(List<String> deviceCodeList, Integer handlingStatus, String startDate,
+                                               String endDate, Integer pageNum, Integer pageSize, Integer systemType);
+}

+ 222 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/AlarmDetectorServiceImpl.java

@@ -0,0 +1,222 @@
+package com.usky.fire.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.fire.domain.AlarmDetector;
+import com.usky.fire.mapper.AlarmDetectorMapper;
+import com.usky.fire.service.AlarmDetectorService;
+import com.usky.fire.service.util.OnlineMethod;
+import com.usky.fire.service.vo.AlarmDetectorVo;
+import com.usky.fire.service.vo.AlarmFireStatisticalVo;
+import com.usky.system.model.LoginUser;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 独立式无线探测器告警 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+@Service
+public class AlarmDetectorServiceImpl extends AbstractCrudService<AlarmDetectorMapper, AlarmDetector> implements AlarmDetectorService {
+
+    @Override
+    public CommonPage<AlarmDetectorVo> alarmDetectorLowerList(Integer handlingStatus, String startDate, String endDate,
+                                                              Integer pageNum, Integer pageSize, Integer systemType) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String userType = null;
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        //缺少维保单位部分代码
+        List<String> devcieCodeList = new ArrayList<>();
+        CommonPage<AlarmDetector> alarmDetectorList = this.alarDetectorList(devcieCodeList, handlingStatus, startDate, endDate, pageNum, pageSize, systemType);
+        List<AlarmDetectorVo> list = new ArrayList<>();
+        for (int i = 0; i < alarmDetectorList.getRecords().size(); i++) {
+            AlarmDetectorVo alarmDetectorVo = new AlarmDetectorVo();
+            alarmDetectorVo.setId(alarmDetectorList.getRecords().get(i).getId());
+            alarmDetectorVo.setDataSources(alarmDetectorList.getRecords().get(i).getDataSources());
+            alarmDetectorVo.setDeviceCode(alarmDetectorList.getRecords().get(i).getDeviceCode());
+            alarmDetectorVo.setDataTime(df.format(alarmDetectorList.getRecords().get(i).getDataTime()));
+            alarmDetectorVo.setDeviceStatus(alarmDetectorList.getRecords().get(i).getDeviceStatus());
+            alarmDetectorVo.setAddress(alarmDetectorList.getRecords().get(i).getAddress());
+            alarmDetectorVo.setSystemType(alarmDetectorList.getRecords().get(i).getSystemType());
+            alarmDetectorVo.setAlarmType(alarmDetectorList.getRecords().get(i).getAlarmType());
+            alarmDetectorVo.setBatteryLevel(alarmDetectorList.getRecords().get(i).getBatteryLevel());
+            alarmDetectorVo.setSignalIntensity(alarmDetectorList.getRecords().get(i).getSignalIntensity());
+            alarmDetectorVo.setAlarmValue(alarmDetectorList.getRecords().get(i).getAlarmValue());
+            alarmDetectorVo.setHandler(alarmDetectorList.getRecords().get(i).getHandler());
+            if (alarmDetectorList.getRecords().get(i).getHandlingTime() != null) {
+                alarmDetectorVo.setHandlingTime(df.format(alarmDetectorList.getRecords().get(i).getHandlingTime()));
+            } else {
+                alarmDetectorVo.setHandlingTime(null);
+            }
+            alarmDetectorVo.setHandlingContent(alarmDetectorList.getRecords().get(i).getHandlingContent());
+            alarmDetectorVo.setHandlerPhone(alarmDetectorList.getRecords().get(i).getHandlerPhone());
+            alarmDetectorVo.setHandlingStatus(alarmDetectorList.getRecords().get(i).getHandlingStatus());
+            alarmDetectorVo.setFalseAlarm(alarmDetectorList.getRecords().get(i).getFalseAlarm());
+            alarmDetectorVo.setSitePhoto(alarmDetectorList.getRecords().get(i).getSitePhoto());
+            alarmDetectorVo.setCompanyName("未定义单位表");
+            alarmDetectorVo.setAlarmConten("未定义内容");
+            list.add(alarmDetectorVo);
+        }
+        return new CommonPage<>(list, alarmDetectorList.getTotal(), pageSize, pageNum);
+    }
+
+    @Override
+    public Map<String, Object> detectorStatistics(Integer systemType) {
+        String userType = null;
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        //缺少维保单位部分代码
+        List<String> devcieCodeList = new ArrayList<>();
+
+        int untreated = this.detectorCount(devcieCodeList, 0, systemType);
+        int processed = this.detectorCount(devcieCodeList, 1, systemType);
+//        String disposalRate =  processed / (untreated + processed) + "%";
+        Integer count = untreated + processed;
+        String disposalRate = OnlineMethod.myPercent(processed, count);
+        Map<String, Object> map = new HashMap<>();
+        map.put("untreated", untreated);//告警未处理数
+        map.put("processed", processed);//告警未处理数
+        map.put("disposalRate", disposalRate);//告警处理率
+        map.put("alarmCount", count);//告警总数
+        return map;
+    }
+
+    @Override
+    public Map<String, Object> detectorStatisticalChart(Integer systemType, String startDate, String endDate) {
+        String userType = null;
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        //缺少维保单位部分代码
+        List<String> devcieCodeList = new ArrayList<>();
+        List<AlarmFireStatisticalVo> list = baseMapper.selectAlarmDetectorStatistical(devcieCodeList, systemType, startDate, endDate);
+        List<Integer> alarmCountList = new ArrayList<>();
+        List<Integer> handleCountList = new ArrayList<>();
+        List<String> alarmTimeList = new ArrayList<>();
+        List<String> handleRateList = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            alarmCountList.add(list.get(i).getCount());
+            handleCountList.add(list.get(i).getSum());
+            alarmTimeList.add(list.get(i).getAlarmTime());
+            handleRateList.add(OnlineMethod.myPercent(list.get(i).getSum(), list.get(i).getCount()));
+        }
+        Map<String, Object> map = new HashMap<>();
+        map.put("alarmCountList", alarmCountList);//告警总数
+        map.put("handleCountList", handleCountList);//告警处理数量
+        map.put("alarmTimeList", alarmTimeList);//告警日期
+        map.put("handleRateList", handleRateList);//告警处置占比
+        return map;
+    }
+
+    @Override
+    public void updateAlarmDetector(AlarmDetector alarmDetector) {
+        alarmDetector.setHandler(SecurityUtils.getUsername());
+        alarmDetector.setHandlingTime(LocalDateTime.now());
+        alarmDetector.setHandlingStatus(1);
+        this.updateById(alarmDetector);
+    }
+
+    @Override
+    public List<AlarmDetectorVo> alarmDetectorLowerListExport(Integer handlingStatus, String startDate, String endDate, Integer systemType) {
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String userType = null;
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser != null && !"".equals(loginUser)) {
+            userType = loginUser.getUserType();
+        }
+        //缺少维保单位部分代码
+        List<String> devcieCodeList = new ArrayList<>();
+        CommonPage<AlarmDetector> alarmDetectorList = this.alarDetectorList(devcieCodeList, handlingStatus, startDate, endDate, 0, 0, systemType);
+        List<AlarmDetectorVo> list = new ArrayList<>();
+        for (int i = 0; i < alarmDetectorList.getRecords().size(); i++) {
+            AlarmDetectorVo alarmDetectorVo = new AlarmDetectorVo();
+            alarmDetectorVo.setId(alarmDetectorList.getRecords().get(i).getId());
+            alarmDetectorVo.setDataSources(alarmDetectorList.getRecords().get(i).getDataSources());
+            alarmDetectorVo.setDeviceCode(alarmDetectorList.getRecords().get(i).getDeviceCode());
+            alarmDetectorVo.setDataTime(df.format(alarmDetectorList.getRecords().get(i).getDataTime()));
+            alarmDetectorVo.setDeviceStatus(alarmDetectorList.getRecords().get(i).getDeviceStatus());
+            alarmDetectorVo.setAddress(alarmDetectorList.getRecords().get(i).getAddress());
+            alarmDetectorVo.setSystemType(alarmDetectorList.getRecords().get(i).getSystemType());
+            alarmDetectorVo.setAlarmType(alarmDetectorList.getRecords().get(i).getAlarmType());
+            alarmDetectorVo.setBatteryLevel(alarmDetectorList.getRecords().get(i).getBatteryLevel());
+            alarmDetectorVo.setSignalIntensity(alarmDetectorList.getRecords().get(i).getSignalIntensity());
+            alarmDetectorVo.setAlarmValue(alarmDetectorList.getRecords().get(i).getAlarmValue());
+            alarmDetectorVo.setHandler(alarmDetectorList.getRecords().get(i).getHandler());
+            if (alarmDetectorList.getRecords().get(i).getHandlingTime() != null) {
+                alarmDetectorVo.setHandlingTime(df.format(alarmDetectorList.getRecords().get(i).getHandlingTime()));
+            } else {
+                alarmDetectorVo.setHandlingTime(null);
+            }
+            alarmDetectorVo.setHandlingContent(alarmDetectorList.getRecords().get(i).getHandlingContent());
+            alarmDetectorVo.setHandlerPhone(alarmDetectorList.getRecords().get(i).getHandlerPhone());
+            alarmDetectorVo.setHandlingStatus(alarmDetectorList.getRecords().get(i).getHandlingStatus());
+            alarmDetectorVo.setFalseAlarm(alarmDetectorList.getRecords().get(i).getFalseAlarm());
+            alarmDetectorVo.setSitePhoto(alarmDetectorList.getRecords().get(i).getSitePhoto());
+            alarmDetectorVo.setCompanyName("未定义单位表");
+            alarmDetectorVo.setAlarmConten("未定义内容");
+            list.add(alarmDetectorVo);
+        }
+        return list;
+    }
+
+
+    @Override
+    public Integer detectorCount(List<String> deviceCodeList, Integer handlingStatus, Integer systemType) {
+        LambdaQueryWrapper<AlarmDetector> queryWrapper = Wrappers.lambdaQuery();
+        if (deviceCodeList.size() > 0) {
+            queryWrapper.in(AlarmDetector::getDeviceCode, deviceCodeList);
+        }
+        if (handlingStatus != null) {
+            queryWrapper.eq(AlarmDetector::getHandlingStatus, handlingStatus);
+        }
+        if (systemType != null && systemType != 0) {
+            queryWrapper.eq(AlarmDetector::getSystemType, systemType);
+        }
+        int total = this.count(queryWrapper);
+        return total;
+    }
+
+    public CommonPage<AlarmDetector> alarDetectorList(List<String> deviceCodeList, Integer handlingStatus, String startDate,
+                                                      String endDate, Integer pageNum, Integer pageSize, Integer systemType) {
+        LambdaQueryWrapper<AlarmDetector> queryWrapper = Wrappers.lambdaQuery();
+        if (deviceCodeList.size() > 0) {
+            queryWrapper.in(AlarmDetector::getDeviceCode, deviceCodeList);
+        }
+        if (handlingStatus != null) {
+            queryWrapper.eq(AlarmDetector::getHandlingStatus, handlingStatus);
+        }
+        if (systemType != 0 && systemType != null) {
+            queryWrapper.in(AlarmDetector::getSystemType, systemType);
+        }
+        if (startDate != null && !"".equals(startDate) && endDate != null && !"".equals(endDate)) {
+            queryWrapper.between(AlarmDetector::getDataTime, startDate, endDate);
+        }
+        int total = this.count(queryWrapper);
+        queryWrapper.orderByDesc(AlarmDetector::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + "," + pageSize);
+        }
+        List<AlarmDetector> list = this.list(queryWrapper);
+        return new CommonPage<>(list, total, pageSize, pageNum);
+    }
+}

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/AlarmFireServiceImpl.java

@@ -237,7 +237,7 @@ public class AlarmFireServiceImpl extends AbstractCrudService<AlarmFireMapper, A
     /**
      * 火警告警处置/故障告警处置-数量统计
      *
-     * @param deviceCodeList 单位编号
+     * @param deviceCodeList 设备编号
      * @param handlingStatus 处理状态(0、未处理 1、已处理)
      * @param alarmTypeList  告警类型(2 火警、4 故障、16 监管等)
      * @return

+ 135 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/AlarmDetectorVo.java

@@ -0,0 +1,135 @@
+package com.usky.fire.service.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ruoyi.common.core.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 独立式无线探测器告警
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class AlarmDetectorVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 数据来源
+     */
+    private String dataSources;
+
+    /**
+     * 设备编号
+     */
+    @Excel(name = "设备编号")
+    private String deviceCode;
+
+    /**
+     * 数据上报时间
+     */
+    @Excel(name = "告警时间")
+    private String dataTime;
+
+    /**
+     * 设备状态
+     */
+    private Integer deviceStatus;
+
+    /**
+     * 上报地址
+     */
+    private String address;
+
+    /**
+     * 系统类型(1.火灾自动报警系统 2.自动喷水灭火系统 3.消防给水及消火栓系统 4.防排烟系统 5.电气火灾系统 6.消防视频监控系统)
+     */
+    private Integer systemType;
+
+    /**
+     * 告警类型(如WP1、WP2)
+     */
+    @Excel(name = "告警类型", readConverterExp = "WP1=低压,WP2=高压,LL1=低水位,LL2=高水位")
+    private String alarmType;
+
+    /**
+     * 电池电量
+     */
+    private Integer batteryLevel;
+
+    /**
+     * 信号强度
+     */
+    private String signalIntensity;
+
+    /**
+     * 告警值
+     */
+    @Excel(name = "告警值")
+    private Double alarmValue;
+
+    /**
+     * 处理人
+     */
+    @Excel(name = "处理人")
+    private String handler;
+
+    /**
+     * 处理时间
+     */
+    @Excel(name = "处理时间")
+    private String handlingTime;
+
+    /**
+     * 处理内容
+     */
+    private String handlingContent;
+
+    /**
+     * 处理人电话
+     */
+    private String handlerPhone;
+
+    /**
+     * 处理状态(0、未处理 1、已处理)
+     */
+    @Excel(name = "处理状态", readConverterExp = "0=未处理,1=已处理")
+    private Integer handlingStatus;
+
+    /**
+     * 是否误报(0、非误报 1、误报)
+     */
+    private Integer falseAlarm;
+
+    /**
+     * 现场照片
+     */
+    private String sitePhoto;
+
+    /**
+     * 单位名称
+     */
+    @Excel(name = "单位名称")
+    private String companyName;
+
+    /**
+     * 告警内容
+     */
+    @Excel(name = "告警内容")
+    private String alarmConten;
+
+}

+ 1 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/AlarmFireVo.java

@@ -8,7 +8,6 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
-import java.time.LocalDateTime;
 
 /**
  * <p>
@@ -23,7 +22,7 @@ import java.time.LocalDateTime;
 @Accessors(chain = true)
 public class AlarmFireVo implements Serializable {
 
-    private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;

+ 52 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/AlarmDetectorMapper.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.AlarmDetectorMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.AlarmDetector">
+        <id column="id" property="id"/>
+        <result column="data_sources" property="dataSources"/>
+        <result column="device_code" property="deviceCode"/>
+        <result column="data_time" property="dataTime"/>
+        <result column="device_status" property="deviceStatus"/>
+        <result column="address" property="address"/>
+        <result column="system_type" property="systemType"/>
+        <result column="alarm_type" property="alarmType"/>
+        <result column="battery_level" property="batteryLevel"/>
+        <result column="signal_intensity" property="signalIntensity"/>
+        <result column="alarm_value" property="alarmValue"/>
+        <result column="handler" property="handler"/>
+        <result column="handling_time" property="handlingTime"/>
+        <result column="handling_content" property="handlingContent"/>
+        <result column="handler_phone" property="handlerPhone"/>
+        <result column="handling_status" property="handlingStatus"/>
+        <result column="false_alarm" property="falseAlarm"/>
+        <result column="site_photo" property="sitePhoto"/>
+    </resultMap>
+
+    <select id="selectAlarmDetectorStatistical" resultType="com.usky.fire.service.vo.AlarmFireStatisticalVo">
+        SELECT
+        DATE_FORMAT(data_time, "%Y-%m-%d") AS dataTime,
+        count(*) AS `count`,
+        sum(handling_status) AS `sum`
+        FROM
+        alarm_detector
+        <where>
+            <if test="deviceList != null and deviceList.size() > 0">
+                AND device_code in
+                <foreach item="item" collection="deviceList" open="(" separator="," close=")">
+                    #{item.deviceCode}
+                </foreach>
+            </if>
+            <if test="startDate != null and startDate != '' and startDate != null and startDate != ''">
+                and data_time BETWEEN #{startDate} AND #{endDate}
+            </if>
+            <if test="systemType != null and systemType!=0">
+                AND system_type = #{systemType}
+            </if>
+        </where>
+        GROUP BY
+        data_time
+    </select>
+
+</mapper>