Jelajahi Sumber

处理前端页面

wukai 2 tahun lalu
induk
melakukan
8a5338f81c

+ 122 - 101
sync-in/src/main/resources/templates/in/info/info.html

@@ -1,92 +1,95 @@
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
-    <th:block th:include="include :: header('内网数据同步列表')" />
+    <th:block th:include="include :: header('内网数据同步列表')"/>
 </head>
 <body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                <label>同步文件名:</label>
-                                <input type="text" name="syncFileName"/>
-                            </li>
-                            <li>
-                                <label>同步文件MD5值:</label>
-                                <input type="text" name="syncFileMd5"/>
-                            </li>
-                            <li>
-                                <label>同步文件大小:</label>
-                                <input type="text" name="syncFileSize"/>
-                            </li>
-                            <li>
-                                <label>同步文件本次序号:</label>
-                                <input type="text" name="syncSort"/>
-                            </li>
-                            <li>
-                                <label>文件MD5值校验:</label>
-                                <input type="text" name="syncValid"/>
-                            </li>
-                            <li>
-                                <label>文件处理花费时间:</label>
-                                <input type="text" name="costTime"/>
-                            </li>
-                            <li>
-                                <label>成功状态:</label>
-                                <input type="text" name="isSucess"/>
-                            </li>
-                            <li>
-                                <label>文件处理时间:</label>
-                                <input type="text" class="time-input" placeholder="请选择文件处理时间" name="createTime"/>
-                            </li>
-                            <li>
-                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                            </li>
-                        </ul>
-                    </div>
-                </form>
-            </div>
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>同步文件名:</label>
+                            <input type="text" name="syncFileName"/>
+                        </li>
+                        <li>
+                            <label>同步文件MD5值:</label>
+                            <input type="text" name="syncFileMd5"/>
+                        </li>
+                        <li>
+                            <label>同步文件大小:</label>
+                            <input type="text" name="syncFileSize"/>
+                        </li>
+                        <li>
+                            <label>同步文件本次序号:</label>
+                            <input type="text" name="syncSort"/>
+                        </li>
+                        <li>
+                            <label>文件MD5值校验:</label>
+                            <input type="text" name="syncValid"/>
+                        </li>
+                        <li>
+                            <label>文件处理花费时间:</label>
+                            <input type="text" name="costTime"/>
+                        </li>
+                        <li>
+                            <label>成功状态:</label>
+                            <input type="text" name="isSucess"/>
+                        </li>
+                        <li>
+                            <label>文件处理时间:</label>
+                            <input type="text" class="time-input" placeholder="请选择文件处理时间" name="createTime"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
+                                    class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
+                                    class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
 
-            <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="in:info:add">
-                    <i class="fa fa-plus"></i> 添加
-                </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="in:info:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="in:info:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="in:info:export">
-                    <i class="fa fa-download"></i> 导出
-                </a>
-            </div>
-            <div class="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="in:info:add">-->
+            <!--                    <i class="fa fa-plus"></i> 添加-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="in:info:edit">-->
+            <!--                    <i class="fa fa-edit"></i> 修改-->
+            <!--                </a>-->
+            <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="in:info:remove">-->
+            <!--                    <i class="fa fa-remove"></i> 删除-->
+            <!--                </a>-->
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="in:info:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
         </div>
     </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('in:info:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('in:info:remove')}]];
-        var prefix = ctx + "in/info";
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('in:info:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('in:info:remove')}]];
+    var yesNo = [[${@dict.getType('sys_yes_no')}]];
+    var prefix = ctx + "in/info";
 
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                modalName: "内网数据同步",
-                columns: [{
-                    checkbox: true
-                },
+    $(function () {
+        var options = {
+            url: prefix + "/list",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            exportUrl: prefix + "/export",
+            modalName: "内网数据同步",
+            columns: [{
+                checkbox: true
+            },
                 {
                     field: 'infoId',
                     title: '数据ID',
@@ -98,31 +101,49 @@
                 },
                 {
                     field: 'syncFileName',
-                    title: '同步文件名'
+                    title: '文件名'
                 },
                 {
                     field: 'syncFileMd5',
-                    title: '同步文件MD5值'
+                    title: '文件MD5值'
                 },
                 {
                     field: 'syncFileSize',
-                    title: '同步文件大小'
+                    title: '文件大小(MB)',
+                    formatter: function (value, row, index) {
+                        if (value / 1024 / 1024 / 1024 > 1) {
+                            return (value / 1024 / 1024 / 1024).toFixed(2) + " GB"
+                        } else if (value / 1024 / 1024 > 1) {
+                            return (value / 1024 / 1024).toFixed(2) + " MB"
+                        } else {
+                            return (value / 1024).toFixed(2) + " KB";
+                        }
+                    }
                 },
                 {
                     field: 'syncSort',
-                    title: '同步文件本次序号'
+                    title: '文件本次序号'
                 },
                 {
                     field: 'syncValid',
-                    title: '文件MD5值校验'
+                    title: 'MD5值校验状态',
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(yesNo, value);
+                    }
                 },
                 {
                     field: 'costTime',
-                    title: '文件处理花费时间'
+                    title: '花费时间(s)',
+                    formatter: function (value, row, index) {
+                        return value / 1000;
+                    }
                 },
                 {
                     field: 'isSucess',
-                    title: '成功状态'
+                    title: '成功状态',
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(yesNo, value);
+                    }
                 },
                 {
                     field: 'createTime',
@@ -131,20 +152,20 @@
                 {
                     field: 'logMsg',
                     title: '日志信息'
-                },
-                {
-                    title: '操作',
-                    align: 'center',
-                    formatter: function(value, row, index) {
-                        var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.infoId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.infoId + '\')"><i class="fa fa-remove"></i>删除</a>');
-                        return actions.join('');
-                    }
+                    // },
+                    // {
+                    //     title: '操作',
+                    //     align: 'center',
+                    //     formatter: function(value, row, index) {
+                    //         var actions = [];
+                    //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.infoId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                    //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.infoId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                    //         return actions.join('');
+                    //     }
                 }]
-            };
-            $.table.init(options);
-        });
-    </script>
+        };
+        $.table.init(options);
+    });
+</script>
 </body>
 </html>

+ 42 - 28
sync-out/src/main/resources/mapper/out/OutSyncInfoMapper.xml

@@ -1,44 +1,56 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.out.mapper.OutSyncInfoMapper">
-    
+
     <resultMap type="OutSyncInfo" id="OutSyncInfoResult">
-        <result property="infoId"    column="INFO_ID"    />
-        <result property="syncType"    column="SYNC_TYPE"    />
-        <result property="syncFileName"    column="SYNC_FILE_NAME"    />
-        <result property="syncFileMd5"    column="SYNC_FILE_MD5"    />
-        <result property="syncFileSize"    column="SYNC_FILE_SIZE"    />
-        <result property="syncSort"    column="SYNC_SORT"    />
-        <result property="costTime"    column="COST_TIME"    />
-        <result property="uploadTime"    column="UPLOAD_TIME"    />
-        <result property="uploadStatus"    column="UPLOAD_STATUS"    />
+        <result property="infoId" column="INFO_ID"/>
+        <result property="syncType" column="SYNC_TYPE"/>
+        <result property="syncFileName" column="SYNC_FILE_NAME"/>
+        <result property="syncFileMd5" column="SYNC_FILE_MD5"/>
+        <result property="syncFileSize" column="SYNC_FILE_SIZE"/>
+        <result property="syncSort" column="SYNC_SORT"/>
+        <result property="costTime" column="COST_TIME"/>
+        <result property="uploadTime" column="UPLOAD_TIME"/>
+        <result property="uploadStatus" column="UPLOAD_STATUS"/>
     </resultMap>
 
     <sql id="selectOutSyncInfoVo">
-        select INFO_ID, SYNC_TYPE, SYNC_FILE_NAME, SYNC_FILE_MD5, SYNC_FILE_SIZE, SYNC_SORT, COST_TIME, UPLOAD_TIME, UPLOAD_STATUS from out_sync_info
+        select INFO_ID,
+               SYNC_TYPE,
+               SYNC_FILE_NAME,
+               SYNC_FILE_MD5,
+               SYNC_FILE_SIZE,
+               SYNC_SORT,
+               COST_TIME,
+               UPLOAD_TIME,
+               UPLOAD_STATUS
+        from out_sync_info
     </sql>
 
     <select id="selectOutSyncInfoList" parameterType="OutSyncInfo" resultMap="OutSyncInfoResult">
         <include refid="selectOutSyncInfoVo"/>
-        <where>  
-            <if test="syncType != null  and syncType != ''"> and SYNC_TYPE = #{syncType}</if>
-            <if test="syncFileName != null  and syncFileName != ''"> and SYNC_FILE_NAME like concat('%', #{syncFileName}, '%')</if>
-            <if test="syncFileMd5 != null  and syncFileMd5 != ''"> and SYNC_FILE_MD5 = #{syncFileMd5}</if>
-            <if test="syncFileSize != null "> and SYNC_FILE_SIZE = #{syncFileSize}</if>
-            <if test="syncSort != null "> and SYNC_SORT = #{syncSort}</if>
-            <if test="costTime != null "> and COST_TIME = #{costTime}</if>
-            <if test="uploadTime != null "> and UPLOAD_TIME = #{uploadTime}</if>
-            <if test="uploadStatus != null  and uploadStatus != ''"> and UPLOAD_STATUS = #{uploadStatus}</if>
+        <where>
+            <if test="syncType != null  and syncType != ''">and SYNC_TYPE = #{syncType}</if>
+            <if test="syncFileName != null  and syncFileName != ''">and SYNC_FILE_NAME like concat('%', #{syncFileName},
+                '%')
+            </if>
+            <if test="syncFileMd5 != null  and syncFileMd5 != ''">and SYNC_FILE_MD5 = #{syncFileMd5}</if>
+            <if test="syncFileSize != null ">and SYNC_FILE_SIZE = #{syncFileSize}</if>
+            <if test="syncSort != null ">and SYNC_SORT = #{syncSort}</if>
+            <if test="costTime != null ">and COST_TIME = #{costTime}</if>
+            <if test="uploadTime != null ">and UPLOAD_TIME = #{uploadTime}</if>
+            <if test="uploadStatus != null  and uploadStatus != ''">and UPLOAD_STATUS = #{uploadStatus}</if>
         </where>
+        order by UPLOAD_TIME desc
     </select>
-    
+
     <select id="selectOutSyncInfoByInfoId" parameterType="Long" resultMap="OutSyncInfoResult">
         <include refid="selectOutSyncInfoVo"/>
         where INFO_ID = #{infoId}
     </select>
-        
+
     <insert id="insertOutSyncInfo" parameterType="OutSyncInfo" useGeneratedKeys="true" keyProperty="infoId">
         insert into out_sync_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -50,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="costTime != null">COST_TIME,</if>
             <if test="uploadTime != null">UPLOAD_TIME,</if>
             <if test="uploadStatus != null">UPLOAD_STATUS,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="syncType != null">#{syncType},</if>
             <if test="syncFileName != null">#{syncFileName},</if>
@@ -60,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="costTime != null">#{costTime},</if>
             <if test="uploadTime != null">#{uploadTime},</if>
             <if test="uploadStatus != null">#{uploadStatus},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateOutSyncInfo" parameterType="OutSyncInfo">
@@ -79,11 +91,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteOutSyncInfoByInfoId" parameterType="Long">
-        delete from out_sync_info where INFO_ID = #{infoId}
+        delete
+        from out_sync_info
+        where INFO_ID = #{infoId}
     </delete>
 
     <delete id="deleteOutSyncInfoByInfoIds" parameterType="String">
-        delete from out_sync_info where INFO_ID in 
+        delete from out_sync_info where INFO_ID in
         <foreach item="infoId" collection="array" open="(" separator="," close=")">
             #{infoId}
         </foreach>

+ 26 - 23
sync-out/src/main/resources/templates/out/process/process.html

@@ -18,11 +18,11 @@
                                 </select>
                             </li>
                             <li>
-                                <label>操作关键字;MONGO存储时间戳:</label>
+                                <label>时间戳:</label>
                                 <input type="text" name="processKey"/>
                             </li>
                             <li>
-                                <label>操作花费时间:</label>
+                                <label>花费时间(s):</label>
                                 <input type="text" name="costTime"/>
                             </li>
                             <li>
@@ -39,15 +39,15 @@
             </div>
 
             <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="out:process:add">
-                    <i class="fa fa-plus"></i> 添加
-                </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="out:process:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="out:process:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
+<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="out:process:add">-->
+<!--                    <i class="fa fa-plus"></i> 添加-->
+<!--                </a>-->
+<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="out:process:edit">-->
+<!--                    <i class="fa fa-edit"></i> 修改-->
+<!--                </a>-->
+<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="out:process:remove">-->
+<!--                    <i class="fa fa-remove"></i> 删除-->
+<!--                </a>-->
                 <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="out:process:export">
                     <i class="fa fa-download"></i> 导出
                 </a>
@@ -89,25 +89,28 @@
                 },
                 {
                     field: 'processKey',
-                    title: '操作关键字;MONGO存储时间戳'
+                    title: '操作关键字(时间戳)'
                 },
                 {
                     field: 'costTime',
-                    title: '操作花费时间'
+                    title: '花费时间(s)',
+                    formatter: function (value, row, index) {
+                        return value / 1000;
+                    }
                 },
                 {
                     field: 'createTime',
                     title: '操作时间'
-                },
-                {
-                    title: '操作',
-                    align: 'center',
-                    formatter: function(value, row, index) {
-                        var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.infoId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.infoId + '\')"><i class="fa fa-remove"></i>删除</a>');
-                        return actions.join('');
-                    }
+                // },
+                // {
+                //     title: '操作',
+                //     align: 'center',
+                //     formatter: function(value, row, index) {
+                //         var actions = [];
+                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.infoId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.infoId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                //         return actions.join('');
+                //     }
                 }]
             };
             $.table.init(options);

+ 0 - 0
sync-admin/src/main/resources/templates/out/sync/add.html → sync-out/src/main/resources/templates/out/sync/add.html


+ 0 - 0
sync-admin/src/main/resources/templates/out/sync/edit.html → sync-out/src/main/resources/templates/out/sync/edit.html


+ 1 - 1
sync-admin/src/main/resources/templates/out/sync/sync.html → sync-out/src/main/resources/templates/out/sync/sync.html

@@ -98,7 +98,7 @@
                 },
                 {
                     field: 'costTime',
-                    title: '文件上传花费时间(s)',
+                    title: '花费时间(s)',
                     formatter: function (value, row, index) {
                         return value / 1000;
                     }