Administrator %!s(int64=3) %!d(string=hai) anos
pai
achega
53908b8533

+ 6 - 0
leiSP-admin/pom.xml

@@ -85,6 +85,12 @@
             <artifactId>mybusiness</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.13</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 1 - 0
leiSP-admin/src/main/resources/templates/index.html

@@ -180,6 +180,7 @@
                     </a>
                 </div>
                 <ul class="nav navbar-top-links navbar-right welcome-message">
+					<li><a title="可视化" href="/VisualizationController/index" target="_blank"><i class="fa fa-video-camera"></i> 可视化</a></li>
                     <li><a title="示例" href="" target="_blank"><i class="fa fa-video-camera"></i> 示例</a></li>
                     <li><a title="文档" href="" target="_blank"><i class="fa fa-question-circle"></i> 文档</a></li>
 	                <li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li>

+ 16 - 0
mybusiness/src/main/java/com/business/controller/SysTestController.java

@@ -0,0 +1,16 @@
+package com.business.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Controller
+@RequestMapping("SysTestController")
+public class SysTestController {
+
+    @GetMapping("sfz")
+    public String sfz(){
+        return "system/test/sfz";
+    }
+}

+ 16 - 0
mybusiness/src/main/java/com/business/controller/VisualizationController.java

@@ -0,0 +1,16 @@
+package com.business.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("VisualizationController")
+public class VisualizationController {
+
+    @GetMapping("index")
+    public String index(){
+        return "/visualization/index";
+    }
+
+}

+ 40 - 22
mybusiness/src/main/java/com/sooka/system/controller/TUInterfaceinfoController.java

@@ -8,6 +8,10 @@ import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.page.TableDataInfo;
 import com.sooka.common.enums.BusinessType;
 import com.sooka.common.utils.poi.ExcelUtil;
+import com.sooka.system.domain.TUParamsbusiness;
+import com.sooka.system.domain.TUParamspublic;
+import com.sooka.system.service.ITUParamsbusinessService;
+import com.sooka.system.service.ITUParamspublicService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -20,6 +24,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.sooka.system.domain.TUInterfaceinfo;
 import com.sooka.system.service.ITUInterfaceinfoService;
 
+import javax.annotation.Resource;
+
 
 /**
  * 【请填写功能名称】Controller
@@ -29,17 +35,19 @@ import com.sooka.system.service.ITUInterfaceinfoService;
  */
 @Controller
 @RequestMapping("/system/interfaceinfo")
-public class TUInterfaceinfoController extends BaseController
-{
+public class TUInterfaceinfoController extends BaseController {
     private String prefix = "system/interfaceinfo";
 
     @Autowired
     private ITUInterfaceinfoService tUInterfaceinfoService;
+    @Resource
+    private ITUParamsbusinessService ituParamsbusinessService;
+    @Resource
+    private ITUParamspublicService ituParamspublicService;
 
     @RequiresPermissions("system:interfaceinfo:view")
     @GetMapping()
-    public String interfaceinfo()
-    {
+    public String interfaceinfo() {
         return prefix + "/interfaceinfo";
     }
 
@@ -49,8 +57,7 @@ public class TUInterfaceinfoController extends BaseController
     @RequiresPermissions("system:interfaceinfo:list")
     @PostMapping("/list")
     @ResponseBody
-    public TableDataInfo list(TUInterfaceinfo tUInterfaceinfo)
-    {
+    public TableDataInfo list(TUInterfaceinfo tUInterfaceinfo) {
         startPage();
         List<TUInterfaceinfo> list = tUInterfaceinfoService.selectTUInterfaceinfoList(tUInterfaceinfo);
         return getDataTable(list);
@@ -63,8 +70,7 @@ public class TUInterfaceinfoController extends BaseController
     @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ResponseBody
-    public AjaxResult export(TUInterfaceinfo tUInterfaceinfo)
-    {
+    public AjaxResult export(TUInterfaceinfo tUInterfaceinfo) {
         List<TUInterfaceinfo> list = tUInterfaceinfoService.selectTUInterfaceinfoList(tUInterfaceinfo);
         ExcelUtil<TUInterfaceinfo> util = new ExcelUtil<TUInterfaceinfo>(TUInterfaceinfo.class);
         return util.exportExcel(list, "interfaceinfo");
@@ -74,8 +80,7 @@ public class TUInterfaceinfoController extends BaseController
      * 新增【请填写功能名称】
      */
     @GetMapping("/add")
-    public String add()
-    {
+    public String add() {
         return prefix + "/add";
     }
 
@@ -86,8 +91,7 @@ public class TUInterfaceinfoController extends BaseController
     @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
-    public AjaxResult addSave(TUInterfaceinfo tUInterfaceinfo)
-    {
+    public AjaxResult addSave(TUInterfaceinfo tUInterfaceinfo) {
         return toAjax(tUInterfaceinfoService.insertTUInterfaceinfo(tUInterfaceinfo));
     }
 
@@ -95,8 +99,7 @@ public class TUInterfaceinfoController extends BaseController
      * 修改【请填写功能名称】
      */
     @GetMapping("/edit/{id}")
-    public String edit(@PathVariable("id") String id, ModelMap mmap)
-    {
+    public String edit(@PathVariable("id") String id, ModelMap mmap) {
         TUInterfaceinfo tUInterfaceinfo = tUInterfaceinfoService.selectTUInterfaceinfoById(id);
         mmap.put("tUInterfaceinfo", tUInterfaceinfo);
         return prefix + "/edit";
@@ -109,8 +112,7 @@ public class TUInterfaceinfoController extends BaseController
     @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @ResponseBody
-    public AjaxResult editSave(TUInterfaceinfo tUInterfaceinfo)
-    {
+    public AjaxResult editSave(TUInterfaceinfo tUInterfaceinfo) {
         return toAjax(tUInterfaceinfoService.updateTUInterfaceinfo(tUInterfaceinfo));
     }
 
@@ -119,18 +121,34 @@ public class TUInterfaceinfoController extends BaseController
      */
     @RequiresPermissions("system:interfaceinfo:remove")
     @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
-    @PostMapping( "/remove")
+    @PostMapping("/remove")
     @ResponseBody
-    public AjaxResult remove(String ids)
-    {
+    public AjaxResult remove(String ids) {
         return toAjax(tUInterfaceinfoService.deleteTUInterfaceinfoByIds(ids));
     }
 
     @GetMapping("/settingParams/{id}")
-    public String repair(@PathVariable("id") String id, ModelMap mmap)
-    {
+    public String settingParams(@PathVariable("id") String id, ModelMap mmap) {
         mmap.put("interfaceinfo_id", id);
-        return prefix + "/index";
+        return "system/paramsbusiness/paramsbusiness";
+    }
+
+    @GetMapping("/execInterface/{id}")
+    public String execInterface(@PathVariable("id") String id, ModelMap mmap) {
+        mmap.put("interfaceinfo_id", id);
+        //按接口id查询接口基本信息
+        TUInterfaceinfo tuInterfaceinfo = tUInterfaceinfoService.selectTUInterfaceinfoById(id);
+        //按接口id查询公共参数
+        List params_public = ituParamspublicService.selectTUParamspublicList(new TUParamspublic());
+        //按接口id查询业务参数
+        TUParamsbusiness tuParamsbusiness = new TUParamsbusiness();
+        tuParamsbusiness.setInterfaceinfoId(id);
+        List params_business = ituParamsbusinessService.selectTUParamsbusinessList(tuParamsbusiness);
+
+        mmap.put("tuInterfaceinfo",tuInterfaceinfo);
+        mmap.put("params_public_list",params_public);
+        mmap.put("params_business_list",params_business);
+        return "system/interfaceinfo/execInterface";
     }
 
 }

+ 3 - 2
mybusiness/src/main/java/com/sooka/system/controller/TUParamsbusinessController.java

@@ -73,9 +73,10 @@ public class TUParamsbusinessController extends BaseController
     /**
      * 新增业务请求参数
      */
-    @GetMapping("/add")
-    public String add()
+    @GetMapping("/add/{interfaceinfo_id}")
+    public String add(@PathVariable("interfaceinfo_id") String id,ModelMap mmap)
     {
+
         return prefix + "/add";
     }
 

+ 15 - 0
mybusiness/src/main/java/com/sooka/system/domain/TUParamsbusiness.java

@@ -5,6 +5,7 @@ import com.sooka.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+
 /**
  * 业务请求参数对象 t_u_paramsbusiness
  *
@@ -53,6 +54,10 @@ public class TUParamsbusiness extends BaseEntity
     @Excel(name = "顺序")
     private Long seq;
 
+    /** 对应接口id */
+    @Excel(name = "对应接口id")
+    private String interfaceinfoId;
+
     public void setId(String id)
     {
         this.id = id;
@@ -143,6 +148,15 @@ public class TUParamsbusiness extends BaseEntity
     {
         return seq;
     }
+    public void setInterfaceinfoId(String interfaceinfoId)
+    {
+        this.interfaceinfoId = interfaceinfoId;
+    }
+
+    public String getInterfaceinfoId()
+    {
+        return interfaceinfoId;
+    }
 
     @Override
     public String toString() {
@@ -162,6 +176,7 @@ public class TUParamsbusiness extends BaseEntity
             .append("isRequired", getIsRequired())
             .append("pamsexplain", getPamsexplain())
             .append("seq", getSeq())
+            .append("interfaceinfoId", getInterfaceinfoId())
             .toString();
     }
 }

+ 65 - 0
mybusiness/src/main/java/com/util/ImgBase64.java

@@ -0,0 +1,65 @@
+package com.util;
+
+import org.apache.commons.codec.binary.Base64;
+import sun.misc.BASE64Decoder;
+
+import java.io.*;
+
+public class ImgBase64 {
+    /**
+     * 将图片转换成Base64编码
+     * @param imgFile 待处理图片
+     * @return
+     */
+    public static String getImgStr(String imgFile) {
+        // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
+
+        InputStream in = null;
+        byte[] data = null;
+        // 读取图片字节数组
+        try {
+            in = new FileInputStream(imgFile);
+            data = new byte[in.available()];
+            in.read(data);
+            in.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return Base64.encodeBase64String(data);
+    }
+
+    /**
+     * 对字节数组字符串进行Base64解码并生成图片
+     * @param imgStr 图片数据
+     * @param imgFilePath 保存图片全路径地址
+     * @return
+     */
+    public static boolean generateImage(String imgStr, String imgFilePath) {
+        //
+        if (imgStr == null) // 图像数据为空
+            return false;
+        BASE64Decoder decoder = new BASE64Decoder();
+        try {
+            // Base64解码
+            byte[] b = decoder.decodeBuffer(imgStr);
+            for (int i = 0; i < b.length; ++i) {
+                if (b[i] < 0) {// 调整异常数据
+                    b[i] += 256;
+                }
+            }
+            // 生成jpg图片
+            OutputStream out = new FileOutputStream(imgFilePath);
+            out.write(b);
+            out.flush();
+            out.close();
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+
+    public static void main(String[] args){
+        System.out.println(getImgStr("d:/test.png"));
+    }
+}

+ 13 - 7
mybusiness/src/main/resources/mapper/system/TUParamsbusinessMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sooka.system.mapper.TUParamsbusinessMapper">
-    
+
     <resultMap type="TUParamsbusiness" id="TUParamsbusinessResult">
         <result property="id"    column="id"    />
         <result property="status"    column="status"    />
@@ -20,15 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isRequired"    column="is_required"    />
         <result property="pamsexplain"    column="pamsexplain"    />
         <result property="seq"    column="seq"    />
+        <result property="interfaceinfoId"    column="interfaceinfo_id"    />
     </resultMap>
 
     <sql id="selectTUParamsbusinessVo">
-        select id, status, remark, del_flag, create_by, create_time, update_by, update_time, field_en, field_name, field_type, max_length, is_required, pamsexplain, seq from t_u_paramsbusiness
+        select id, status, remark, del_flag, create_by, create_time, update_by, update_time, field_en, field_name, field_type, max_length, is_required, pamsexplain, seq, interfaceinfo_id from t_u_paramsbusiness
     </sql>
 
     <select id="selectTUParamsbusinessList" parameterType="TUParamsbusiness" resultMap="TUParamsbusinessResult">
         <include refid="selectTUParamsbusinessVo"/>
-        <where>  
+        <where>
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="fieldEn != null  and fieldEn != ''"> and field_en = #{fieldEn}</if>
             <if test="fieldName != null  and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
@@ -37,14 +38,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRequired != null  and isRequired != ''"> and is_required = #{isRequired}</if>
             <if test="pamsexplain != null  and pamsexplain != ''"> and pamsexplain = #{pamsexplain}</if>
             <if test="seq != null "> and seq = #{seq}</if>
+            <if test="interfaceinfoId != null  and interfaceinfoId != ''"> and interfaceinfo_id = #{interfaceinfoId}</if>
         </where>
+        order by seq asc
     </select>
-    
+
     <select id="selectTUParamsbusinessById" parameterType="String" resultMap="TUParamsbusinessResult">
         <include refid="selectTUParamsbusinessVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertTUParamsbusiness" parameterType="TUParamsbusiness">
         insert into t_u_paramsbusiness
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -63,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRequired != null">is_required,</if>
             <if test="pamsexplain != null">pamsexplain,</if>
             <if test="seq != null">seq,</if>
+            <if test="interfaceinfoId != null">interfaceinfo_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -80,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRequired != null">#{isRequired},</if>
             <if test="pamsexplain != null">#{pamsexplain},</if>
             <if test="seq != null">#{seq},</if>
+            <if test="interfaceinfoId != null">#{interfaceinfoId},</if>
          </trim>
     </insert>
 
@@ -100,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isRequired != null">is_required = #{isRequired},</if>
             <if test="pamsexplain != null">pamsexplain = #{pamsexplain},</if>
             <if test="seq != null">seq = #{seq},</if>
+            <if test="interfaceinfoId != null">interfaceinfo_id = #{interfaceinfoId},</if>
         </trim>
         where id = #{id}
     </update>
@@ -109,10 +115,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteTUParamsbusinessByIds" parameterType="String">
-        delete from t_u_paramsbusiness where id in 
+        delete from t_u_paramsbusiness where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 7 - 6
mybusiness/src/main/resources/mapper/system/TUParamspublicMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sooka.system.mapper.TUParamspublicMapper">
-    
+
     <resultMap type="TUParamspublic" id="TUParamspublicResult">
         <result property="id"    column="id"    />
         <result property="status"    column="status"    />
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTUParamspublicList" parameterType="TUParamspublic" resultMap="TUParamspublicResult">
         <include refid="selectTUParamspublicVo"/>
-        <where>  
+        <where>
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="fieldEn != null  and fieldEn != ''"> and field_en = #{fieldEn}</if>
             <if test="fieldName != null  and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
@@ -38,13 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pamsexplain != null  and pamsexplain != ''"> and pamsexplain = #{pamsexplain}</if>
             <if test="seq != null "> and seq = #{seq}</if>
         </where>
+        order by seq asc
     </select>
-    
+
     <select id="selectTUParamspublicById" parameterType="String" resultMap="TUParamspublicResult">
         <include refid="selectTUParamspublicVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertTUParamspublic" parameterType="TUParamspublic">
         insert into t_u_paramspublic
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -109,10 +110,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteTUParamspublicByIds" parameterType="String">
-        delete from t_u_paramspublic where id in 
+        delete from t_u_paramspublic where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 40 - 0
mybusiness/src/main/resources/templates/system/interfaceinfo/execInterface.html

@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+接口基本信息<br>
+<p>接口名称: <label th:text="${tuInterfaceinfo.interfaceName}"></label></p>
+<p>信息项: <label th:text="${tuInterfaceinfo.infoItem}"></label></p>
+<p>使用场景描述: <label th:text="${tuInterfaceinfo.usageScenarios}"></label></p>
+<p>共享方式:
+    <select name="interfaceType" class="form-control m-b" th:with="type=${@dict.getType('interface_type')}">
+        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+    </select>
+</p>
+<!--<p>: <label th:text="${tuInterfaceinfo.}"></label></p>-->
+<!--<p>: <label th:text="${tuInterfaceinfo.}"></label></p>-->
+<!--<p>: <label th:text="${tuInterfaceinfo.}"></label></p>-->
+<!--<p>: <label th:text="${tuInterfaceinfo.}"></label></p>-->
+
+接口参数(公共参数)
+
+接口参数(业务参数)
+
+
+<button>调用</button>
+
+<textarea>
+    返回值
+</textarea>
+
+<script>
+    var shareType_datas = [[${@dict.getType('share_type')}]];
+    var interfaceType_datas = [[${@dict.getType('interface_type')}]];
+</script>
+
+
+</body>
+</html>

+ 8 - 1
mybusiness/src/main/resources/templates/system/interfaceinfo/interfaceinfo.html

@@ -163,6 +163,8 @@
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><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.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="settingParams(\'' + row.id + '\')"><i class="fa fa-edit"></i>设置参数</a> ');
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="execInterface(\'' + row.id + '\')"><i class="fa fa-edit"></i>调用接口</a> ');
+
                         return actions.join('');
                     }
                 }]
@@ -174,7 +176,12 @@
         function settingParams(id) {
             var url = prefix + "/settingParams/"+id;
             console.log(url)
-            $.modal.openTab("查看【车辆信息】详情", url);
+            $.modal.openTab("设置业务接口参数", url);
+        }
+        function execInterface(id) {
+            var url = prefix + "/execInterface/"+id;
+            console.log(url)
+            $.modal.openTab("设置业务接口参数", url);
         }
 
 

+ 59 - 72
mybusiness/src/main/resources/templates/system/paramsbusiness/add.html

@@ -1,86 +1,73 @@
 <!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
 <head>
-    <th:block th:include="include :: header('新增业务请求参数')" />
+    <th:block th:include="include :: header('新增业务请求参数')"/>
 </head>
 <body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-paramsbusiness-add">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">状态:</label>
-                <div class="col-sm-8">
-                    <div class="radio-box">
-                        <input type="radio" name="status" value="">
-                        <label th:for="status" th:text="未知"></label>
-                    </div>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
-                </div>
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form class="form-horizontal m" id="form-paramsbusiness-add">
+        <input type="hidden" id="interfaceinfoId" name="interfaceinfoId" th:value="*{interfaceinfo_id}"/>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">字段英文:</label>
+            <div class="col-sm-8">
+                <input name="fieldEn" class="form-control" type="text">
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">删除时间:</label>
-                <div class="col-sm-8">
-                    <input name="delFlag" 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="fieldName" class="form-control" type="text">
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">字段英文:</label>
-                <div class="col-sm-8">
-                    <input name="fieldEn" class="form-control" type="text">
-                </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">字段类型:</label>
+            <div class="col-sm-8">
+                <select name="fieldType" class="form-control m-b" th:with="type=${@dict.getType('field_type')}">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">字段名称:</label>
-                <div class="col-sm-8">
-                    <input name="fieldName" 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="maxLength" class="form-control" type="text">
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">字段类型:</label>
-                <div class="col-sm-8">
-                    <select name="fieldType" class="form-control m-b">
-                        <option value="">所有</option>
-                    </select>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
-                </div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label">是否必填:</label>
+            <div class="col-sm-8">
+                <select name="isRequired" class="form-control m-b" th:with="type=${@dict.getType('is_required')}">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">最大长度:</label>
-                <div class="col-sm-8">
-                    <input name="maxLength" 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="pamsexplain" class="form-control" type="text">
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">是否必填:</label>
-                <div class="col-sm-8">
-                    <input name="isRequired" 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="seq" class="form-control" type="text">
             </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">说明:</label>
-                <div class="col-sm-8">
-                    <input name="pamsexplain" 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="seq" class="form-control" type="text">
-                </div>
-            </div>
-        </form>
-    </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var prefix = ctx + "system/paramsbusiness"
-        $("#form-paramsbusiness-add").validate({
-            focusCleanup: true
-        });
+        </div>
+
+    </form>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var prefix = ctx + "system/paramsbusiness"
+    $("#form-paramsbusiness-add").validate({
+        focusCleanup: true
+    });
 
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/add", $('#form-paramsbusiness-add').serialize());
-            }
+    function submitHandler() {
+        if ($.validate.form()) {
+            $.operate.save(prefix + "/add", $('#form-paramsbusiness-add').serialize());
         }
-    </script>
+    }
+</script>
 </body>
-</html>
+</html>

+ 15 - 22
mybusiness/src/main/resources/templates/system/paramsbusiness/edit.html

@@ -7,61 +7,54 @@
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
         <form class="form-horizontal m" id="form-paramsbusiness-edit" th:object="${tUParamsbusiness}">
             <input name="id" th:field="*{id}" type="hidden">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">状态:</label>
-                <div class="col-sm-8">
-                    <div class="radio-box">
-                        <input type="radio" name="status" value="">
-                        <label th:for="status" th:text="未知"></label>
-                    </div>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
-                </div>
-            </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">字段英文:</label>
                 <div class="col-sm-8">
                     <input name="fieldEn" th:field="*{fieldEn}" class="form-control" type="text">
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">字段名称:</label>
                 <div class="col-sm-8">
                     <input name="fieldName" th:field="*{fieldName}" class="form-control" type="text">
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">字段类型:</label>
                 <div class="col-sm-8">
-                    <select name="fieldType" class="form-control m-b">
-                        <option value="">所有</option>
+                    <select name="fieldType" class="form-control m-b" th:with="type=${@dict.getType('field_type')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                th:field="*{fieldType}"></option>
                     </select>
-                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">最大长度:</label>
                 <div class="col-sm-8">
                     <input name="maxLength" th:field="*{maxLength}" class="form-control" type="text">
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">是否必填:</label>
                 <div class="col-sm-8">
-                    <input name="isRequired" th:field="*{isRequired}" class="form-control" type="text">
+                    <select name="isRequired" class="form-control m-b" th:with="type=${@dict.getType('is_required')}">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:field="*{isRequired}"></option>
+                    </select>
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">说明:</label>
                 <div class="col-sm-8">
                     <input name="pamsexplain" th:field="*{pamsexplain}" class="form-control" type="text">
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">顺序:</label>
                 <div class="col-sm-8">
                     <input name="seq" th:field="*{seq}" class="form-control" type="text">
                 </div>
             </div>
+
         </form>
     </div>
     <th:block th:include="include :: footer" />
@@ -78,4 +71,4 @@
         }
     </script>
 </body>
-</html>
+</html>

+ 36 - 28
mybusiness/src/main/resources/templates/system/paramsbusiness/paramsbusiness.html

@@ -8,16 +8,10 @@
         <div class="row">
             <div class="col-sm-12 search-collapse">
                 <form id="formId">
+                    <input type="hidden" id="interfaceinfoId" name="interfaceinfoId" th:value="*{interfaceinfo_id}"/>
                     <div class="select-list">
                         <ul>
                             <li>
-                                <label>状态:</label>
-                                <select name="status">
-                                    <option value="">所有</option>
-                                    <option value="-1">代码生成请选择字典属性</option>
-                                </select>
-                            </li>
-                            <li>
                                 <label>字段英文:</label>
                                 <input type="text" name="fieldEn"/>
                             </li>
@@ -27,26 +21,17 @@
                             </li>
                             <li>
                                 <label>字段类型:</label>
-                                <select name="fieldType">
+                                <select name="fieldType" th:with="type=${@dict.getType('field_type')}">
                                     <option value="">所有</option>
-                                    <option value="-1">代码生成请选择字典属性</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                 </select>
                             </li>
                             <li>
-                                <label>最大长度:</label>
-                                <input type="text" name="maxLength"/>
-                            </li>
-                            <li>
                                 <label>是否必填:</label>
-                                <input type="text" name="isRequired"/>
-                            </li>
-                            <li>
-                                <label>说明:</label>
-                                <input type="text" name="pamsexplain"/>
-                            </li>
-                            <li>
-                                <label>顺序:</label>
-                                <input type="text" name="seq"/>
+                                <select name="isRequired" th:with="type=${@dict.getType('is_required')}">
+                                    <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>
@@ -58,7 +43,7 @@
             </div>
 
             <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:paramsbusiness:add">
+                <a class="btn btn-success" onclick="showParamsbusiness($('#interfaceinfoId').val())" shiro:hasPermission="system:paramsbusiness:add">
                     <i class="fa fa-plus"></i> 添加
                 </a>
                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:paramsbusiness:edit">
@@ -82,6 +67,9 @@
         var removeFlag = [[${@permission.hasPermi('system:paramsbusiness:remove')}]];
         var prefix = ctx + "system/paramsbusiness";
 
+        var fieldType_datas = [[${@dict.getType('field_type')}]];
+        var isRequired_datas = [[${@dict.getType('is_required')}]];
+
         $(function() {
             var options = {
                 url: prefix + "/list",
@@ -100,11 +88,13 @@
                 },
                 {
                     field: 'status',
-                    title: '状态'
+                    title: '状态',
+                    visible: false
                 },
                 {
                     field: 'remark',
-                    title: '注释'
+                    title: '注释',
+                    visible: false
                 },
                 {
                     field: 'fieldEn',
@@ -116,7 +106,10 @@
                 },
                 {
                     field: 'fieldType',
-                    title: '字段类型'
+                    title: '字段类型',
+                    formatter: function(value, item, index) {
+                        return $.table.selectDictLabel(fieldType_datas, item.fieldType);
+                    }
                 },
                 {
                     field: 'maxLength',
@@ -124,7 +117,10 @@
                 },
                 {
                     field: 'isRequired',
-                    title: '是否必填'
+                    title: '是否必填',
+                    formatter: function(value, item, index) {
+                        return $.table.selectDictLabel(isRequired_datas, item.isRequired);
+                    }
                 },
                 {
                     field: 'pamsexplain',
@@ -135,6 +131,11 @@
                     title: '顺序'
                 },
                 {
+                    field: 'interfaceinfoId',
+                    title: '对应接口id',
+                    visible: false
+                },
+                {
                     title: '操作',
                     align: 'center',
                     formatter: function(value, row, index) {
@@ -147,6 +148,13 @@
             };
             $.table.init(options);
         });
+
+
+        function showParamsbusiness(id) {
+            var url = prefix + (id.length==0?"/addParamsbusiness/":"/add/") +id;
+            console.log(url)
+            $.modal.open("添加【业务参数】", url);
+        }
     </script>
 </body>
-</html>
+</html>

+ 3 - 12
mybusiness/src/main/resources/templates/system/paramspublic/paramspublic.html

@@ -8,6 +8,7 @@
         <div class="row">
             <div class="col-sm-12 search-collapse">
                 <form id="formId">
+                    <input type="hidden" id="interfaceinfoId" name="interfaceinfoId" th:value="*{interfaceinfo_id}"/>
                     <div class="select-list">
                         <ul>
                             <li>
@@ -25,10 +26,7 @@
                                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                 </select>
                             </li>
-                            <li>
-                                <label>最大长度:</label>
-                                <input type="text" name="maxLength"/>
-                            </li>
+
                             <li>
                                 <label>是否必填:</label>
                                 <select name="isRequired" th:with="type=${@dict.getType('is_required')}">
@@ -36,14 +34,7 @@
                                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                 </select>
                             </li>
-                            <li>
-                                <label>说明:</label>
-                                <input type="text" name="pamsexplain"/>
-                            </li>
-                            <li>
-                                <label>顺序:</label>
-                                <input type="text" name="seq"/>
-                            </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>

+ 213 - 0
mybusiness/src/main/resources/templates/system/test/sfz.html

@@ -0,0 +1,213 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+吉林省-居民身份证信息-数据查询接口 <br>
+<table>
+    <tr>
+        <td>
+            信息项
+        </td>
+        <td>
+            信息内容
+        </td>
+    </tr>
+    <tr>
+        <td>
+            服务中文名称
+        </td>
+        <td>
+            居民身份证信息
+        </td>
+    </tr>
+    <tr>
+        <td>
+            使用场景描述
+        </td>
+        <td>
+            根据上传的姓名、身份证号查询居民身份证信息。
+        </td>
+    </tr>
+    <tr>
+        <td>
+            共享方式
+        </td>
+        <td>
+            有条件共享
+        </td>
+    </tr>
+</table>
+接口类型:POST
+
+<table>
+    <tr>
+        <td>
+            appId
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            version
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            format
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            charset
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            timestamp
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            name
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td>
+            idcardNo
+        </td>
+        <td>
+            <input type="text">
+        </td>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <button onclick="search()">查询</button>
+        </td>
+    </tr>
+</table>
+<table>
+    <tr>
+        <td>
+            发证机关
+        </td>
+        <td id="licenceIssue">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            姓名
+        </td>
+        <td id="name">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            性别
+        </td>
+        <td id="gender">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            民族
+        </td>
+        <td id="nationality">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            出生日期
+        </td>
+        <td id="birthDate">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            公民身份号码
+        </td>
+        <td id="idcardNo">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            户籍地
+        </td>
+        <td id="addressPermanent">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            照片
+        </td>
+        <td id="photos">
+
+        </td>
+    </tr>
+    <tr>
+        <td>
+            相片
+        </td>
+        <td>
+            <image id="photograph"></image>
+        </td>
+    </tr>
+</table>
+<textarea id="result" rows="20" cols="100">
+    结果数据...
+</textarea>
+
+<script th:src="@{/js/jquery.min.js}"></script>
+<script th:inline="javascript">
+    function search() {
+        $.ajax({
+            type: "GET",
+            url: "http://127.0.0.1:88/api/test/sfz",
+            beforeSend: function (request) {
+                request.setRequestHeader("accessId", "1625205696412");
+                request.setRequestHeader("stringToSign", "4ab54dea9926f3386b56fd5fe51b35ae0fe1405a");
+            },
+            success: function (result) {
+                $("#result").text(JSON.stringify(result.data.data[0]));
+                var res = result.data.data[0]
+                $("#licenceIssue").text(res.licenceIssue);
+                $("#name").text(res.name);
+                $("#gender").text(res.gender);
+                $("#nationality").text(res.nationality);
+                $("#birthDate").text(res.birthDate);
+                $("#idcardNo").text(res.idcardNo);
+                $("#addressPermanent").text(res.addressPermanent);
+                $("#photograph").attr("src","data:image/jpg;base64,"+res.photograph);
+            }
+        });
+    }
+</script>
+
+</body>
+</html>

+ 10 - 0
mybusiness/src/main/resources/templates/visualization/index.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+可视化主页
+</body>
+</html>