Parcourir la source

修改图书馆 日志

wangzhe il y a 1 an
Parent
commit
3edf83f073
18 fichiers modifiés avec 460 ajouts et 50 suppressions
  1. 24 1
      mybusiness/src/main/java/com/business/controller/VisualizationController.java
  2. 16 0
      mybusiness/src/main/java/com/sooka/system/mapper/TUInterfaceinfoMapper.java
  3. 9 0
      mybusiness/src/main/java/com/sooka/system/service/ITUInterfaceinfoService.java
  4. 145 7
      mybusiness/src/main/java/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.java
  5. 62 4
      mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml
  6. 28 0
      mybusiness/src/main/resources/static/visualization/js/echarts_div.js
  7. 3 1
      mybusiness/src/main/resources/static/visualization/js/th_jk.js
  8. 35 10
      mybusiness/src/main/resources/templates/visualization/index.html
  9. BIN
      mybusiness/target/classes/com/business/controller/VisualizationController.class
  10. BIN
      mybusiness/target/classes/com/sooka/system/mapper/TUInterfaceinfoMapper.class
  11. BIN
      mybusiness/target/classes/com/sooka/system/service/ITUInterfaceinfoService.class
  12. BIN
      mybusiness/target/classes/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.class
  13. 62 4
      mybusiness/target/classes/mapper/system/TUInterfaceinfoMapper.xml
  14. 28 0
      mybusiness/target/classes/static/visualization/js/echarts_div.js
  15. 3 1
      mybusiness/target/classes/static/visualization/js/th_jk.js
  16. 6 8
      mybusiness/target/classes/templates/system/peoplemarryinfodouble/peoplemarryinfodouble.html
  17. 4 4
      mybusiness/target/classes/templates/system/peoplemarryinfosingle/peoplemarryinfosingle.html
  18. 35 10
      mybusiness/target/classes/templates/visualization/index.html

+ 24 - 1
mybusiness/src/main/java/com/business/controller/VisualizationController.java

@@ -13,6 +13,7 @@ import com.sooka.framework.util.ShiroUtils;
 import com.sooka.system.domain.SysDept;
 import com.sooka.system.domain.SysDept;
 import com.sooka.system.domain.SysDictData;
 import com.sooka.system.domain.SysDictData;
 import com.sooka.system.domain.TUInterfaceinfo;
 import com.sooka.system.domain.TUInterfaceinfo;
+import com.sooka.system.mapper.TUInterfaceinfoMapper;
 import com.sooka.system.service.ISysDeptService;
 import com.sooka.system.service.ISysDeptService;
 import com.sooka.system.service.ITUInterfaceinfoService;
 import com.sooka.system.service.ITUInterfaceinfoService;
 import com.sooka.system.utils.DictUtils;
 import com.sooka.system.utils.DictUtils;
@@ -49,6 +50,9 @@ public class VisualizationController extends BaseController {
     @Autowired
     @Autowired
     private ISysDeptService sysDeptService;
     private ISysDeptService sysDeptService;
 
 
+    @Autowired
+    private TUInterfaceinfoMapper interfaceinfoMapper;
+
     private static final String FORMAT_STRING = "0000000000";
     private static final String FORMAT_STRING = "0000000000";
 
 
     @GetMapping("index")
     @GetMapping("index")
@@ -135,7 +139,9 @@ public class VisualizationController extends BaseController {
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
 ////        interfaceinfoService.imputationData();
 ////        interfaceinfoService.imputationData();
 //        interfaceinfoService.imputationDataByMonth();
 //        interfaceinfoService.imputationDataByMonth();
-        jsonObject.put("data", "well done");
+//        jsonObject.put("data", "well done");
+        int interfaceinfo_test_Affected_rows = interfaceinfoMapper.insertInterfaceTestParam();
+        jsonObject.put("data", "insert into t_u_interfaceinfo_test Affected rows: " + interfaceinfo_test_Affected_rows + ", well done");
         return jsonObject;
         return jsonObject;
     }
     }
 
 
@@ -351,6 +357,23 @@ public class VisualizationController extends BaseController {
     }
     }
 
 
     /**
     /**
+     * 查询接口状态 接口可用性监测
+     * */
+    @PostMapping("getInterfaceStatus")
+    @ResponseBody
+    public AjaxResult getInterfaceStatus(){
+        return interfaceinfoService.getInterfaceStatus();
+    }
+    /**
+     * 查询接口状态 接口可用性监测
+     * */
+    @PostMapping("getInterfaceStatusAgain")
+    @ResponseBody
+    public AjaxResult getInterfaceStatusAgain(){
+        return interfaceinfoService.getInterfaceStatusAgain();
+    }
+
+    /**
      * 接口申请数量
      * 接口申请数量
      * @param deptId 部门ID
      * @param deptId 部门ID
      * @return 结果
      * @return 结果

+ 16 - 0
mybusiness/src/main/java/com/sooka/system/mapper/TUInterfaceinfoMapper.java

@@ -226,6 +226,22 @@ public interface TUInterfaceinfoMapper
      * */
      * */
     public Integer getInterfaceCount(@Param("status") String status);
     public Integer getInterfaceCount(@Param("status") String status);
 
 
+    // 平台可用接口集合
+    public List<TUInterfaceinfo> interfaceCountTotal();
+    // 近24小时活跃接口数
+    public Integer interfaceCountActive();
+    // 平台接口调用返回状态
+    public Integer interfaceCountAvailable();
+    public Integer interfaceCountUnavailable();
+    // 平台接口调用返回状态
+    public Map selectInterfaceTest(String interfaceId);
+    // 接口测试表维护初始化数据 可随意调用
+    public Integer insertInterfaceTestParam();
+    // 接口状态表维护每日接口状态数据
+    public Integer insertInterfaceStatus(Map map);
+    // 删除今日接口状态监测数据
+    public Integer deleteInterfaceStatusToday();
+
     /**
     /**
      * 根据部门ID查询分类数量
      * 根据部门ID查询分类数量
      * @return 结果
      * @return 结果

+ 9 - 0
mybusiness/src/main/java/com/sooka/system/service/ITUInterfaceinfoService.java

@@ -1,6 +1,8 @@
 package com.sooka.system.service;
 package com.sooka.system.service;
 
 
 import java.util.List;
 import java.util.List;
+
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.system.domain.TUInterfaceinfo;
 import com.sooka.system.domain.TUInterfaceinfo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -143,6 +145,13 @@ public interface ITUInterfaceinfoService
     public Integer getInterfaceCount(String status);
     public Integer getInterfaceCount(String status);
 
 
     /**
     /**
+     * 查询接口状态 接口可用性监测
+     * @return 结果
+     * */
+    public AjaxResult getInterfaceStatus();
+    public AjaxResult getInterfaceStatusAgain();
+
+    /**
      * 根据部门ID查询分类数量
      * 根据部门ID查询分类数量
      * @return 结果
      * @return 结果
      * */
      * */

+ 145 - 7
mybusiness/src/main/java/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.java

@@ -1,22 +1,19 @@
 package com.sooka.system.service.impl;
 package com.sooka.system.service.impl;
 
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
-import com.business.domain.ImputationData;
+import com.alibaba.fastjson.JSONObject;
 import com.business.mapper.ImputationDataMapper;
 import com.business.mapper.ImputationDataMapper;
 import com.sooka.apply.domain.IntDetailed;
 import com.sooka.apply.domain.IntDetailed;
 import com.sooka.apply.mapper.IntRecordMapper;
 import com.sooka.apply.mapper.IntRecordMapper;
+import com.sooka.common.core.domain.AjaxResult;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.core.text.Convert;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.DateUtils;
 import com.sooka.common.utils.uuid.UUID;
 import com.sooka.common.utils.uuid.UUID;
 import com.sooka.framework.util.ShiroUtils;
 import com.sooka.framework.util.ShiroUtils;
+import com.util.HttpUtil2;
 import com.util.NumberUtils;
 import com.util.NumberUtils;
 import com.util.SecretKeyUtil;
 import com.util.SecretKeyUtil;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.sooka.system.mapper.TUInterfaceinfoMapper;
 import com.sooka.system.mapper.TUInterfaceinfoMapper;
 import com.sooka.system.domain.TUInterfaceinfo;
 import com.sooka.system.domain.TUInterfaceinfo;
@@ -302,6 +299,147 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
     }
     }
 
 
     /**
     /**
+     * 测试接口可用性状态
+     * @return 结果
+     * */
+    private boolean testInterface(TUInterfaceinfo interfaceinfo){
+        String http_province = "http://172.24.5.241:6689";
+        String http_local_api = "http://172.17.5.4:7777";
+        Map<String, String> interfaceTest = tUInterfaceinfoMapper.selectInterfaceTest(interfaceinfo.getId());
+        // share_type_1=市共享,share_type_2=市归集,share_type_3=省上报,share_type_4=省共享
+        if(interfaceTest == null){// 未配置接口参数的接口不做统计 默认算正常状态
+            return true;
+        }else {
+            String deptId = interfaceTest.get("dept_id");
+            String deptName = interfaceTest.get("dept_name");
+            String shareType = interfaceTest.get("share_type");
+            String interfaceType = interfaceTest.get("interface_type");
+            String intCode = interfaceTest.get("int_code");
+            String secretKey = interfaceTest.get("secret_key");
+            String interfaceAddress = interfaceTest.get("interface_address");
+            String testParam = interfaceTest.get("test_param");
+            String interfaceId = interfaceTest.get("interface_id");
+            String interfaceName = interfaceTest.get("interface_name");
+            if(interfaceType.equals("get")){
+                return true;
+            }else if(interfaceType.equals("post")){
+                if(shareType.equals("share_type_1") || shareType.equals("share_type_2") || shareType.equals("share_type_3") || shareType.equals("share_type_4")){// 市共享 市归集 省上报 省共享
+                    boolean status = false;
+                    Map map = new HashMap();
+                    map.put("intCode", intCode);
+                    map.put("secretKey", secretKey);
+                    map.put("Content-Type", "application/json");
+//                    String params = "{\"certNumMan\":\""+tUPeoplemarryinfodouble.getCertnumberman()+"\",\"nameMan\":\""+tUPeoplemarryinfodouble.getNameman()+"\",\"certNumWoman\":\""+tUPeoplemarryinfodouble.getCertnumberwoman()+"\",\"nameWoman\":\""+tUPeoplemarryinfodouble.getNamewoman()+"\"}";
+                    String params = testParam;
+//                    map.put("Authorization-Type", "Basic");
+//                    map.put("Authorization", "Basic NjBlODQxNzQyZTIyMDE2NjUzYmQ3NmE4N2QxY2FjMzA6ODhlOWM0NzcxMWZkMTM5YjhiMGMyODlkZjBiMWI5YmQ=");
+//                    map.put("Service-ID", "qNpU77");
+                    try {
+                        String result = HttpUtil2.doPost(http_local_api + interfaceAddress, params, map);
+//                        System.out.println("share_type_1=市共享,share_type_2=市归集 测试接口可用性状态" + interfaceName + "testInterface result=" + result);
+                        if(result != null && (JSONObject.parseObject(result).getString("code").equals("0") || JSONObject.parseObject(result).getString("code").equals("1000"))){// 省共享返回的是1000
+                            status = true;
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }finally {
+                        String shareTypeLabel = "";
+                        if(shareType.equals("share_type_1")){
+                            shareTypeLabel = "share_type_1=市共享";
+                        }else if(shareType.equals("share_type_2")){
+                            shareTypeLabel = "share_type_2=市归集";
+                        }else if(shareType.equals("share_type_3")){
+                            shareTypeLabel = "share_type_3=省上报";
+                        }else if(shareType.equals("share_type_4")){
+                            shareTypeLabel = "share_type_4=省共享";
+                        }
+                        System.out.println(shareTypeLabel + " 测试接口可用性状态:" + interfaceName + "testInterface status=" + (status ? "0" : "1"));
+                        Map interfaceStatus = new HashMap();
+                        interfaceStatus.put("id", UUID.randomUUID().toString());
+                        interfaceStatus.put("intCode", intCode);
+                        interfaceStatus.put("status", status ? "0" : "1");
+                        interfaceStatus.put("shareType", shareType);
+                        interfaceStatus.put("interfaceId", interfaceId);
+                        interfaceStatus.put("interfaceName", interfaceName);
+                        interfaceStatus.put("interfaceAddress", interfaceAddress);
+                        interfaceStatus.put("deptId", deptId);
+                        interfaceStatus.put("deptName", deptName);
+                        tUInterfaceinfoMapper.insertInterfaceStatus(interfaceStatus);
+                    }
+                    return status;
+                }else { // 省上报 省共享
+                    boolean status = false;
+                    Map map = new HashMap();
+                    map.put("intCode", intCode);
+                    map.put("secretKey", secretKey);
+                    map.put("Content-Type", "application/json");
+//                    String params = "{\"certNumMan\":\""+tUPeoplemarryinfodouble.getCertnumberman()+"\",\"nameMan\":\""+tUPeoplemarryinfodouble.getNameman()+"\",\"certNumWoman\":\""+tUPeoplemarryinfodouble.getCertnumberwoman()+"\",\"nameWoman\":\""+tUPeoplemarryinfodouble.getNamewoman()+"\"}";
+                    map.put("Authorization-Type", "Basic");
+                    map.put("Authorization", "Basic NjBlODQxNzQyZTIyMDE2NjUzYmQ3NmE4N2QxY2FjMzA6ODhlOWM0NzcxMWZkMTM5YjhiMGMyODlkZjBiMWI5YmQ=");
+                    map.put("Service-ID", "qNpU77");
+                    return true;
+                }
+            }else {
+                return true;
+            }
+        }
+    }
+
+    /**
+     * 查询接口状态 接口可用性监测
+     * @return 结果
+     * */
+    @Override
+    public AjaxResult getInterfaceStatus(){
+        Map map = new HashMap();
+        List<TUInterfaceinfo> interfaceCountTotalList = tUInterfaceinfoMapper.interfaceCountTotal();
+        Integer interfaceCountTotal = interfaceCountTotalList.size();
+        Integer interfaceCountActive = tUInterfaceinfoMapper.interfaceCountActive();
+        Integer interfaceCountAvailable = tUInterfaceinfoMapper.interfaceCountAvailable();
+        if(interfaceCountAvailable == 0){// 今日无数据 需要测试接口 若今日已有数据 测过接口不重复测试 使用已有数据
+            for (int i = 0; i < interfaceCountTotal; i++) {
+                boolean available = testInterface(interfaceCountTotalList.get(i));
+                if(available){
+                    interfaceCountAvailable++;
+                }
+            }
+        }
+        Integer interfaceCountUnavailable = tUInterfaceinfoMapper.interfaceCountUnavailable();
+        map.put("interfaceCountTotal", interfaceCountTotal);
+        map.put("interfaceCountActive", interfaceCountActive);
+        map.put("interfaceCountInactive", interfaceCountTotal - interfaceCountActive);
+        map.put("interfaceCountAvailable", interfaceCountTotal - interfaceCountUnavailable);
+        map.put("interfaceCountUnavailable", interfaceCountUnavailable);
+        return AjaxResult.success(map);
+    }
+
+    /**
+     * 查询接口状态 接口可用性监测 防止系统接口调用过于频繁 每日仅验证一次可用性 只有刷新的时候再重新验证可用性
+     * @return 结果
+     * */
+    @Override
+    public AjaxResult getInterfaceStatusAgain(){
+        Map map = new HashMap();
+        List<TUInterfaceinfo> interfaceCountTotalList = tUInterfaceinfoMapper.interfaceCountTotal();
+        Integer interfaceCountTotal = interfaceCountTotalList.size();
+        Integer interfaceCountActive = tUInterfaceinfoMapper.interfaceCountActive();
+        Integer interfaceCountAvailable = 0;
+        tUInterfaceinfoMapper.deleteInterfaceStatusToday();// 删除今日接口状态监测数据
+        for (TUInterfaceinfo interfaceInfo : interfaceCountTotalList) {
+            if(testInterface(interfaceInfo)){
+                interfaceCountAvailable++;
+            }
+        }
+        Integer interfaceCountUnavailable = tUInterfaceinfoMapper.interfaceCountUnavailable();
+        map.put("interfaceCountTotal", interfaceCountTotal);
+        map.put("interfaceCountActive", interfaceCountActive);
+        map.put("interfaceCountInactive", interfaceCountTotal - interfaceCountActive);
+        map.put("interfaceCountAvailable", interfaceCountTotal - interfaceCountUnavailable);
+        map.put("interfaceCountUnavailable", interfaceCountUnavailable);
+        return AjaxResult.success(map);
+    }
+
+    /**
      * 根据部门ID查询分类数量
      * 根据部门ID查询分类数量
      * @return 结果
      * @return 结果
      * */
      * */

+ 62 - 4
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -372,7 +372,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY dict_value
         ORDER BY dict_value
     </select>
     </select>
 
 
-    <select id="getPercent" resultMap="TUInterfaceinfoResult" parameterType="String">
+    <select id="getPercent" resultMap="TUInterfaceinfoResult" parameterType="java.lang.String">
         SELECT
         SELECT
             CONVERT (
             CONVERT (
                 (
                 (
@@ -381,7 +381,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             COUNT(id)
                             COUNT(id)
                         FROM
                         FROM
                             t_u_interfaceinfo
                             t_u_interfaceinfo
-                        WHERE del_flag = 0 and DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
+                        WHERE del_flag = 0 and a.status = 0 and DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
                     ) * 100
                     ) * 100
                 ),
                 ),
                 DECIMAL (10, 0)
                 DECIMAL (10, 0)
@@ -392,7 +392,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
         FROM
             t_u_interfaceinfo a
             t_u_interfaceinfo a
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
-        WHERE a.del_flag = 0 and DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
+        WHERE a.del_flag = 0 and a.status = 0 and DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
         GROUP BY
         GROUP BY
             share_type
             share_type
         ORDER BY dict_value
         ORDER BY dict_value
@@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select SUM(callsuccnum) from t_u_interfaceinfo where del_flag = 0 and `status` = 0 AND dept_id = #{deptId}  and share_type = 'share_type_2' GROUP BY dept_id
         select SUM(callsuccnum) from t_u_interfaceinfo where del_flag = 0 and `status` = 0 AND dept_id = #{deptId}  and share_type = 'share_type_2' GROUP BY dept_id
     </select>
     </select>
 
 
-    <select id="getInterfaceCount" parameterType="String" resultType="Integer">
+    <select id="getInterfaceCount" parameterType="java.lang.String" resultType="java.lang.Integer">
         SELECT
         SELECT
             count(id) count
             count(id) count
         FROM
         FROM
@@ -503,6 +503,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and del_flag = 0
             and del_flag = 0
     </select>
     </select>
 
 
+    <select id="interfaceCountTotal" resultMap="TUInterfaceinfoResult">
+        select
+            id, interface_name, share_type, interface_address, dept_id, dept_name
+        from
+            t_u_interfaceinfo
+        where
+            del_flag = 0 and status = 0
+    </select>
+
+    <select id="interfaceCountActive" resultType="java.lang.Integer">
+        select
+          count(id)
+        from
+            t_u_interfaceinfo
+        where
+            del_flag = 0 and status = 0 and latest_call_time >= date_sub(now(), interval 24 hour)
+    </select>
+
+    <select id="interfaceCountAvailable" resultType="java.lang.Integer">
+        select
+            count(id)
+        from
+            t_u_interfaceinfo_status
+        where
+            del_flag = 0 and status = 0 and date(update_time) = current_date()
+    </select>
+    <select id="interfaceCountUnavailable" resultType="java.lang.Integer">
+        select
+            count(id)
+        from
+            t_u_interfaceinfo_status
+        where
+            del_flag = 0 and status = 1 and date(update_time) = current_date()
+    </select>
+
+    <select id="selectInterfaceTest" parameterType="java.lang.String" resultType="java.util.Map">
+        select
+            interface_id, interface_name, interface_address, interface_type, share_type, int_code, secret_key, test_param, dept_id, dept_name
+        from
+            t_u_interfaceinfo_test
+        where
+            test_param is not null and test_param != '' and interface_id = #{interfaceId}
+    </select>
+
+    <update id="insertInterfaceTestParam">
+        INSERT INTO `thsjzt`.`t_u_interfaceinfo_test`(`id`, `int_code`, `secret_key`, `share_type`, `test_param`, `interface_id`, `interface_type`, `interface_name`, `interface_address`, `dept_id`, `dept_name`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`)
+          select id, code, null, `share_type`, null, id, 'post', `interface_name`, `interface_address`, `dept_id`, `dept_name`, 0, null, null, null, null
+          from t_u_interfaceinfo where del_flag = 0 and status = 0 and id not in(select interface_id from t_u_interfaceinfo_test)
+    </update>
+
+    <insert id="insertInterfaceStatus" parameterType="java.util.Map">
+        insert into t_u_interfaceinfo_status (id, code, status, share_type, interface_id, interface_name, interface_address, dept_id, dept_name)
+        values (#{id}, #{intCode}, #{status}, #{shareType}, #{interfaceId}, #{interfaceName}, #{interfaceAddress}, #{deptId}, #{deptName})
+    </insert>
+    <delete id="deleteInterfaceStatusToday" parameterType="java.util.Map">
+        update t_u_interfaceinfo_status set del_flag = 2 where date(update_time) = current_date()
+    </delete>
+
     <select id="getSubJkspfx" resultMap="TUInterfaceinfoResult">
     <select id="getSubJkspfx" resultMap="TUInterfaceinfoResult">
         SELECT
         SELECT
             IFNULL(
             IFNULL(

+ 28 - 0
mybusiness/src/main/resources/static/visualization/js/echarts_div.js

@@ -267,6 +267,34 @@ function getFaultInterfaceCount() {
 		$("#faultInterfaceCount").text(res);
 		$("#faultInterfaceCount").text(res);
 	});
 	});
 }
 }
+// 查询接口状态 接口可用性监测
+function getInterfaceStatus() {
+	$.post("/visualization/getInterfaceStatus",function (res) {
+		// console.log("res=", res);
+		if(res.code == 0){
+			let data = res.data;
+			$("#interfaceCountTotal").text(data.interfaceCountTotal);
+			$("#interfaceCountActive").text(data.interfaceCountActive);
+			$("#interfaceCountInactive").text(data.interfaceCountInactive);
+			$("#interfaceCountAvailable").text(data.interfaceCountAvailable);
+			$("#interfaceCountUnavailable").text(data.interfaceCountUnavailable);
+		}
+	});
+}
+// 查询接口状态 接口可用性监测
+function getInterfaceStatusAgain() {
+	$.post("/visualization/getInterfaceStatusAgain",function (res) {
+		// console.log("res=", res);
+		if(res.code == 0){
+			let data = res.data;
+			$("#interfaceCountTotal").text(data.interfaceCountTotal);
+			$("#interfaceCountActive").text(data.interfaceCountActive);
+			$("#interfaceCountInactive").text(data.interfaceCountInactive);
+			$("#interfaceCountAvailable").text(data.interfaceCountAvailable);
+			$("#interfaceCountUnavailable").text(data.interfaceCountUnavailable);
+		}
+	});
+}
 
 
 // 归集数据排名
 // 归集数据排名
 function jkgj(res) {
 function jkgj(res) {

+ 3 - 1
mybusiness/src/main/resources/static/visualization/js/th_jk.js

@@ -12,7 +12,9 @@
         }, 1000);
         }, 1000);
 
 
         /** 查询故障接口数量 **/
         /** 查询故障接口数量 **/
-        getFaultInterfaceCount();
+        // getFaultInterfaceCount();
+        /** 查询接口状态 **/
+        getInterfaceStatus();
         /** 接口数量和占比 **/
         /** 接口数量和占比 **/
         countAndPercent();
         countAndPercent();
         /** 归集数据频次/接口数量排名 **/
         /** 归集数据频次/接口数量排名 **/

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

@@ -16,18 +16,43 @@
 </div>
 </div>
 <div class="header clearfix">
 <div class="header clearfix">
     <div class="time fl">
     <div class="time fl">
-        <span class="nyr">2022-08-17</span>&nbsp;&nbsp;&nbsp;<span class="sfm">09:35:57</span>
+        <span class="nyr" style="float: left; line-height: 60px">2022-08-07</span>
+        <span class="sfm" style="float: left; line-height: 60px; margin-left: 17px; width: 110px;">09:35:57</span>
+        <div class="header_nav" style="float: left; margin-left: 8px;">
+            <div class="nav_a nav_la">
+                <span style="font-size: 21px">接入部门<i>(<span style="font-size: 20px">[[${deptCount}]]</span>)</i></span>
+                <div class="nav_div">
+                    <a th:each="dept:${depts}" th:id="${dept.deptId}">[[${dept.deptName}]]</a>
+                </div>
+            </div>
+        </div>
     </div>
     </div>
     <h1 class="logo"><img th:src="@{/visualization/images/thqzj_logo.png}"/></h1>
     <h1 class="logo"><img th:src="@{/visualization/images/thqzj_logo.png}"/></h1>
-    <div class="header_nav fr">
-        <a class="nav_a on">大数据</a>
-        <div class="nav_a nav_la">
-            <span>接入部门<i>(<span>[[${deptCount}]]</span>)</i></span>
-            <div class="nav_div">
-                <a th:each="dept:${depts}" th:id="${dept.deptId}">[[${dept.deptName}]]</a>
-            </div>
-          </div>
-        <a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>
+    <!--<div class="header_nav fr">-->
+        <!--<a class="nav_a on">大数据</a>-->
+        <!--<div class="nav_a nav_la">-->
+            <!--<span>接入部门<i>(<span>[[${deptCount}]]</span>)</i></span>-->
+            <!--<div class="nav_div">-->
+            <!--</div>-->
+        <!--</div>-->
+        <!--<a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>-->
+    <!--</div>-->
+    <div class="header_nav fr" onclick="getInterfaceStatusAgain()">
+        <div class="nav_a" style="width:162px; font-size: 21px;">
+            <!--<a style="">接入接口<span style="color: #00FFEA; font-size: 20px; font-weight: 900; font-family: electronicFont">(9999)</span></a>-->
+            <span style="font-size: 21px;">接入接口<i style="color: #00FFEA!important; font-size: 20px;">(<span style="color: #00FFEA!important; font-size: 20px; font-family: electronicFont" id="interfaceCountTotal">0</span>)</i></span>
+        </div>
+        <div class="nav_a" style="margin-left: 0px;">
+            <div style="height: 24px;">
+                <span>活跃<i style="color: #00ff3c!important;">(<span style="color: #00ff3c!important; font-family: electronicFont" id="interfaceCountActive">0</span>)</i></span>
+                <span>非活跃<i style="color: #ff9900!important;">(<span style="color: #ff9900!important; font-family: electronicFont" id="interfaceCountInactive">0</span>)</i></span>
+            </div>
+            <div style="height: 24px;">
+                <span>可用<i style="color: #00ff3c!important;">(<span style="color: #00ff3c!important; font-family: electronicFont" id="interfaceCountAvailable">0</span>)</i></span>
+                <span>不可用<i>(<span style="font-family: electronicFont" id="interfaceCountUnavailable">0</span>)</i></span>
+            </div>
+        </div>
+        <!--<a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>-->
     </div>
     </div>
 </div>
 </div>
 <div class="content clearfix">
 <div class="content clearfix">

BIN
mybusiness/target/classes/com/business/controller/VisualizationController.class


BIN
mybusiness/target/classes/com/sooka/system/mapper/TUInterfaceinfoMapper.class


BIN
mybusiness/target/classes/com/sooka/system/service/ITUInterfaceinfoService.class


BIN
mybusiness/target/classes/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.class


+ 62 - 4
mybusiness/target/classes/mapper/system/TUInterfaceinfoMapper.xml

@@ -372,7 +372,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY dict_value
         ORDER BY dict_value
     </select>
     </select>
 
 
-    <select id="getPercent" resultMap="TUInterfaceinfoResult" parameterType="String">
+    <select id="getPercent" resultMap="TUInterfaceinfoResult" parameterType="java.lang.String">
         SELECT
         SELECT
             CONVERT (
             CONVERT (
                 (
                 (
@@ -381,7 +381,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             COUNT(id)
                             COUNT(id)
                         FROM
                         FROM
                             t_u_interfaceinfo
                             t_u_interfaceinfo
-                        WHERE del_flag = 0 and DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
+                        WHERE del_flag = 0 and a.status = 0 and DATE_FORMAT(create_time,'%Y') like concat('%', #{year}, '%')
                     ) * 100
                     ) * 100
                 ),
                 ),
                 DECIMAL (10, 0)
                 DECIMAL (10, 0)
@@ -392,7 +392,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
         FROM
             t_u_interfaceinfo a
             t_u_interfaceinfo a
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
         LEFT JOIN sys_dict_data b ON a.share_type = b.dict_value
-        WHERE a.del_flag = 0 and DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
+        WHERE a.del_flag = 0 and a.status = 0 and DATE_FORMAT(a.create_time,'%Y') like concat('%', #{year}, '%')
         GROUP BY
         GROUP BY
             share_type
             share_type
         ORDER BY dict_value
         ORDER BY dict_value
@@ -493,7 +493,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select SUM(callsuccnum) from t_u_interfaceinfo where del_flag = 0 and `status` = 0 AND dept_id = #{deptId}  and share_type = 'share_type_2' GROUP BY dept_id
         select SUM(callsuccnum) from t_u_interfaceinfo where del_flag = 0 and `status` = 0 AND dept_id = #{deptId}  and share_type = 'share_type_2' GROUP BY dept_id
     </select>
     </select>
 
 
-    <select id="getInterfaceCount" parameterType="String" resultType="Integer">
+    <select id="getInterfaceCount" parameterType="java.lang.String" resultType="java.lang.Integer">
         SELECT
         SELECT
             count(id) count
             count(id) count
         FROM
         FROM
@@ -503,6 +503,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and del_flag = 0
             and del_flag = 0
     </select>
     </select>
 
 
+    <select id="interfaceCountTotal" resultMap="TUInterfaceinfoResult">
+        select
+            id, interface_name, share_type, interface_address, dept_id, dept_name
+        from
+            t_u_interfaceinfo
+        where
+            del_flag = 0 and status = 0
+    </select>
+
+    <select id="interfaceCountActive" resultType="java.lang.Integer">
+        select
+          count(id)
+        from
+            t_u_interfaceinfo
+        where
+            del_flag = 0 and status = 0 and latest_call_time >= date_sub(now(), interval 24 hour)
+    </select>
+
+    <select id="interfaceCountAvailable" resultType="java.lang.Integer">
+        select
+            count(id)
+        from
+            t_u_interfaceinfo_status
+        where
+            del_flag = 0 and status = 0 and date(update_time) = current_date()
+    </select>
+    <select id="interfaceCountUnavailable" resultType="java.lang.Integer">
+        select
+            count(id)
+        from
+            t_u_interfaceinfo_status
+        where
+            del_flag = 0 and status = 1 and date(update_time) = current_date()
+    </select>
+
+    <select id="selectInterfaceTest" parameterType="java.lang.String" resultType="java.util.Map">
+        select
+            interface_id, interface_name, interface_address, interface_type, share_type, int_code, secret_key, test_param, dept_id, dept_name
+        from
+            t_u_interfaceinfo_test
+        where
+            test_param is not null and test_param != '' and interface_id = #{interfaceId}
+    </select>
+
+    <update id="insertInterfaceTestParam">
+        INSERT INTO `thsjzt`.`t_u_interfaceinfo_test`(`id`, `int_code`, `secret_key`, `share_type`, `test_param`, `interface_id`, `interface_type`, `interface_name`, `interface_address`, `dept_id`, `dept_name`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`)
+          select id, code, null, `share_type`, null, id, 'post', `interface_name`, `interface_address`, `dept_id`, `dept_name`, 0, null, null, null, null
+          from t_u_interfaceinfo where del_flag = 0 and status = 0 and id not in(select interface_id from t_u_interfaceinfo_test)
+    </update>
+
+    <insert id="insertInterfaceStatus" parameterType="java.util.Map">
+        insert into t_u_interfaceinfo_status (id, code, status, share_type, interface_id, interface_name, interface_address, dept_id, dept_name)
+        values (#{id}, #{intCode}, #{status}, #{shareType}, #{interfaceId}, #{interfaceName}, #{interfaceAddress}, #{deptId}, #{deptName})
+    </insert>
+    <delete id="deleteInterfaceStatusToday" parameterType="java.util.Map">
+        update t_u_interfaceinfo_status set del_flag = 2 where date(update_time) = current_date()
+    </delete>
+
     <select id="getSubJkspfx" resultMap="TUInterfaceinfoResult">
     <select id="getSubJkspfx" resultMap="TUInterfaceinfoResult">
         SELECT
         SELECT
             IFNULL(
             IFNULL(

+ 28 - 0
mybusiness/target/classes/static/visualization/js/echarts_div.js

@@ -267,6 +267,34 @@ function getFaultInterfaceCount() {
 		$("#faultInterfaceCount").text(res);
 		$("#faultInterfaceCount").text(res);
 	});
 	});
 }
 }
+// 查询接口状态 接口可用性监测
+function getInterfaceStatus() {
+	$.post("/visualization/getInterfaceStatus",function (res) {
+		// console.log("res=", res);
+		if(res.code == 0){
+			let data = res.data;
+			$("#interfaceCountTotal").text(data.interfaceCountTotal);
+			$("#interfaceCountActive").text(data.interfaceCountActive);
+			$("#interfaceCountInactive").text(data.interfaceCountInactive);
+			$("#interfaceCountAvailable").text(data.interfaceCountAvailable);
+			$("#interfaceCountUnavailable").text(data.interfaceCountUnavailable);
+		}
+	});
+}
+// 查询接口状态 接口可用性监测
+function getInterfaceStatusAgain() {
+	$.post("/visualization/getInterfaceStatusAgain",function (res) {
+		// console.log("res=", res);
+		if(res.code == 0){
+			let data = res.data;
+			$("#interfaceCountTotal").text(data.interfaceCountTotal);
+			$("#interfaceCountActive").text(data.interfaceCountActive);
+			$("#interfaceCountInactive").text(data.interfaceCountInactive);
+			$("#interfaceCountAvailable").text(data.interfaceCountAvailable);
+			$("#interfaceCountUnavailable").text(data.interfaceCountUnavailable);
+		}
+	});
+}
 
 
 // 归集数据排名
 // 归集数据排名
 function jkgj(res) {
 function jkgj(res) {

+ 3 - 1
mybusiness/target/classes/static/visualization/js/th_jk.js

@@ -12,7 +12,9 @@
         }, 1000);
         }, 1000);
 
 
         /** 查询故障接口数量 **/
         /** 查询故障接口数量 **/
-        getFaultInterfaceCount();
+        // getFaultInterfaceCount();
+        /** 查询接口状态 **/
+        getInterfaceStatus();
         /** 接口数量和占比 **/
         /** 接口数量和占比 **/
         countAndPercent();
         countAndPercent();
         /** 归集数据频次/接口数量排名 **/
         /** 归集数据频次/接口数量排名 **/

+ 6 - 8
mybusiness/target/classes/templates/system/peoplemarryinfodouble/peoplemarryinfodouble.html

@@ -15,7 +15,7 @@
                             <input type="text" name="nameman"/>
                             <input type="text" name="nameman"/>
                         </li>
                         </li>
                         <li>
                         <li>
-                            <label>男方身份证号:</label>
+                            <label style="width: 91px">男方身份证号:</label>
                             <input type="text" name="certnumberman"/>
                             <input type="text" name="certnumberman"/>
                         </li>
                         </li>
                         <li>
                         <li>
@@ -23,15 +23,13 @@
                             <input type="text" name="namewoman"/>
                             <input type="text" name="namewoman"/>
                         </li>
                         </li>
                         <li>
                         <li>
-                            <label>女方身份号码:</label>
+                            <label style="width: 91px">女方身份号码:</label>
                             <input type="text" name="certnumberwoman"/>
                             <input type="text" name="certnumberwoman"/>
                         </li>
                         </li>
-                        <li>
-                            <label>授权码:</label>
-                            <input type="text" id="secretKey" name="secretKey"/>
-                        </li>
-
-
+                        <!--<li>-->
+                            <!--<label>授权码:</label>-->
+                            <!--<input type="text" id="secretKey" name="secretKey"/>-->
+                        <!--</li>-->
                         <li>
                         <li>
                             <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                             <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                     class="fa fa-search"></i>&nbsp;搜索</a>
                                     class="fa fa-search"></i>&nbsp;搜索</a>

+ 4 - 4
mybusiness/target/classes/templates/system/peoplemarryinfosingle/peoplemarryinfosingle.html

@@ -25,10 +25,10 @@
                             <label>身份证号:</label>
                             <label>身份证号:</label>
                             <input type="text" name="certnumberman"/>
                             <input type="text" name="certnumberman"/>
                         </li>
                         </li>
-                        <li>
-                            <label>授权码:</label>
-                            <input type="text" id="secretKey" name="secretKey"/>
-                        </li>
+                        <!--<li>-->
+                            <!--<label>授权码:</label>-->
+                            <!--<input type="text" id="secretKey" name="secretKey"/>-->
+                        <!--</li>-->
                         <!--<li>-->
                         <!--<li>-->
                         <!--<label>返回码:</label>-->
                         <!--<label>返回码:</label>-->
                         <!--<input type="text" name="code"/>-->
                         <!--<input type="text" name="code"/>-->

+ 35 - 10
mybusiness/target/classes/templates/visualization/index.html

@@ -16,18 +16,43 @@
 </div>
 </div>
 <div class="header clearfix">
 <div class="header clearfix">
     <div class="time fl">
     <div class="time fl">
-        <span class="nyr">2022-08-17</span>&nbsp;&nbsp;&nbsp;<span class="sfm">09:35:57</span>
+        <span class="nyr" style="float: left; line-height: 60px">2022-08-07</span>
+        <span class="sfm" style="float: left; line-height: 60px; margin-left: 17px; width: 110px;">09:35:57</span>
+        <div class="header_nav" style="float: left; margin-left: 8px;">
+            <div class="nav_a nav_la">
+                <span style="font-size: 21px">接入部门<i>(<span style="font-size: 20px">[[${deptCount}]]</span>)</i></span>
+                <div class="nav_div">
+                    <a th:each="dept:${depts}" th:id="${dept.deptId}">[[${dept.deptName}]]</a>
+                </div>
+            </div>
+        </div>
     </div>
     </div>
     <h1 class="logo"><img th:src="@{/visualization/images/thqzj_logo.png}"/></h1>
     <h1 class="logo"><img th:src="@{/visualization/images/thqzj_logo.png}"/></h1>
-    <div class="header_nav fr">
-        <a class="nav_a on">大数据</a>
-        <div class="nav_a nav_la">
-            <span>接入部门<i>(<span>[[${deptCount}]]</span>)</i></span>
-            <div class="nav_div">
-                <a th:each="dept:${depts}" th:id="${dept.deptId}">[[${dept.deptName}]]</a>
-            </div>
-          </div>
-        <a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>
+    <!--<div class="header_nav fr">-->
+        <!--<a class="nav_a on">大数据</a>-->
+        <!--<div class="nav_a nav_la">-->
+            <!--<span>接入部门<i>(<span>[[${deptCount}]]</span>)</i></span>-->
+            <!--<div class="nav_div">-->
+            <!--</div>-->
+        <!--</div>-->
+        <!--<a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>-->
+    <!--</div>-->
+    <div class="header_nav fr" onclick="getInterfaceStatusAgain()">
+        <div class="nav_a" style="width:162px; font-size: 21px;">
+            <!--<a style="">接入接口<span style="color: #00FFEA; font-size: 20px; font-weight: 900; font-family: electronicFont">(9999)</span></a>-->
+            <span style="font-size: 21px;">接入接口<i style="color: #00FFEA!important; font-size: 20px;">(<span style="color: #00FFEA!important; font-size: 20px; font-family: electronicFont" id="interfaceCountTotal">0</span>)</i></span>
+        </div>
+        <div class="nav_a" style="margin-left: 0px;">
+            <div style="height: 24px;">
+                <span>活跃<i style="color: #00ff3c!important;">(<span style="color: #00ff3c!important; font-family: electronicFont" id="interfaceCountActive">0</span>)</i></span>
+                <span>非活跃<i style="color: #ff9900!important;">(<span style="color: #ff9900!important; font-family: electronicFont" id="interfaceCountInactive">0</span>)</i></span>
+            </div>
+            <div style="height: 24px;">
+                <span>可用<i style="color: #00ff3c!important;">(<span style="color: #00ff3c!important; font-family: electronicFont" id="interfaceCountAvailable">0</span>)</i></span>
+                <span>不可用<i>(<span style="font-family: electronicFont" id="interfaceCountUnavailable">0</span>)</i></span>
+            </div>
+        </div>
+        <!--<a class="nav_a">接口故障<i>(<span id="faultInterfaceCount">0</span>)</i></a>-->
     </div>
     </div>
 </div>
 </div>
 <div class="content clearfix">
 <div class="content clearfix">