Browse Source

报警历史接口

zhj 2 years atrás
parent
commit
a5bac4ced6
31 changed files with 788 additions and 11 deletions
  1. 194 2
      src/main/java/com/welampiot/controller/AlarmController.java
  2. 16 0
      src/main/java/com/welampiot/dao/AllAlarmInfoLogDao.java
  3. 1 0
      src/main/java/com/welampiot/dao/LampDao.java
  4. 1 0
      src/main/java/com/welampiot/dao/LampPoleDao.java
  5. 2 0
      src/main/java/com/welampiot/dao/ManholeDao.java
  6. 17 0
      src/main/java/com/welampiot/dao/RepairDispatchDao.java
  7. 2 0
      src/main/java/com/welampiot/dao/RepairInfoDao.java
  8. 2 0
      src/main/java/com/welampiot/dao/WaterImmersionDevInfoDao.java
  9. 29 0
      src/main/java/com/welampiot/dto/RepairDispatchDTO.java
  10. 16 0
      src/main/java/com/welampiot/service/AllAlarmInfoLogService.java
  11. 1 0
      src/main/java/com/welampiot/service/LampPoleService.java
  12. 1 0
      src/main/java/com/welampiot/service/LampService.java
  13. 2 0
      src/main/java/com/welampiot/service/ManholeService.java
  14. 17 0
      src/main/java/com/welampiot/service/RepairDispatchService.java
  15. 2 0
      src/main/java/com/welampiot/service/RepairInfoService.java
  16. 5 4
      src/main/java/com/welampiot/service/WaterImmersionDevInfoService.java
  17. 41 1
      src/main/java/com/welampiot/service/impl/AllAlarmInfoLogServiceImpl.java
  18. 5 0
      src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java
  19. 5 0
      src/main/java/com/welampiot/service/impl/LampServiceImpl.java
  20. 5 0
      src/main/java/com/welampiot/service/impl/ManholeServiceImpl.java
  21. 27 0
      src/main/java/com/welampiot/service/impl/RepairDispatchServiceImpl.java
  22. 5 0
      src/main/java/com/welampiot/service/impl/RepairInfoServiceImpl.java
  23. 5 0
      src/main/java/com/welampiot/service/impl/WaterImmersionDevInfoServiceImpl.java
  24. 34 0
      src/main/java/com/welampiot/vo/AlarmRepairInfoVO.java
  25. 306 4
      src/main/resources/mapper/AllAlarmInfoLogMapper.xml
  26. 6 0
      src/main/resources/mapper/LampMapper.xml
  27. 6 0
      src/main/resources/mapper/LampPoleMapper.xml
  28. 6 0
      src/main/resources/mapper/ManholeMapper.xml
  29. 15 0
      src/main/resources/mapper/RepairDispatchMapper.xml
  30. 8 0
      src/main/resources/mapper/RepairInfoMapper.xml
  31. 6 0
      src/main/resources/mapper/WaterImmersionDevInfoMapper.xml

+ 194 - 2
src/main/java/com/welampiot/controller/AlarmController.java

@@ -2,10 +2,12 @@ package com.welampiot.controller;
 
 import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
-import com.welampiot.dto.AllAlarmInfoLogDTO;
-import com.welampiot.service.AllAlarmInfoLogService;
+import com.welampiot.dto.*;
+import com.welampiot.service.*;
 import com.welampiot.utils.ToolUtils;
+import com.welampiot.vo.AlarmRepairInfoVO;
 import com.welampiot.vo.AllAlarmInfoLogVO;
+import com.welampiot.vo.RepairPersonnelDetailsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,8 +18,11 @@ import javax.servlet.http.HttpServletRequest;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * ClassName: AlarmController
@@ -37,6 +42,22 @@ public class AlarmController {
 
     @Autowired
     private ToolUtils toolUtils;
+    @Autowired
+    private LampService lampService;
+    @Autowired
+    private LampPoleService lampPoleService;
+    @Autowired
+    private ManholeService manholeService;
+    @Autowired
+    private ElectricBoxService electricBoxService;
+    @Autowired
+    private WaterImmersionDevInfoService waterImmersionDevInfoService;
+    @Autowired
+    private RepairDispatchService repairDispatchService;
+    @Autowired
+    private RepairInfoService repairInfoService;
+    @Autowired
+    private RepairPersonnelService repairPersonnelService;
 
     /**
      * 获取告警列表
@@ -147,4 +168,175 @@ public class AlarmController {
         allAlarmInfoLogVO1.setTotal(allAlarmInfoLogService.getAlarmTotalByStatus(allAlarmInfoLogVO));
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,allAlarmInfoLogVO1);
     }
+
+    /**
+     * 报警历史
+     * @param request 分页、区域路段筛选、故障类型、设备类型
+     * @return 报警历史列表
+     */
+    @RequestMapping(value = "/history", method = RequestMethod.POST)
+    public BaseResult<?> history(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
+        Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
+        String keyword = (String) toolUtils.getRequestContent(request,"keyword",2);
+        Integer devType = (Integer) toolUtils.getRequestContent(request,"devType",1);
+        int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
+        int count = request.getParameter("count") == null ? 16 : Integer.parseInt(request.getParameter("count"));
+
+        AllAlarmInfoLogVO vo = new AllAlarmInfoLogVO();
+        vo.setLimit(count * (page - 1));
+        vo.setOffset(count);
+        vo.setSectionId(sectionId);
+        vo.setAreaId(areaId);
+        vo.setKeyword(keyword);
+        vo.setVersion(version);
+        vo.setSectionList(toolUtils.getSectionList(request));
+        List<AllAlarmInfoLogDTO> alarmList;
+        List<AllAlarmInfoLogDTO> list = new ArrayList<>();
+        Integer total;
+        switch (devType) {
+            case 5:
+                alarmList = allAlarmInfoLogService.getElectricBoxAlarmListByVO(vo);
+                total = allAlarmInfoLogService.getEleBoxAlarmTotal(vo);
+                break;
+            case 4:
+                alarmList = allAlarmInfoLogService.getWaterImmersionAlarmListByVO(vo);
+                total = allAlarmInfoLogService.getWaterAlarmTotal(vo);
+                break;
+            case 3:
+                alarmList = allAlarmInfoLogService.getManholeAlarmListByVO(vo);
+                total = allAlarmInfoLogService.getManholeAlarmTotal(vo);
+                break;
+            case 2:
+                alarmList = allAlarmInfoLogService.getLampPoleAlarmListByVO(vo);
+                total = allAlarmInfoLogService.getLampPoleAlarmTotal(vo);
+                break;
+            case 1:
+                alarmList = allAlarmInfoLogService.getLampAlarmListByVO(vo);
+                total = allAlarmInfoLogService.getLampAlarmTotal(vo);
+                break;
+            default:
+                List<AllAlarmInfoLogDTO> eleBoxList = allAlarmInfoLogService.getElectricBoxAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> waterList = allAlarmInfoLogService.getWaterImmersionAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> lampPoleList = allAlarmInfoLogService.getLampPoleAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> lampList = allAlarmInfoLogService.getLampAlarmListByVO(vo);
+                List<AllAlarmInfoLogDTO> manholeList = allAlarmInfoLogService.getManholeAlarmListByVO(vo);
+                // 将配电箱、水浸、灯杆、路灯、井盖合并成一个列表
+                alarmList = Stream.of(eleBoxList, waterList, lampPoleList, lampList, manholeList)
+                        .flatMap(Collection::stream)
+                        .collect(Collectors.toList());
+                Integer eleBoxAlarmTotal = allAlarmInfoLogService.getEleBoxAlarmTotal(vo);
+                Integer lampPoleAlarmTotal = allAlarmInfoLogService.getLampPoleAlarmTotal(vo);
+                Integer lampAlarmTotal = allAlarmInfoLogService.getLampAlarmTotal(vo);
+                Integer waterAlarmTotal = allAlarmInfoLogService.getWaterAlarmTotal(vo);
+                Integer manholeAlarmTotal = allAlarmInfoLogService.getManholeAlarmTotal(vo);
+                total = eleBoxAlarmTotal + lampAlarmTotal + lampPoleAlarmTotal + waterAlarmTotal + manholeAlarmTotal;
+                break;
+        }
+        alarmList.forEach(dto -> {
+            if (dto.getArea() == null) {
+                dto.setArea("");
+            }
+            if (dto.getSection() == null) {
+                dto.setSection("");
+            }
+            if (dto.getNumber() == null) {
+                dto.setNumber("");
+            }
+            if (dto.getName() == null) {
+                dto.setName("");
+            }
+            if (dto.getLongitude() == null) {
+                dto.setLongitude("0");
+            }
+            if (dto.getLatitude() == null) {
+                dto.setLatitude("0");
+            }
+            list.add(dto);
+        });
+        AllAlarmInfoLogVO allAlarmInfoLogVO = new AllAlarmInfoLogVO();
+        allAlarmInfoLogVO.setList(list);
+        allAlarmInfoLogVO.setTotal((int) Math.ceil(total / Double.parseDouble(String.valueOf(count))));
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,allAlarmInfoLogVO);
+    }
+
+    /**
+     * 维修信息
+     * @param request 故障id
+     * @return 维修信息
+     */
+    @RequestMapping(value = "/info", method = RequestMethod.POST)
+    public BaseResult<?> info(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        if (id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        AllAlarmInfoLogDTO alarmDTO = allAlarmInfoLogService.getAlarmInfoDTOById(id,version);
+        if (alarmDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+        AlarmRepairInfoVO alarmRepairInfoVO = new AlarmRepairInfoVO();
+        alarmRepairInfoVO.setArea(alarmDTO.getArea());
+        alarmRepairInfoVO.setSection(alarmRepairInfoVO.getSection());
+        alarmRepairInfoVO.setAlarmType(alarmRepairInfoVO.getAlarmType());
+        if (alarmDTO.getStatus() == 0) {
+            alarmRepairInfoVO.setAlarmStatus("未完成");
+        } else if (alarmDTO.getStatus() == 1) {
+            alarmRepairInfoVO.setAlarmStatus("处理中");
+        } else  {
+            alarmRepairInfoVO.setAlarmStatus("已完成");
+        }
+        RepairDispatchDTO repairDispatchDTO = repairDispatchService.getRepairDispatchByAlarmId(alarmDTO.getId());
+        RepairInfoDTO repairInfoDTO = repairInfoService.getRepairInfoDTOByAlarmId(alarmDTO.getId());
+        if (repairInfoDTO == null || repairDispatchDTO == null)
+            return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+        alarmRepairInfoVO.setRepairUser(repairInfoDTO.getRepairTime());
+        alarmRepairInfoVO.setRepairUser(repairInfoDTO.getUsername());
+        alarmRepairInfoVO.setDispatchTime(repairDispatchDTO.getUpdateTime());
+        if (alarmDTO.getDevType() == 0) { // 路灯
+            LampInfoDTO lampInfoDTO = lampService.getLampInfoDTOById(alarmDTO.getLampId());
+            alarmRepairInfoVO.setNumber(lampInfoDTO.getNumber());
+        } else if (alarmDTO.getDevType() == 1) { // 灯杆
+            LampPoleDTO lampPoleDTO = lampPoleService.getLampPoleDTOById(alarmDTO.getLampId());
+            alarmRepairInfoVO.setNumber(lampPoleDTO.getNumber());
+        } else if (alarmDTO.getDevType() == 2) { // 井盖
+            ManholeDTO manholeDTO = manholeService.getManholeDTOById(alarmDTO.getLampId());
+            alarmRepairInfoVO.setNumber(manholeDTO.getAddress());
+        } else if (alarmDTO.getDevType() == 3) { // 水浸
+            WaterImmersionDevInfoDTO waterDTO = waterImmersionDevInfoService.getWaterDTOById(alarmDTO.getLampId());
+            alarmRepairInfoVO.setNumber(waterDTO.getNumber());
+        } else if (alarmDTO.getDevType() == 4) { // 配电箱
+            ElectricBoxDTO electricBoxDTO = electricBoxService.getDetailsById(alarmDTO.getLampId());
+            alarmRepairInfoVO.setNumber(electricBoxDTO.getAddress());
+        }
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,alarmRepairInfoVO);
+    }
+
+    /**
+     * 维修人
+     * @param request 故障id
+     * @return 维修人信息
+     */
+    @RequestMapping(value = "/repairUser", method = RequestMethod.POST)
+    public BaseResult<?> repairUser(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        if (id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        RepairInfoDTO dto = repairInfoService.getRepairInfoDTOByAlarmId(id);
+        if (dto == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+        RepairPersonnelDetailsVO vo = repairPersonnelService.getDetailsByRepairPersonnelDTO(dto.getRepairUserid());
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
+    }
+
+    /**
+     * 删除告警信息
+     * @param request 故障id
+     * @return 删除数据
+     */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    public BaseResult<?> del(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer id = (Integer) toolUtils.getRequestContent(request,"id",1);
+        if (id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        allAlarmInfoLogService.deleteAlarmData(id);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
+    }
 }

+ 16 - 0
src/main/java/com/welampiot/dao/AllAlarmInfoLogDao.java

@@ -28,4 +28,20 @@ public interface AllAlarmInfoLogDao {
     Integer getAlarmHandlingCount(OperationVO vo);
 
     Integer getAlarmHandledCount(OperationVO vo);
+
+    List<AllAlarmInfoLogDTO> getManholeAlarmListByVO(AllAlarmInfoLogVO vo);
+
+    Integer getLampPoleAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getLampAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getEleBoxAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getWaterAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getManholeAlarmTotal(AllAlarmInfoLogVO vo);
+
+    AllAlarmInfoLogDTO getAlarmInfoDTOById(@Param("id") Integer id, @Param("version") Integer version);
+
+    void deleteAlarmData(@Param("id") Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/LampDao.java

@@ -34,4 +34,5 @@ public interface LampDao {
     void changeLampLocationById(LampInfoDTO dto);
     Integer getSectionOfLampCountBySectionId(@Param("id") Integer id);
     String getNameOrNumber(@Param("type") Integer type,@Param("value") Integer value,@Param("version") Integer version);
+    LampInfoDTO getLampInfoDTOById(@Param("id") Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/LampPoleDao.java

@@ -30,4 +30,5 @@ public interface LampPoleDao {
     Integer getBroadcastCount(LampPoleDTO dto);
     Integer getSectionIdByLampPoleId(@Param("id") Integer id);
     void changeLampPoleLocationById(LampPoleDTO dto);
+    LampPoleDTO getLampPoleDTOById(@Param("id") Integer id);
 }

+ 2 - 0
src/main/java/com/welampiot/dao/ManholeDao.java

@@ -40,4 +40,6 @@ public interface ManholeDao {
     void deleteManholeLogDataById(@Param("id") Integer id);
 
     void changeManholeLocationById(ManholeDTO dto);
+
+    ManholeDTO getManholeDTOById(@Param("id") Integer id);
 }

+ 17 - 0
src/main/java/com/welampiot/dao/RepairDispatchDao.java

@@ -0,0 +1,17 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.RepairDispatchDTO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * ClassName: RepairDispatchDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/13 - 16:55
+ * @Version: v1.0
+ */
+public interface RepairDispatchDao {
+    RepairDispatchDTO getRepairDispatchByAlarmId(@Param("alarmId") Integer alarmId);
+}

+ 2 - 0
src/main/java/com/welampiot/dao/RepairInfoDao.java

@@ -18,4 +18,6 @@ public interface RepairInfoDao {
     List<RepairInfoDTO> getRepairInfoByDTO(RepairInfoDTO dto);
 
     void deleteRepairInfoDataById(@Param("id") Integer id);
+
+    RepairInfoDTO getRepairInfoDTOByAlarmId(@Param("alarmId") Integer alarmId);
 }

+ 2 - 0
src/main/java/com/welampiot/dao/WaterImmersionDevInfoDao.java

@@ -35,4 +35,6 @@ public interface WaterImmersionDevInfoDao {
     void deleteWaterImmersionDataByDTO(@Param("id") Integer id);
 
     void deleteWaterImmersionLogDataByDTO(@Param("id") Integer id);
+
+    WaterImmersionDevInfoDTO getWaterDTOById(@Param("id") Integer id);
 }

+ 29 - 0
src/main/java/com/welampiot/dto/RepairDispatchDTO.java

@@ -0,0 +1,29 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: RepairDispatchDTO
+ * Package: com.welampiot.dto
+ * Description: 维修调度信息表
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/13 - 16:45
+ * @Version: v1.0
+ */
+@Data
+public class RepairDispatchDTO implements Serializable {
+    private Integer id;
+
+    private Integer repairUserid; // 调度人员id
+
+    private String finishTime; // 实际完成时间
+
+    private String updateTime; // 创建时间
+
+    private Integer alarmId; // 告警id
+
+    private Integer lampId; // 路灯id
+}

+ 16 - 0
src/main/java/com/welampiot/service/AllAlarmInfoLogService.java

@@ -27,4 +27,20 @@ public interface AllAlarmInfoLogService {
     Integer getAlarmHandlingCount(OperationVO vo);
 
     Integer getAlarmHandledCount(OperationVO vo);
+
+    List<AllAlarmInfoLogDTO> getManholeAlarmListByVO(AllAlarmInfoLogVO vo);
+
+    Integer getLampPoleAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getLampAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getEleBoxAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getWaterAlarmTotal(AllAlarmInfoLogVO vo);
+
+    Integer getManholeAlarmTotal(AllAlarmInfoLogVO vo);
+
+    AllAlarmInfoLogDTO getAlarmInfoDTOById(Integer id, Integer version);
+
+    void deleteAlarmData(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/service/LampPoleService.java

@@ -24,4 +24,5 @@ public interface LampPoleService {
     LampPoleInfoVO getLampPoleCount(LampPoleDTO lampPoleDTO, LampInfoDTO lampInfoDTO);
     Integer getSectionIdByLampPoleId(Integer id);
     void changeLampPoleLocationById(LampPoleDTO dto);
+    LampPoleDTO getLampPoleDTOById(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/service/LampService.java

@@ -36,4 +36,5 @@ public interface LampService {
     void changeLampLocationById(LampInfoDTO dto);
     Integer getSectionOfLampCountBySectionId(Integer id);
     String getNameOrNumber(Integer type,Integer value,Integer version);
+    LampInfoDTO getLampInfoDTOById(@Param("id") Integer id);
 }

+ 2 - 0
src/main/java/com/welampiot/service/ManholeService.java

@@ -33,4 +33,6 @@ public interface ManholeService {
     void deleteManholeLogDataById(@Param("id") Integer id);
 
     void changeManholeLocationById(ManholeDTO dto);
+
+    ManholeDTO getManholeDTOById(@Param("id") Integer id);
 }

+ 17 - 0
src/main/java/com/welampiot/service/RepairDispatchService.java

@@ -0,0 +1,17 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.RepairDispatchDTO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * ClassName: RepairDispatchService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/13 - 16:57
+ * @Version: v1.0
+ */
+public interface RepairDispatchService {
+    RepairDispatchDTO getRepairDispatchByAlarmId(@Param("alarmId") Integer alarmId);
+}

+ 2 - 0
src/main/java/com/welampiot/service/RepairInfoService.java

@@ -16,4 +16,6 @@ public interface RepairInfoService {
     RepairInfoVO getRepairInfoByDTO(RepairInfoDTO dto);
 
     void deleteRepairInfoDataById(Integer id);
+
+    RepairInfoDTO getRepairInfoDTOByAlarmId(Integer alarmId);
 }

+ 5 - 4
src/main/java/com/welampiot/service/WaterImmersionDevInfoService.java

@@ -4,7 +4,6 @@ import com.welampiot.dto.WaterImmersionDevInfoDTO;
 import com.welampiot.dto.WaterImmersionDevInfoLogDTO;
 import com.welampiot.vo.WaterImmersionDevInfoLogVO;
 import com.welampiot.vo.WaterImmersionDevInfoVO;
-import org.apache.ibatis.annotations.Param;
 
 /**
  * ClassName: WaterImmersionDevInfoService
@@ -24,9 +23,11 @@ public interface WaterImmersionDevInfoService {
 
     Integer findByWaterImmersionDTO(WaterImmersionDevInfoDTO dto);
 
-    Integer findSectionIdById(@Param("id") Integer id);
+    Integer findSectionIdById(Integer id);
 
-    void deleteWaterImmersionDataByDTO(@Param("id") Integer id);
+    void deleteWaterImmersionDataByDTO(Integer id);
 
-    void deleteWaterImmersionLogDataByDTO(@Param("id") Integer id);
+    void deleteWaterImmersionLogDataByDTO(Integer id);
+
+    WaterImmersionDevInfoDTO getWaterDTOById(Integer id);
 }

+ 41 - 1
src/main/java/com/welampiot/service/impl/AllAlarmInfoLogServiceImpl.java

@@ -135,7 +135,7 @@ public class AllAlarmInfoLogServiceImpl implements AllAlarmInfoLogService {
 
     @Override
     public Integer getAlarmUntreatedCount(OperationVO vo) {
-        return allAlarmInfoLogDao.getAlarmHandledCount(vo);
+        return allAlarmInfoLogDao.getAlarmUntreatedCount(vo);
     }
 
     @Override
@@ -147,4 +147,44 @@ public class AllAlarmInfoLogServiceImpl implements AllAlarmInfoLogService {
     public Integer getAlarmHandledCount(OperationVO vo) {
         return allAlarmInfoLogDao.getAlarmHandledCount(vo);
     }
+
+    @Override
+    public List<AllAlarmInfoLogDTO> getManholeAlarmListByVO(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getManholeAlarmListByVO(vo);
+    }
+
+    @Override
+    public Integer getLampPoleAlarmTotal(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getLampPoleAlarmTotal(vo);
+    }
+
+    @Override
+    public Integer getLampAlarmTotal(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getLampAlarmTotal(vo);
+    }
+
+    @Override
+    public Integer getEleBoxAlarmTotal(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getEleBoxAlarmTotal(vo);
+    }
+
+    @Override
+    public Integer getWaterAlarmTotal(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getWaterAlarmTotal(vo);
+    }
+
+    @Override
+    public Integer getManholeAlarmTotal(AllAlarmInfoLogVO vo) {
+        return allAlarmInfoLogDao.getManholeAlarmTotal(vo);
+    }
+
+    @Override
+    public AllAlarmInfoLogDTO getAlarmInfoDTOById(Integer id, Integer version) {
+        return allAlarmInfoLogDao.getAlarmInfoDTOById(id, version);
+    }
+
+    @Override
+    public void deleteAlarmData(Integer id) {
+        allAlarmInfoLogDao.deleteAlarmData(id);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java

@@ -403,4 +403,9 @@ public class LampPoleServiceImpl implements LampPoleService {
     public void changeLampPoleLocationById(LampPoleDTO dto) {
         lampPoleDao.changeLampPoleLocationById(dto);
     }
+
+    @Override
+    public LampPoleDTO getLampPoleDTOById(Integer id) {
+        return lampPoleDao.getLampPoleDTOById(id);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/LampServiceImpl.java

@@ -345,4 +345,9 @@ public class LampServiceImpl implements LampService {
     public String getNameOrNumber(Integer type, Integer value, Integer version) {
         return lampDao.getNameOrNumber(type, value, version);
     }
+
+    @Override
+    public LampInfoDTO getLampInfoDTOById(Integer id) {
+        return lampDao.getLampInfoDTOById(id);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/ManholeServiceImpl.java

@@ -255,4 +255,9 @@ public class ManholeServiceImpl implements ManholeService {
     public void changeManholeLocationById(ManholeDTO dto) {
         manholeDao.changeManholeLocationById(dto);
     }
+
+    @Override
+    public ManholeDTO getManholeDTOById(Integer id) {
+        return manholeDao.getManholeDTOById(id);
+    }
 }

+ 27 - 0
src/main/java/com/welampiot/service/impl/RepairDispatchServiceImpl.java

@@ -0,0 +1,27 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.RepairDispatchDao;
+import com.welampiot.dto.RepairDispatchDTO;
+import com.welampiot.service.RepairDispatchService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * ClassName: RepairDispatchServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/13 - 16:57
+ * @Version: v1.0
+ */
+@Service
+public class RepairDispatchServiceImpl implements RepairDispatchService {
+    @Autowired
+    private RepairDispatchDao repairDispatchDao;
+
+    @Override
+    public RepairDispatchDTO getRepairDispatchByAlarmId(Integer alarmId) {
+        return repairDispatchDao.getRepairDispatchByAlarmId(alarmId);
+    }
+}

+ 5 - 0
src/main/java/com/welampiot/service/impl/RepairInfoServiceImpl.java

@@ -67,4 +67,9 @@ public class RepairInfoServiceImpl implements RepairInfoService {
     public void deleteRepairInfoDataById(Integer id) {
         repairInfoDao.deleteRepairInfoDataById(id);
     }
+
+    @Override
+    public RepairInfoDTO getRepairInfoDTOByAlarmId(Integer alarmId) {
+        return repairInfoDao.getRepairInfoDTOByAlarmId(alarmId);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/WaterImmersionDevInfoServiceImpl.java

@@ -280,4 +280,9 @@ public class WaterImmersionDevInfoServiceImpl implements WaterImmersionDevInfoSe
     public void deleteWaterImmersionLogDataByDTO(Integer id) {
         waterImmersionDevInfoDao.deleteWaterImmersionLogDataByDTO(id);
     }
+
+    @Override
+    public WaterImmersionDevInfoDTO getWaterDTOById(Integer id) {
+        return waterImmersionDevInfoDao.getWaterDTOById(id);
+    }
 }

+ 34 - 0
src/main/java/com/welampiot/vo/AlarmRepairInfoVO.java

@@ -0,0 +1,34 @@
+package com.welampiot.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: AlarmRepariInfoVO
+ * Package: com.welampiot.vo
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/7/13 - 17:54
+ * @Version: v1.0
+ */
+@Data
+public class AlarmRepairInfoVO implements Serializable {
+
+    private String area;
+
+    private String section;
+
+    private String number;
+
+    private String alarmType;
+
+    private String alarmStatus;
+
+    private String repairUser;
+
+    private String repairTime;
+
+    private String dispatchTime;
+}

+ 306 - 4
src/main/resources/mapper/AllAlarmInfoLogMapper.xml

@@ -170,7 +170,7 @@
     
     <select id="getLampAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
         select
-            a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+            a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
             s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
             <choose>
                 <when test="version == 0">
@@ -233,6 +233,9 @@
         <if test="alarmType != null and alarmType != ''">
             and a.stralarmtype like '%${alarmType}%'
         </if>
+        <if test="keyword != null and keyword != ''">
+            and l.number like '%${keyword}%'
+        </if>
         <if test="limit >= 0 and offset > 0">
             limit #{limit},#{offset}
         </if>
@@ -240,7 +243,7 @@
 
     <select id="getLampPoleAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
         select
-        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
         s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
         <choose>
             <when test="version == 0">
@@ -303,6 +306,9 @@
         <if test="alarmType != null and alarmType != ''">
             and a.stralarmtype like '%${alarmType}%'
         </if>
+        <if test="keyword != null and keyword != ''">
+            and l.number like '%${keyword}%'
+        </if>
         <if test="limit >= 0 and offset > 0">
             limit #{limit},#{offset}
         </if>
@@ -310,7 +316,7 @@
 
     <select id="getWaterImmersionAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
         select
-        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
         s.name as section,a.devType,w.number,lp.longitude,lp.latitude,w.name
         <choose>
             <when test="version == 0">
@@ -374,6 +380,9 @@
         <if test="alarmType != null and alarmType != ''">
             and a.stralarmtype like '%${alarmType}%'
         </if>
+        <if test="keyword != null and keyword != ''">
+            and w.number like '%${keyword}%'
+        </if>
         <if test="limit >= 0 and offset > 0">
             limit #{limit},#{offset}
         </if>
@@ -381,7 +390,7 @@
 
     <select id="getElectricBoxAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
         select
-        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
         s.name as section,a.devType,e.address as `number`,e.longitude,e.latitude,e.name
         <choose>
             <when test="version == 0">
@@ -444,6 +453,82 @@
         <if test="alarmType != null and alarmType != ''">
             and a.stralarmtype like '%${alarmType}%'
         </if>
+        <if test="keyword != null and keyword != ''">
+            and e.address like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getManholeAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
+        select
+        a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
+        s.name as section,a.devType,m.address as `number`,m.longitude,m.latitude,m.name
+        <choose>
+            <when test="version == 0">
+                ,gl.chinese_name as area
+            </when>
+            <when test="version == 1">
+                ,gl.english_name as area
+            </when>
+            <otherwise>
+                ,gl.ru_name as area
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl1.chinese_name as city
+            </when>
+            <when test="version == 1">
+                ,gl1.english_name as city
+            </when>
+            <otherwise>
+                ,gl1.ru_name as city
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="version == 0">
+                ,gl2.chinese_name as province
+            </when>
+            <when test="version == 1">
+                ,gl2.english_name as province
+            </when>
+            <otherwise>
+                ,gl2.ru_name as province
+            </otherwise>
+        </choose>
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join manhole m on a.lampid = m.id
+        where a.devType = 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.address like '%${keyword}%'
+        </if>
         <if test="limit >= 0 and offset > 0">
             limit #{limit},#{offset}
         </if>
@@ -540,4 +625,221 @@
         </if>
     </select>
 
+    <select id="getManholeAlarmTotal" resultType="Integer">
+        select count(*)
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join manhole m on a.lampid = m.id
+        where a.devType = 2
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.address like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getLampAlarmTotal" resultType="Integer">
+        select count(*)
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lampinfo m on a.lampid = m.id
+        where a.devType = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.number like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getLampPoleAlarmTotal" resultType="Integer">
+        select count(*)
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lamp_pole m on a.lampid = m.id
+        where a.devType = 1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.number like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getEleBoxAlarmTotal" resultType="Integer">
+        select count(*)
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join electric_box m on a.lampid = m.id
+        where a.devType = 4
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.address like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getWaterAlarmTotal" resultType="Integer">
+        select count(*)
+        from all_alarm_info_log a
+        left join section s on a.sectionId = s.id
+        left join global_location gl on s.pid = gl.id
+        left join global_location gl1 on gl.pid = gl1.id
+        left join global_location gl2 on gl1.pid = gl2.id
+        left join lamp_pole lp on a.lampid = lp.id
+        left join water_immersion_dev_info m on m.lamp_pole_id = lp.id
+        where a.devType = 3
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and a.sectionId in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            and s.id = #{sectionId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            and gl.id = #{areaId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            and gl1.id = #{cityId}
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            and gl2.id = #{provinceId}
+        </if>
+        <if test="alarmType != null and alarmType != ''">
+            and a.stralarmtype like '%${alarmType}%'
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and m.number like '%${keyword}%'
+        </if>
+        <if test="limit >= 0 and offset > 0">
+            limit #{limit},#{offset}
+        </if>
+    </select>
+
+    <select id="getAlarmInfoDTOById" resultType="AllAlarmInfoLogDTO">
+        select
+            a.id,a.devType,a.lampid,s.name as section,a.alarmtype as alarmType,a.status
+            <choose>
+                <when test="version == 0">
+                    ,gl.chinese_name as area
+                </when>
+                <when test="version == 1">
+                    ,gl.english_name as area
+                </when>
+                <otherwise>
+                    ,gl.ru_name as area
+                </otherwise>
+            </choose>
+        from all_alarm_info_log a
+        left join section s on s.id = a.sectionId
+        left join global_location gl on s.pid = gl.id
+        where a.id = #{id}
+    </select>
+
+    <delete id="deleteAlarmData">
+        delete
+        from all_alarm_info_log
+        where id = #{id};
+    </delete>
+
 </mapper>

+ 6 - 0
src/main/resources/mapper/LampMapper.xml

@@ -647,5 +647,11 @@
             </when>
         </choose>
     </select>
+
+    <select id="getLampInfoDTOById" resultType="com.welampiot.dto.LampInfoDTO">
+        select l.id,l.number
+        from lampinfo l
+        where l.id = #{id}
+    </select>
     
 </mapper>

+ 6 - 0
src/main/resources/mapper/LampPoleMapper.xml

@@ -436,5 +436,11 @@
             l.latitude = #{latitude}
         where l.id = #{id}
     </update>
+
+    <select id="getLampPoleDTOById" resultType="LampPoleDTO">
+        select l.id,l.number
+        from lamp_pole l
+        where l.id = #{id}
+    </select>
     
 </mapper>

+ 6 - 0
src/main/resources/mapper/ManholeMapper.xml

@@ -174,4 +174,10 @@
         where m.id = #{id}
     </update>
 
+    <select id="getManholeDTOById" resultType="ManholeDTO">
+        select m.id,m.address
+        from manhole m
+        where m.id = #{id}
+    </select>
+
 </mapper>

+ 15 - 0
src/main/resources/mapper/RepairDispatchMapper.xml

@@ -0,0 +1,15 @@
+<?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.welampiot.dao.RepairDispatchDao">
+
+    <select id="getRepairDispatchByAlarmId" resultType="RepairDispatchDTO">
+        select
+            r.id,
+            r.updatetime as updateTime
+        from repair_dispatch r
+        where r.alarmid = #{alarmId}
+        order by updateTime desc
+        limit 1
+    </select>
+
+</mapper>

+ 8 - 0
src/main/resources/mapper/RepairInfoMapper.xml

@@ -16,5 +16,13 @@
         from repair_info
         where id = #{id};
     </delete>
+
+    <select id="getRepairInfoDTOByAlarmId" resultType="RepairInfoDTO">
+        select r.id,r.repair_time as repairTime,r.user_name as username,r.repair_userid as repairUserid
+        from repair_info r
+        where r.alarmid = #{alarmId}
+        order by r.repair_time desc
+        limit 1
+    </select>
     
 </mapper>

+ 6 - 0
src/main/resources/mapper/WaterImmersionDevInfoMapper.xml

@@ -141,4 +141,10 @@
         where water_immersion_id = #{id};
     </delete>
 
+    <select id="getWaterDTOById" resultType="WaterImmersionDevInfoDTO">
+        select w.id,w.number
+        from water_immersion_dev_info w
+        where w.id = #{id}
+    </select>
+
 </mapper>