王佳豪
2021-06-26 1192471cf1701e532ceb32dc103f1c8e0fb818ba
sap请求日志
1.列表显示优化
2.增加Sap请求日志模糊搜索功能
7个文件已修改
70 ■■■■ 已修改文件
src/main/java/com/slcf/controller/SapRequestLogController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/slcf/dao/SapRequestLogDao.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/slcf/service/SapRequestLogService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/slcf/service/impl/SapRequestLogServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/SapRequestLogMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/pages/sapRequestLog.jsp 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/jsFiles/sapRequestLog.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/slcf/controller/SapRequestLogController.java
@@ -39,8 +39,8 @@
    /* 查询sap请求日志 */
    @ResponseBody
    @RequestMapping("/querySapLog.action")
    public List<SapRequestLogBean> querySapLog(){
        List<SapRequestLogBean> list = sapRequestLogService.querySapLog();
    public List<SapRequestLogBean> querySapLog(String condition){
        List<SapRequestLogBean> list = sapRequestLogService.querySapLog(condition);
        return list;
    }
}
src/main/java/com/slcf/dao/SapRequestLogDao.java
@@ -12,7 +12,7 @@
public interface SapRequestLogDao {
    // 查询sap请求日志
    public List<SapRequestLogBean> querySapLog();
    public List<SapRequestLogBean> querySapLog(@Param("condition") String condition);
    // 新增sap请求日志
    public Integer addSapLog(@Param("matnr") String matnr, @Param("request") String request, @Param("response") String response, @Param("create_time") Date create_time, @Param("type") Integer type, @Param("remark") String remark);
src/main/java/com/slcf/service/SapRequestLogService.java
@@ -10,7 +10,7 @@
/* 查询sap请求日志 */
public interface SapRequestLogService {
    public List<SapRequestLogBean> querySapLog();
    public List<SapRequestLogBean> querySapLog(String condition);
    public Integer addSapLog(SapRequestLogBean param);
}
src/main/java/com/slcf/service/impl/SapRequestLogServiceImpl.java
@@ -24,8 +24,8 @@
    /**
     * 查询sap请求日志
     */
    public List<SapRequestLogBean> querySapLog() {
        List<SapRequestLogBean> list = sapRequestLogDao.querySapLog();
    public List<SapRequestLogBean> querySapLog(String condition) {
        List<SapRequestLogBean> list = sapRequestLogDao.querySapLog(condition);
        return list;
    }
src/main/resources/mapper/SapRequestLogMapper.xml
@@ -15,7 +15,18 @@
</resultMap>
<select id="querySapLog" resultMap="BaseResult">
    SELECT * FROM sap_request_log ORDER BY create_time desc;
    SELECT * FROM sap_request_log
    where 1 = 1
    <if test="condition != null and condition != ''">
        and (
        matnr like '%' + #{condition} + '%'
        or request like '%' + #{condition} + '%'
        or response like '%' + #{condition} + '%'
        or remark like '%' + #{condition} + '%'
        or type like '%' + #{condition} + '%'
        )
    </if>
    ORDER BY create_time desc
</select>
<insert id="addSapLog">
src/main/webapp/WEB-INF/pages/sapRequestLog.jsp
@@ -7,21 +7,36 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="${path }/jsFiles/sapRequestLog.js"></script>
<style type="text/css">
</style>
</head>
<body>
<%--<div class="panel panel-default">--%>
<%--<div class="panel-body">--%>
<%--<form id="conForm" class="form-inline">--%>
<%----%>
<%--</form>--%>
<%--</div>--%>
<%--</div>--%>
<div class="panel panel-default">
    <div class="panel-body">
        <input type="text" class="form-control" style="width:10%; display: inline-block" id="condition" name="condition"
               placeholder="请输入">
        <button style="display: inline-block" type="button" onclick="onSearch()" class="btn btn-info">
            <span class="glyphicon glyphicon-search" aria-hidden="true">  搜索</span></button>
    </div>
</div>
<div class="table-responsive">
    <table id="test-table" class="table table-hover table-striped table-condensed table-bordered"></table>
</div>
<div id="showDetail" class="modal fade" data-backdrop="static">
    <div>
    </div>
    <div class="modal-content">
        <div class="modal-header" id="headerName">
           日志明细
@@ -35,5 +50,6 @@
    </div>
</div>
<script type="text/javascript" src="${path }/jsFiles/sapRequestLog.js"></script>
</body>
</html>
src/main/webapp/jsFiles/sapRequestLog.js
@@ -69,12 +69,11 @@
        ],
        queryParamsType: "undefined",
        queryParams: function queryParams(params) {   //设置查询参数
            // var param = {
            //     pageNumber: params.pageNumber,
            //     pageSize: params.pageSize
            //     // searchText: params.searchText
            // };
            // return param;
            var condition = $("#condition").val();
            var param = {
                condition: condition
            };
            return param;
        },
        formatLoadingMessage: function () {
            return "请稍等,正在加载中...";
@@ -201,3 +200,13 @@
    // 显示模态框
    $("#showDetail").modal('hide');
}
function onSearch() {
    $("#test-table").bootstrapTable('refreshOptions',{pageNumber:1}); //分页后重新搜索时,初始化页码为1
}
$('#content').keydown(function () {
    if (event.keyCode === 13) {
        onSearch();
    }
});