大屏 - 告警管理
This commit is contained in:
parent
ab6a0b43df
commit
1e1ae7947c
|
|
@ -0,0 +1,53 @@
|
|||
package com.securitycontrol.screen.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.securitycontrol.common.core.constant.HttpStatus;
|
||||
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.background.dto.DeviceDto;
|
||||
import com.securitycontrol.entity.background.vo.DeviceVo;
|
||||
import com.securitycontrol.entity.screen.dto.AlarmMgeDto;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
import com.securitycontrol.screen.service.AlarmMgeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
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;
|
||||
|
||||
import static com.securitycontrol.common.core.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* 告警管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/largeScreen/alarmMge/")
|
||||
@Slf4j
|
||||
public class AlarmMgeController extends BaseController {
|
||||
@Resource(name = "AlarmMgeService")
|
||||
private AlarmMgeService service;
|
||||
|
||||
@ApiOperation(value = "告警管理列表")
|
||||
@GetMapping("getAlarmMgeList")
|
||||
@Log(title = "告警管理", menu = "告警管理->告警管理", grade = OperationType.QUERY_BUSINESS, details = "查询告警管理列表", type = "业务日志")
|
||||
public TableDataInfo getAlarmMgeList(AlarmMgeDto dto) {
|
||||
try{
|
||||
// startPage();
|
||||
List<AlarmMgeVo> list = service.getAlarmMgeList(dto);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.securitycontrol.screen.mapper;
|
||||
|
||||
import com.securitycontrol.entity.background.vo.DutyPlanVo;
|
||||
import com.securitycontrol.entity.screen.dto.AlarmMgeDto;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理
|
||||
*/
|
||||
@Repository(value = "AlarmMgeMapper")
|
||||
public interface AlarmMgeMapper {
|
||||
|
||||
List<AlarmMgeVo> getAlarmMgeList(AlarmMgeDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.screen.dto.AlarmMgeDto;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理
|
||||
*/
|
||||
public interface AlarmMgeService {
|
||||
List<AlarmMgeVo> getAlarmMgeList(AlarmMgeDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.entity.background.vo.DutyPlanVo;
|
||||
import com.securitycontrol.entity.screen.dto.AlarmMgeDto;
|
||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||
import com.securitycontrol.entity.screen.vo.AlarmMgeVo;
|
||||
import com.securitycontrol.entity.system.base.vo.ProVo;
|
||||
import com.securitycontrol.screen.mapper.AlarmMgeMapper;
|
||||
import com.securitycontrol.screen.service.AlarmMgeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* 告警管理
|
||||
*/
|
||||
@Slf4j
|
||||
@Service(value = "AlarmMgeService")
|
||||
public class AlarmMgeServiceImpl implements AlarmMgeService {
|
||||
|
||||
@Resource(name = "AlarmMgeMapper")
|
||||
private AlarmMgeMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<AlarmMgeVo> getAlarmMgeList(AlarmMgeDto dto) {
|
||||
List<AlarmMgeVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getAlarmMgeList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("获取告警管理列表",e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?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.AlarmMgeMapper">
|
||||
|
||||
<select id="getAlarmMgeList" resultType="com.securitycontrol.entity.screen.vo.AlarmMgeVo">
|
||||
SELECT tw.warn_id as warnId,
|
||||
sb.city_name AS name,
|
||||
sb.org_id AS orgId,
|
||||
tp.pro_id as proId,
|
||||
tp.pro_name as proName,
|
||||
tw.warn_content as warnContent,
|
||||
twt.team_id as teamId,
|
||||
twt.team_name as teamName,
|
||||
twt.team_leader as teamLeader
|
||||
FROM tb_warn tw
|
||||
LEFT JOIN sys_build sb ON sb.org_id = tw.org_id
|
||||
LEFT JOIN tb_project tp ON tp.bid_code = tw.bid_code
|
||||
LEFT JOIN tb_work_team twt ON twt.team_id = tw.team_id
|
||||
where tw.warn_type = #{warnType}
|
||||
<if test="orgId !=null and orgId!=''">
|
||||
AND sb.org_id = #{orgId}
|
||||
</if>
|
||||
|
||||
<if test="proName !=null and proName!=''">
|
||||
AND tp.pro_name LIKE concat('%',#{proName},'%')
|
||||
</if>
|
||||
|
||||
<if test="teamLeader !=null and teamLeader!=''">
|
||||
AND twt.team_leader LIKE concat('%',#{teamLeader},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue