Quellcode durchsuchen

移动位置 删除无用的资源

JoeLazy vor 2 Monaten
Ursprung
Commit
3aabf5f0a1

+ 1 - 1
src/main/java/com/sundata/internalevaluation/calc/calcUnit/InterfaceCalcUnit.java

@@ -8,7 +8,7 @@ import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONException;
 import cn.hutool.json.JSONUtil;
 import com.sundata.common.util.JsonUtil;
-import com.sundata.internalevaluation.calc.calcUnit.interfaces.InterfaceRunning;
+import com.sundata.internalevaluation.calc.interfaces.InterfaceRunning;
 import com.sundata.internalevaluation.calc.exception.CalcConfigException;
 import com.sundata.internalevaluation.calc.exception.SendRequestException;
 import com.sundata.internalevaluation.calc.model.CalcResult;

+ 220 - 220
src/main/java/com/sundata/internalevaluation/calc/custom/GetDataTest.java

@@ -1,223 +1,223 @@
-package com.sundata.internalevaluation.calc.custom;
-
-import cn.hutool.core.util.RandomUtil;
-import com.sundata.internalevaluation.script.ScriptUtil;
-import com.sundata.internalevaluation.script.TemplateUtil;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author JoeLazy
- * @date 2025-02-14 17:12:49
- * @description: 测试Java方法获取参数
- */
-public class GetDataTest {
-
-    private static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
-    private static final String YYYYMMDD = "yyyyMMdd";
-    private static final String HHMMSS = "HHmmss";
-    private static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
-    private static final String YYYY_MM_DD = "yyyy-MM-dd";
-    private static final String HH_MM_SS = "HH:mm:ss";
-
-    public String getDateTimeNumber() {
-        return getStr(YYYYMMDDHHMMSS);
-    }
-    public String getDateNumber() {
-        return getStr(YYYYMMDD);
-    }
-    public String getTimeNumber() {
-        return getStr(HHMMSS);
-    }
-    public String getDateTime() {
-        return getStr(YYYY_MM_DD_HH_MM_SS);
-    }
-    public String getDate() {
-        return getStr(YYYY_MM_DD);
-    }
-    public String getTime() {
-        return getStr(HH_MM_SS);
-    }
-
-    public String getStr(String format) {
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
-        return simpleDateFormat.format(nowDate());
-    }
-
-    public Date nowDate() {
-        return new Date();
-    }
-
-
-    public int getInt(int i) {
-        return i;
-    }
-
-
-    public String getString(String str) {
-        return str;
-    }
-
-
-//    public void aa() {
-//        // 模板字符${value}的正则表达式
-//        String regex = "\\$\\{([^}]+)}";
-//        // 生成正则表达式对象
-//        Pattern pattern = Pattern.compile(regex);
-//
-//        // 应入参数
-//        String[] values = {"workDate","account","orgcode","TaskId","TaskSerialNum"};
-//        // 替换模板字符用
-//        Map<String,String> inputMap = new HashMap<String,String>();
-//        // 造假参数
-//        inputMap.put("workDate","'a'");
-//        inputMap.put("account","'a'");
-//        inputMap.put("orgcode","'a'");
-//        inputMap.put("TaskId","'a'");
-//        inputMap.put("TaskSerialNum","'a'");
-//        // 使用apache的StrSubstitutor替换模板字符
-//        StrSubstitutor sub = new StrSubstitutor(inputMap);
-//
-//
-//        // 对请求中的数据逻辑说明的sql进行正则匹配
-//        Matcher matcher = pattern.matcher(relationModel.getSqlCode());
-//        // 判断缺失参数用
-//        ArrayList<String> paramList = new ArrayList<String>(Arrays.asList(values));
-//        // 游标
-//        int matcherCount = 0;
-//        // 检查开始
-//        while (matcher.find()) {
-//            if (!paramList.contains(matcher.group(1))) {
-//                String err = "数据初始化逻辑中,该参数[" + matcher.group(1) + "]不应存在!";
-//                log.error(err);
-//                throw new BusinessException(err);
-//            } else {
-//                // 排除不缺失参数
-//                paramList.remove(matcher.group(1));
-//            }
-//            matcherCount++;
+//package com.sundata.internalevaluation.calc.custom;
+//
+//import cn.hutool.core.util.RandomUtil;
+//import com.sundata.internalevaluation.script.ScriptUtil;
+//import com.sundata.internalevaluation.script.TemplateUtil;
+//
+//import java.text.SimpleDateFormat;
+//import java.util.*;
+//
+///**
+// * Created by IntelliJ IDEA.
+// *
+// * @author JoeLazy
+// * @date 2025-02-14 17:12:49
+// * @description: 测试Java方法获取参数
+// */
+//public class GetDataTest {
+//
+//    private static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+//    private static final String YYYYMMDD = "yyyyMMdd";
+//    private static final String HHMMSS = "HHmmss";
+//    private static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+//    private static final String YYYY_MM_DD = "yyyy-MM-dd";
+//    private static final String HH_MM_SS = "HH:mm:ss";
+//
+//    public String getDateTimeNumber() {
+//        return getStr(YYYYMMDDHHMMSS);
+//    }
+//    public String getDateNumber() {
+//        return getStr(YYYYMMDD);
+//    }
+//    public String getTimeNumber() {
+//        return getStr(HHMMSS);
+//    }
+//    public String getDateTime() {
+//        return getStr(YYYY_MM_DD_HH_MM_SS);
+//    }
+//    public String getDate() {
+//        return getStr(YYYY_MM_DD);
+//    }
+//    public String getTime() {
+//        return getStr(HH_MM_SS);
+//    }
+//
+//    public String getStr(String format) {
+//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+//        return simpleDateFormat.format(nowDate());
+//    }
+//
+//    public Date nowDate() {
+//        return new Date();
+//    }
+//
+//
+//    public int getInt(int i) {
+//        return i;
+//    }
+//
+//
+//    public String getString(String str) {
+//        return str;
+//    }
+//
+//
+////    public void aa() {
+////        // 模板字符${value}的正则表达式
+////        String regex = "\\$\\{([^}]+)}";
+////        // 生成正则表达式对象
+////        Pattern pattern = Pattern.compile(regex);
+////
+////        // 应入参数
+////        String[] values = {"workDate","account","orgcode","TaskId","TaskSerialNum"};
+////        // 替换模板字符用
+////        Map<String,String> inputMap = new HashMap<String,String>();
+////        // 造假参数
+////        inputMap.put("workDate","'a'");
+////        inputMap.put("account","'a'");
+////        inputMap.put("orgcode","'a'");
+////        inputMap.put("TaskId","'a'");
+////        inputMap.put("TaskSerialNum","'a'");
+////        // 使用apache的StrSubstitutor替换模板字符
+////        StrSubstitutor sub = new StrSubstitutor(inputMap);
+////
+////
+////        // 对请求中的数据逻辑说明的sql进行正则匹配
+////        Matcher matcher = pattern.matcher(relationModel.getSqlCode());
+////        // 判断缺失参数用
+////        ArrayList<String> paramList = new ArrayList<String>(Arrays.asList(values));
+////        // 游标
+////        int matcherCount = 0;
+////        // 检查开始
+////        while (matcher.find()) {
+////            if (!paramList.contains(matcher.group(1))) {
+////                String err = "数据初始化逻辑中,该参数[" + matcher.group(1) + "]不应存在!";
+////                log.error(err);
+////                throw new BusinessException(err);
+////            } else {
+////                // 排除不缺失参数
+////                paramList.remove(matcher.group(1));
+////            }
+////            matcherCount++;
+////        }
+////
+////        // 假参数赋值
+////        String resolvedString = sub.replace(relationModel.getSqlCode());
+////    }
+//
+//
+//
+//    public static void main(String[] args) {
+////        String sql = "select * from a where a = ${a} and b = ${b} and c =${a}";
+////        Map<String, Object> map = new HashMap<>();
+////
+////        map.put("a", "isA");
+////        map.put("b", "isB");
+//
+////        Map<String, Object> map = new HashMap<>();
+////        map.put("isStaff", 0);
+////        map.put("isEmployrecord", 0);
+////        map.put("isBankBlack", 1);
+////        map.put("isIntro", 0);
+////        map.put("isCredit", false);
+////        map.put("str", "qiao");
+////        String script = "${isStaff}==1 || ${isEmployrecord}==1 || ${isBankBlack}==1 || ${isIntro} ==1";
+////        script = "isCredit==true";
+////        script = "'${str}'=='qiao'";
+////        script = TemplateUtil.execute(UUID.randomUUID().toString(), script, map);
+////        Object o = ScriptUtil.executeScript(UUID.randomUUID().toString(), script, map);
+//
+//
+//
+//        // 创建绑定变量
+//        Map<String, Object> binding = new HashMap<>();
+//
+//        // 创建自定义对象
+//        binding.put("aNumber", 100);
+//        binding.put("name", "CodeLife Leno");
+//        binding.put("location", "china Guangzhou");
+//
+//
+//        String scriptStr = """
+//                "Hello, $name from $location!"
+//                """;
+//        System.out.println(ScriptUtil.executeScript(UUID.randomUUID().toString(), scriptStr, binding));
+//
+//        System.out.println("");
+//
+//        test();
+//
+////        bb(sql, map);
+//    }
+//
+//
+//    static void test() {
+//        String scriptId = RandomUtil.randomString(10);
+//        String scriptStr = """
+//                "Hello, $name from $location!"
+//                """;
+//        String scriptId2 = RandomUtil.randomString(10);
+//        String scriptStr2 = """
+//                aNumber > 100
+//                """;
+//        String templateId = RandomUtil.randomString(10);
+//        String templateStr = """
+//                Hello, ${user.name}!
+//                You have ${messages.size()} new messages.
+//                <%// 使用 Groovy 脚本计算未读消息数 --%>
+//                <% def unreadMessages = messages.count { it.startsWith("Unread") } %>
+//                Unread messages000: ${unreadMessages}
+//                <%// 条件判断 --%>
+//                <% if (unreadMessages > 0) { %>
+//                    You have some unread messages.
+//                <% } else { %>
+//                    All messages are read.
+//                <% } %>
+//                Messages:
+//                <%// 遍历消息列表 --%>
+//                ${messages.each { msg -> println(" -- " + msg) }}
+//                """;
+//
+//        // 创建绑定变量
+//        Map<String, Object> binding = new HashMap<>();
+//
+//        // 创建自定义对象
+//        User user = new User("Alice");
+//        binding.put("aNumber", 100);
+//        binding.put("name", "CodeLife Leno");
+//        binding.put("location", "china Guangzhou");
+//        binding.put("user", user);
+//        // 创建消息列表
+//        List<String> messages = List.of("Unread Message 1", "Read Message 2", "Unread Message 3");
+//        binding.put("messages", messages);
+//
+//        System.out.println(ScriptUtil.executeScript(scriptId, scriptStr, binding));
+//        System.out.println("--------------------------------------------");
+//        System.out.println(ScriptUtil.executeScript(scriptId2, scriptStr2, binding));
+//        System.out.println("--------------------------------------------");
+//
+//        templateStr = """
+//                <% if (approveSts == 03) { %>审批状态:审核中,<% } else { %>其他...,<% } %><% if (agrSts == 01) { %>额度状态:生效,<% } else if (agrSts == 02){ %>额度状态:手动冻结,<% } else if (agrSts == 02){%>额度状态:系统冻结,<% } %>
+//                """;
+//
+//        binding.put("approveSts",3);
+//        binding.put("agrSts",1);
+//
+//        System.out.println(TemplateUtil.execute(templateId, templateStr, binding));
+//    }
+//
+//
+//    // 自定义 User 类
+//    static class User {
+//        private String name;
+//
+//        public User(String name) {
+//            this.name = name;
 //        }
 //
-//        // 假参数赋值
-//        String resolvedString = sub.replace(relationModel.getSqlCode());
+//        public String getName() {
+//            return name;
+//        }
 //    }
-
-
-
-    public static void main(String[] args) {
-//        String sql = "select * from a where a = ${a} and b = ${b} and c =${a}";
-//        Map<String, Object> map = new HashMap<>();
-//
-//        map.put("a", "isA");
-//        map.put("b", "isB");
-
-//        Map<String, Object> map = new HashMap<>();
-//        map.put("isStaff", 0);
-//        map.put("isEmployrecord", 0);
-//        map.put("isBankBlack", 1);
-//        map.put("isIntro", 0);
-//        map.put("isCredit", false);
-//        map.put("str", "qiao");
-//        String script = "${isStaff}==1 || ${isEmployrecord}==1 || ${isBankBlack}==1 || ${isIntro} ==1";
-//        script = "isCredit==true";
-//        script = "'${str}'=='qiao'";
-//        script = TemplateUtil.execute(UUID.randomUUID().toString(), script, map);
-//        Object o = ScriptUtil.executeScript(UUID.randomUUID().toString(), script, map);
-
-
-
-        // 创建绑定变量
-        Map<String, Object> binding = new HashMap<>();
-
-        // 创建自定义对象
-        binding.put("aNumber", 100);
-        binding.put("name", "CodeLife Leno");
-        binding.put("location", "china Guangzhou");
-
-
-        String scriptStr = """
-                "Hello, $name from $location!"
-                """;
-        System.out.println(ScriptUtil.executeScript(UUID.randomUUID().toString(), scriptStr, binding));
-
-        System.out.println("");
-
-        test();
-
-//        bb(sql, map);
-    }
-
-
-    static void test() {
-        String scriptId = RandomUtil.randomString(10);
-        String scriptStr = """
-                "Hello, $name from $location!"
-                """;
-        String scriptId2 = RandomUtil.randomString(10);
-        String scriptStr2 = """
-                aNumber > 100
-                """;
-        String templateId = RandomUtil.randomString(10);
-        String templateStr = """
-                Hello, ${user.name}!
-                You have ${messages.size()} new messages.
-                <%// 使用 Groovy 脚本计算未读消息数 --%>
-                <% def unreadMessages = messages.count { it.startsWith("Unread") } %>
-                Unread messages000: ${unreadMessages}
-                <%// 条件判断 --%>
-                <% if (unreadMessages > 0) { %>
-                    You have some unread messages.
-                <% } else { %>
-                    All messages are read.
-                <% } %>
-                Messages:
-                <%// 遍历消息列表 --%>
-                ${messages.each { msg -> println(" -- " + msg) }}
-                """;
-
-        // 创建绑定变量
-        Map<String, Object> binding = new HashMap<>();
-
-        // 创建自定义对象
-        User user = new User("Alice");
-        binding.put("aNumber", 100);
-        binding.put("name", "CodeLife Leno");
-        binding.put("location", "china Guangzhou");
-        binding.put("user", user);
-        // 创建消息列表
-        List<String> messages = List.of("Unread Message 1", "Read Message 2", "Unread Message 3");
-        binding.put("messages", messages);
-
-        System.out.println(ScriptUtil.executeScript(scriptId, scriptStr, binding));
-        System.out.println("--------------------------------------------");
-        System.out.println(ScriptUtil.executeScript(scriptId2, scriptStr2, binding));
-        System.out.println("--------------------------------------------");
-
-        templateStr = """
-                <% if (approveSts == 03) { %>审批状态:审核中,<% } else { %>其他...,<% } %><% if (agrSts == 01) { %>额度状态:生效,<% } else if (agrSts == 02){ %>额度状态:手动冻结,<% } else if (agrSts == 02){%>额度状态:系统冻结,<% } %>
-                """;
-
-        binding.put("approveSts",3);
-        binding.put("agrSts",1);
-
-        System.out.println(TemplateUtil.execute(templateId, templateStr, binding));
-    }
-
-
-    // 自定义 User 类
-    static class User {
-        private String name;
-
-        public User(String name) {
-            this.name = name;
-        }
-
-        public String getName() {
-            return name;
-        }
-    }
-
-}
+//
+//}

+ 58 - 58
src/main/java/com/sundata/internalevaluation/calc/custom/MergeFileDemo.java

@@ -1,58 +1,58 @@
-package com.sundata.internalevaluation.calc.custom;
-
-import java.io.*;
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author JoeLazy
- * @date 2025-02-27 15:49:17
- * @description: sql合并
- */
-public class MergeFileDemo {
-
-    public static void main(String[] args) throws Exception {
-
-        File sourcesDir = new File("C:\\Users\\JoeLazy\\Desktop\\sql\\DML");
-        File file = new File("C:\\Users\\JoeLazy\\Desktop\\sql\\DML.sql");
-        File[] files = sourcesDir.listFiles(item ->
-                item.getName().endsWith(".sql")
-                        && item.isFile()
-                        && !"SYS_LOGS.sql".equals(item.getName()));
-        if (files != null) {
-            mergeSqlInsertFile(files, file);
-        }
-    }
-
-
-    public static void mergeSqlInsertFile( File[] sourcesFiles, File targetFile) throws Exception{
-
-
-        try (BufferedWriter writer = new BufferedWriter(new FileWriter(targetFile))) {
-            for (File file : sourcesFiles) {
-                System.out.print("Processing: " + file.getName());
-                try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
-                    writer.write("-- " + file.getName());
-                    writer.newLine();
-                    String line;
-                    while ((line = reader.readLine()) != null) {
-                        line = line.replaceAll("USER_ZYJ.", "");
-                        writer.write(line);
-                        writer.newLine();
-                    }
-                }
-                writer.newLine();
-                writer.newLine();
-                writer.newLine();
-                writer.flush();
-                System.out.println("       ---> 完成");
-            }
-        }
-
-        System.out.println("-----> 所有文件合并完成 <------");
-    }
-
-
-
-}
-
+//package com.sundata.internalevaluation.calc.custom;
+//
+//import java.io.*;
+//
+///**
+// * Created by IntelliJ IDEA.
+// *
+// * @author JoeLazy
+// * @date 2025-02-27 15:49:17
+// * @description: sql合并
+// */
+//public class MergeFileDemo {
+//
+//    public static void main(String[] args) throws Exception {
+//
+//        File sourcesDir = new File("C:\\Users\\JoeLazy\\Desktop\\sql\\DML");
+//        File file = new File("C:\\Users\\JoeLazy\\Desktop\\sql\\DML.sql");
+//        File[] files = sourcesDir.listFiles(item ->
+//                item.getName().endsWith(".sql")
+//                        && item.isFile()
+//                        && !"SYS_LOGS.sql".equals(item.getName()));
+//        if (files != null) {
+//            mergeSqlInsertFile(files, file);
+//        }
+//    }
+//
+//
+//    public static void mergeSqlInsertFile( File[] sourcesFiles, File targetFile) throws Exception{
+//
+//
+//        try (BufferedWriter writer = new BufferedWriter(new FileWriter(targetFile))) {
+//            for (File file : sourcesFiles) {
+//                System.out.print("Processing: " + file.getName());
+//                try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
+//                    writer.write("-- " + file.getName());
+//                    writer.newLine();
+//                    String line;
+//                    while ((line = reader.readLine()) != null) {
+//                        line = line.replaceAll("USER_ZYJ.", "");
+//                        writer.write(line);
+//                        writer.newLine();
+//                    }
+//                }
+//                writer.newLine();
+//                writer.newLine();
+//                writer.newLine();
+//                writer.flush();
+//                System.out.println("       ---> 完成");
+//            }
+//        }
+//
+//        System.out.println("-----> 所有文件合并完成 <------");
+//    }
+//
+//
+//
+//}
+//

+ 1 - 1
src/main/java/com/sundata/internalevaluation/calc/calcUnit/interfaces/AddressInterfaceRunningService.java → src/main/java/com/sundata/internalevaluation/calc/interfaces/AddressInterfaceRunningService.java

@@ -1,4 +1,4 @@
-package com.sundata.internalevaluation.calc.calcUnit.interfaces;
+package com.sundata.internalevaluation.calc.interfaces;
 
 import com.sundata.common.util.JsonUtil;
 import org.springframework.stereotype.Service;

+ 1 - 1
src/main/java/com/sundata/internalevaluation/calc/calcUnit/interfaces/InterfaceRunning.java → src/main/java/com/sundata/internalevaluation/calc/interfaces/InterfaceRunning.java

@@ -1,4 +1,4 @@
-package com.sundata.internalevaluation.calc.calcUnit.interfaces;
+package com.sundata.internalevaluation.calc.interfaces;
 
 public interface InterfaceRunning {
 

+ 228 - 228
src/main/java/com/sundata/internalevaluation/calc/util/JsonToCalciteUtil.java

@@ -1,228 +1,228 @@
-package com.sundata.internalevaluation.calc.util;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.calcite.adapter.file.JsonScannableTable;
-import org.apache.calcite.jdbc.CalciteConnection;
-import org.apache.calcite.schema.SchemaPlus;
-import org.apache.calcite.schema.impl.AbstractSchema;
-import org.apache.calcite.util.Sources;
-
-import java.sql.*;
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author JoeLazy
- * @date 2025-02-18 11:44:07
- * @description: json转虚拟表
- */
-public class JsonToCalciteUtil {
-
-    private Connection connection = null;
-
-    private Statement statement = null;
-
-    private ResultSet resultSet = null;
-
-    public ResultSet jsonToResultSet(String jsonStr, String sql) throws SQLException, JsonProcessingException {
-        // 1. 使用 Jackson 解析 JSON 数据
-        ObjectMapper objectMapper = new ObjectMapper();
-        JsonNode rootNode = objectMapper.readTree(jsonStr);
-
-        //2. 创建 Calcite Schema
-        connection = DriverManager.getConnection("jdbc:calcite:");
-        CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
-
-
-        String json01 = "[\n" +
-                "    {\n" +
-                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
-                "      \"subName\": \"Associate Degree in Health Science\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
-                "      \"subName\": \"Associate Degree in Medicine\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
-                "      \"subName\": \"Master of Biological Science\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
-                "      \"subName\": \"Bachelor of Criminology\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
-                "      \"subName\": \"Master of Teaching\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
-                "      \"subName\": \"Associate Degree in Creative Arts\"\n" +
-                "    }\n" +
-                "  ]";
-
-
-        String json02 = "[\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
-                "      \"score\": 70.82\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
-                "      \"score\": 24.71\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
-                "      \"score\": 44.05\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
-                "      \"score\": 78.65\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
-                "      \"score\": 26.77\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
-                "      \"score\": 3.0\n" +
-                "    }\n" +
-                "  ]";
-
-
-        SchemaPlus rootSchema = calciteConnection.getRootSchema();
-        SchemaPlus credite = rootSchema.add("credite", new AbstractSchema());
-
-
-        SchemaPlus subjectSc = rootSchema.add("subjectSc", new AbstractSchema());
-        subjectSc.add("subject", new JsonScannableTable(Sources.of(json01)));
-        SchemaPlus scoresSc = rootSchema.add("scoresSc", new AbstractSchema());
-        scoresSc.add("scores", new JsonScannableTable(Sources.of(json02)));
-
-
-        // 注册 JSON 数据为表
-        rootNode.fields().forEachRemaining(entry -> {
-            String tableName = entry.getKey();
-            JsonNode tableData = entry.getValue();
-            rootSchema.add(tableName, new JsonScannableTable(Sources.of(tableData.toString())));
-        });
-
-        sql =
-                """
-                        select "subjectSc"."subject"."subName","scoresSc"."scores"."score" from "subjectSc"."subject" inner join "scoresSc"."scores" on "subjectSc"."subject"."subNo" = "scoresSc"."scores"."subNo"
-                        """;
-
-
-        // 4. 执行 SQL 查询
-        statement = connection.createStatement();
-        resultSet = statement.executeQuery(sql);
-        while (resultSet.next()) {
-            System.out.printf("Order ID: %s, Amount: %.2f\n",
-                    resultSet.getString(1),
-                    resultSet.getDouble(2));
-
-        }
-        return resultSet;
-    }
-
-    public void closeResource() throws SQLException {
-        // 关闭连接
-        if (resultSet != null) {
-            resultSet.close();
-        }
-        if (statement != null) {
-            statement.close();
-        }
-        if (connection != null) {
-            connection.close();
-        }
-    }
-
-
-    public static void main(String[] args) throws SQLException, JsonProcessingException {
-        JsonToCalciteUtil jsonToCalciteUtil = new JsonToCalciteUtil();
-
-        String json1 = "{\n" +
-                "  \"student\": [\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"syuName\": \"阎彬\",\n" +
-                "      \"stuSex\": \"男\",\n" +
-                "      \"stuAge\": 26,\n" +
-                "      \"stuClass\": \"1\"\n" +
-                "    }\n" +
-                "  ],\n" +
-                "  \"scores\": [\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
-                "      \"score\": 70.82\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
-                "      \"score\": 24.71\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
-                "      \"score\": 44.05\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
-                "      \"score\": 78.65\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
-                "      \"score\": 26.77\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
-                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
-                "      \"score\": 3.0\n" +
-                "    }\n" +
-                "  ],\n" +
-                "  \"subject\": [\n" +
-                "    {\n" +
-                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
-                "      \"subName\": \"Associate Degree in Health Science\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
-                "      \"subName\": \"Associate Degree in Medicine\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
-                "      \"subName\": \"Master of Biological Science\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
-                "      \"subName\": \"Bachelor of Criminology\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
-                "      \"subName\": \"Master of Teaching\"\n" +
-                "    },\n" +
-                "    {\n" +
-                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
-                "      \"subName\": \"Associate Degree in Creative Arts\"\n" +
-                "    }\n" +
-                "  ]\n" +
-                "}";
-
-        ResultSet resultSet1 = jsonToCalciteUtil.jsonToResultSet(json1, "");
-
-
-    }
-
-}
+//package com.sundata.internalevaluation.calc.util;
+//
+//import com.fasterxml.jackson.core.JsonProcessingException;
+//import com.fasterxml.jackson.databind.JsonNode;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import org.apache.calcite.adapter.file.JsonScannableTable;
+//import org.apache.calcite.jdbc.CalciteConnection;
+//import org.apache.calcite.schema.SchemaPlus;
+//import org.apache.calcite.schema.impl.AbstractSchema;
+//import org.apache.calcite.util.Sources;
+//
+//import java.sql.*;
+//
+///**
+// * Created by IntelliJ IDEA.
+// *
+// * @author JoeLazy
+// * @date 2025-02-18 11:44:07
+// * @description: json转虚拟表
+// */
+//public class JsonToCalciteUtil {
+//
+//    private Connection connection = null;
+//
+//    private Statement statement = null;
+//
+//    private ResultSet resultSet = null;
+//
+//    public ResultSet jsonToResultSet(String jsonStr, String sql) throws SQLException, JsonProcessingException {
+//        // 1. 使用 Jackson 解析 JSON 数据
+//        ObjectMapper objectMapper = new ObjectMapper();
+//        JsonNode rootNode = objectMapper.readTree(jsonStr);
+//
+//        //2. 创建 Calcite Schema
+//        connection = DriverManager.getConnection("jdbc:calcite:");
+//        CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
+//
+//
+//        String json01 = "[\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
+//                "      \"subName\": \"Associate Degree in Health Science\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
+//                "      \"subName\": \"Associate Degree in Medicine\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
+//                "      \"subName\": \"Master of Biological Science\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
+//                "      \"subName\": \"Bachelor of Criminology\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
+//                "      \"subName\": \"Master of Teaching\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
+//                "      \"subName\": \"Associate Degree in Creative Arts\"\n" +
+//                "    }\n" +
+//                "  ]";
+//
+//
+//        String json02 = "[\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
+//                "      \"score\": 70.82\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
+//                "      \"score\": 24.71\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
+//                "      \"score\": 44.05\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
+//                "      \"score\": 78.65\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
+//                "      \"score\": 26.77\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
+//                "      \"score\": 3.0\n" +
+//                "    }\n" +
+//                "  ]";
+//
+//
+//        SchemaPlus rootSchema = calciteConnection.getRootSchema();
+//        SchemaPlus credite = rootSchema.add("credite", new AbstractSchema());
+//
+//
+//        SchemaPlus subjectSc = rootSchema.add("subjectSc", new AbstractSchema());
+//        subjectSc.add("subject", new JsonScannableTable(Sources.of(json01)));
+//        SchemaPlus scoresSc = rootSchema.add("scoresSc", new AbstractSchema());
+//        scoresSc.add("scores", new JsonScannableTable(Sources.of(json02)));
+//
+//
+//        // 注册 JSON 数据为表
+//        rootNode.fields().forEachRemaining(entry -> {
+//            String tableName = entry.getKey();
+//            JsonNode tableData = entry.getValue();
+//            rootSchema.add(tableName, new JsonScannableTable(Sources.of(tableData.toString())));
+//        });
+//
+//        sql =
+//                """
+//                        select "subjectSc"."subject"."subName","scoresSc"."scores"."score" from "subjectSc"."subject" inner join "scoresSc"."scores" on "subjectSc"."subject"."subNo" = "scoresSc"."scores"."subNo"
+//                        """;
+//
+//
+//        // 4. 执行 SQL 查询
+//        statement = connection.createStatement();
+//        resultSet = statement.executeQuery(sql);
+//        while (resultSet.next()) {
+//            System.out.printf("Order ID: %s, Amount: %.2f\n",
+//                    resultSet.getString(1),
+//                    resultSet.getDouble(2));
+//
+//        }
+//        return resultSet;
+//    }
+//
+//    public void closeResource() throws SQLException {
+//        // 关闭连接
+//        if (resultSet != null) {
+//            resultSet.close();
+//        }
+//        if (statement != null) {
+//            statement.close();
+//        }
+//        if (connection != null) {
+//            connection.close();
+//        }
+//    }
+//
+//
+//    public static void main(String[] args) throws SQLException, JsonProcessingException {
+//        JsonToCalciteUtil jsonToCalciteUtil = new JsonToCalciteUtil();
+//
+//        String json1 = "{\n" +
+//                "  \"student\": [\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"syuName\": \"阎彬\",\n" +
+//                "      \"stuSex\": \"男\",\n" +
+//                "      \"stuAge\": 26,\n" +
+//                "      \"stuClass\": \"1\"\n" +
+//                "    }\n" +
+//                "  ],\n" +
+//                "  \"scores\": [\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
+//                "      \"score\": 70.82\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
+//                "      \"score\": 24.71\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
+//                "      \"score\": 44.05\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
+//                "      \"score\": 78.65\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
+//                "      \"score\": 26.77\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"stuNo\": \"2e482de1-c984-4447-a968-ffc2f9cd4a2a\",\n" +
+//                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
+//                "      \"score\": 3.0\n" +
+//                "    }\n" +
+//                "  ],\n" +
+//                "  \"subject\": [\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"07cc9eca-4e66-4d1c-9dd1-fe4671c2e18b\",\n" +
+//                "      \"subName\": \"Associate Degree in Health Science\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"cda7b717-bbff-40fd-af90-7e22dcea8457\",\n" +
+//                "      \"subName\": \"Associate Degree in Medicine\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"9cf8534b-37c6-4365-8453-d1454e336992\",\n" +
+//                "      \"subName\": \"Master of Biological Science\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"b21f3d9b-670b-4819-8faa-dbb2324f522a\",\n" +
+//                "      \"subName\": \"Bachelor of Criminology\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"635c0a8a-3701-43f1-a1d6-d359465df3c6\",\n" +
+//                "      \"subName\": \"Master of Teaching\"\n" +
+//                "    },\n" +
+//                "    {\n" +
+//                "      \"subNo\": \"2aa9e2d1-5f0e-41c6-8bf5-970b08d47b67\",\n" +
+//                "      \"subName\": \"Associate Degree in Creative Arts\"\n" +
+//                "    }\n" +
+//                "  ]\n" +
+//                "}";
+//
+//        ResultSet resultSet1 = jsonToCalciteUtil.jsonToResultSet(json1, "");
+//
+//
+//    }
+//
+//}

+ 43 - 0
src/main/java/com/sundata/internalevaluation/calc/util/ParamUtils.java

@@ -0,0 +1,43 @@
+package com.sundata.internalevaluation.calc.util;
+
+import com.sundata.internalevaluation.calc.exception.RequestParamException;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @author JoeLazy
+ * @date 2025-05-07 17:38:46
+ * @description: 接口参数中 获取参数的工具类
+ */
+public class ParamUtils {
+
+
+    /**
+     * 获取局域网IP地址
+     * @return ip
+     */
+    public static String getIpAddress(){
+        try {
+            return InetAddress.getLocalHost().getHostAddress();
+        } catch (UnknownHostException e) {
+            throw new RequestParamException("调用工具类获取IP地址失败![ParamUtils.getIpAddress()]");
+        }
+    }
+
+
+    /**
+     * 获取当前时间指定格式的字符串
+     * @param format 时间日期格式
+     * @return 对应字符串
+     */
+    public static String getDateStr(String format){
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        return sdf.format(new Date());
+    }
+
+}

+ 32 - 32
src/main/java/com/sundata/internalevaluation/calc/util/SqlUtil.java

@@ -1,32 +1,32 @@
-package com.sundata.internalevaluation.calc.util;
-
-import org.apache.commons.lang.text.StrSubstitutor;
-
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author JoeLazy
- * @date 2025-02-17 16:16:49
- * @description: sql语句工具类
- */
-public class SqlUtil {
-
-    public static String sqlFormat(String sql, Map<String, Object> map) {
-
-        // 模板字符${value}的正则表达式
-        String regex = "\\$\\{([^}]+)}";
-        // 生成正则表达式对象
-        Pattern pattern = Pattern.compile(regex);
-        // 对请求中的数据逻辑说明的sql进行正则匹配
-        Matcher matcher = pattern.matcher(sql);
-        StrSubstitutor sub = new StrSubstitutor(map);
-
-        return sub.replace(sql);
-
-    }
-
-}
+//package com.sundata.internalevaluation.calc.util;
+//
+//import org.apache.commons.lang.text.StrSubstitutor;
+//
+//import java.util.Map;
+//import java.util.regex.Matcher;
+//import java.util.regex.Pattern;
+//
+///**
+// * Created by IntelliJ IDEA.
+// *
+// * @author JoeLazy
+// * @date 2025-02-17 16:16:49
+// * @description: sql语句工具类
+// */
+//public class SqlUtil {
+//
+//    public static String sqlFormat(String sql, Map<String, Object> map) {
+//
+//        // 模板字符${value}的正则表达式
+//        String regex = "\\$\\{([^}]+)}";
+//        // 生成正则表达式对象
+//        Pattern pattern = Pattern.compile(regex);
+//        // 对请求中的数据逻辑说明的sql进行正则匹配
+//        Matcher matcher = pattern.matcher(sql);
+//        StrSubstitutor sub = new StrSubstitutor(map);
+//
+//        return sub.replace(sql);
+//
+//    }
+//
+//}

+ 144 - 144
src/main/java/com/sundata/internalevaluation/conf/JsonToCalciteExample.java

@@ -1,144 +1,144 @@
-package com.sundata.internalevaluation.conf;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.calcite.DataContext;
-import org.apache.calcite.adapter.file.JsonScannableTable;
-import org.apache.calcite.jdbc.CalciteConnection;
-import org.apache.calcite.linq4j.Enumerable;
-import org.apache.calcite.linq4j.Linq4j;
-import org.apache.calcite.rel.type.RelDataType;
-import org.apache.calcite.rel.type.RelDataTypeFactory;
-import org.apache.calcite.schema.SchemaPlus;
-import org.apache.calcite.schema.impl.AbstractSchema;
-import org.apache.calcite.schema.impl.AbstractTable;
-import org.apache.calcite.sql.type.SqlTypeName;
-import org.apache.calcite.util.Pair;
-import org.apache.calcite.util.Sources;
-
-import java.sql.*;
-import java.util.*;
-
-public class JsonToCalciteExample {
-
-    public  Object jsonTotable(String jsonDate, String sql)  {
-        // 1. JSON 数据
-        Object resValue = null;
-        try{
-            // 2. 使用 Jackson 解析 JSON 数据
-            ObjectMapper objectMapper = new ObjectMapper();
-            JsonNode rootNode = objectMapper.readTree(jsonDate);
-            // 3. 创建 Calcite Schema
-            Connection connection = DriverManager.getConnection("jdbc:calcite:");
-            CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
-            SchemaPlus rootSchema = calciteConnection.getRootSchema();
-
-
-
-            // 注册 JSON 数据为表
-            rootNode.fields().forEachRemaining(entry -> {
-                String schename =entry.getKey();
-                String schenameData="";
-                JsonNode schenameData1=null;
-                try {
-                    schenameData = String.valueOf(entry.getValue());
-                    schenameData1 =objectMapper.readTree(schenameData);
-                } catch (JsonProcessingException e) {
-                    throw new RuntimeException(e);
-                }
-                SchemaPlus schema = rootSchema.add(schename,new AbstractSchema());
-                schenameData1.fields().forEachRemaining(entrynext -> {
-                    String tableName =entrynext.getKey();
-                    JsonNode tableData =entrynext.getValue();
-                    schema.add(tableName, new JsonScannableTable(Sources.of(tableData.toString())));
-                });
-            });
-
-            //调用张艳杰接收连接方法
-            resValue = getConnectionTable(calciteConnection,sql);
-            // 关闭连接信息
-            connection.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-        return resValue;
-    }
-
-    // 自定义表类实现
-    static class JsonTable extends AbstractTable {
-        private final List<Map<String, Object>> rows = new ArrayList<>();
-
-        public JsonTable(JsonNode data) {
-            for (JsonNode row : data) {
-                Map<String, Object> map = new HashMap<>();
-                row.fieldNames().forEachRemaining(field -> {
-                    map.put(field, row.get(field).isNumber()
-                            ? row.get(field).numberValue()
-                            : row.get(field).asText());
-                });
-                rows.add(map);
-            }
-        }
-
-        @Override
-        public RelDataType getRowType(RelDataTypeFactory typeFactory) {
-            // 动态推断字段类型
-            if (rows.isEmpty()) {
-                return typeFactory.createStructType(Collections.emptyList());
-            }
-
-            Map<String, Object> firstRow = rows.get(0);
-            List<Pair<String, RelDataType>> fields = new ArrayList<>();
-            for (Map.Entry<String, Object> entry : firstRow.entrySet()) {
-                SqlTypeName sqlType = (entry.getValue() instanceof Number)
-                        ? SqlTypeName.DECIMAL
-                        : SqlTypeName.VARCHAR;
-                fields.add(Pair.of(entry.getKey(), typeFactory.createSqlType(sqlType)));
-            }
-
-            return typeFactory.createStructType(fields);
-        }
-
-        public Enumerable<Object[]> scan(DataContext root) {
-            List<Object[]> result = new ArrayList<>();
-            for (Map<String, Object> row : rows) {
-                result.add(row.values().toArray());
-            }
-            return Linq4j.asEnumerable(result);
-        }
-    }
-
-    /**
-     *
-     * @param calciteConnection
-     * @param sql
-     * @return
-     */
-    public Object getConnectionTable (CalciteConnection calciteConnection,String sql) {
-        //获取域
-        SchemaPlus rootSchemafter = calciteConnection.getRootSchema();
-        //根域中获取子域
-        SchemaPlus childrenSchema=rootSchemafter.getSubSchema(calciteConnection.getRootSchema().getName());
-        Object childrebnameobj=rootSchemafter.getSubSchemaNames();
-        //子域名
-//        String childrenName = childrenSchema.getName();
-//        System.out.println("childrenName: " + childrenName);
-//        //子域中表名
-//        Set<String> tableSet = childrenSchema.getTableNames();
-        // 定义返回结果
-        Object value = null;
-        try {
-            Statement statement = calciteConnection.createStatement();
-            ResultSet resultSet = statement.executeQuery(sql);
-            if (resultSet.next()){
-                value = resultSet.getObject(1);
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-            throw new RuntimeException(e);
-        }
-        return value;
-    }
-}
+//package com.sundata.internalevaluation.conf;
+//
+//import com.fasterxml.jackson.core.JsonProcessingException;
+//import com.fasterxml.jackson.databind.JsonNode;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import org.apache.calcite.DataContext;
+//import org.apache.calcite.adapter.file.JsonScannableTable;
+//import org.apache.calcite.jdbc.CalciteConnection;
+//import org.apache.calcite.linq4j.Enumerable;
+//import org.apache.calcite.linq4j.Linq4j;
+//import org.apache.calcite.rel.type.RelDataType;
+//import org.apache.calcite.rel.type.RelDataTypeFactory;
+//import org.apache.calcite.schema.SchemaPlus;
+//import org.apache.calcite.schema.impl.AbstractSchema;
+//import org.apache.calcite.schema.impl.AbstractTable;
+//import org.apache.calcite.sql.type.SqlTypeName;
+//import org.apache.calcite.util.Pair;
+//import org.apache.calcite.util.Sources;
+//
+//import java.sql.*;
+//import java.util.*;
+//
+//public class JsonToCalciteExample {
+//
+//    public  Object jsonTotable(String jsonDate, String sql)  {
+//        // 1. JSON 数据
+//        Object resValue = null;
+//        try{
+//            // 2. 使用 Jackson 解析 JSON 数据
+//            ObjectMapper objectMapper = new ObjectMapper();
+//            JsonNode rootNode = objectMapper.readTree(jsonDate);
+//            // 3. 创建 Calcite Schema
+//            Connection connection = DriverManager.getConnection("jdbc:calcite:");
+//            CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
+//            SchemaPlus rootSchema = calciteConnection.getRootSchema();
+//
+//
+//
+//            // 注册 JSON 数据为表
+//            rootNode.fields().forEachRemaining(entry -> {
+//                String schename =entry.getKey();
+//                String schenameData="";
+//                JsonNode schenameData1=null;
+//                try {
+//                    schenameData = String.valueOf(entry.getValue());
+//                    schenameData1 =objectMapper.readTree(schenameData);
+//                } catch (JsonProcessingException e) {
+//                    throw new RuntimeException(e);
+//                }
+//                SchemaPlus schema = rootSchema.add(schename,new AbstractSchema());
+//                schenameData1.fields().forEachRemaining(entrynext -> {
+//                    String tableName =entrynext.getKey();
+//                    JsonNode tableData =entrynext.getValue();
+//                    schema.add(tableName, new JsonScannableTable(Sources.of(tableData.toString())));
+//                });
+//            });
+//
+//            //调用张艳杰接收连接方法
+//            resValue = getConnectionTable(calciteConnection,sql);
+//            // 关闭连接信息
+//            connection.close();
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            throw new RuntimeException(e);
+//        }
+//        return resValue;
+//    }
+//
+//    // 自定义表类实现
+//    static class JsonTable extends AbstractTable {
+//        private final List<Map<String, Object>> rows = new ArrayList<>();
+//
+//        public JsonTable(JsonNode data) {
+//            for (JsonNode row : data) {
+//                Map<String, Object> map = new HashMap<>();
+//                row.fieldNames().forEachRemaining(field -> {
+//                    map.put(field, row.get(field).isNumber()
+//                            ? row.get(field).numberValue()
+//                            : row.get(field).asText());
+//                });
+//                rows.add(map);
+//            }
+//        }
+//
+//        @Override
+//        public RelDataType getRowType(RelDataTypeFactory typeFactory) {
+//            // 动态推断字段类型
+//            if (rows.isEmpty()) {
+//                return typeFactory.createStructType(Collections.emptyList());
+//            }
+//
+//            Map<String, Object> firstRow = rows.get(0);
+//            List<Pair<String, RelDataType>> fields = new ArrayList<>();
+//            for (Map.Entry<String, Object> entry : firstRow.entrySet()) {
+//                SqlTypeName sqlType = (entry.getValue() instanceof Number)
+//                        ? SqlTypeName.DECIMAL
+//                        : SqlTypeName.VARCHAR;
+//                fields.add(Pair.of(entry.getKey(), typeFactory.createSqlType(sqlType)));
+//            }
+//
+//            return typeFactory.createStructType(fields);
+//        }
+//
+//        public Enumerable<Object[]> scan(DataContext root) {
+//            List<Object[]> result = new ArrayList<>();
+//            for (Map<String, Object> row : rows) {
+//                result.add(row.values().toArray());
+//            }
+//            return Linq4j.asEnumerable(result);
+//        }
+//    }
+//
+//    /**
+//     *
+//     * @param calciteConnection
+//     * @param sql
+//     * @return
+//     */
+//    public Object getConnectionTable (CalciteConnection calciteConnection,String sql) {
+//        //获取域
+//        SchemaPlus rootSchemafter = calciteConnection.getRootSchema();
+//        //根域中获取子域
+//        SchemaPlus childrenSchema=rootSchemafter.getSubSchema(calciteConnection.getRootSchema().getName());
+//        Object childrebnameobj=rootSchemafter.getSubSchemaNames();
+//        //子域名
+////        String childrenName = childrenSchema.getName();
+////        System.out.println("childrenName: " + childrenName);
+////        //子域中表名
+////        Set<String> tableSet = childrenSchema.getTableNames();
+//        // 定义返回结果
+//        Object value = null;
+//        try {
+//            Statement statement = calciteConnection.createStatement();
+//            ResultSet resultSet = statement.executeQuery(sql);
+//            if (resultSet.next()){
+//                value = resultSet.getObject(1);
+//            }
+//        } catch (SQLException e) {
+//            e.printStackTrace();
+//            throw new RuntimeException(e);
+//        }
+//        return value;
+//    }
+//}

+ 0 - 36
src/main/java/com/sundata/internalevaluation/task/AsyncTask.java

@@ -1,36 +0,0 @@
-package com.sundata.internalevaluation.task;
-
-import com.sundata.internalevaluation.business.model.IrbonlineAsynTaskInfo;
-import com.sundata.internalevaluation.business.service.IrbonlineAsynTaskInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-import java.util.List;
-
-/**
- * Created by IntelliJ IDEA.
- *
- * @author JoeLazy
- * @date 2025-02-27 16:22:55
- * @description: 异步调用的规则集定时任务
- */
-
-//@Configuration
-@EnableAsync
-@EnableScheduling
-public class AsyncTask {
-
-    @Autowired
-    private IrbonlineAsynTaskInfoService irbonlineAsynTaskInfoService;
-
-
-    @Async
-    @Scheduled(fixedRate = 1000, initialDelay = 5000)
-    public void asyncCalcRulesTask() {
-        List<IrbonlineAsynTaskInfo> taskInfoListByStatus = irbonlineAsynTaskInfoService.getTaskInfoListByStatus("03");
-        System.out.println("异步调用的规则集定时任务");
-    }
-}

+ 4 - 8
src/main/java/com/sundata/product/rfEngine/PublicComponent/ProjectTeam/ProjectTeamComponent.java

@@ -1,17 +1,13 @@
 package com.sundata.product.rfEngine.PublicComponent.ProjectTeam;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
-import com.sundata.internalevaluation.conf.JsonToCalciteExample;
 import com.sundata.internalevaluation.calc.util.CalcUtil;
 
-public class ProjectTeamComponent {
+import java.util.HashMap;
+import java.util.Map;
 
-    JsonToCalciteExample jsontable =new JsonToCalciteExample();
+public class ProjectTeamComponent {
 
     public  Map<String,Object> doJavaLogic(Map<String, Object> inputmap) throws Exception {