ソースを参照

首页界面整改, dangan增加ord 排序字段 用于控制前端显示

1037015548@qq.com 2 年 前
コミット
fdb03e284a

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java

@@ -1,7 +1,9 @@
 package com.ruoyi.web.controller.system;
 
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 import javax.servlet.ServletRequest;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletResponse;

+ 1 - 1
ruoyi-admin/src/main/resources/application-test.yml

@@ -53,7 +53,7 @@ spring:
                 # 主库数据源 stringtype=unspecified 如果stringtype设置为 unspecified,参数将作为非类型值发送到服务器,并且服务器将尝试推断适当的类型。
                 master:
 #                     url: jdbc:postgresql://119.96.165.176:5432/test_lixing?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
-                     url: jdbc:postgresql://119.96.165.176:5432/lhk_union_mgr?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
+                     url: jdbc:postgresql://119.96.165.176:5432/lhk_union_mgr_new?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
                      username: postgres
                      password: kpr.23417.postgres
                 # 从库数据源

+ 12 - 0
ruoyi-admin/src/main/resources/templates/system/dangan/add.html

@@ -321,6 +321,18 @@
             <div class="row">
                 <div class="col-sm-6">
                     <div class="form-group">
+                        <label class="col-sm-3 control-label">排序:</label>
+                        <div class="col-sm-8">
+                            <input class="form-control" type="number" name="ord" required>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group">
                         <input type="hidden" id="fileName" name="fileName">
                         <input type="hidden" id="filePath" name="filePath">
                         <label class="col-sm-3 control-label ">文档信息:</label>

+ 12 - 0
ruoyi-admin/src/main/resources/templates/system/dangan/edit.html

@@ -317,6 +317,18 @@
             <div class="row">
                 <div class="col-sm-6">
                     <div class="form-group">
+                        <label class="col-sm-3 control-label">排序:</label>
+                        <div class="col-sm-8">
+                            <input class="form-control" type="number" name="ord" th:field="*{ord}" required>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-sm-6">
+                </div>
+            </div>
+            <div class="row">
+                <div class="col-sm-6">
+                    <div class="form-group">
                         <input type="hidden" id="fileName" name="fileName">
                         <input type="hidden" id="filePath" name="filePath">
                         <label  class="col-sm-3 control-label "  >文档信息:</label>

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/Dangan.java

@@ -152,6 +152,8 @@ public class Dangan extends BaseEntity
     @Excel(name = "图标信息")
     private String iconInfo;
 
+    private Integer ord;
+
     //图标id
     private Long iconId;
 
@@ -159,6 +161,14 @@ public class Dangan extends BaseEntity
 
     private String iconPath;
 
+    public Integer getOrd() {
+        return ord;
+    }
+
+    public void setOrd(Integer ord) {
+        this.ord = ord;
+    }
+
     public Long getIconId() {
         return iconId;
     }

+ 6 - 1
ruoyi-system/src/main/resources/mapper/system/DanganMapper.xml

@@ -45,13 +45,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+        <result property="ord"    column="ord"    />
     </resultMap>
 
     <sql id="selectDanganVo">
         select dangan_id,
         key_id,
         dangan_no,dangan_name, status,
-         sys_person, file_type, model, project_id, brand, run_device_id, relate_device_id, maintain_item_id, factory_time, project_time, use_unit, medium, maintain_time, page_address, test_address, build_factory, build_factory_time, factory_person, factory_person_phone, language, server_ip, server_location, server_info, server_based_yes_no, ops_person, charge_unit, mode, file_info,icon_info, create_by, create_time, update_by, update_time, remark from sys_dangan
+         sys_person, file_type, model, project_id, brand, run_device_id, relate_device_id, maintain_item_id, factory_time, project_time, use_unit, medium, maintain_time, page_address, test_address, build_factory, build_factory_time, factory_person, factory_person_phone, language, server_ip, server_location, server_info, server_based_yes_no, ops_person, charge_unit, mode, file_info,icon_info, create_by, create_time, update_by, update_time, remark,ord from sys_dangan
     </sql>
 
     <select id="selectDanganList" parameterType="Dangan" resultMap="DanganResult">
@@ -91,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="mode != null  and mode != ''"> and mode = #{mode}</if>
             <if test="fileInfo != null  and fileInfo != ''"> and file_info = #{fileInfo}</if>
             <if test="iconInfo != null  and iconInfo != ''"> and icon_info = #{iconInfo}</if>
+            <if test="ord != null  and ord != ''"> and ord = #{ord}</if>
         </where>
     </select>
     
@@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="ord != null">ord,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="danganName != null">#{danganName},</if>
@@ -182,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="ord != null">#{ord},</if>
          </trim>
     </insert>
 
@@ -227,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="ord != null">ord = #{ord},</if>
         </trim>
         where dangan_id = #{danganId}
     </update>

+ 1 - 0
ruoyi-system/src/main/resources/mapper/system/UserRelateMapper.xml

@@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND to_date(ur.relate_time,'YY-MM-DD') &lt;= to_date(#{params.endTime},'YY-MM-DD')
             </if>
         </where>
+        order by d.ord
     </select>
     
     <select id="selectUserRelateById" parameterType="Long" resultMap="UserRelateResult">