瀏覽代碼

省接口对接准备代码

wangzhe 2 年之前
父節點
當前提交
6a2a67dccd

+ 1 - 0
leiSP-framework/src/main/java/com/sooka/framework/config/ShiroConfig.java

@@ -290,6 +290,7 @@ public class ShiroConfig
         // 不需要拦截的访问
         filterChainDefinitionMap.put("/login", "anon,captchaValidate");
         filterChainDefinitionMap.put("/system/interfaceLog/addLog", "anon,captchaValidate");
+        filterChainDefinitionMap.put("/business/app/GetProvinceController/getEnterpriseUniscId", "anon,captchaValidate");
         // 注册相关
         filterChainDefinitionMap.put("/register", "anon,captchaValidate");
         // 系统权限列表

+ 47 - 0
mybusiness/src/main/java/com/business/controller/GetProvinceController.java

@@ -0,0 +1,47 @@
+package com.business.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sooka.system.domain.BaseBusinessEntity;
+import com.util.HttpUtil2;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 对接省平台获取数据信息Controller
+ *
+ * @author zhe
+ * @date 2022-12-17
+ */
+@RequestMapping("/business/app/GetProvinceController")
+@RestController
+public class GetProvinceController {
+
+    @RequestMapping("getEnterpriseUniscId")
+    public String getEnterpriseUniscId(@RequestBody BaseBusinessEntity baseBusinessEntity) {
+        System.out.println("sending Post to http://172.24.5.241:6689/api/cegnir/getEnterpriseUniscId 1...");
+        System.out.println("sending Post to http://172.24.5.241:6689/api/cegnir/getEnterpriseUniscId 2...");
+        System.out.println("sending Post to http://172.24.5.241:6689/api/cegnir/getEnterpriseUniscId 3...");
+        Map headerparam = new HashMap();
+        headerparam.put("Authorization-Type", "Basic");
+        headerparam.put("Authorization", "Basic NjBlODQxNzQyZTIyMDE2NjUzYmQ3NmE4N2QxY2FjMzA6ODhlOWM0NzcxMWZkMTM5YjhiMGMyODlkZjBiMWI5YmQ=Service-ID:qNpU77");
+        String url = "http://172.24.5.241:6689";
+        String parem = "{\n" +
+                "  \"appId\": \"1234\",\n" +
+                "  \"charset\": \"utf-8\",\n" +
+                "  \"format\": \"JSON\",\n" +
+                "  \"timestamp\": \"2022-12-16 10:22:00\",\n" +
+                "  \"version\": \"1.0.0\",\n" +
+                "  \"enterpriseName\": \"北京阿里巴巴信息技术有限公司\"\n" +
+                "}";
+        try{
+            return HttpUtil2.doPost(url + "/api/cegnir/getEnterpriseUniscId", JSONObject.toJSONString(parem), headerparam);
+        }catch (Exception e){
+            e.printStackTrace();
+            return "interfaceErrorMsg:" + e.toString();
+        }
+    }
+}

+ 20 - 21
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -45,27 +45,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTUInterfaceinfoList" parameterType="TUInterfaceinfo" resultMap="TUInterfaceinfoResult">
         <include refid="selectTUInterfaceinfoVo"/>
-        <where>
-            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="interfaceName != null  and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
-            <if test="needRefresh != null  and needRefresh != ''"> and need_refresh = #{needRefresh}</if>
-            <if test="infoItem != null  and infoItem != ''"> and info_item = #{infoItem}</if>
-            <if test="usageScenarios != null  and usageScenarios != ''"> and usage_scenarios = #{usageScenarios}</if>
-            <if test="shareType != null  and shareType != ''"> and share_type = #{shareType}</if>
-            <if test="interfaceType != null  and interfaceType != ''"> and interface_type = #{interfaceType}</if>
-            <if test="env != null  and env != ''"> and env = #{env}</if>
-            <if test="signServeraddress != null  and signServeraddress != ''"> and sign_serveraddress = #{signServeraddress}</if>
-            <if test="interfaceAddress != null  and interfaceAddress != ''"> and interface_address = #{interfaceAddress}</if>
-            <if test="typeIam != null  and typeIam != ''"> and type_iam = #{typeIam}</if>
-            <if test="typeAksk != null  and typeAksk != ''"> and type_aksk = #{typeAksk}</if>
-            <if test="code != null  and code != ''"> and code = #{code}</if>
-            <if test="callsuccnum != null  and callsuccnum != ''"> and callsuccnum = #{callsuccnum}</if>
-            <if test="callfailnum != null  and callfailnum != ''"> and callfailnum = #{callfailnum}</if>
-            <if test="shareType1 != null  and shareType1 != '' and shareType3 != null  and shareType3 != ''">
-                and share_type in (#{shareType1}, #{shareType3})
-            </if>
-        </where>
+        where del_flag = '0'
+        <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        <if test="status != null  and status != ''"> and status = #{status}</if>
+        <if test="interfaceName != null  and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
+        <if test="needRefresh != null  and needRefresh != ''"> and need_refresh = #{needRefresh}</if>
+        <if test="infoItem != null  and infoItem != ''"> and info_item = #{infoItem}</if>
+        <if test="usageScenarios != null  and usageScenarios != ''"> and usage_scenarios = #{usageScenarios}</if>
+        <if test="shareType != null  and shareType != ''"> and share_type = #{shareType}</if>
+        <if test="interfaceType != null  and interfaceType != ''"> and interface_type = #{interfaceType}</if>
+        <if test="env != null  and env != ''"> and env = #{env}</if>
+        <if test="signServeraddress != null  and signServeraddress != ''"> and sign_serveraddress = #{signServeraddress}</if>
+        <if test="interfaceAddress != null  and interfaceAddress != ''"> and interface_address = #{interfaceAddress}</if>
+        <if test="typeIam != null  and typeIam != ''"> and type_iam = #{typeIam}</if>
+        <if test="typeAksk != null  and typeAksk != ''"> and type_aksk = #{typeAksk}</if>
+        <if test="code != null  and code != ''"> and code = #{code}</if>
+        <if test="callsuccnum != null  and callsuccnum != ''"> and callsuccnum = #{callsuccnum}</if>
+        <if test="callfailnum != null  and callfailnum != ''"> and callfailnum = #{callfailnum}</if>
+        <if test="shareType1 != null  and shareType1 != '' and shareType3 != null  and shareType3 != ''">
+            and share_type in (#{shareType1}, #{shareType3})
+        </if>
         order by create_time desc
     </select>