xiewenjie 3 年之前
父節點
當前提交
2574a5ed38

+ 1 - 1
pom.xml

@@ -142,7 +142,7 @@
             <dependency>
                 <groupId>com.github.pagehelper</groupId>
                 <artifactId>pagehelper-spring-boot-starter</artifactId>
-                <version>1.3.1</version>
+                <version>1.4.0</version>
             </dependency>
             <!-- 					-->
             <dependency>

+ 200 - 180
sxz-application/src/main/java/com.fdkk.sxz/main.java

@@ -1,190 +1,210 @@
 package com.fdkk.sxz;
 
+import cn.hutool.core.lang.Console;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.socket.aio.AioClient;
+import cn.hutool.socket.aio.AioSession;
+import cn.hutool.socket.aio.SimpleIoAction;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
 
 public class main {
+    //public static void main(String[] args) {
+    //    String json = "{\n" +
+    //            "    \"sweepLocations\": [\n" +
+    //            "        {\n" +
+    //            "            \"subgroup\": 0,\n" +
+    //            "            \"pose\": {\n" +
+    //            "                \"rotation\": {\n" +
+    //            "                    \"w\": 0.95928264,\n" +
+    //            "                    \"x\": -0.0017092235,\n" +
+    //            "                    \"y\": -0.0016763769,\n" +
+    //            "                    \"z\": -0.28243768\n" +
+    //            "                },\n" +
+    //            "                \"translation\": {\n" +
+    //            "                    \"x\": 3.6112025,\n" +
+    //            "                    \"y\": 0.12166519,\n" +
+    //            "                    \"z\": 0.07516695\n" +
+    //            "                }\n" +
+    //            "            },\n" +
+    //            "            \"visibles3\": [\n" +
+    //            "                1,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"visibles2\": [\n" +
+    //            "                1,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"puck\": {\n" +
+    //            "                \"x\": 3.6112025,\n" +
+    //            "                \"y\": 0.12166519,\n" +
+    //            "                \"z\": -1.39718955\n" +
+    //            "            },\n" +
+    //            "            \"uuid\": \"0\",\n" +
+    //            "            \"visibles\": [\n" +
+    //            "                1,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"group\": 1\n" +
+    //            "        },\n" +
+    //            "        {\n" +
+    //            "            \"subgroup\": 0,\n" +
+    //            "            \"pose\": {\n" +
+    //            "                \"rotation\": {\n" +
+    //            "                    \"w\": 0.97998166,\n" +
+    //            "                    \"x\": -0.00051350286,\n" +
+    //            "                    \"y\": -0.00007887775,\n" +
+    //            "                    \"z\": -0.19908713\n" +
+    //            "                },\n" +
+    //            "                \"translation\": {\n" +
+    //            "                    \"x\": 1.6813623,\n" +
+    //            "                    \"y\": 0.20879818,\n" +
+    //            "                    \"z\": 0.07516695\n" +
+    //            "                }\n" +
+    //            "            },\n" +
+    //            "            \"visibles3\": [\n" +
+    //            "                0,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"visibles2\": [\n" +
+    //            "                0,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"puck\": {\n" +
+    //            "                \"x\": 1.6813623,\n" +
+    //            "                \"y\": 0.20879818,\n" +
+    //            "                \"z\": -1.39718955\n" +
+    //            "            },\n" +
+    //            "            \"uuid\": \"2\",\n" +
+    //            "            \"visibles\": [\n" +
+    //            "                0,\n" +
+    //            "                2,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"group\": 1\n" +
+    //            "        },\n" +
+    //            "        {\n" +
+    //            "            \"subgroup\": 0,\n" +
+    //            "            \"pose\": {\n" +
+    //            "                \"rotation\": {\n" +
+    //            "                    \"w\": 0.7688388,\n" +
+    //            "                    \"x\": -0.0022818057,\n" +
+    //            "                    \"y\": 0.0016657045,\n" +
+    //            "                    \"z\": -0.6394364\n" +
+    //            "                },\n" +
+    //            "                \"translation\": {\n" +
+    //            "                    \"x\": -1.0941758,\n" +
+    //            "                    \"y\": -0.15828772,\n" +
+    //            "                    \"z\": 0.07516695\n" +
+    //            "                }\n" +
+    //            "            },\n" +
+    //            "            \"visibles3\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"visibles2\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"puck\": {\n" +
+    //            "                \"x\": -1.0941758,\n" +
+    //            "                \"y\": -0.15828772,\n" +
+    //            "                \"z\": -1.39718955\n" +
+    //            "            },\n" +
+    //            "            \"uuid\": \"4\",\n" +
+    //            "            \"visibles\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                3\n" +
+    //            "            ],\n" +
+    //            "            \"group\": 1\n" +
+    //            "        },\n" +
+    //            "        {\n" +
+    //            "            \"subgroup\": 1,\n" +
+    //            "            \"pose\": {\n" +
+    //            "                \"rotation\": {\n" +
+    //            "                    \"w\": 0.75378096,\n" +
+    //            "                    \"x\": -0.00085483055,\n" +
+    //            "                    \"y\": 0.0011985971,\n" +
+    //            "                    \"z\": -0.6571241\n" +
+    //            "                },\n" +
+    //            "                \"translation\": {\n" +
+    //            "                    \"x\": -4.213454,\n" +
+    //            "                    \"y\": -0.17369196,\n" +
+    //            "                    \"z\": 0.07516695\n" +
+    //            "                }\n" +
+    //            "            },\n" +
+    //            "            \"visibles3\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                2\n" +
+    //            "            ],\n" +
+    //            "            \"visibles2\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                2\n" +
+    //            "            ],\n" +
+    //            "            \"puck\": {\n" +
+    //            "                \"x\": -4.213454,\n" +
+    //            "                \"y\": -0.17369196,\n" +
+    //            "                \"z\": -1.39718955\n" +
+    //            "            },\n" +
+    //            "            \"uuid\": \"6\",\n" +
+    //            "            \"visibles\": [\n" +
+    //            "                0,\n" +
+    //            "                1,\n" +
+    //            "                2\n" +
+    //            "            ],\n" +
+    //            "            \"group\": 1\n" +
+    //            "        }\n" +
+    //            "    ]\n" +
+    //            "}";
+    //    JSONObject visionJson = JSON.parseObject(json);
+    //    JSONArray sweepArray = visionJson.getJSONArray("sweepLocations");
+    //    List<JSONObject> roamingPoint = new ArrayList();
+    //    for (int i = 0; i < sweepArray.size(); i++) {
+    //        JSONObject objectJson = sweepArray.getJSONObject(i);
+    //        JSONObject newJson = new JSONObject();
+    //        newJson.put("uuid", objectJson.getString("uuid"));
+    //        JSONObject puck = objectJson.getJSONObject("puck");
+    //        puck.put("y", puck.getDoubleValue("y") * -1);
+    //        puck.remove("z");
+    //        newJson.put("puck", puck);
+    //        newJson.put("subgroup", objectJson.getInteger("subgroup"));
+    //        roamingPoint.add(newJson);
+    //    }
+    //    Map<String, List<JSONObject>> subgroup = roamingPoint.stream().collect(
+    //                    Collectors.groupingBy(x -> x.getString("subgroup"))).entrySet().stream()
+    //            .collect(Collectors.toMap(e -> "floor" + e.getKey(), Map.Entry::getValue));
+    //
+    //    System.out.println(JSON.toJSONString(subgroup));
+    //}
+
+
     public static void main(String[] args) {
-        String json = "{\n" +
-                "    \"sweepLocations\": [\n" +
-                "        {\n" +
-                "            \"subgroup\": 0,\n" +
-                "            \"pose\": {\n" +
-                "                \"rotation\": {\n" +
-                "                    \"w\": 0.95928264,\n" +
-                "                    \"x\": -0.0017092235,\n" +
-                "                    \"y\": -0.0016763769,\n" +
-                "                    \"z\": -0.28243768\n" +
-                "                },\n" +
-                "                \"translation\": {\n" +
-                "                    \"x\": 3.6112025,\n" +
-                "                    \"y\": 0.12166519,\n" +
-                "                    \"z\": 0.07516695\n" +
-                "                }\n" +
-                "            },\n" +
-                "            \"visibles3\": [\n" +
-                "                1,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"visibles2\": [\n" +
-                "                1,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"puck\": {\n" +
-                "                \"x\": 3.6112025,\n" +
-                "                \"y\": 0.12166519,\n" +
-                "                \"z\": -1.39718955\n" +
-                "            },\n" +
-                "            \"uuid\": \"0\",\n" +
-                "            \"visibles\": [\n" +
-                "                1,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"group\": 1\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"subgroup\": 0,\n" +
-                "            \"pose\": {\n" +
-                "                \"rotation\": {\n" +
-                "                    \"w\": 0.97998166,\n" +
-                "                    \"x\": -0.00051350286,\n" +
-                "                    \"y\": -0.00007887775,\n" +
-                "                    \"z\": -0.19908713\n" +
-                "                },\n" +
-                "                \"translation\": {\n" +
-                "                    \"x\": 1.6813623,\n" +
-                "                    \"y\": 0.20879818,\n" +
-                "                    \"z\": 0.07516695\n" +
-                "                }\n" +
-                "            },\n" +
-                "            \"visibles3\": [\n" +
-                "                0,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"visibles2\": [\n" +
-                "                0,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"puck\": {\n" +
-                "                \"x\": 1.6813623,\n" +
-                "                \"y\": 0.20879818,\n" +
-                "                \"z\": -1.39718955\n" +
-                "            },\n" +
-                "            \"uuid\": \"2\",\n" +
-                "            \"visibles\": [\n" +
-                "                0,\n" +
-                "                2,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"group\": 1\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"subgroup\": 0,\n" +
-                "            \"pose\": {\n" +
-                "                \"rotation\": {\n" +
-                "                    \"w\": 0.7688388,\n" +
-                "                    \"x\": -0.0022818057,\n" +
-                "                    \"y\": 0.0016657045,\n" +
-                "                    \"z\": -0.6394364\n" +
-                "                },\n" +
-                "                \"translation\": {\n" +
-                "                    \"x\": -1.0941758,\n" +
-                "                    \"y\": -0.15828772,\n" +
-                "                    \"z\": 0.07516695\n" +
-                "                }\n" +
-                "            },\n" +
-                "            \"visibles3\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"visibles2\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"puck\": {\n" +
-                "                \"x\": -1.0941758,\n" +
-                "                \"y\": -0.15828772,\n" +
-                "                \"z\": -1.39718955\n" +
-                "            },\n" +
-                "            \"uuid\": \"4\",\n" +
-                "            \"visibles\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                3\n" +
-                "            ],\n" +
-                "            \"group\": 1\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"subgroup\": 1,\n" +
-                "            \"pose\": {\n" +
-                "                \"rotation\": {\n" +
-                "                    \"w\": 0.75378096,\n" +
-                "                    \"x\": -0.00085483055,\n" +
-                "                    \"y\": 0.0011985971,\n" +
-                "                    \"z\": -0.6571241\n" +
-                "                },\n" +
-                "                \"translation\": {\n" +
-                "                    \"x\": -4.213454,\n" +
-                "                    \"y\": -0.17369196,\n" +
-                "                    \"z\": 0.07516695\n" +
-                "                }\n" +
-                "            },\n" +
-                "            \"visibles3\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                2\n" +
-                "            ],\n" +
-                "            \"visibles2\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                2\n" +
-                "            ],\n" +
-                "            \"puck\": {\n" +
-                "                \"x\": -4.213454,\n" +
-                "                \"y\": -0.17369196,\n" +
-                "                \"z\": -1.39718955\n" +
-                "            },\n" +
-                "            \"uuid\": \"6\",\n" +
-                "            \"visibles\": [\n" +
-                "                0,\n" +
-                "                1,\n" +
-                "                2\n" +
-                "            ],\n" +
-                "            \"group\": 1\n" +
-                "        }\n" +
-                "    ]\n" +
-                "}";
-        JSONObject visionJson = JSON.parseObject(json);
-        JSONArray sweepArray = visionJson.getJSONArray("sweepLocations");
-        List<JSONObject> roamingPoint = new ArrayList();
-        for (int i = 0; i < sweepArray.size(); i++) {
-            JSONObject objectJson = sweepArray.getJSONObject(i);
-            JSONObject newJson = new JSONObject();
-            newJson.put("uuid", objectJson.getString("uuid"));
-            JSONObject puck = objectJson.getJSONObject("puck");
-            puck.put("y", puck.getDoubleValue("y") * -1);
-            puck.remove("z");
-            newJson.put("puck", puck);
-            newJson.put("subgroup", objectJson.getInteger("subgroup"));
-            roamingPoint.add(newJson);
-        }
-        Map<String, List<JSONObject>> subgroup = roamingPoint.stream().collect(
-                        Collectors.groupingBy(x -> x.getString("subgroup"))).entrySet().stream()
-                .collect(Collectors.toMap(e -> "floor" + e.getKey(), Map.Entry::getValue));
+        AioClient client = new AioClient(new InetSocketAddress("192.168.0.75", 8233), new SimpleIoAction() {
 
-        System.out.println(JSON.toJSONString(subgroup));
+            @Override
+            public void doAction(AioSession session, ByteBuffer data) {
+                if (data.hasRemaining()) {
+                    Console.log(StrUtil.utf8Str(data));
+                    session.read();
+                }
+                Console.log("OK");
+            }
+        });
+        String json = JSON.toJSONString("{\"uuid\":\"111222333\",\"max\":\"111222333.max\",\"flag\":\"false\"}");
+        client.write(ByteBuffer.wrap(json.getBytes()));
+        client.read();
+        client.close();
     }
 }

+ 1 - 1
sxz-application/src/main/resources/application-dev.properties

@@ -59,7 +59,7 @@ pagehelper.reasonable=true
 #为了支持startPage(Object params)方法,增加了该参数来配置参数映射,用于从对象中根据属性名取值, 可以配置pageNum,pageSize,count,pageSizeZero,reasonable,不配置映射的用默认值, 默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero
 pagehelper.params=count=countSql
 #支持通过 Mapper 接口参数来传递分页参数,默认值false,分页插件会从查询方法的参数值中,自动根据上面 params 配置的字段中取值,查找到合适的值时就会自动分页
-pagehelper.supportMethodsArguments=true
+pagehelper.support-methods-arguments=true
 #如果 pageSize=0 就会查询出全部的结果(相当于没有执行分页查询)
 pagehelper.page-size-zero=true
 #redis

+ 1 - 1
sxz-application/src/main/resources/application-devuat.properties

@@ -60,7 +60,7 @@ pagehelper.reasonable=true
 #为了支持startPage(Object params)方法,增加了该参数来配置参数映射,用于从对象中根据属性名取值, 可以配置pageNum,pageSize,count,pageSizeZero,reasonable,不配置映射的用默认值, 默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero
 pagehelper.params=count=countSql
 #支持通过 Mapper 接口参数来传递分页参数,默认值false,分页插件会从查询方法的参数值中,自动根据上面 params 配置的字段中取值,查找到合适的值时就会自动分页
-pagehelper.supportMethodsArguments=true
+pagehelper.support-methods-arguments=true
 #如果 pageSize=0 就会查询出全部的结果(相当于没有执行分页查询)
 pagehelper.page-size-zero=true
 #redis

+ 1 - 1
sxz-application/src/main/resources/application-prod.properties

@@ -60,7 +60,7 @@ pagehelper.reasonable=true
 #为了支持startPage(Object params)方法,增加了该参数来配置参数映射,用于从对象中根据属性名取值, 可以配置pageNum,pageSize,count,pageSizeZero,reasonable,不配置映射的用默认值, 默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero
 pagehelper.params=count=countSql
 #支持通过 Mapper 接口参数来传递分页参数,默认值false,分页插件会从查询方法的参数值中,自动根据上面 params 配置的字段中取值,查找到合适的值时就会自动分页
-pagehelper.supportMethodsArguments=true
+pagehelper.support-methods-arguments=true
 #如果 pageSize=0 就会查询出全部的结果(相当于没有执行分页查询)
 pagehelper.page-size-zero=true
 #redis

+ 1 - 1
sxz-application/src/main/resources/application-uat.properties

@@ -60,7 +60,7 @@ pagehelper.reasonable=true
 #为了支持startPage(Object params)方法,增加了该参数来配置参数映射,用于从对象中根据属性名取值, 可以配置pageNum,pageSize,count,pageSizeZero,reasonable,不配置映射的用默认值, 默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero
 pagehelper.params=count=countSql
 #支持通过 Mapper 接口参数来传递分页参数,默认值false,分页插件会从查询方法的参数值中,自动根据上面 params 配置的字段中取值,查找到合适的值时就会自动分页
-pagehelper.supportMethodsArguments=true
+pagehelper.support-methods-arguments=true
 #如果 pageSize=0 就会查询出全部的结果(相当于没有执行分页查询)
 pagehelper.page-size-zero=true
 #redis