Explorar o código

修改系统配置页面及表设计

chengpan %!s(int64=2) %!d(string=hai) anos
pai
achega
7c0a9ed7d0

+ 6 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/opt/SysInfoConfigController.java

@@ -1,6 +1,9 @@
 package com.ruoyi.web.controller.opt;
 
 import java.util.List;
+
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.opt.domain.ConfigDictData;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -72,8 +75,10 @@ public class SysInfoConfigController extends BaseController
      * 新增系统配置
      */
     @GetMapping("/add")
-    public String add()
+    public String add(ModelMap mmap)
     {
+        List<ConfigDictData> dictDataList = sysInfoConfigService.selectConfigSysTpList();
+        mmap.put("data", JSON.toJSON(dictDataList));
         return prefix + "/add";
     }
 

+ 49 - 52
ruoyi-admin/src/main/resources/templates/opt/config/add.html

@@ -6,75 +6,72 @@
 <body class="white-bg">
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
         <form class="form-horizontal m" id="form-config-add">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">系统类型:</label>
-                <div class="col-sm-8">
-                    <select name="sysTpCd" class="form-control m-b" th:with="type=${@dict.getType('sys_tp_cd')}">
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                    </select>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">接口请求类型:</label>
-                <div class="col-sm-8">
-                    <select name="methTpCd" class="form-control m-b" th:with="type=${@dict.getType('process_status_cd')}">
-                        <option value="">--请选择--</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                    </select>
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">接口请求地址:</label>
-                <div class="col-sm-8">
-                    <input name="methUrl" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">APPID:</label>
-                <div class="col-sm-8">
-                    <input name="appId" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">APPKEY:</label>
-                <div class="col-sm-8">
-                    <input name="appKey" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">收款开户行:</label>
-                <div class="col-sm-8">
-                    <input name="skKhh" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">收款账户名称:</label>
-                <div class="col-sm-8">
-                    <input name="skAccountNm" class="form-control" type="text">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">配置类型:</label>
+                <div id="element" class="row">
+                    <div class="col-sm-4">
+                        <select name="typeCd" class="type form-control m-b" data-first-title="请选择">
+                            <option value="">请选择</option>
+                        </select>
+                    </div>
+                    <div class="col-sm-4">
+                        <select name="sceneTpCd" class="router form-control m-b" data-first-title="请选择">
+                            <option value="">请选择</option>
+                        </select>
+                    </div>
                 </div>
             </div>
             <div class="form-group">    
-                <label class="col-sm-3 control-label">收款账号:</label>
+                <label class="col-sm-3 control-label">内容:</label>
                 <div class="col-sm-8">
-                    <input name="skAccount" class="form-control" type="text">
+                    <input name="content" class="form-control" type="text">
                 </div>
             </div>
             <div class="form-group">    
                 <label class="col-sm-3 control-label">状态:</label>
                 <div class="col-sm-8">
-                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
-                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
-                    </div>
+                    <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_normal_disable')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                    </select>
                 </div>
             </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />
+    <th:block th:include="include :: jquery-cxselect-js" />
     <script th:inline="javascript">
+        // 直接返回获取
+        var data = [[${data}]];
+        $('#element').cxSelect({
+            selects: ['type', 'router'],
+            jsonValue: 'v',
+            data: data
+        });
+
         var prefix = ctx + "opt/config"
         $("#form-config-add").validate({
-            focusCleanup: true
+            rules: {
+                typeCd: {
+                    required: true
+                },
+                sceneTpCd: {
+                    required: true
+                },
+                content: {
+                    required: true
+                }
+            },
+            messages: {
+                typeCd: {
+                    required: "",
+                },
+                sceneTpCd: {
+                    required: "",
+                },
+                content: {
+                    required: "内容不能为空",
+                }
+            }
         });
 
         function submitHandler() {

+ 104 - 114
ruoyi-admin/src/main/resources/templates/opt/config/config.html

@@ -1,160 +1,150 @@
 <!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>
-                                <select name="sysTpCd" th:with="type=${@dict.getType('sys_tp_cd')}">
-                                    <option value="">所有</option>
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                                </select>
-                            </li>
-                            <li>
-                                <label>接口请求地址:</label>
-                                <input type="text" name="methUrl"/>
-                            </li>
-                            <li>
-                                <label>APPID:</label>
-                                <input type="text" name="appId"/>
-                            </li>
-                            <li>
-                                <label>收款开户行:</label>
-                                <input type="text" name="skKhh"/>
-                            </li>
-                            <li>
-                                <label>收款账户名称:</label>
-                                <input type="text" name="skAccountNm"/>
-                            </li>
-                            <li>
-                                <label>收款账号:</label>
-                                <input type="text" name="skAccount"/>
-                            </li>
-                            <li>
-                                <label>状态:</label>
-                                <select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
-                                    <option value="">所有</option>
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                                </select>
-                            </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>
+                            <select name="typeCd" th:with="type=${@dict.getType('sys_tp_cd')}">
+                                <option value="">所有</option>
+                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
+                                        th:value="${dict.dictValue}"></option>
+                            </select>
+                        </li>
+                        <li>
+                            <label>场景类型:</label>
+                            <select name="sceneTpCd" th:with="type=${@dict.getType('sys_tp_cd')}">
+                                <option value="">所有</option>
+                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
+                                        th:value="${dict.dictValue}"></option>
+                            </select>
+                        </li>
+                        <li>
+                            <label>内容:</label>
+                            <input type="text" name="content"/>
+                        </li>
+                        <li>
+                            <label>状态:</label>
+                            <select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
+                                <option value="">所有</option>
+                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
+                                        th:value="${dict.dictValue}"></option>
+                            </select>
+                        </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="opt:config:add">
-                    <i class="fa fa-plus"></i> 添加
-                </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="opt:config:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="opt:config:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="opt:config: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="opt:config:add">
+                <i class="fa fa-plus"></i> 添加
+            </a>
+            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="opt:config:edit">
+                <i class="fa fa-edit"></i> 修改
+            </a>
+            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
+               shiro:hasPermission="opt:config:remove">
+                <i class="fa fa-remove"></i> 删除
+            </a>
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="opt:config: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('opt:config:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('opt:config:remove')}]];
-        var sysTpCdDatas = [[${@dict.getType('sys_tp_cd')}]];
-        var methTpCdDatas = [[${@dict.getType('process_status_cd')}]];
-        var statusDatas = [[${@dict.getType('sys_normal_disable')}]];
-        var prefix = ctx + "opt/config";
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('opt:config:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('opt:config:remove')}]];
+    var typeCdDatas = [[${@dict.getType('sys_tp_cd')}]];
+    var sceneTpCdDatas = [[${@dict.getType('sys_tp_cd')}]];
+    var statusDatas = [[${@dict.getType('sys_normal_disable')}]];
+    var prefix = ctx + "opt/config";
 
-        $(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: 'confId',
                     title: '配置ID',
                     visible: false
                 },
                 {
-                    field: 'sysTpCd',
+                    field: 'typeCd',
                     title: '系统类型',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(sysTpCdDatas, value);
-                    }
-                },
-                {
-                    field: 'methTpCd',
-                    title: '接口请求类型',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(methTpCdDatas, value);
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(typeCdDatas, value);
                     }
                 },
                 {
-                    field: 'methUrl',
-                    title: '接口请求地址'
+                    field: 'sceneTpNm',
+                    title: '场景类型'
                 },
                 {
-                    field: 'appId',
-                    title: 'APPID'
+                    field: 'content',
+                    title: '内容'
                 },
                 {
-                    field: 'appKey',
-                    title: 'APPKEY'
+                    field: 'createBy',
+                    title: '创建人'
                 },
                 {
-                    field: 'skKhh',
-                    title: '收款开户行'
+                    field: 'createTime',
+                    title: '创建时间'
                 },
                 {
-                    field: 'skAccountNm',
-                    title: '收款账户名称'
+                    field: 'updateBy',
+                    title: '修改人'
                 },
                 {
-                    field: 'skAccount',
-                    title: '收款账号'
+                    field: 'updateTime',
+                    title: '修改时间'
                 },
                 {
                     field: 'status',
                     title: '状态',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(statusDatas, value);
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(statusDatas, value);
                     }
                 },
                 {
                     title: '操作',
                     align: 'center',
-                    formatter: function(value, row, index) {
+                    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.confId + '\')"><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.confId + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }]
-            };
-            $.table.init(options);
-        });
-    </script>
+        };
+        $.table.init(options);
+    });
+</script>
 </body>
 </html>

+ 10 - 42
ruoyi-admin/src/main/resources/templates/opt/config/edit.html

@@ -10,63 +10,31 @@
             <div class="form-group">    
                 <label class="col-sm-3 control-label">系统类型:</label>
                 <div class="col-sm-8">
-                    <select name="sysTpCd" class="form-control m-b" th:with="type=${@dict.getType('sys_tp_cd')}">
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sysTpCd}"></option>
+                    <select name="typeCd" class="form-control m-b" th:with="type=${@dict.getType('sys_tp_cd')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{typeCd}"></option>
                     </select>
                 </div>
             </div>
             <div class="form-group">    
-                <label class="col-sm-3 control-label">接口请求类型:</label>
+                <label class="col-sm-3 control-label">场景类型:</label>
                 <div class="col-sm-8">
-                    <select name="methTpCd" class="form-control m-b" th:with="type=${@dict.getType('process_status_cd')}">
-                        <option value="">--请选择--</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{methTpCd}"></option>
+                    <select name="sceneTpCd" class="form-control m-b" th:with="type=${@dict.getType('sys_tp_cd')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sceneTpCd}"></option>
                     </select>
                 </div>
             </div>
             <div class="form-group">    
-                <label class="col-sm-3 control-label">接口请求地址:</label>
+                <label class="col-sm-3 control-label">内容:</label>
                 <div class="col-sm-8">
-                    <input name="methUrl" th:field="*{methUrl}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">APPID:</label>
-                <div class="col-sm-8">
-                    <input name="appId" th:field="*{appId}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">APPKEY:</label>
-                <div class="col-sm-8">
-                    <input name="appKey" th:field="*{appKey}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">收款开户行:</label>
-                <div class="col-sm-8">
-                    <input name="skKhh" th:field="*{skKhh}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">收款账户名称:</label>
-                <div class="col-sm-8">
-                    <input name="skAccountNm" th:field="*{skAccountNm}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">收款账号:</label>
-                <div class="col-sm-8">
-                    <input name="skAccount" th:field="*{skAccount}" class="form-control" type="text">
+                    <input name="content" th:field="*{content}" class="form-control" type="text">
                 </div>
             </div>
             <div class="form-group">    
                 <label class="col-sm-3 control-label">状态:</label>
                 <div class="col-sm-8">
-                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
-                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
-                    </div>
+                    <select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_normal_disable')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
+                    </select>
                 </div>
             </div>
         </form>

+ 30 - 0
ruoyi-system/src/main/java/com/ruoyi/opt/domain/ConfigDictData.java

@@ -0,0 +1,30 @@
+package com.ruoyi.opt.domain;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ConfigDictData {
+
+    /**
+     * 数据值字段名称
+     */
+    private String v;
+
+    /**
+     * 数据标题字段名称
+     */
+    private String n;
+
+    /**
+     * 子集数据字段名称
+     */
+    private List<ConfigDictData> s;
+
+    /**
+     * 下级字典类型
+     */
+    private String childDictType;
+
+}

+ 13 - 137
ruoyi-system/src/main/java/com/ruoyi/opt/domain/SysInfoConfig.java

@@ -1,5 +1,6 @@
 package com.ruoyi.opt.domain;
 
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -7,10 +8,11 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 系统配置对象 sys_info_config
- * 
+ *
  * @author chengpan
  * @date 2022-09-05
  */
+@Data
 public class SysInfoConfig extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -20,148 +22,22 @@ public class SysInfoConfig extends BaseEntity
 
     /** 系统类型 */
     @Excel(name = "系统类型")
-    private String sysTpCd;
+    private String typeCd;
 
-    /** 接口请求类型 */
-    @Excel(name = "接口请求类型")
-    private String methTpCd;
+    /** 场景类型 */
+    @Excel(name = "场景类型编码")
+    private String sceneTpCd;
 
-    /** 接口请求地址 */
-    @Excel(name = "接口请求地址")
-    private String methUrl;
+    /** 场景类型 */
+    @Excel(name = "场景类型名称")
+    private String sceneTpNm;
 
-    /** APPID */
-    @Excel(name = "APPID")
-    private String appId;
-
-    /** APPKEY */
-    @Excel(name = "APPKEY")
-    private String appKey;
-
-    /** 收款开户行 */
-    @Excel(name = "收款开户行")
-    private String skKhh;
-
-    /** 收款账户名称 */
-    @Excel(name = "收款账户名称")
-    private String skAccountNm;
-
-    /** 收款账号 */
-    @Excel(name = "收款账号")
-    private String skAccount;
+    /** 内容 */
+    @Excel(name = "内容")
+    private String content;
 
     /** 状态 */
     @Excel(name = "状态")
     private String status;
 
-    public void setConfId(Long confId) 
-    {
-        this.confId = confId;
-    }
-
-    public Long getConfId() 
-    {
-        return confId;
-    }
-    public void setSysTpCd(String sysTpCd) 
-    {
-        this.sysTpCd = sysTpCd;
-    }
-
-    public String getSysTpCd() 
-    {
-        return sysTpCd;
-    }
-    public void setMethTpCd(String methTpCd) 
-    {
-        this.methTpCd = methTpCd;
-    }
-
-    public String getMethTpCd() 
-    {
-        return methTpCd;
-    }
-    public void setMethUrl(String methUrl) 
-    {
-        this.methUrl = methUrl;
-    }
-
-    public String getMethUrl() 
-    {
-        return methUrl;
-    }
-    public void setAppId(String appId) 
-    {
-        this.appId = appId;
-    }
-
-    public String getAppId() 
-    {
-        return appId;
-    }
-    public void setAppKey(String appKey) 
-    {
-        this.appKey = appKey;
-    }
-
-    public String getAppKey() 
-    {
-        return appKey;
-    }
-    public void setSkKhh(String skKhh) 
-    {
-        this.skKhh = skKhh;
-    }
-
-    public String getSkKhh() 
-    {
-        return skKhh;
-    }
-    public void setSkAccountNm(String skAccountNm) 
-    {
-        this.skAccountNm = skAccountNm;
-    }
-
-    public String getSkAccountNm() 
-    {
-        return skAccountNm;
-    }
-    public void setSkAccount(String skAccount) 
-    {
-        this.skAccount = skAccount;
-    }
-
-    public String getSkAccount() 
-    {
-        return skAccount;
-    }
-    public void setStatus(String status) 
-    {
-        this.status = status;
-    }
-
-    public String getStatus() 
-    {
-        return status;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("confId", getConfId())
-            .append("sysTpCd", getSysTpCd())
-            .append("methTpCd", getMethTpCd())
-            .append("methUrl", getMethUrl())
-            .append("appId", getAppId())
-            .append("appKey", getAppKey())
-            .append("skKhh", getSkKhh())
-            .append("skAccountNm", getSkAccountNm())
-            .append("skAccount", getSkAccount())
-            .append("status", getStatus())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .toString();
-    }
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/opt/mapper/SysInfoConfigMapper.java

@@ -3,8 +3,10 @@ package com.ruoyi.opt.mapper;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.opt.domain.ConfigDictData;
 import com.ruoyi.opt.domain.SysInfoConfig;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 系统配置Mapper接口
@@ -62,4 +64,10 @@ public interface SysInfoConfigMapper extends BaseMapper<SysInfoConfig>
      * @return 结果
      */
     public int deleteSysInfoConfigByConfIds(String[] confIds);
+
+    /**
+     * 获取配置登记页面下拉框
+     * @return
+     */
+    List<ConfigDictData> selectDictDataListByDictType(@Param("dictType") String dictType);
 }

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/opt/service/ISysInfoConfigService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.opt.service;
 
 import java.util.List;
+
+import com.ruoyi.opt.domain.ConfigDictData;
 import com.ruoyi.opt.domain.SysInfoConfig;
 
 /**
@@ -58,4 +60,11 @@ public interface ISysInfoConfigService
      * @return 结果
      */
     public int deleteSysInfoConfigByConfId(Long confId);
+
+    /**
+     * 获取配置登记页面下拉框
+     * @return
+     */
+    List<ConfigDictData> selectConfigSysTpList();
+
 }

+ 18 - 0
ruoyi-system/src/main/java/com/ruoyi/opt/service/impl/SysInfoConfigServiceImpl.java

@@ -2,12 +2,15 @@ package com.ruoyi.opt.service.impl;
 
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.opt.domain.ConfigDictData;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.opt.mapper.SysInfoConfigMapper;
 import com.ruoyi.opt.domain.SysInfoConfig;
 import com.ruoyi.opt.service.ISysInfoConfigService;
 import com.ruoyi.common.core.text.Convert;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 系统配置Service业务层处理
@@ -95,4 +98,19 @@ public class SysInfoConfigServiceImpl implements ISysInfoConfigService
     {
         return sysInfoConfigMapper.deleteSysInfoConfigByConfId(confId);
     }
+
+    @Override
+    public List<ConfigDictData> selectConfigSysTpList() {
+        List<ConfigDictData> configDictDataList = sysInfoConfigMapper.selectDictDataListByDictType("sys_tp_cd");
+        if(!CollectionUtils.isEmpty(configDictDataList)){
+            for (ConfigDictData configDictData : configDictDataList) {
+                String childDictType = configDictData.getChildDictType();
+                if(StringUtils.isNotBlank(childDictType)){
+                    List<ConfigDictData> childConfigDictData = sysInfoConfigMapper.selectDictDataListByDictType(childDictType);
+                    configDictData.setS(childConfigDictData);
+                }
+            }
+        }
+        return configDictDataList;
+    }
 }

+ 43 - 50
ruoyi-system/src/main/resources/mapper/opt/SysInfoConfigMapper.xml

@@ -1,19 +1,15 @@
 <?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.ruoyi.opt.mapper.SysInfoConfigMapper">
-    
+
     <resultMap type="SysInfoConfig" id="SysInfoConfigResult">
         <result property="confId"    column="conf_id"    />
-        <result property="sysTpCd"    column="sys_tp_cd"    />
-        <result property="methTpCd"    column="meth_tp_cd"    />
-        <result property="methUrl"    column="meth_url"    />
-        <result property="appId"    column="app_id"    />
-        <result property="appKey"    column="app_key"    />
-        <result property="skKhh"    column="sk_khh"    />
-        <result property="skAccountNm"    column="sk_account_nm"    />
-        <result property="skAccount"    column="sk_account"    />
+        <result property="typeCd"    column="type_cd"    />
+        <result property="sceneTpCd"    column="scene_tp_cd"    />
+        <result property="sceneTpNm"    column="scene_tp_nm"    />
+        <result property="content"    column="content"    />
         <result property="status"    column="status"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -22,72 +18,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectSysInfoConfigVo">
-        select conf_id, sys_tp_cd, meth_tp_cd, meth_url, app_id, app_key, sk_khh, sk_account_nm, sk_account, status, create_by, create_time, update_by, update_time from sys_info_config
+        select c.conf_id, c.type_cd, c.scene_tp_cd, c.content, c.STATUS, c.create_by, c.create_time, c.update_by, c.update_time,
+               (SELECT a.dict_label FROM sys_dict_data a WHERE a.dict_value = c.scene_tp_cd
+                    AND a.dict_type = (SELECT d.child_dict_type FROM sys_dict_data d WHERE d.dict_type = 'sys_tp_cd' AND d.dict_value = c.type_cd)
+               ) AS scene_tp_nm
+        FROM
+            sys_info_config c
     </sql>
 
     <select id="selectSysInfoConfigList" parameterType="SysInfoConfig" resultMap="SysInfoConfigResult">
         <include refid="selectSysInfoConfigVo"/>
-        <where>  
-            <if test="sysTpCd != null  and sysTpCd != ''"> and sys_tp_cd = #{sysTpCd}</if>
-            <if test="methUrl != null  and methUrl != ''"> and meth_url like concat('%', #{methUrl}, '%')</if>
-            <if test="appId != null  and appId != ''"> and app_id like concat('%', #{appId}, '%')</if>
-            <if test="skKhh != null  and skKhh != ''"> and sk_khh like concat('%', #{skKhh}, '%')</if>
-            <if test="skAccountNm != null  and skAccountNm != ''"> and sk_account_nm like concat('%', #{skAccountNm}, '%')</if>
-            <if test="skAccount != null  and skAccount != ''"> and sk_account like concat('%', #{skAccount}, '%')</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+        <where>
+            <if test="typeCd != null  and typeCd != ''"> and c.type_cd = #{typeCd}</if>
+            <if test="sceneTpCd != null  and sceneTpCd != ''"> and c.scene_tp_cd = #{sceneTpCd}</if>
+            <if test="content != null  and content != ''"> and c.content = #{content}</if>
+            <if test="status != null  and status != ''"> and c.status = #{status}</if>
         </where>
     </select>
-    
+
     <select id="selectSysInfoConfigByConfId" parameterType="Long" resultMap="SysInfoConfigResult">
         <include refid="selectSysInfoConfigVo"/>
-        where conf_id = #{confId}
+        where c.conf_id = #{confId}
     </select>
-        
+
     <insert id="insertSysInfoConfig" parameterType="SysInfoConfig" useGeneratedKeys="true" keyProperty="confId">
         insert into sys_info_config
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="sysTpCd != null">sys_tp_cd,</if>
-            <if test="methTpCd != null">meth_tp_cd,</if>
-            <if test="methUrl != null">meth_url,</if>
-            <if test="appId != null">app_id,</if>
-            <if test="appKey != null">app_key,</if>
-            <if test="skKhh != null">sk_khh,</if>
-            <if test="skAccountNm != null">sk_account_nm,</if>
-            <if test="skAccount != null">sk_account,</if>
+            <if test="typeCd != null">type_cd,</if>
+            <if test="sceneTpCd != null">scene_tp_cd,</if>
+            <if test="content != null">content,</if>
             <if test="status != null">status,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="sysTpCd != null">#{sysTpCd},</if>
-            <if test="methTpCd != null">#{methTpCd},</if>
-            <if test="methUrl != null">#{methUrl},</if>
-            <if test="appId != null">#{appId},</if>
-            <if test="appKey != null">#{appKey},</if>
-            <if test="skKhh != null">#{skKhh},</if>
-            <if test="skAccountNm != null">#{skAccountNm},</if>
-            <if test="skAccount != null">#{skAccount},</if>
+            <if test="typeCd != null">#{typeCd},</if>
+            <if test="sceneTpCd != null">#{sceneTpCd},</if>
+            <if test="content != null">#{content},</if>
             <if test="status != null">#{status},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateSysInfoConfig" parameterType="SysInfoConfig">
         update sys_info_config
         <trim prefix="SET" suffixOverrides=",">
-            <if test="sysTpCd != null">sys_tp_cd = #{sysTpCd},</if>
-            <if test="methTpCd != null">meth_tp_cd = #{methTpCd},</if>
-            <if test="methUrl != null">meth_url = #{methUrl},</if>
-            <if test="appId != null">app_id = #{appId},</if>
-            <if test="appKey != null">app_key = #{appKey},</if>
-            <if test="skKhh != null">sk_khh = #{skKhh},</if>
-            <if test="skAccountNm != null">sk_account_nm = #{skAccountNm},</if>
-            <if test="skAccount != null">sk_account = #{skAccount},</if>
+            <if test="typeCd != null">type_cd = #{typeCd},</if>
+            <if test="sceneTpCd != null">scene_tp_cd = #{sceneTpCd},</if>
+            <if test="content != null">content = #{content},</if>
             <if test="status != null">status = #{status},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
@@ -102,10 +85,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteSysInfoConfigByConfIds" parameterType="String">
-        delete from sys_info_config where conf_id in 
+        delete from sys_info_config where conf_id in
         <foreach item="confId" collection="array" open="(" separator="," close=")">
             #{confId}
         </foreach>
     </delete>
 
+    <resultMap type="ConfigDictData" id="ConfigDictDataResult">
+        <result property="v"    column="dict_value"    />
+        <result property="n"    column="dict_label"    />
+        <result property="childDictType"    column="child_dict_type"    />
+    </resultMap>
+
+    <select id="selectDictDataListByDictType" parameterType="String"  resultMap="ConfigDictDataResult">
+        select d.dict_value, d.dict_label ,d.child_dict_type from sys_dict_data d where d.dict_type = #{dictType}
+    </select>
+
 </mapper>