Commit 3f4b7681 authored by wangjinjing's avatar wangjinjing

添加设备统一管理页面跳转

parent c535d54d
......@@ -17,13 +17,15 @@ import java.util.Map;
public class ExportEngine {
private static Log iLog = LogFactory.getLog(ExportEngine.class.getName());
public void exportData(String sheetName, ExcelCol[] headertxt, List<Map> list, HttpServletResponse responses) {
public void exportData(String sheetName, String headertxt, String enhead, List<Map> list, HttpServletResponse responses) {
if(null==headertxt || null==enhead)return;
OutputStream os = null;
try {
os = responses.getOutputStream();
responses.reset();// 清空输出流
responses.setCharacterEncoding("utf-8");
responses.setHeader("Content-disposition", "attachment; filename=" + (new Date()).getTime() + ".xls");// 设定输出文件头
responses.setContentType("application/msexcel;charset=gb2312");// 定义输出类型
responses.setContentType("application/msexcel;charset=utf-8");// 定义输出类型
HSSFWorkbook workbook = new HSSFWorkbook();
// 创建字体对象
HSSFFont font = workbook.createFont();
......@@ -36,15 +38,16 @@ public class ExportEngine {
// 单元格的字体用什么?就用上面设置好的东西
cellStyle.setFont(font);
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
HSSFSheet sheet = workbook.createSheet(sheetName);
HSSFSheet sheet = workbook.createSheet("sheet1");
sheet.setDefaultColumnWidth((short) 12);
// 生成表头
String[] cells=headertxt.split(",");
HSSFRow row = sheet.createRow((short) 0);
if (headertxt != null && headertxt.length > 0) {
if (cells != null && cells.length > 0) {
short j = 0;
for (ExcelCol s : headertxt) {
for (String s : cells) {
HSSFCell cell1 = row.createCell(j);
cell1.setCellValue(headertxt[j].getColName());
cell1.setCellValue(cells[j]);
cell1.setCellStyle(cellStyle);
j = (short) (j + 1);
}
......@@ -53,13 +56,16 @@ public class ExportEngine {
HSSFCellStyle cs = workbook.createCellStyle();
cs.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// 生成数据
String[] encells=enhead.split(",");
for (int i = 0; i < list.size(); i++) {
HSSFRow datarow = sheet.createRow((short) i + 1);
Map mp = list.get(i);
for (short k = 0; k < headertxt.length; k++) {
iLog.info(list.get(i));
for (short k = 0; k < encells.length; k++) {
iLog.info("encells[k]"+encells[k]);
HSSFCell datacell = datarow.createCell(k);
datacell.setCellStyle(cs);
datacell.setCellValue(mp.get(headertxt[k].getColKey()) == null ? "" : mp.get(headertxt[k].getColKey()) + "");
datacell.setCellValue( encells[k] == null ? "" : mp.get(encells[k])==null?"":mp.get(encells[k]).toString());
}
}
workbook.write(os);
......
......@@ -200,6 +200,13 @@ public class IndexController {
model.addAttribute("userOnlineCount", userOnlineCount);
return "welcome";
}
@OperationLog("设备统一管理")
@GetMapping("/sbtygl")
public String sbtygl(Model model) {
List<Menu> menuTreeVOS = menuService.selectCurrentUserMenuTree();
model.addAttribute("menus", menuTreeVOS);
return "page/sbtygl";
}
@OperationLog("查看近七日登录统计图")
@GetMapping("/weekLoginCount")
......
......@@ -39,6 +39,11 @@ public class TrafficStatisticsController {
@Value("${pushrecordurl}")
private String pushrecordurl;
@Value("${exportcolumn}")
private String exportcolumn;
@Value("${enexportcolumn}")
private String enexportcolumn;
@OperationLog("获取车流量列表,从当天凌晨开始")
......@@ -880,40 +885,11 @@ public class TrafficStatisticsController {
listMap.put("xzbh",item.getAreaid());
listMap.put("xzmc", item.getXzmc());
listMap.put("recordtime", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",item.getRecordtime()));
listMap.put("recordlevel", item.getAlarmlevel()+"级");
listMap.put("recordlevel", item.getAlarmlevel());
listMap.put("recordname", item.getRecordname());
lists.add(listMap);
}
ExcelCol[] cells = new ExcelCol[8];
cells[0] = new ExcelCol();
cells[0].setColKey("sbbh");
cells[0].setColName("设备编号");
cells[1] = new ExcelCol();
cells[1].setColKey("tdbh");
cells[1].setColName("通道编号");
cells[2] = new ExcelCol();
cells[2].setColKey("tdmc");
cells[2].setColName("设备名称");
cells[3] = new ExcelCol();
cells[3].setColKey("xzbh");
cells[3].setColName("区域编号");
cells[4] = new ExcelCol();
cells[4].setColKey("xzmc");
cells[4].setColName("区域名称");
cells[5] = new ExcelCol();
cells[5].setColKey("recordtime");
cells[5].setColName("告警时间");
cells[6] = new ExcelCol();
cells[6].setColKey("recordlevel");
cells[6].setColName("告警等级");
cells[7] = new ExcelCol();
cells[7].setColKey("recordname");
cells[7].setColName("告警名称");
Map<String, Object> param= new HashMap<>(4);
SimpleDateFormat formart = new SimpleDateFormat("yyyy-MM-dd");
String dateTime = formart.format(new Date());
......@@ -921,7 +897,7 @@ public class TrafficStatisticsController {
param.put("sheetName", "告警事件");
param.put("header", "告警事件");
// new ExportEngine().exportCommData(param, cells, lists, response);
new ExportEngine().exportData("告警事件", cells, lists, response);
new ExportEngine().exportData("告警事件", exportcolumn,enexportcolumn, lists, response);
}
......
......@@ -9,44 +9,44 @@ import java.util.Date;
public class Traffalarmrecord implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Long recordid ;// ��¼��� ��������
private Integer algotype ;//--�㷨���� Ĭ���� 0:��˾ 1:��������˾
private Long areaid ;//--Ͻ�����
private String fdid ;//�豸���
private Integer channelid ;//--ͨ�����
private Integer channeletype;//ͨ������ �ɺ���
private String channelname ;//ͨ������
private Date recordtime ;//�¼���¼ʱ��
private String recordtype ;//�¼���¼����
private String location ;//Ŀ�궨λ��Ϣ
private String img1urlfrom ;//ͼƬԴ��ַ
private String img1path ;//ͼƬ�洢��ַ
private String img2urlfrom ;//ͼƬԴ��ַ
private String img2path ;//ͼƬ�洢��ַ
private String img3urlfrom ;//ͼƬԴ��ַ
private String img3path ;//ͼƬ�洢��ַ
private String img4urlfrom ;//ͼƬԴ��ַ
private String img4path ;//ͼƬ�洢��ַ
private String img5urlfrom;//ͼƬԴ��ַ
private String img5path ;//ͼƬ�洢��ַ
private String videourlfrom ;//��ƵԴ��ַ
private String videopath ;//��Ƶ�洢��ַ
private Date retrytime ;//video���Ե����һ�εĶ�ȡ��ʱ��
private Integer retrycount ;//ideo���Զ�ȡ�ܴ���
private Integer recordlevel;//�¼����� --Ĭ��Ϊ0 ����������ʱδ֪
private Integer checkstatus ;//0:����� 1:���ͨ�� 2:��˲�ͨ�� 9:����
private String creator;//������
private Date createtime ;//����ʱ��
private String updator ;//������
private Date updatetime ;//����ʱ��
private Long recordid ;
private Integer algotype ;
private Long areaid ;
private String fdid ;
private Integer channelid ;
private Integer channeletype;
private String channelname ;
private Date recordtime ;
private String recordtype ;
private String location ;
private String img1urlfrom ;
private String img1path ;
private String img2urlfrom ;
private String img2path ;
private String img3urlfrom ;
private String img3path ;
private String img4urlfrom ;
private String img4path ;
private String img5urlfrom;
private String img5path ;
private String videourlfrom ;
private String videopath ;
private Date retrytime ;
private Integer retrycount ;
private Integer recordlevel;
private Integer checkstatus ;
private String creator;
private Date createtime ;
private String updator ;
private Date updatetime ;
private String remark ;
private Integer pushstatus;//����״̬
private String pushdesc;//��������
private String pushcount;//���ʹ���
private Date pushdate;//����ʱ��
private String processstatus ;//����״̬
private String objlable ;//��������
private String objlablename ;//��������
private Integer pushstatus;
private String pushdesc;
private String pushcount;
private Date pushdate;
private String processstatus ;
private String objlable ;
private String objlablename ;
private String videoname;
private String rectificationtype;
@Override
......
......@@ -2,15 +2,15 @@ spring.profiles.active=dev
server.port=8082
#spring.datasource.username=hzjt
#spring.datasource.password=hzjt
#spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl
spring.datasource.username=test
spring.datasource.password=test
spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.username=hzjt
spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl
#spring.datasource.username=test
#spring.datasource.password=test
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
# ��ʼ����С����С�����
# \uFFFD\uFFFD\u02BC\uFFFD\uFFFD\uFFFD\uFFFD\u0421\uFFFD\uFFFD\uFFFD\uFFFD\u0421\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=20
......@@ -51,13 +51,16 @@ shiro-action.log.login = false
shiro-action.session-timeout=259200
shiro-action.perms-cache-timeout=518400
shiro-action.super-admin-username=admin
shiro-action.super-admin-username=test
shiro-action.retry-count=5
shiro-action.retry-timeout=300
shiro-action.login-verify=true
managername=admin
spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=static/**,public/**
managername=admin
spring.profiles.path= D:/hzjt_service/imp/config/im/hzjt.properties
\ No newline at end of file
spring.profiles.path= D:/hzjt_service/imp/config/im/hzjt.properties
exportcolumn=\u8BBE\u5907\u7F16\u53F7,\u901A\u9053\u7F16\u53F7,\u8BBE\u5907\u540D\u79F0,\u533A\u57DF\u7F16\u53F7,\u533A\u57DF\u540D\u79F0,\u544A\u8B66\u65F6\u95F4,\u544A\u8B66\u7B49\u7EA7,\u544A\u8B66\u540D\u79F0
enexportcolumn=sbbh,tdbh,tdmc,xzbh,xzmc,recordtime,recordlevel,recordname
\ No newline at end of file
......@@ -11,7 +11,7 @@
a.pushdesc,
p.dept_name as xztreename
from sbtdspsr ta
left join traffdevicewriteresult a
inner join traffdevicewriteresult a
on a.sbbh = ta.sbbh
and a.tdbh = ta.tdbh
left join dept p
......@@ -47,8 +47,8 @@
p.dept_name as xztreename,
b.remark1 as deviceconfig
from sbtdspsr ta
left join traffdevicewriteresult a on a.sbbh = ta.sbbh and a.tdbh = ta.tdbh
left join traffdeviceconfig b on b.fdid = ta.sbbh and b.channelid = ta.tdbh
inner join traffdevicewriteresult a on a.sbbh = ta.sbbh and a.tdbh = ta.tdbh
inner join traffdeviceconfig b on b.fdid = ta.sbbh and b.channelid = ta.tdbh
left join dept p on p.dept_id = ta.xzbh
<where>
<if test="xhs !=null and xhs.size>0 ">
......
let vue_sjcx = new Vue({
el: '#sjcx',
data: {
data_table_wfpz: [
{xzmc:'杭州支队', xzaddress:'http://33.51.6.97:8009/operation/node-list'},
{xzmc:'杭州支队',xzaddress:'http://33.55.1.85-96:8009/operation/node-list'},
{xzmc:'温州支队:',xzaddress:'http://33.57.1.22:8009/operation/node-list'},
{xzmc:'绍兴支队:',xzaddress:'http://33.61.1.23:8009/operation/node-list'},
{xzmc:'嘉兴支队',xzaddress:'http://33.55.1.85-96:8009/operation/node-list'},
{xzmc:'衢州支队',xzaddress:''},
{xzmc:'丽水支队',xzaddress:'http://33.53.1.171:8009/operation/node-list'},
{xzmc:'金华支队',xzaddress:'http://33.60.1.7:8009/operation/node-list'},
{xzmc:'湖州支队',xzaddress:'http://33.52.1.222:8009/operation/node-list'}
]
},
methods: {
gopage:function(item){
window.open(item,"_blank");
}
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-datetimepicker.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-select.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-treeview.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-switch.min.css">
<link rel="stylesheet" href="../css/sbts.css">
<link rel="stylesheet" href="../css/photoviewer.css">
<title>设备统一管理</title>
</head>
<body>
<div id="page-sy">
<div class="right-nav">
<div class="tab-content content-sjfx">
<div role="tabpanel" class="tab-pane active" id="sjcx">
<div class="div-left">
<div id="sjcx_s" class="div-right">
<div style="height:calc(100% - 130px);margin-top: 20px;" class="tables">
<table class="table table-td" style="text-align: center;">
<thead>
<tr style="background-color: rgb(228, 228, 228);">
<td>支队名称</td>
<td style="width: 400px;" >服务器链接地址
</td>
</tr>
</thead>
<tbody class="div-pub-gt">
<tr v-for="(item,index) in data_table_wfpz">
<td v-text="item.xzmc"></td>
<td style="width: 400px;">
<a @click="gopage(item.xzaddress)" target="_blank">{{item.xzaddress}}</a>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
sjcx
</body>
<script src="../js/jquery-3.1.1.min.js"></script>
<!--<script src="../js/viewer.min.js"></script>-->
<script src="../js/util/photoviewer.js"></script>
<script src="../bootstrap/js/bootstrap.js"></script>
<script src="../bootstrap/js/bootstrap-paginator.js"></script>
<script src="../bootstrap/js/bootstrap-treeview.js"></script>
<script src="../bootstrap/js/bootstrap-select.js"></script>
<script src="../bootstrap/js/bootstrap-switch.min.js"></script>
<!--<script src="../bootstrap/js/bootstrap-datetimepicker.js"></script>-->
<!--<script src="../bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>-->
<script src="../js/laydate/laydate.js"></script>
<script src="../js/vue.js"></script>
<script src="../js/util/http_util.js"></script>
<script src="../js/tsgl/sbtygl.js"></script>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment