Commit c465c71e by wangling

日志查询添加导出功能

parent 8d248499
......@@ -11,11 +11,13 @@ import com.founder.interservice.splog.model.SpLog;
import com.founder.interservice.splog.service.SpLogService;
import com.founder.interservice.util.EasyUIPage;
import com.alibaba.fastjson.JSONArray;
import com.founder.interservice.util.ExportExcelUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -99,6 +101,21 @@ public class LoginLogController {
return objectMap;
}
/**
* 导出登录日志统计Excel
* @param response
* @param loginLog
* @throws Exception
*/
@RequestMapping(value="/exportDlrzExcel")
public void exportDlrzExcel(HttpServletResponse response, LoginLog loginLog)throws Exception{
List<LoginLog> rtrdList = loginLogService.getLoginLogExcel(loginLog);
//导出Excel
ExportExcelUtil<LoginLog> exportExcelUtil = new ExportExcelUtil<>();
String[] headersName = {"案事件编号","登录人姓名","登录人身份证号","登录人警号","登录人联系电话","登录单位","登录IP","登录时间"};
String[] headersField = {"asjbh","cxrXm","cxrSfzh","cxrJh","cxrLxdh","dldwmc","cxrKssj","cxrIp","cxrJssj"};
exportExcelUtil.exportExcel("登录日志显示统计表", headersName, headersField, rtrdList, response);
}
@RequestMapping(value = "/selectLoginLogPage",method = {RequestMethod.GET,RequestMethod.POST})
public String getSelectLoginLogPage(){
......
......@@ -2,6 +2,7 @@ package com.founder.interservice.loginlog.service;
import com.founder.interservice.loginlog.model.LoginLog;
import java.util.List;
import java.util.Map;
/**
......@@ -24,4 +25,6 @@ public interface LoginLogService {
//查询一段时间内登录人数
public int selectLoginNum(LoginLog loginLog);
List<LoginLog> getLoginLogExcel(LoginLog loginLog);
}
......@@ -51,4 +51,9 @@ public class LoginLogServiceImpl implements LoginLogService {
System.out.print("total==="+total);
return total;
}
@Override
public List<LoginLog> getLoginLogExcel(LoginLog loginLog) {
return loginLogMapper.getLoginLogExcel(loginLog);
}
}
......@@ -39,4 +39,6 @@ public interface LoginLogMapper {
* @return
*/
public int getLoginLogCount(LoginLog loginLog);
List<LoginLog> getLoginLogExcel(LoginLog loginLog);
}
......@@ -32,4 +32,5 @@ public interface RecordLogMapper {
//(分页list)
public List<Querylog> queryQueryLogByPage(QuerylogFilter filter) throws Exception;
List<Querylog> getQueryLogExcel(QuerylogFilter filter);
}
......@@ -4,6 +4,8 @@ import com.founder.interservice.splog.model.SpLog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by zhulinying on 2019/3/22.
*/
......@@ -16,4 +18,6 @@ public interface SpLogmapper {
* @throws
*/
int selectSplogNum(SpLog spLog);
List<SpLog> getSpLogExcel(SpLog spLog);
}
......@@ -7,6 +7,7 @@ import com.founder.interservice.recordLog.model.Querylog;
import com.founder.interservice.recordLog.queryModel.QuerylogFilter;
import com.founder.interservice.recordLog.service.RecordLogService;
import com.founder.interservice.util.EasyUIPage;
import com.founder.interservice.util.ExportExcelUtil;
import com.founder.interservice.util.ResultVOUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -95,5 +97,20 @@ public class RecordLogController {
public ModelAndView recordLogView(){
return new ModelAndView("RecordLog/RecordLog");
}
/**
* 导出查询日志统计Excel
* @param response
* @param filter
* @throws Exception
*/
@RequestMapping(value="/exportCxrzExcel")
public void exportCxrzExcel(HttpServletResponse response, QuerylogFilter filter)throws Exception{
List<Querylog> rtrdList = recordLogService.getQueryLogExcel(filter);
//导出Excel
ExportExcelUtil<Querylog> exportExcelUtil = new ExportExcelUtil<>();
String[] headersName = {"案事件编号","查询标识号","标识号类型名称","查询人姓名","查询人身份证号","查询人警号","查询人联系电话","查询人单位","登记时间"};
String[] headersField = {"asjbh","cxbsh","bshlxmc","cxrXm","cxrSfzh","cxrJh","cxrLxdh","dldwmc","cxrKssj","cxrJssj"};
exportExcelUtil.exportExcel("查询日志显示统计表", headersName, headersField, rtrdList, response);
}
}
......@@ -3,6 +3,7 @@ package com.founder.interservice.recordLog.service;
import com.founder.interservice.recordLog.model.Querylog;
import com.founder.interservice.recordLog.queryModel.QuerylogFilter;
import java.util.List;
import java.util.Map;
/**
......@@ -17,4 +18,5 @@ public interface RecordLogService {
public void saveQueryLog(Querylog querylog) throws Exception;
public Map<String,Object> queryQueryLogList(QuerylogFilter filter) throws Exception;
List<Querylog> getQueryLogExcel(QuerylogFilter filter);
}
......@@ -41,4 +41,9 @@ public class RecordLogServiceImpl implements RecordLogService {
resuletMap.put("queryLogList",queryLogList);
return resuletMap;
}
@Override
public List<Querylog> getQueryLogExcel(QuerylogFilter filter) {
return recordLogMapper.getQueryLogExcel(filter);
}
}
......@@ -3,6 +3,7 @@ package com.founder.interservice.splog.controller;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.splog.model.SpLog;
import com.founder.interservice.splog.service.SpLogService;
import com.founder.interservice.util.ExportExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -61,7 +63,20 @@ public class SpLogController {
}
return objectMap;
}
/**
* 导出审批日志统计Excel
* @param response
* @param spLog
* @throws Exception
*/
@RequestMapping(value="/exportSprzExcel")
public void exportSprzExcel(HttpServletResponse response, SpLog spLog)throws Exception{
List<SpLog> rtrdList = spLogService.getSpLogExcel(spLog);
//导出Excel
ExportExcelUtil<SpLog> exportExcelUtil = new ExportExcelUtil<>();
String[] headersName = {"申请标题","案事件编号","审批标识号","标识号类型名称","呈请人姓名","呈请人身份证号","呈请人警号","呈请人联系电话","呈请人单位","登记时间"};
String[] headersField = {"spTitle","asjbh","spbsh","bshlxmc","cqrXm","cqrSfzh","cqrJh","cqrLxdh","dldwmc","djsj"};
exportExcelUtil.exportExcel("审批日志显示统计表", headersName, headersField, rtrdList, response);
}
}
......@@ -4,8 +4,12 @@ import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.splog.model.SpLog;
import org.springframework.data.domain.Page;
import java.util.List;
public interface SpLogService {
public void saveSpLog(SpLog spLog) throws Exception;
public Page<SpLog> querySpLogs(SpLog spLog) throws InterServiceException;
public int selectSplogNum(SpLog spLog) throws InterServiceException;
List<SpLog> getSpLogExcel(SpLog spLog);
}
......@@ -19,6 +19,7 @@ import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.Date;
import java.util.List;
@Service
public class SpLogServiceImpl implements SpLogService {
......@@ -111,4 +112,9 @@ public class SpLogServiceImpl implements SpLogService {
}
return predicate;
}
@Override
public List<SpLog> getSpLogExcel(SpLog spLog) {
return spLogmapper.getSpLogExcel(spLog);
}
}
......@@ -162,5 +162,23 @@
</where>
</select>
<select id="getQueryLogExcel" parameterType="com.founder.interservice.recordLog.queryModel.QuerylogFilter" resultType="com.founder.interservice.recordLog.queryModel.QuerylogFilter">
select
t.CXR_SFZH as cxrSfzh,
t.CXR_XM as cxrXm,
t.CXR_JH as cxrJh,
t.CXR_LXDH as cxrLxdh,
t.DLDWDM,
t.DLDWMC,
t.CXBSH,
t.BSHLXDM,
t.BSHLXMC,
t.ASJBH,
t.DJSJ
from TB_ST_QUERYLOG t
<where>
<include refid="queryQueryLog_where"/>
</where>
order by t.DJSJ desc
</select>
</mapper>
\ No newline at end of file
......@@ -107,4 +107,21 @@
<include refid="loginLog_where_sql" />
</where>
</select>
<select id="getLoginLogExcel" parameterType="com.founder.interservice.loginlog.model.LoginLog" resultType="com.founder.interservice.loginlog.model.LoginLog">
select
t.ASJBH as asjbh,
t.CXR_SFZH as cxrSfzh,
t.CXR_XM as cxrXm,
t.CXR_JH as cxrJh,
t.CXR_LXDH as cxrLxdh,
t.dldwdm,
t.dldwmc,
t.CXR_DLSJ as cxrDlsj,
t.CXR_IP as cxrIp
FROM TB_ST_LOGINLOG t
<where>
<include refid="loginLog_where_sql" />
</where>
order by CXR_DLSJ desc
</select>
</mapper>
\ No newline at end of file
<?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.founder.interservice.mapper.xzxt.SpLogmapper">
<sql id="querySpLog_where">
<if test="spTitle != null and spTitle != ''">
and t.SP_TITLE like CONCAT(CONCAT('%',#{spTitle}),'%')
</if>
<if test="cqrSfzh != null and cqrSfzh != ''">
and t.CQR_SFZH like CONCAT(CONCAT('%',#{cqrSfzh}),'%')
</if>
<if test="cqrXm != null and cqrXm != '' ">
and t.CQR_XM like CONCAT(CONCAT('%',#{cqrXm}),'%')
</if>
<if test="cqrJh != null and cqrJh != ''">
and t.CQR_JH like CONCAT(CONCAT('%',#{cqrJh}),'%')
</if>
<if test="cqrLxdh != null and cqrLxdh != ''">
and t.CQR_LXDH like CONCAT(CONCAT('%',#{cqrLxdh}),'%')
</if>
<if test="cqrIp != null and cqrIp != ''">
and t.CQR_IP like CONCAT(CONCAT('%',#{cqrIp}),'%')
</if>
<if test="dldwdm != null and dldwdm != ''">
and t.DLDWDM like CONCAT(CONCAT('%',#{dldwdm}),'%')
</if>
<if test="dldwmc != null and dldwmc != ''">
and t.DLDWMC like CONCAT(CONCAT('%',#{dldwmc}),'%')
</if>
<if test="spbsh != null and spbsh != ''">
and t.SPBSH like CONCAT(CONCAT('%',#{spbsh}),'%')
</if>
<if test="bshlxdm != null and bshlxdm != ''">
and t.BSHLXDM like CONCAT(CONCAT('%',#{bshlxdm}),'%')
</if>
<if test="bshlxmc != null and bshlxmc != ''">
and t.BSHLXMC like CONCAT(CONCAT('%',#{bshlxmc}),'%')
</if>
<if test="asjbh != null and asjbh != ''">
and t.ASJBH like CONCAT(CONCAT('%',#{asjbh}),'%')
</if>
<if test="kssj != null and kssj != ''">
and t.DJSJ <![CDATA[>=]]> to_date(#{startTime},'yyyy-MM-dd')
</if>
<if test="jssj != null and jssj != ''">
and t.DJSJ <![CDATA[<=]]> to_date(#{endTime},'yyyy-MM-dd')
</if>
</sql>
<select id="selectSplogNum" parameterType="com.founder.interservice.splog.model.SpLog" resultType="java.lang.Integer">
SELECT COUNT(*) FROM TB_ST_SPLOG t
<where>
......@@ -12,5 +58,26 @@
</if>
</where>
</select>
<select id="getSpLogExcel" parameterType="com.founder.interservice.splog.model.SpLog" resultType="com.founder.interservice.splog.model.SpLog">
select
t.SP_TITLE as spTitle,
t.CQR_SFZH as cqrSfzh,
t.CQR_XM as cqrXm,
t.CQR_JH as cqrJh,
t.CQR_LXDH as cqrLxdh,
t.CQR_IP as cqrIp,
t.DLDWDM,
t.DLDWMC,
t.SPBSH,
t.BSHLXDM,
t.BSHLXMC,
t.ASJBH,
t.SPZT,
t.DJSJ
from TB_ST_SPLOG t
<where>
<include refid="querySpLog_where"/>
</where>
order by t.DJSJ desc
</select>
</mapper>
\ No newline at end of file
......@@ -56,6 +56,7 @@
<td colspan="8" style="text-align:center;">
<a href="javascript:queryQueryLog();" class="btn_cx">查询</a>
<a href="javascript:clear();" class="btn_qkcxtj">重置</a>
<li class="pull-right" style="margin-right: 15px; position: relative;top: -3px;cursor: pointer;" value="excel" onclick="exportExcel()"><img src="/images/dcexcel.png" style="position: relative;top: 20px;margin-right: 4px;"/></li>
</td>
</tr>
</table>
......@@ -134,7 +135,25 @@
});
}
function exportExcel(){
var param= {
"asjbh":$("#asjbh").val().trim(),
"cxrXm":$("#cxrXm").val().trim(),
"cxrSfzh":$("#cxrSfzh").val().trim(),
"cxrJh":$("#cxrJh").val().trim(),
"cxrLxdh":$("#cxrLxdh").val().trim(),
"dldwmc":$("#dldwmc").val().trim(),
"cxrKssj":$("#cxrKssj").datebox("getValue"),
"cxrJssj":$("#cxrJssj").datebox("getValue"),
"yhCate":"00",
"projectName":"刑专智慧侦查脑图"
};
$.messager.confirm('确认', "确定导出excel附件吗?", function (r) {
if (r) {
window.open ("/exportDlrzExcel?projectName="+param.projectName+"&yhCate="+param.yhCate+"&asjbh="+param.asjbhs+"&cxrXm="+param.cxrXm+"&cxrSfzh="+param.cxrSfzh+"&cxrJh="+param.cxrJh+"&cxrLxdh="+param.cxrLxdh+"&dldwmc="+param.dldwmc+"&cxrKssj="+param.cxrKssj+"&cxrJssj="+param.cxrJssj);
}
});
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -70,6 +70,7 @@
<td colspan="8" style="text-align:center;">
<a href="javascript:queryQueryLog();" class="btn_cx">查询</a>
<a href="javascript:clear();" class="btn_qkcxtj">重置</a>
<li class="pull-right" style="margin-right: 15px; position: relative;top: -3px;cursor: pointer;" value="excel" onclick="exportExcel()"><img src="/images/dcexcel.png" style="position: relative;top: 20px;margin-right: 4px;"/></li>
</td>
</tr>
</table>
......@@ -152,7 +153,27 @@ function queryQueryLog(){
});
}
function exportExcel(){
var param= {
"asjbh":$("#asjbh").val().trim(),
"cxbsh":$("#cxbsh").val().trim(),
"bshlxdm":$("#bshlxdm").val(),
"cxrXm":$("#cxrXm").val().trim(),
"cxrSfzh":$("#cxrSfzh").val().trim(),
"cxrJh":$("#cxrJh").val().trim(),
"cxrLxdh":$("#cxrLxdh").val().trim(),
"dldwmc":$("#dldwmc").val().trim(),
"kssj":$("#kssj").datebox("getValue"),
"jssj":$("#jssj").datebox("getValue"),
"yhCate":"00",
"projectName":"刑专智慧侦查脑图"
};
$.messager.confirm('确认', "确定导出excel附件吗?", function (r) {
if (r) {
window.open ("/exportCxrzExcel?projectName="+param.projectName+"&yhCate="+param.yhCate+"&asjbh="+param.asjbh+"&cxbsh="+param.cxbsh+"&bshlxdm="+param.bshlxdm+"&cxrXm="+param.cxrXm+"&cxrSfzh="+param.cxrSfzh+"&cxrJh="+param.cxrJh+"&cxrLxdh="+param.cxrLxdh+"&dldwmc="+param.dldwmc+"&kssj="+param.kssj+"&jssj="+param.jssj);
}
});
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -71,6 +71,7 @@
<td colspan="8" style="text-align:center;">
<a href="javascript:queryQueryLog();" class="btn_cx">查询</a>
<a href="javascript:clear();" class="btn_qkcxtj">重置</a>
<li class="pull-right" style="margin-right: 15px; position: relative;top: -3px;cursor: pointer;" value="excel" onclick="exportExcel()"><img src="/images/dcexcel.png" style="position: relative;top: 20px;margin-right: 4px;"/></li>
</td>
</tr>
</table>
......@@ -154,7 +155,27 @@ function queryQueryLog(){
}
});
}
function exportExcel(){
var param= {
"asjbh":$("#asjbh").val().trim(),
"spbsh":$("#spbsh").val().trim(),
"bshlxdm":$("#bshlxdm").val().trim(),
"cqrXm":$("#cxrXm").val().trim(),
"cqrSfzh":$("#cxrSfzh").val().trim(),
"cqrJh":$("#cxrJh").val().trim(),
"cqrLxdh":$("#cxrLxdh").val().trim(),
"dldwmc":$("#dldwmc").val().trim(),
"startTime":$("#startTime").datebox("getValue")==""?null:$("#startTime").datebox("getValue"),
"endTime":$("#endTime").datebox("getValue")==""?null:$("#endTime").datebox("getValue"),
"yhCate":"00",
"projectName":"刑专智慧侦查脑图"
};
$.messager.confirm('确认', "确定导出excel附件吗?", function (r) {
if (r) {
window.open ("/exportSprzExcel?projectName="+param.projectName+"&yhCate="+param.yhCate+"&asjbh="+param.asjbh+"&spbsh="+param.spbsh+"&bshlxdm="+param.bshlxdm+"&cqrXm="+param.cqrXm+"&cqrSfzh="+param.cqrSfzh+"&cqrJh="+param.cqrJh+"&cqrLxdh="+param.cqrLxdh+"&dldwmc="+param.dldwmc+"&startTime="+param.startTime+"&endTime="+param.endTime);
}
});
}
</script>
</body>
</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