Browse Source

上一个提交修改js的参数传入全量参数
本次格式化清理代码

andy 1 year ago
parent
commit
43c4701615

+ 2 - 2
src/main/java/com/scbfkj/uni/api/LogAop.java

@@ -226,10 +226,10 @@ public class LogAop {
                     if (Objects.nonNull(usergroupid) && Objects.equals("0", usergroupid.toString())) {
                         body.put("filterColumns", Collections.singletonList("*"));
                     }
-                }else {
+                } else {
 //                    不需要登录也没有设置权限的默认添加一个所有列权限
 
-                    if(body!=null && !body.containsKey("filterColumns")){
+                    if (body != null && !body.containsKey("filterColumns")) {
                         body.put("filterColumns", Collections.singletonList("*"));
                     }
                 }

+ 22 - 22
src/main/java/com/scbfkj/uni/library/IbmmqUtil.java

@@ -8,30 +8,30 @@ import com.ibm.msg.client.jakarta.wmq.compat.base.internal.MQQueueManager;
 
 public class IbmmqUtil {
 
-    public static int getDepth(String host, int port, int ccsid, String queueManager, String channel,String queueName, String username, String password) {
-    MQQueueManager qMgr = null;
-    try {
-        MQEnvironment.hostname = host;
-        MQEnvironment.port = port;
-        MQEnvironment.CCSID = ccsid;
-        MQEnvironment.channel = channel;
-        MQEnvironment.userID = username;
-        MQEnvironment.password = password;
+    public static int getDepth(String host, int port, int ccsid, String queueManager, String channel, String queueName, String username, String password) {
+        MQQueueManager qMgr = null;
+        try {
+            MQEnvironment.hostname = host;
+            MQEnvironment.port = port;
+            MQEnvironment.CCSID = ccsid;
+            MQEnvironment.channel = channel;
+            MQEnvironment.userID = username;
+            MQEnvironment.password = password;
 
-        qMgr = new MQQueueManager(queueManager);
-        MQQueue queue = qMgr.accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_SHARED);
-        return queue.getCurrentDepth();
-    } catch (MQException e) {
-        e.printStackTrace();
-        return -1;
-    } finally {
-        if (qMgr != null) {
-            try {
-                qMgr.disconnect();
-            } catch (MQException e) {
-                e.printStackTrace();
+            qMgr = new MQQueueManager(queueManager);
+            MQQueue queue = qMgr.accessQueue(queueName, MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_SHARED);
+            return queue.getCurrentDepth();
+        } catch (MQException e) {
+            e.printStackTrace();
+            return -1;
+        } finally {
+            if (qMgr != null) {
+                try {
+                    qMgr.disconnect();
+                } catch (MQException e) {
+                    e.printStackTrace();
+                }
             }
         }
     }
 }
-}

+ 0 - 1
src/main/java/com/scbfkj/uni/library/script/JsScriptEngineUtil.java

@@ -12,7 +12,6 @@ import org.graalvm.polyglot.Context;
 import org.graalvm.polyglot.Source;
 import org.graalvm.polyglot.Value;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;

+ 7 - 7
src/main/java/com/scbfkj/uni/process/DataBase.java

@@ -138,7 +138,7 @@ public class DataBase {
                     } catch (SQLException e) {
                         connection.rollback();
                         throw e;
-                    }finally {
+                    } finally {
                         connection.commit();
                     }
                 }
@@ -381,11 +381,11 @@ public class DataBase {
         Connection conn = getDataSourcePool(connection).getConnection();
         metaData = conn.getMetaData();
 
-        if(connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
+        if (connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
             resultSet = metaData.getColumns(null, "public", tableName, null);
-        }else if(connection.contains("jdbc:oracle") ) {
+        } else if (connection.contains("jdbc:oracle")) {
             resultSet = metaData.getColumns(null, conn.getMetaData().getUserName(), tableName, null);
-        }else{
+        } else {
             resultSet = metaData.getColumns(conn.getCatalog(), null, tableName, null);
         }
 
@@ -431,11 +431,11 @@ public class DataBase {
         ArrayList<String> result = new ArrayList<>();
         try (Connection conn = getDataSourcePool(connection).getConnection()) {
             metaData = conn.getMetaData();
-            if(connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
+            if (connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
                 resultSet = metaData.getTables(null, "public", null, new String[]{"TABLE"});
-            }else if(connection.contains("jdbc:oracle") ) {
+            } else if (connection.contains("jdbc:oracle")) {
                 resultSet = metaData.getTables(null, conn.getMetaData().getUserName(), "%", new String[]{"TABLE"});
-            }else{
+            } else {
                 resultSet = metaData.getTables(conn.getCatalog(), null, null, new String[]{"TABLE"});
             }
             while (resultSet.next()) {

+ 2 - 2
src/main/java/com/scbfkj/uni/process/Kafka.java

@@ -73,8 +73,8 @@ public class Kafka {
 
     public static Map<String, Object> receptionMessage(String connectConfig, String topic, String groupId) throws Exception {
         Map<String, Object> connectConfigMaps = (Map<String, Object>) DataFormatUtil.stringToMap(connectConfig);
-            connectConfigMaps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
-            connectConfigMaps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
+        connectConfigMaps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
+        connectConfigMaps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
         if (Objects.nonNull(groupId)) {
             connectConfigMaps.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
         }

+ 3 - 3
src/main/java/com/scbfkj/uni/process/RabbitMQ.java

@@ -67,7 +67,7 @@ public class RabbitMQ {
 
 
     public void sendMessage(
-            String host, Long port, String username, String password, String virtualHost,String queueName,
+            String host, Long port, String username, String password, String virtualHost, String queueName,
             Object data
     ) throws JMSException {
 
@@ -77,7 +77,7 @@ public class RabbitMQ {
             if (data instanceof Object[] datas) {
                 for (Object it : datas) {
 
-                    execSend(template, it,queueName);
+                    execSend(template, it, queueName);
                 }
             } else if (data instanceof Iterable<?> datas) {
 
@@ -107,7 +107,7 @@ public class RabbitMQ {
             String queueName) throws IOException {
         String message = mapper.writeValueAsString(data);
 
-        template.send(queueName,session -> session.createTextMessage(message));
+        template.send(queueName, session -> session.createTextMessage(message));
     }
 
 

+ 3 - 3
src/main/java/com/scbfkj/uni/service/DataProcessService.java

@@ -179,9 +179,9 @@ public class DataProcessService {
                     result = JsScriptEngineUtil.eval(expressionStr, resource);
                 } else {
                     List<Map<String, Object>> params = DATA_BASE.query(Config.getCenterConnectionStr(), """
-                        select
-                        algorithmparametersid, algorithmlibraryid, parametername, subscriptionexpressions, parametertype, datasource
-                        from algorithmparameters where algorithmlibraryid =?""", algorithmlibraryid.toString());
+                            select
+                            algorithmparametersid, algorithmlibraryid, parametername, subscriptionexpressions, parametertype, datasource
+                            from algorithmparameters where algorithmlibraryid =?""", algorithmlibraryid.toString());
 
 //        获取入参列表
                     List<Object> parameters = new ArrayList<>();

+ 2 - 2
src/main/java/com/scbfkj/uni/system/SystemInit.java

@@ -76,10 +76,10 @@ public class SystemInit {
         Config.setContainerCode(containerCode);
         Config.setSecurityEnable(securityEnable);
         Config.setDebug(debug);
-        if(encryptEnable) {
+        if (encryptEnable) {
             Config.setCenterConnectionStr(DataEncryptionUtil.decryptRSAByPrivateKey(centerConfig));
             Config.setSecurityConnectionStr(DataEncryptionUtil.decryptRSAByPrivateKey(securityConfig));
-        }else{
+        } else {
             Config.setCenterConnectionStr(centerConfig);
             Config.setSecurityConnectionStr(securityConfig);
         }

+ 1 - 1
src/test/java/com/scbfkj/uni/process/KafkaTest.java

@@ -26,7 +26,7 @@ class KafkaTest {
         while (true) {
             Kafka.sendMessage(config, "test01", new ArrayList<>() {{
                 for (int i = 0; i < 1000; i++) {
-                    add("hello" + i+":"+System.currentTimeMillis());
+                    add("hello" + i + ":" + System.currentTimeMillis());
                 }
             }});
             Thread.sleep(1000);

+ 0 - 2
src/test/java/com/scbfkj/uni/process/RabbitMQTest.java

@@ -6,8 +6,6 @@ import org.junit.jupiter.api.Test;
 import java.util.ArrayList;
 import java.util.List;
 
-import static org.junit.jupiter.api.Assertions.*;
-
 class RabbitMQTest {
 
     private RabbitMQ rabbitMQ = new RabbitMQ();