Commit c535d54d authored by wangjinjing's avatar wangjinjing

添加导出和推送设备功能

parent 1714551e
...@@ -23,7 +23,7 @@ public class ExportEngine { ...@@ -23,7 +23,7 @@ public class ExportEngine {
os = responses.getOutputStream(); os = responses.getOutputStream();
responses.reset();// 清空输出流 responses.reset();// 清空输出流
responses.setHeader("Content-disposition", "attachment; filename=" + (new Date()).getTime() + ".xls");// 设定输出文件头 responses.setHeader("Content-disposition", "attachment; filename=" + (new Date()).getTime() + ".xls");// 设定输出文件头
responses.setContentType("application/msexcel");// 定义输出类型 responses.setContentType("application/msexcel;charset=gb2312");// 定义输出类型
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFWorkbook workbook = new HSSFWorkbook();
// 创建字体对象 // 创建字体对象
HSSFFont font = workbook.createFont(); HSSFFont font = workbook.createFont();
...@@ -91,7 +91,7 @@ public class ExportEngine { ...@@ -91,7 +91,7 @@ public class ExportEngine {
responses.reset();// 清空输出流 responses.reset();// 清空输出流
String fileName = map.get("fileName").toString(); String fileName = map.get("fileName").toString();
fileName = toUtf8String(fileName); fileName = toUtf8String(fileName);
responses.setHeader("Content-disposition", "attachment; filename=" + fileName + ".xls");// 设定输出文件头 responses.setHeader("Content-disposition", "attachment; filename=" + new String(fileName.getBytes("gbk"), "uft-8") + ".xls");// 设定输出文件头
responses.setContentType("application/msexcel");// 定义输出类型 responses.setContentType("application/msexcel");// 定义输出类型
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFWorkbook workbook = new HSSFWorkbook();
HSSFFont font = workbook.createFont();// 创建字体对象 HSSFFont font = workbook.createFont();// 创建字体对象
...@@ -107,7 +107,7 @@ public class ExportEngine { ...@@ -107,7 +107,7 @@ public class ExportEngine {
HSSFRow row2 = sheet.createRow(0); HSSFRow row2 = sheet.createRow(0);
row2.setHeight((short) 400); row2.setHeight((short) 400);
HSSFCell cell2 = row2.createCell(0); HSSFCell cell2 = row2.createCell(0);
cell2.setCellValue(map.get("header").toString()); cell2.setCellValue( new String(map.get("header").toString().getBytes("gbk"), "utf-8") );
cell2.setCellStyle(cellStyle2); cell2.setCellStyle(cellStyle2);
for (int k = 1; k < headertxt.length; k++) { for (int k = 1; k < headertxt.length; k++) {
row2.createCell(k).setCellStyle(cellStyle2); row2.createCell(k).setCellStyle(cellStyle2);
...@@ -118,8 +118,9 @@ public class ExportEngine { ...@@ -118,8 +118,9 @@ public class ExportEngine {
if (headertxt != null && headertxt.length > 0) { if (headertxt != null && headertxt.length > 0) {
short j = 0; short j = 0;
for (ExcelCol s : headertxt) { for (ExcelCol s : headertxt) {
if(null==s)continue;
HSSFCell cell1 = row.createCell(j); HSSFCell cell1 = row.createCell(j);
cell1.setCellValue(headertxt[j].getColName()); cell1.setCellValue( new String(headertxt[j].getColName().getBytes("gbk"), "utf-8"));
cell1.setCellStyle(cellStyle); cell1.setCellStyle(cellStyle);
j = (short) (j + 1); j = (short) (j + 1);
} }
......
...@@ -45,7 +45,7 @@ public class TraffdevicewriteresultController { ...@@ -45,7 +45,7 @@ public class TraffdevicewriteresultController {
* 查询推送成功分页 * 查询推送成功分页
*/ */
@PostMapping("/queryTraffdevicewriteresultByPage") @PostMapping("/queryTraffdevicewriteresultByPage")
public PageResultBean<Traffdevicewriteresult> queryTraffdevicewriteresultByPage(TraffdevicewriteresultParams traffdevicewriteresult) { public PageResultBean<Traffdevicewriteresult> queryTraffdevicewriteresultByPage(@RequestBody TraffdevicewriteresultParams traffdevicewriteresult) {
List<Traffdevicewriteresult> list= traffdevicewriteresultService.queryTraffdevicewriteresultByPage(traffdevicewriteresult); List<Traffdevicewriteresult> list= traffdevicewriteresultService.queryTraffdevicewriteresultByPage(traffdevicewriteresult);
PageInfo<Traffdevicewriteresult> rolePageInfo = new PageInfo<>(list); PageInfo<Traffdevicewriteresult> rolePageInfo = new PageInfo<>(list);
...@@ -56,7 +56,7 @@ public class TraffdevicewriteresultController { ...@@ -56,7 +56,7 @@ public class TraffdevicewriteresultController {
* 查询所有监控推送状态分页 * 查询所有监控推送状态分页
*/ */
@PostMapping("/querySbtdspsrResultByPage") @PostMapping("/querySbtdspsrResultByPage")
public PageResultBean<SbtdspsrResult> querySbtdspsrResultByPage(SbtdspsrParams sbtdspsr) { public PageResultBean<SbtdspsrResult> querySbtdspsrResultByPage(@RequestBody SbtdspsrParams sbtdspsr) {
List<SbtdspsrResult> list=traffdevicewriteresultService.querySbtdspsrResultByPage(sbtdspsr); List<SbtdspsrResult> list=traffdevicewriteresultService.querySbtdspsrResultByPage(sbtdspsr);
PageInfo<SbtdspsrResult> rolePageInfo = new PageInfo<>(list); PageInfo<SbtdspsrResult> rolePageInfo = new PageInfo<>(list);
return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList()); return new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList());
......
...@@ -749,13 +749,11 @@ public class TrafficStatisticsController { ...@@ -749,13 +749,11 @@ public class TrafficStatisticsController {
@RequestParam("limit") Integer limit, @RequestParam("limit") Integer limit,
@RequestParam("pushstatus") String pushstatus, @RequestParam("pushstatus") String pushstatus,
@RequestParam("deptid") String deptid, @RequestParam("deptid") String deptid,
@RequestParam("construction") String construction, @RequestParam("construction") String construction) {
@RequestParam("starttime") String starttime,
@RequestParam("endtime") String endtime) {
Map map = new HashMap(); Map map = new HashMap();
map.put("starttime", starttime); // map.put("starttime", starttime);
map.put("pushstatus", pushstatus); map.put("pushstatus", pushstatus);
map.put("endtime", endtime); // map.put("endtime", endtime);
map.put("deptid", deptid); map.put("deptid", deptid);
map.put("construction", construction); map.put("construction", construction);
List<Traffalarmrecord> carList = trafficStatisticsService.selectPushRecordsBypage(map, page, limit); List<Traffalarmrecord> carList = trafficStatisticsService.selectPushRecordsBypage(map, page, limit);
...@@ -776,8 +774,8 @@ public class TrafficStatisticsController { ...@@ -776,8 +774,8 @@ public class TrafficStatisticsController {
} }
@OperationLog("导出事件推送结果") @OperationLog("导出事件结果")
@RequestMapping("/expTraffalarmrecordstat") @RequestMapping("/expTraffalarmrecord")
@ResponseBody @ResponseBody
public void expTraffalarmrecordstat(HttpServletResponse response, TraffalarmrecordstatParams traffalarmrecordstatParams) { public void expTraffalarmrecordstat(HttpServletResponse response, TraffalarmrecordstatParams traffalarmrecordstatParams) {
String eventname = traffalarmrecordstatParams.getEventtype(); String eventname = traffalarmrecordstatParams.getEventtype();
...@@ -808,7 +806,6 @@ public class TrafficStatisticsController { ...@@ -808,7 +806,6 @@ public class TrafficStatisticsController {
cells[4] = new ExcelCol(); cells[4] = new ExcelCol();
cells[4].setColKey("checkstatusms"); cells[4].setColKey("checkstatusms");
cells[4].setColName("免审"); cells[4].setColName("免审");
Map<String, Object> params = new HashMap<>(4); Map<String, Object> params = new HashMap<>(4);
SimpleDateFormat formart = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formart = new SimpleDateFormat("yyyy-MM-dd");
String dateTime = formart.format(new Date()); String dateTime = formart.format(new Date());
...@@ -853,6 +850,79 @@ public class TrafficStatisticsController { ...@@ -853,6 +850,79 @@ public class TrafficStatisticsController {
} }
@OperationLog("导出事件")
@RequestMapping("/expAllTraffalarmrecord/{sendOrNot}")
@ResponseBody
public void expAllTraffalarmrecord(HttpServletResponse response,@PathVariable("sendOrNot")String sendOrNot,@RequestBody TraffalarmrecordParams params) {
String[] arry = {};
Map parammap = new HashMap();
parammap.put("videoids", Arrays.asList(params.getVideoids() == "" ? arry : params.getVideoids().split(",")));
parammap.put("starttime", params.getStarttime());
parammap.put("endtime", params.getEndtime());
parammap.put("recordtype", params.getRecordtype());
parammap.put("checkstatus", params.getCheckstatus());
parammap.put("deptid", params.getDeptid());
parammap.put("construction", params.getConstruction());
parammap.put("objlables", Arrays.asList(params.getObjlabel() == "" ? arry : params.getObjlabel().split(",")));
parammap.put("processstatus", Arrays.asList(params.getProcessstatus() == "" ? arry : params.getProcessstatus().split(",")));
parammap.put("rectificationtype", params.getRectificationtype());
parammap.put("pushstatus", sendOrNot);
List<TraffalarmrecordResult> traffalarmrecordResults =
trafficStatisticsService.expTraffalarmrecord(parammap);
//新增到excel 中
List<Map> lists = new ArrayList<>();
for (TraffalarmrecordResult item : traffalarmrecordResults) {
HashMap<String, Object> listMap = new HashMap<>();
listMap.put("sbbh",item.getFdid());
listMap.put("tdbh",item.getChannelid());
listMap.put("tdmc",item.getTdmc());
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("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());
param.put("fileName", "告警事件-" + dateTime);
param.put("sheetName", "告警事件");
param.put("header", "告警事件");
// new ExportEngine().exportCommData(param, cells, lists, response);
new ExportEngine().exportData("告警事件", cells, lists, response);
}
} }
...@@ -9,38 +9,38 @@ import java.util.Date; ...@@ -9,38 +9,38 @@ import java.util.Date;
@Setter @Setter
public class SbtdspsrParams extends Sbtdspsr { public class SbtdspsrParams extends Sbtdspsr {
/** /**
* 创建时间 * ����ʱ��
*/ */
private Date createtime; private Date createtime;
/** /**
* 推送状态(0成功1失败) * ����״̬(0�ɹ�1ʧ��)
*/ */
private Long pushstatus; private Long pushstatus;
/** /**
* 推送描述 * ��������
*/ */
private String pushdesc; private String pushdesc;
/** /**
* 推送次数 * ���ʹ���
*/ */
private Long pushcount; private Long pushcount;
/** /**
* 行政编号 * �������
*/ */
private String xzbh; private String xzbh;
/** /**
* * ��ע
*/ */
private String remark; private String remark;
/** /**
* 行政名称 * ��������
*/ */
private String xztreename; private String xztreename;
...@@ -48,5 +48,4 @@ public class SbtdspsrParams extends Sbtdspsr { ...@@ -48,5 +48,4 @@ public class SbtdspsrParams extends Sbtdspsr {
private Integer page; private Integer page;
private Integer limit; private Integer limit;
} }
...@@ -187,6 +187,11 @@ public class TrafficStatisticsService { ...@@ -187,6 +187,11 @@ public class TrafficStatisticsService {
public int updateTraffalarmrecordPushStatusById(String recordid ){ public int updateTraffalarmrecordPushStatusById(String recordid ){
return trafficStatisticsMapper.updateTraffalarmrecordPushStatusById(recordid); return trafficStatisticsMapper.updateTraffalarmrecordPushStatusById(recordid);
} }
public List<TraffalarmrecordResult> expTraffalarmrecord( Map map) {
List<TraffalarmrecordResult> traffalarmrecordResults=trafficStatisticsMapper.queryTraffalarmrecordByPage(map);
return traffalarmrecordResults;
}
} }
\ No newline at end of file
...@@ -2,12 +2,12 @@ spring.profiles.active=dev ...@@ -2,12 +2,12 @@ spring.profiles.active=dev
server.port=8082 server.port=8082
spring.datasource.username=hzjt #spring.datasource.username=hzjt
spring.datasource.password=hzjt #spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl #spring.datasource.url=jdbc:oracle:thin:@33.50.1.22:1521:orcl
#spring.datasource.username=test spring.datasource.username=test
#spring.datasource.password=test spring.datasource.password=test
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
# ��ʼ����С����С����� # ��ʼ����С����С�����
...@@ -51,7 +51,7 @@ shiro-action.log.login = false ...@@ -51,7 +51,7 @@ shiro-action.log.login = false
shiro-action.session-timeout=259200 shiro-action.session-timeout=259200
shiro-action.perms-cache-timeout=518400 shiro-action.perms-cache-timeout=518400
shiro-action.super-admin-username=test shiro-action.super-admin-username=admin
shiro-action.retry-count=5 shiro-action.retry-count=5
shiro-action.retry-timeout=300 shiro-action.retry-timeout=300
shiro-action.login-verify=true shiro-action.login-verify=true
...@@ -59,5 +59,5 @@ shiro-action.login-verify=true ...@@ -59,5 +59,5 @@ shiro-action.login-verify=true
spring.devtools.restart.enabled=true spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=static/**,public/** spring.devtools.restart.exclude=static/**,public/**
managername=admin
spring.profiles.path= D:/hzjt_service/imp/config/im/hzjt.properties spring.profiles.path= D:/hzjt_service/imp/config/im/hzjt.properties
\ No newline at end of file
...@@ -735,6 +735,8 @@ ...@@ -735,6 +735,8 @@
</select> </select>
<update id="updateTraffalarmrecordById" parameterType="java.util.List"> <update id="updateTraffalarmrecordById" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";"> <foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";">
<if test='item.processstatus != null and item.processstatus=="1"'> <if test='item.processstatus != null and item.processstatus=="1"'>
......
...@@ -3,26 +3,28 @@ ...@@ -3,26 +3,28 @@
<mapper namespace="im.zhaojun.system.mapper.TraffdevicewriteresultMapper"> <mapper namespace="im.zhaojun.system.mapper.TraffdevicewriteresultMapper">
<select id="querySbtdspsrResultByPage" resultType="im.zhaojun.system.model.SbtdspsrResult"> <select id="querySbtdspsrResultByPage" resultType="im.zhaojun.system.model.SbtdspsrResult">
SELECT select ta.*,
TA.*, a.createtime,
A.CREATETIME, a.pushstatus,
A.PUSHSTATUS, a.pushcount,
A.PUSHCOUNT, a.remark,
A.REMARK, a.pushdesc,
A.PUSHDESC, p.dept_name as xztreename
p.xzmc AS xztreename from sbtdspsr ta
FROM SBTDSPSR TA left join traffdevicewriteresult a
LEFT JOIN TRAFFDEVICEWRITERESULT A ON A.SBBH = TA.SBBH AND A.TDBH = TA.TDBH on a.sbbh = ta.sbbh
LEFT JOIN ptxzs p ON p.xzbh = TA.xzbh and a.tdbh = ta.tdbh
WHERE 1=1 left join dept p
on p.dept_id = ta.xzbh
<where>
<if test="sbbh !=null and sbbh != ''"> <if test="sbbh !=null and sbbh != ''">
and (TA.sbbh like '%'||#{sbbh}||'%' OR TA.tdmc like '%'||#{sbbh}||'%' OR TA.tdmcpy like '%'||#{sbbh}||'%' ) and (TA.sbbh like '%'||#{sbbh}||'%' OR TA.tdmc like '%'||#{sbbh}||'%' OR TA.tdmcpy like '%'||#{sbbh}||'%' )
</if> </if>
<if test="xzbh !=null and xzbh != ''"> <if test="xzbh !=null and xzbh != ''">
AND TA.xzbh IN and ta.xzbh
in ( in (
select t.dept_id select t.dept_id
from DEPT t start with dept_id =#{xzbh} from dept t start with dept_id =#{xzbh}
connect by parent_id = prior dept_id) connect by parent_id = prior dept_id)
</if> </if>
<if test="pushstatus !=null and pushstatus != 9"> <if test="pushstatus !=null and pushstatus != 9">
...@@ -31,28 +33,30 @@ ...@@ -31,28 +33,30 @@
<if test="pushstatus !=null and pushstatus == 9"> <if test="pushstatus !=null and pushstatus == 9">
and (A.pushstatus is null) and (A.pushstatus is null)
</if> </if>
</where>
</select> </select>
<select id="querySbtdspsrByXh" resultType="im.zhaojun.system.model.SbtdspsrParams"> <select id="querySbtdspsrByXh" resultType="im.zhaojun.system.model.SbtdspsrParams">
SELECT select
TA.*, ta.*,
A.CREATETIME, a.createtime,
A.PUSHSTATUS, a.pushstatus,
A.PUSHCOUNT, a.pushcount,
A.REMARK, a.remark,
A.PUSHDESC, a.pushdesc,
p.xzmc AS xztreename, p.dept_name as xztreename,
B.remark1 AS deviceconfig b.remark1 as deviceconfig
FROM SBTDSPSR TA from sbtdspsr ta
LEFT JOIN TRAFFDEVICEWRITERESULT A ON A.SBBH = TA.SBBH AND A.TDBH = TA.TDBH 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 left join traffdeviceconfig b on b.fdid = ta.sbbh and b.channelid = ta.tdbh
LEFT JOIN ptxzs p ON p.xzbh = TA.xzbh left join dept p on p.dept_id = ta.xzbh
WHERE 1=1 <where>
<if test="xhs !=null and xhs.size>0 "> <if test="xhs !=null and xhs.size>0 ">
and TA.XH IN and ta.xh in
<foreach item="xh" collection="xhs" open="(" separator="," close=")"> <foreach item="xh" collection="xhs" open="(" separator="," close=")">
#{xh} #{xh}
</foreach> </foreach>
</if> </if>
</where>
</select> </select>
</mapper> </mapper>
...@@ -78,7 +78,7 @@ let vue_sjcx = new Vue({ ...@@ -78,7 +78,7 @@ let vue_sjcx = new Vue({
} }
}); });
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
} }
} }
}); });
...@@ -99,7 +99,7 @@ let vue_sjcx = new Vue({ ...@@ -99,7 +99,7 @@ let vue_sjcx = new Vue({
this.num1 = 1000; this.num1 = 1000;
this.sjlx = item.id; this.sjlx = item.id;
this.gd_span = ''; this.gd_span = '';
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
}, },
//事件类型切换 //事件类型切换
change_gd: function (item, index) { change_gd: function (item, index) {
...@@ -107,7 +107,7 @@ let vue_sjcx = new Vue({ ...@@ -107,7 +107,7 @@ let vue_sjcx = new Vue({
this.sjlx = item.id; this.sjlx = item.id;
this.num1 = index; this.num1 = index;
this.gd_span = item.name; this.gd_span = item.name;
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
}, },
//详情 //详情
xq: function (item) { xq: function (item) {
...@@ -136,7 +136,7 @@ let vue_sjcx = new Vue({ ...@@ -136,7 +136,7 @@ let vue_sjcx = new Vue({
} }
$("#myModal").modal("show"); $("#myModal").modal("show");
}, },
query: function (pages, items) { query: function (pages, items,exportornot) {
let nodes = $('#tree-xzxq').treeview('getChecked').filter(n=>n.level == null).map(n=> { let nodes = $('#tree-xzxq').treeview('getChecked').filter(n=>n.level == null).map(n=> {
return n.href return n.href
}); });
...@@ -194,6 +194,7 @@ let vue_sjcx = new Vue({ ...@@ -194,6 +194,7 @@ let vue_sjcx = new Vue({
processstatus: processstatus, processstatus: processstatus,
rectificationtype:'', rectificationtype:'',
}; };
if(exportornot==0){
$.ajax({ $.ajax({
url: "/TrafficStatistics/queryTraffalarmrecordByPage/1", url: "/TrafficStatistics/queryTraffalarmrecordByPage/1",
dateType: 'json', dateType: 'json',
...@@ -206,40 +207,38 @@ let vue_sjcx = new Vue({ ...@@ -206,40 +207,38 @@ let vue_sjcx = new Vue({
let a_sum = result.count; let a_sum = result.count;
vue_sjcx.count = result.count; vue_sjcx.count = result.count;
vue_sjcx.data_table_wfpz = result.data; vue_sjcx.data_table_wfpz = result.data;
if (items) {
$("#fy4").bootstrapPaginator({ }
bootstrapMajorVersion: 3, //版本,这里设置为3,大于2即可
currentPage: 1,//当前页
totalPages: Math.ceil(((a_sum > 0) ? a_sum : 1) / vue_sjcx.fy_select),//总页数
// numberofPages: 10,//显示的页数
itemTexts: function (type, page, current) { //修改显示文字
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page;
}
}, onPageClicked: function (event, originalEvent, type, page) { //异步换页
//请求加载数据
vue_sjcx.query(page, false);
} }
}); });
} }
else if(exportornot==1){
var xhr = new XMLHttpRequest();
xhr.open('post', '/TrafficStatistics/expAllTraffalarmrecord/1', true);
xhr.responseType = 'blob';
xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8');
xhr.onload = function () {
if (this.status == 200) {
var blob = this.response;
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
//设置文件名称
a.download = '告警事件.xlsx';
a.click();
} }
} }
}); xhr.send(JSON.stringify(json_s));
}
}, },
getChange: function () { getChange: function () {
setTimeout(function () { setTimeout(function () {
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
}, 200); }, 200);
}, },
exportData: function () {
vue_sjcx.query(1, true,1);
},
cli_input: function () { cli_input: function () {
vue_sjcx.state_arr = []; vue_sjcx.state_arr = [];
$(".div-ul").find('input:checked').each(function () { $(".div-ul").find('input:checked').each(function () {
...@@ -265,7 +264,7 @@ let vue_sjcx = new Vue({ ...@@ -265,7 +264,7 @@ let vue_sjcx = new Vue({
data: JSON.stringify(json_s), data: JSON.stringify(json_s),
success: function (result) { success: function (result) {
if (result.code == 0) { if (result.code == 0) {
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
info_new("状态修改成功"); info_new("状态修改成功");
window.setTimeout("$('#info-warning-new').modal('hide')", 2000); window.setTimeout("$('#info-warning-new').modal('hide')", 2000);
} }
...@@ -549,7 +548,7 @@ wss.onmessage = function (evt) { ...@@ -549,7 +548,7 @@ wss.onmessage = function (evt) {
}); });
if (if_cz) { if (if_cz) {
setTimeout(function () { setTimeout(function () {
vue_sjcx.query(1, true); vue_sjcx.query(1, true,0);
}, 200); }, 200);
} }
} }
......
...@@ -19,7 +19,24 @@ let vue_sjcx = new Vue({ ...@@ -19,7 +19,24 @@ let vue_sjcx = new Vue({
$(".div-pub-gt").find('input:checked').each(function () { $(".div-pub-gt").find('input:checked').each(function () {
vue_sjcx.state_arr.push($(this).val()); vue_sjcx.state_arr.push($(this).val());
}); });
let a = vue_sjcx.state_arr; if (vue_sjcx.state_arr.length == 0) {
info_new("未选择行");
window.setTimeout("$('#info-warning-new').modal('hide')", 2000);
return;
}
vue_ts.data_table_ts = [];
vue_sjcx.state_arr.forEach((item, index)=> {
vue_sjcx.data_table_wfpz.forEach((items, indexs)=> {
if (item == items.xh) {
vue_ts.data_table_ts.push(items);
}
});
});
$("#myModal_ts").modal("show");
}, },
getChange_tszt:function () { getChange_tszt:function () {
setTimeout(function () { setTimeout(function () {
...@@ -45,18 +62,16 @@ let vue_sjcx = new Vue({ ...@@ -45,18 +62,16 @@ let vue_sjcx = new Vue({
}, },
query: function (pages, items) { query: function (pages, items) {
$.ajax({ $.ajax({
url: "/TrafficStatistics/list/pushrecordsBypage", url: "/traffresult/querySbtdspsrResultByPage",
dateType: 'json', dateType: 'json',
type: "GET", type: "POST",
contentType: 'application/json', contentType: 'application/json',
data: { data: JSON.stringify({
starttime: starttime, xzbh:getCookie("bjpt_deptId"),
endtime: endtime,
page: pages, page: pages,
limit: this.fy_select, limit: this.fy_select,
pushstatus: this.clzt_select, pushstatus: this.clzt_select
construction: this.sjlx_select, }),
},
success: function (result) { success: function (result) {
vue_sjcx.data_table_wfpz = []; vue_sjcx.data_table_wfpz = [];
if (result.code == 0) { if (result.code == 0) {
...@@ -104,3 +119,61 @@ let vue_sjcx = new Vue({ ...@@ -104,3 +119,61 @@ let vue_sjcx = new Vue({
}, },
}); });
let vue_ts = new Vue({
el: '#myModal_ts',
data: {
data_table_ts: [],
},
methods: {
//删除
deletes: function (item, index) {
vue_ts.data_table_ts.splice(index, 1);
},
//开始推送
ts_ok: function () {
if (!confirm("确认推送当前表格中的设备吗")) {
return;
}
;
let arrs = '';
vue_sjcx.state_arr.forEach((item, index)=> {
arrs = arrs + item + ',';
});
$.ajax({
url: "/traffresult/sendDevices",
dataType: "json",
type: "POST",
data: {
xhs: arrs,
},
success: function (result) {
if (result.length > 0) {
result.forEach((item, index)=> {
vue_ts.data_table_ts.forEach((items, indexs)=> {
if (item.data == items.xh) {
items.pushdesc = item.msg;
if(item.status==200){
items.pushstatus = 0;
}else{
items.pushstatus = 1;
}
}
});
});
}
}
});
},
//单个推送
ts_s: function () {
},
}
});
$('#myModal_ts').on('hidden.bs.modal', function () {
vue_sjcx.query(1,true);
});
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
<i class="zadmin-icon zadmin-icon-delete zadmin-oper-area zadmin-red" title="删除"></i> <i class="zadmin-icon zadmin-icon-delete zadmin-oper-area zadmin-red" title="删除"></i>
</a> </a>
</shiro:hasPermission> </shiro:hasPermission>
hasPermission/
<shiro:lacksPermission name="menu:update, menu:delete"> <shiro:lacksPermission name="menu:update, menu:delete">
<i class="zadmin-icon zadmin-icon-wuquanxian zadmin-oper-area zadmin-red"></i>无权 <i class="zadmin-icon zadmin-icon-wuquanxian zadmin-oper-area zadmin-red"></i>无权
</shiro:lacksPermission> </shiro:lacksPermission>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<option value="1">推送失败</option> <option value="1">推送失败</option>
</select> </select>
<button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="getChange()">查询</button> <button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="getChange()">查询</button>
<button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="tss()" v-show="tssj_s">推送</button> <button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="tss()">推送</button>
</div> </div>
<div style="height:calc(100% - 130px);margin-top: 20px;" class="tables"> <div style="height:calc(100% - 130px);margin-top: 20px;" class="tables">
<table class="table table-td" style="text-align: center;"> <table class="table table-td" style="text-align: center;">
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
<tbody class="div-pub-gt"> <tbody class="div-pub-gt">
<tr v-for="(item,index) in data_table_wfpz"> <tr v-for="(item,index) in data_table_wfpz">
<td style="width: 40px;"> <td style="width: 40px;">
<input type="checkbox" name="loginName" class="loginName" :value="item.recordid" style="width: 17px;height: 17px;margin-top: 4px;"> <input type="checkbox" name="loginName" class="loginName" :value="item.xh" style="width: 17px;height: 17px;margin-top: 4px;">
</td> </td>
<td v-text="item.recordid"></td> <td v-text="item.sbbh"></td>
<td v-text="item.tdmc" style="width: 400px;"></td> <td v-text="item.tdmc" style="width: 400px;"></td>
<td v-text="item.xzmc"></td> <td v-text="item.tdbh"></td>
<td v-text="item.xzmc"></td> <td v-text="item.xztreename"></td>
<td v-text="item.xzmc"></td> <td v-text="item.xzbh"></td>
<td v-text="item.pushcount==null?'0':item.pushcount"></td> <td v-text="item.pushcount==null?'0':item.pushcount"></td>
<td v-text="item.pushdesc==null?'':item.pushdesc"></td> <td v-text="item.pushdesc==null?'':item.pushdesc"></td>
<td v-text="item.pushstatus==null||item.pushstatus=='9'?'待推送':item.pushstatus=='0'?'推送成功':'推送失败'"></td> <td v-text="item.pushstatus==null||item.pushstatus=='9'?'待推送':item.pushstatus=='0'?'推送成功':'推送失败'"></td>
...@@ -95,6 +95,63 @@ ...@@ -95,6 +95,63 @@
</div> </div>
</div> </div>
<!--事件推送弹出框-->
<div class="modal fade" id="myModal_ts" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="width: 1300px;">
<div class="modal-content" style="color: #e6eaef;width: 1300px;">
<div class="modal-header" style="background-color: rgb(48, 53, 72);">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true" style="color: white;">&times;</span></button>
<h6 class="modal-title">设备推送信息
</h6>
</div>
<div class="modal-body tables" style="height: 650px">
<button type="button" class="btn btn-sm pub-btn" style="margin-left: 0px;margin-top: 0px;" @click="ts_ok()">开始推送
</button>
<table class="table table-td" style="text-align: center;color: dimgrey;margin-top: 10px;">
<thead>
<tr style="background-color: rgb(228, 228, 228);">
<td style="width:40px;"></td>
<td>设备编号</td>
<td style="width: 10px;">通道编号</td>
<td style="width: 400px;">通道名称</td>
<!--<td>辖区名称</td>-->
<td>推送描述</td>
<td>推送状态</td>
<td style="width: 170px;">操作</td>
</tr>
</thead>
<tbody class="div-pub-gt" style="height: calc(100% - 30px);">
<tr v-for="(item,index) in data_table_ts">
<td v-text="index+1" style="width:40px;"></td>
<td v-text="item.sbbh" ></td>
<td v-text="item.tdbh" style="width:10px;"></td>
<td v-text="item.tdmc" style="width: 200px;"></td>
<!--<td v-text="item.xztreename"></td>-->
<td v-text="item.pushdesc==null?'':item.pushdesc"></td>
<td v-text="item.pushstatus==null||item.pushstatus=='9'?'待推送':item.pushstatus=='0'?'推送成功':'推送失败'"></td>
<td style="width: 170px;">
<!--<button type="button" class="btn btn-sm pub-btn pubs_1"-->
<!--@click="xq(item)">详情-->
<!--</button>-->
<button type="button" class="btn btn-sm pub-btn pubs_1"
@click="ts_s(item)" :style="{'background-color':item.pushstatus!=1?'#cccccc':'#368ff3','pointer-events':item.pushstatus!=1?'none':''}">推送
</button>
<button type="button" class="btn btn-sm pub-btn pubs_1"
@click="deletes(item,index)">删除
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer" style="border-top:none;">
<button type="button" class="btn btn-sm" data-dismiss="modal" style="color: #2f2f2f;">关闭</button>
</div>
</div>
</div>
</div>
</body> </body>
<script src="../js/jquery-3.1.1.min.js"></script> <script src="../js/jquery-3.1.1.min.js"></script>
<!--<script src="../js/viewer.min.js"></script>--> <!--<script src="../js/viewer.min.js"></script>-->
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
</ul> </ul>
<span style="float: left;margin-left: 18px;line-height: 48px;color: #368ff3;" v-text="gd_span"></span> <span style="float: left;margin-left: 18px;line-height: 48px;color: #368ff3;" v-text="gd_span"></span>
<button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="getChange()">查询</button> <button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="getChange()">查询</button>
<button type="button" class="btn btn-sm pub-btn" style="margin-left: 30px;" @click="exportData()">导出</button>
</div> </div>
<div style="height:calc(100% - 164px);margin-top: 20px;" class="tables"> <div style="height:calc(100% - 164px);margin-top: 20px;" class="tables">
<ul class="div-ul div-pub-gt" v-if="show"> <ul class="div-ul div-pub-gt" v-if="show">
......
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