大屏 - 告警管理

This commit is contained in:
sliang 2024-03-28 09:25:29 +08:00
parent dbef2ee6c5
commit d27bcc2824
13 changed files with 181 additions and 2 deletions

View File

@ -17,11 +17,20 @@ public class PageUtils extends PageHelper
public static void startPage()
{
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
Boolean reasonable = pageDomain.getReasonable();
PageHelper.startPage(pageNum, pageSize, null).setReasonable(reasonable);
}
public static void startLayPage()
{
PageDomain pageDomain = TableSupport.buildLayPageRequest();
Integer pageNum = pageDomain.getPage();
Integer pageSize = pageDomain.getLimit();
Boolean reasonable = pageDomain.getReasonable();
PageHelper.startPage(pageNum, pageSize, null).setReasonable(reasonable);
}
/**
* 清理分页的线程变量

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.securitycontrol.common.core.constant.Constants;
import com.securitycontrol.common.core.domain.Result;
import com.securitycontrol.common.core.text.Convert;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
@ -87,7 +88,8 @@ public class ServletUtils
{
try
{
return getRequestAttributes().getRequest();
HttpServletRequest REQ= getRequestAttributes().getRequest();
return REQ;
}
catch (Exception e)
{

View File

@ -48,6 +48,10 @@ public class BaseController
{
PageUtils.startPage();
}
protected void startLayPage()
{
PageUtils.startLayPage();
}
/**
* 清理分页的线程变量
@ -81,6 +85,26 @@ public class BaseController
return rspData;
}
protected TableDataInfo getDataTableLayui(List<?> list)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setData(list);
rspData.setMsg("查询成功");
rspData.setCount(new PageInfo(list).getTotal());
return rspData;
}
protected TableDataInfo getDataTableBadLayui(List<?> list,String msg)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(-1);
rspData.setData(list);
rspData.setMsg(msg);
rspData.setCount(new PageInfo(list).getTotal());
return rspData;
}
/**
* 返回成功
*/

View File

@ -15,6 +15,11 @@ public class PageDomain
/** 每页显示记录数 */
private Integer pageSize;
/** 当前记录起始索引 */
private Integer page;
/** 每页显示记录数 */
private Integer limit;
/** 分页参数合理化 */
private Boolean reasonable = true;
@ -39,6 +44,21 @@ public class PageDomain
this.pageSize = pageSize;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Boolean getReasonable()
{

View File

@ -1,5 +1,7 @@
package com.securitycontrol.common.core.web.page;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ -8,6 +10,7 @@ import java.util.List;
*
* @author czc
*/
@Data
public class TableDataInfo implements Serializable
{
private static final long serialVersionUID = 1L;
@ -15,9 +18,15 @@ public class TableDataInfo implements Serializable
/** 总记录数 */
private long total;
/** layui总记录数 */
private long count;
/** 列表数据 */
private List<?> rows;
/** layui列表数据 */
private List<?> data;
/** 消息状态码 */
private int code;

View File

@ -20,6 +20,17 @@ public class TableSupport
*/
public static final String PAGE_SIZE = "pageSize";
/**
* 当前记录起始索引
*/
public static final String PAGE = "page";
/**
* 每页显示记录数
*/
public static final String LIMIT = "limit";
/**
* 排序列
*/
@ -46,9 +57,24 @@ public class TableSupport
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
return pageDomain;
}
/**
* 封装分页对象
*/
public static PageDomain getPageLayDomain()
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPage(Convert.toInt(ServletUtils.getParameter(PAGE), 1));
pageDomain.setLimit(Convert.toInt(ServletUtils.getParameter(LIMIT), 10));
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
return pageDomain;
}
public static PageDomain buildPageRequest()
{
return getPageDomain();
}
public static PageDomain buildLayPageRequest()
{
return getPageLayDomain();
}
}

View File

@ -0,0 +1,26 @@
package com.securitycontrol.entity.screen.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 告警管理
* @author lsun
*/
@Data
public class AlarmMgeDto extends ScreenParamDto {
@ApiModelProperty(value = "id")
private String warnId;
@ApiModelProperty(value = "建管单位id")
private String orgId;
@ApiModelProperty(value = "工程名称")
private String proName;
@ApiModelProperty(value = "班组长名称")
private String teamLeader;
@ApiModelProperty(value = "告警类型")
private String warnType;
}

View File

@ -0,0 +1,34 @@
package com.securitycontrol.entity.screen.vo;
import com.securitycontrol.entity.background.vo.DutyPlanVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
* 告警管理
* @author lsun
*/
@Data
public class AlarmMgeVo {
@ApiModelProperty(value = "id")
private String warnId;
@ApiModelProperty(value = "告警内容")
private String warnContent;
@ApiModelProperty(value = "建管单位名称")
private String orgName;
@ApiModelProperty(value = "建管单位id")
private String orgId;
@ApiModelProperty(value = "工程id")
private String proId;
@ApiModelProperty(value = "工程名称")
private String proName;
@ApiModelProperty(value = "班组id")
private String teamId;
@ApiModelProperty(value = "班组名称")
private String teamName;
@ApiModelProperty(value = "班组长名称")
private String teamLeader;
}

View File

@ -104,5 +104,11 @@ public class SelectController extends BaseController {
return service.getProList(dto);
}
@ApiOperation(value = "告警管理下拉选")
@GetMapping("getSelectLists")
public AjaxResult getSelectLists() {
return service.getSelectLists();
}
}

View File

@ -137,4 +137,6 @@ public interface ISelectMapper {
* @return
*/
List<SelectVo> getProList(SelectDto dto);
List<SelectVo> getSelectLists();
}

View File

@ -140,4 +140,6 @@ public interface ISelectService {
* @return
*/
AjaxResult getProList(SelectDto dto);
AjaxResult getSelectLists();
}

View File

@ -194,6 +194,17 @@ public class SelectServiceImpl implements ISelectService {
return AjaxResult.success(list);
}
@Override
public AjaxResult getSelectLists() {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getSelectLists();
} catch (Exception e) {
log.error("告警管理下拉选",e);
}
return AjaxResult.success(list);
}
@Override
public AjaxResult getBdLists(SelectDto dto) {

View File

@ -127,4 +127,12 @@
and sb.city_name=#{cityName}
</if>
</select>
<select id="getSelectLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT sd2.dict_code AS id,
sd2.dict_name AS name
FROM sys_dict sd
LEFT JOIN sys_dict sd2 ON sd.dict_code = sd2.p_code AND sd2.del_flag = 0
WHERE sd.dict_code = '999' AND sd.del_flag = 0
ORDER BY sd2.dict_sort
</select>
</mapper>