大屏 - 组塔检测
This commit is contained in:
parent
c5ec741499
commit
bae27c5ea2
|
|
@ -0,0 +1,17 @@
|
|||
package com.securitycontrol.entity.screen.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class TowerAssInspectDto extends ScreenDto {
|
||||
|
||||
@ApiModelProperty("杆塔id")
|
||||
private String gtId;
|
||||
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.securitycontrol.entity.screen.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class TowerAssInspectVo {
|
||||
@ApiModelProperty("设备id")
|
||||
private String deviceId;
|
||||
@ApiModelProperty("设备名称")
|
||||
private String deviceName;
|
||||
@ApiModelProperty("设备类别")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("实时检测类别")
|
||||
private String dataType;
|
||||
@ApiModelProperty("采集值")
|
||||
private String val;
|
||||
|
||||
@ApiModelProperty("告警内容")
|
||||
private String warnContent;
|
||||
@ApiModelProperty("预警时间")
|
||||
private String warnTime;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("检测点名称")
|
||||
private String modeName;
|
||||
|
||||
@ApiModelProperty("本次变化值")
|
||||
private String thisChangeVal;
|
||||
|
||||
@ApiModelProperty("累计变化值")
|
||||
private String changeVal;
|
||||
|
||||
@ApiModelProperty("检测时间")
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String isWarn;
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,98 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
import com.securitycontrol.common.log.enums.OperationType;
|
||||
import com.securitycontrol.entity.screen.dto.TowerAssInspectDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
import com.securitycontrol.entity.screen.vo.TowerAssInspectVo;
|
||||
import com.securitycontrol.screen.service.TowerAssInspectService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
* 组塔检测
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/largeScreen/towerAssInspect/")
|
||||
@Slf4j
|
||||
public class TowerAssInspectController extends BaseController {
|
||||
|
||||
@Resource(name = "TowerAssInspectService")
|
||||
private TowerAssInspectService service;
|
||||
|
||||
/**
|
||||
* 设备列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "设备列表")
|
||||
@GetMapping("getDeviceList")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->设备列表", grade = OperationType.QUERY_BUSINESS, details = "查询设备列表", type = "业务日志")
|
||||
public AjaxResult getDeviceList(TowerAssInspectDto dto) {
|
||||
return service.getDeviceList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时检测
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "实时检测")
|
||||
@GetMapping("getRealTimeDetection ")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->实时检测", grade = OperationType.QUERY_BUSINESS, details = "查询实时检测", type = "业务日志")
|
||||
public AjaxResult getRealTimeDetection(TowerAssInspectDto dto) {
|
||||
return service.getRealTimeDetection(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当日检测变化趋势
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "当日检测变化趋势")
|
||||
@GetMapping("getTrend ")
|
||||
@Log(title = "组塔检测", menu = "组塔检测->当日检测变化趋势", grade = OperationType.QUERY_BUSINESS, details = "查询当日检测变化趋势", type = "业务日志")
|
||||
public AjaxResult getTrend(TowerAssInspectDto dto) {
|
||||
return service.getTrend(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "实时告警")
|
||||
@GetMapping("getRealTimeAlarmList")
|
||||
@Log(title = "实时告警", menu = "告警管理->实时告警", grade = OperationType.QUERY_BUSINESS, details = "查询实时告警列表", type = "业务日志")
|
||||
public TableDataInfo getRealTimeAlarmList(TowerAssInspectDto dto) {
|
||||
try{
|
||||
startLayPage();
|
||||
List<TowerAssInspectVo> list = service.getRealTimeAlarmList(dto);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "历史记录")
|
||||
@GetMapping("getHistoryList")
|
||||
@Log(title = "历史记录", menu = "告警管理->历史记录", grade = OperationType.QUERY_BUSINESS, details = "查询历史记录列表", type = "业务日志")
|
||||
public TableDataInfo getHistoryList(TowerAssInspectDto dto) {
|
||||
try{
|
||||
startLayPage();
|
||||
List<TowerAssInspectVo> list = service.getHistoryList(dto);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,24 @@
|
|||
package com.securitycontrol.screen.mapper;
|
||||
|
||||
import com.securitycontrol.entity.screen.dto.TowerAssInspectDto;
|
||||
import com.securitycontrol.entity.screen.vo.TowerAssInspectVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
* 组塔检测
|
||||
*/
|
||||
@Repository(value = "TowerAssInspectMapper")
|
||||
public interface TowerAssInspectMapper {
|
||||
List<TowerAssInspectVo> getDeviceList(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getRealTimeDetection(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getTrend(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getRealTimeAlarmList(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getHistoryList(TowerAssInspectDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,25 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.TowerAssInspectDto;
|
||||
import com.securitycontrol.entity.screen.vo.TowerAssInspectVo;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
* 组塔检测
|
||||
*/
|
||||
public interface TowerAssInspectService {
|
||||
|
||||
AjaxResult getDeviceList(TowerAssInspectDto dto);
|
||||
|
||||
AjaxResult getRealTimeDetection(TowerAssInspectDto dto);
|
||||
|
||||
AjaxResult getTrend(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getRealTimeAlarmList(TowerAssInspectDto dto);
|
||||
|
||||
List<TowerAssInspectVo> getHistoryList(TowerAssInspectDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.TowerAssInspectDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
import com.securitycontrol.entity.screen.vo.TowerAssInspectVo;
|
||||
import com.securitycontrol.entity.system.TreeBuild;
|
||||
import com.securitycontrol.entity.system.vo.TreeNode;
|
||||
import com.securitycontrol.screen.mapper.TowerAssInspectMapper;
|
||||
import com.securitycontrol.screen.service.TowerAssInspectService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lsun
|
||||
* 组塔检测
|
||||
*/
|
||||
@Slf4j
|
||||
@Service(value = "TowerAssInspectService")
|
||||
public class TowerAssInspectServiceImpl implements TowerAssInspectService {
|
||||
@Resource(name = "TowerAssInspectMapper")
|
||||
private TowerAssInspectMapper mapper;
|
||||
|
||||
/**
|
||||
* 设备列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getDeviceList(TowerAssInspectDto dto) {
|
||||
List<TowerAssInspectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDeviceList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("设备列表-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getRealTimeDetection(TowerAssInspectDto dto) {
|
||||
List<TowerAssInspectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getRealTimeDetection(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("实时检测-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTrend(TowerAssInspectDto dto) {
|
||||
List<TowerAssInspectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getTrend(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("当日检测变化趋势-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TowerAssInspectVo> getRealTimeAlarmList(TowerAssInspectDto dto) {
|
||||
List<TowerAssInspectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getRealTimeAlarmList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取实时告警列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TowerAssInspectVo> getHistoryList(TowerAssInspectDto dto) {
|
||||
List<TowerAssInspectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getHistoryList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取历史记录列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<select id="getAlarmMgeList" resultType="com.securitycontrol.entity.screen.vo.AlarmMgeVo">
|
||||
SELECT tw.warn_id as warnId,
|
||||
sb.city_name AS name,
|
||||
sb.city_name AS orgName,
|
||||
sb.org_id AS orgId,
|
||||
tp.pro_id as proId,
|
||||
tp.pro_name as proName,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
<?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.securitycontrol.screen.mapper.TowerAssInspectMapper">
|
||||
|
||||
<select id="getDeviceList" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
|
||||
SELECT tbd.device_id as deviceId,tbd.device_name as deviceName,
|
||||
CASE
|
||||
WHEN tbd.`status` = '1' AND tdv.is_warn = '1' THEN '2'
|
||||
WHEN tbd.`status` = '1' AND tdv.is_warn = '0' THEN '1'
|
||||
WHEN tbd.`status` = '0' THEN '0'
|
||||
END type
|
||||
FROM t_pro_gt tpg
|
||||
LEFT JOIN tb_bd_device tbd ON tpg.gt_id = tbd.gt_id
|
||||
LEFT JOIN tb_device_detail tdd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
|
||||
WHERE tpg.gt_id = #{gtId}
|
||||
</select>
|
||||
|
||||
<select id="getRealTimeDetection" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
|
||||
SELECT CASE WHEN tdd.data_type = '3331' THEN '1'
|
||||
WHEN tdd.data_type = '3332' THEN '2'
|
||||
WHEN tdd.data_type = '3333' THEN '3'
|
||||
END dataType,
|
||||
tdv.val AS val
|
||||
FROM
|
||||
tb_device_detail tdd
|
||||
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
|
||||
WHERE device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<select id="getTrend" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
|
||||
SELECT thdv.create_time as time, thdv.change_val as changeVal FROM tb_device_detail tdd
|
||||
LEFT JOIN tb_his_device_value thdv ON tdd.id = thdv.attribute_id
|
||||
WHERE tdd.device_id = #{deviceId}
|
||||
ORDER BY thdv.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getRealTimeAlarmList" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
|
||||
SELECT tw.warn_content as warnContent,tw.warn_time as warnTime FROM tb_warn tw
|
||||
WHERE tw.device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<select id="getHistoryList" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
|
||||
SELECT ta.area_name as areaName,tdd.mode_name as modeName, thdv.val ,
|
||||
tdd.change_val as thisChangeVal, thdv.change_val as changeVal,tdd.update_time as updateTime,
|
||||
case when thdv.is_warn = '0' then '未告警' else '告警' end isWarn
|
||||
FROM tb_device_detail tdd
|
||||
LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
|
||||
LEFT JOIN tb_area ta ON ta.area_id = tbd.area_id
|
||||
LEFT JOIN tb_his_device_value thdv ON tdd.id = thdv.attribute_id
|
||||
WHERE tdd.device_id = #{deviceId} AND tdd.del_flag = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -62,6 +62,13 @@ public class SelectController extends BaseController {
|
|||
return service.getBuildLists();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "杆塔表下拉选")
|
||||
@GetMapping("getGtLists")
|
||||
public AjaxResult getGtLists(String bidCode) {
|
||||
return service.getGtLists(bidCode);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "字典集合下拉选")
|
||||
@GetMapping("getDictLists")
|
||||
public AjaxResult getDictLists(SelectDto dto) {
|
||||
|
|
|
|||
|
|
@ -139,4 +139,6 @@ public interface ISelectMapper {
|
|||
List<SelectVo> getProList(SelectDto dto);
|
||||
|
||||
List<SelectVo> getSelectLists();
|
||||
|
||||
List<SelectVo> getGtLists(@Param("bidCode") String bidCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,5 +141,15 @@ public interface ISelectService {
|
|||
*/
|
||||
AjaxResult getProList(SelectDto dto);
|
||||
|
||||
/**
|
||||
* 建管单位下拉选
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getSelectLists();
|
||||
|
||||
/**
|
||||
* 杆塔表下拉选
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getGtLists(String bidCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,6 +205,17 @@ public class SelectServiceImpl implements ISelectService {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getGtLists(String bidCode) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getGtLists(bidCode);
|
||||
} catch (Exception e) {
|
||||
log.error("杆塔表下拉选",e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult getBdLists(SelectDto dto) {
|
||||
|
|
|
|||
|
|
@ -138,4 +138,9 @@
|
|||
WHERE sd.dict_code = '999' AND sd.del_flag = 0
|
||||
ORDER BY sd2.dict_sort
|
||||
</select>
|
||||
|
||||
<select id="getGtLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||||
SELECT gt_id AS gtId,gt_name AS name FROM t_pro_gt tpg
|
||||
WHERE tpg.bid_code = #{bidCode}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue