소스 검색

解决启动问题

yucheng 3 년 전
부모
커밋
ef2814e9a3

+ 2 - 2
gradle.properties

@@ -15,8 +15,8 @@ PERSAGY_SERVICE_VERSION = 1.4.228
 #PERSAGY_SERVICE_VERSION = 1.4.165
 
 SYBOTAN_URL = http://www.sybotan.com
-SYBOTAN_KOTLIN_VERSION = 1.4.92
-SYBOTAN_SERVICE_VERSION = 1.4.137
+SYBOTAN_KOTLIN_VERSION = 1.4.109
+SYBOTAN_SERVICE_VERSION = 1.4.148
 
 SAGA_URL = http://www.sagaloud.cn
 SAGA_KOTLIN_VERSION = 1.4.108

+ 12 - 63
revit-algorithm/build.gradle

@@ -50,19 +50,16 @@ dependencies {
     compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: KOTLIN_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // 页面
+    compile group: "org.springframework.boot", name: "spring-boot-starter-freemarker", version: SPRING_BOOT_VERSION
     // spring boot 依赖
     compile group: "org.springframework.boot", name: "spring-boot-starter-web", version: SPRING_BOOT_VERSION
+    compile group: "org.springframework.boot", name: "spring-boot-configuration-processor", version: SPRING_BOOT_VERSION
     compile group: "org.springframework.boot", name: "spring-boot-starter-actuator", version: SPRING_BOOT_VERSION
     compile group: "org.springframework.boot", name: "spring-boot-starter-logging", version: SPRING_BOOT_VERSION
-    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test
-    testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.2.2.RELEASE'
-
-
-
     //消息
     compile group: "org.springframework.boot", name: "spring-boot-starter-activemq", version: SPRING_BOOT_VERSION
-    compile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
-//    providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
+    providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
     // spring boot 缓存
     compile group:"org.springframework.boot", name:"spring-boot-starter-cache", version: SPRING_BOOT_VERSION
 
@@ -86,23 +83,13 @@ dependencies {
 //    compile group: "com.sybotan", name: "sybotan-service-mybatis", version: SYBOTAN_SERVICE_VERSION
 
     // 带隐性数据库接口
-    //compile group: "cn.sagacloud", name: "saga-kotlin-base", version: SAGA_KOTLIN_VERSION
-    //compile group: "cn.sagacloud", name: "saga-kotlin-database", version: SAGA_KOTLIN_VERSION
-    //compile group: "cn.sagacloud", name: "saga-kotlin-mybatis", version: SAGA_KOTLIN_VERSION
-    //compile group: "cn.sagacloud", name: "saga-kotlin-postgresql", version: SAGA_KOTLIN_VERSION
-    compile group: "cn.sagacloud", name: "saga-service-base", version: SAGA_SERVICE_VERSION
-    //compile group: "cn.sagacloud", name: "saga-service-mybatis", version: SAGA_SERVICE_VERSION
-   // compile group: "com.persagy", name: "persagy-kotlin-mysql", version: PERSAGY_KOTLIN_VERSION
-
-
-    compile group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-kotlin-database", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-kotlin-mysql", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-service-base", version: PERSAGY_SERVICE_VERSION
-    compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
-    compile group: "com.persagy", name: "persagy-service-mysql", version: PERSAGY_SERVICE_VERSION
-
+    compile group: "cn.sagacloud", name: "saga-kotlin-base", version: SYBOTAN_KOTLIN_VERSION
+    compile group: "cn.sagacloud", name: "saga-kotlin-database", version: SYBOTAN_KOTLIN_VERSION
+    compile group: "cn.sagacloud", name: "saga-kotlin-mybatis", version: SYBOTAN_KOTLIN_VERSION
+    compile group: "cn.sagacloud", name: "saga-kotlin-mysql", version: SYBOTAN_KOTLIN_VERSION
+    compile group: "cn.sagacloud", name: "saga-service-base", version: SYBOTAN_SERVICE_VERSION
+    compile group: "cn.sagacloud", name: "saga-service-mybatis", version: SYBOTAN_SERVICE_VERSION
+    compile group: "cn.sagacloud", name: "saga-service-mysql", version: SYBOTAN_SERVICE_VERSION
 
     // 生成uuid
     // https://mvnrepository.com/artifact/com.fasterxml.uuid/java-uuid-generator
@@ -118,19 +105,6 @@ dependencies {
     // https://mvnrepository.com/artifact/com.alibaba/fastjson
     compile group: 'com.alibaba', name: 'fastjson', version: '1.2.56'
 
-
-    // activemq
-//    // https://mvnrepository.com/artifact/org.apache.activemq/activemq-all
-//    compile group: 'org.apache.activemq', name: 'activemq-all', version: '5.15.10'
-//// https://mvnrepository.com/artifact/org.apache.activemq/activemq-core
-    compile group: 'org.apache.activemq', name: 'activemq-core', version: '5.7.0'
-//    // https://mvnrepository.com/artifact/org.apache.activemq/activemq-spring
-    compile group: 'org.apache.activemq', name: 'activemq-spring', version: '5.15.10'
-// https://mvnrepository.com/artifact/org.apache.activemq/activemq-pool
-    compile group: 'org.apache.activemq', name: 'activemq-pool', version: '5.15.10'
-// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-activemq
-    compile group: 'org.springframework.boot', name: 'spring-boot-starter-activemq', version: '2.1.8.RELEASE'
-
 //    // anko依赖
 //    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-commons
 //    implementation group: 'org.jetbrains.anko', name: 'anko-commons', version: '0.10.8'
@@ -159,12 +133,6 @@ dependencies {
     // https://mvnrepository.com/artifact/com.belerweb/pinyin4j
     compile group: 'com.belerweb', name: 'pinyin4j', version: '2.5.1'
 
-    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-activemq
-    compile group: 'org.springframework.boot', name: 'spring-boot-starter-activemq', version: '2.2.2.RELEASE'
-
-    compile group: "com.persagy", name: "persagy-service-mysql", version: PERSAGY_SERVICE_VERSION
-
-
     // 数据中心依赖
     compile project(":data-core")
 
@@ -291,23 +259,4 @@ task depolyTestServer {
             }
         }
     }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+}

+ 0 - 35
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/AliyunOSSTest.java

@@ -1,35 +0,0 @@
-package cn.sagacloud.server.algorithm.test;
-
-import com.aliyun.oss.OSS;
-import com.aliyun.oss.model.PartETag;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class AliyunOSSTest {
-
-    private static String endpoint = "*** Provide OSS endpoint ***";
-    private static String accessKeyId = "*** Provide your AccessKeyId ***";
-    private static String accessKeySecret = "*** Provide your AccessKeySecret ***";
-
-    private static OSS client = null;
-
-    private static String bucketName = "*** Provide bucket name ***";
-    private static String key = "*** Provide key ***";
-    private static String localFilePath = "*** Provide local file path ***";
-
-    private static ExecutorService executorService = Executors.newFixedThreadPool(5);
-    private static List<PartETag> partETags = Collections.synchronizedList(new ArrayList<PartETag>());
-
-
-    @Test
-    public void multipart(){
-
-
-
-    }
-}

+ 0 - 89
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/ConfigTest.kt

@@ -1,89 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-
-import cn.sagacloud.server.algorithm.models.config.MyProperties
-import cn.sagacloud.server.algorithm.models.jsonAnalyzer.AllComponents
-import cn.sagacloud.server.algorithm.models.jsonAnalyzer.BaseObj
-import cn.sagacloud.server.algorithm.models.modelFile.FloorModelView
-import cn.sagacloud.server.algorithm.services.CommonService
-import cn.sagacloud.server.algorithm.services.comparator.FloorComparator
-import cn.sagacloud.server.algorithm.services.endpoint.FloorService
-import cn.sagacloud.server.algorithm.services.http.HttpService
-import cn.sagacloud.server.algorithm.services.json.JSONAnalyzerService
-import com.sybotan.base.extensions.toJson
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-
-
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class ConfigTest {
-
-    @Autowired
-    private val prop: MyProperties? = null
-
-    @Autowired
-    private lateinit var floorService : FloorService
-
-    @Autowired
-    lateinit var floorComparator : FloorComparator
-
-    @Autowired
-    lateinit var jsonAnalyzerService : JSONAnalyzerService
-
-    @Autowired
-    lateinit var myProperties : MyProperties
-
-    @Test
-    fun test1() {
-
-        println(prop!!.fileService.uploadPath)
-    }
-
-    @Test
-    fun testMissingFloor(){
-        val floorModelView1 = FloorModelView()
-        floorModelView1.floorName = "B3"
-        val floorModelView2 = FloorModelView()
-        floorModelView2.floorName = "F3"
-        val floorModelView3 = FloorModelView()
-        floorModelView3.floorName = "B1M2"
-        val floorModelView4 = FloorModelView()
-        floorModelView4.floorName = "B1M3"
-        val floorModelView5 = FloorModelView()
-        floorModelView5.floorName = "B2M3"
-        var list = arrayListOf<FloorModelView>(floorModelView1, floorModelView2, floorModelView3, floorModelView4, floorModelView5)
-        val sortedWith = list.sortedWith(floorComparator)
-        val addMissingFloor = floorService.addMissingFloor(sortedWith.toMutableList())
-        addMissingFloor.forEach{
-            println(it.floorName)
-        }
-    }
-
-    @Test
-    fun test11(){
-            "a67ac1ec8fef11ea9dfea9a679dda25a"
-        val id = "03e4dbc2192011ebb7c2517abf7cc6d61"
-        var jsonData : BaseObj<AllComponents>?
-        var size = 0L
-        try {
-            val url = CommonService.getExportJSONDownloadUrl(id, myProperties)
-            println(url)
-//            size = CommonService.getRemoteHttpFileSize(url)
-            val fileStream = HttpService.getInputStream(url)
-             //解析json
-            jsonData = jsonAnalyzerService.analyzeJsonzFile(fileStream)
-
-//            jsonData = JSONObject.parseObject(josn,BaseObj<AllComponents>().javaClass)
-
-            val importResult = jsonAnalyzerService.importModelData(jsonData!!, "")
-            println(importResult.toJson())
-        }catch (e : Exception){
-            println(e.message)
-        }
-
-    }
-}

+ 0 - 50
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/DatabaseFix.kt

@@ -1,50 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.services.BaseDataService
-import com.sybotan.database.SFilter
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-
-/**
- *
- *
- * @author jxing
- */
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class DatabaseFix {
-
-    val dataService = BaseDataService
-
-
-    @Test
-    fun testExceptionTxt(){
-
-        try{
-            0/0
-        }catch (e : Exception){
-            println()
-            println(e.stackTrace)
-            println(org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e))
-            println()
-        }
-
-    }
-
-
-    @Test
-    fun fixBindFloorIds(){
-        val data = dataService.floorModelService.select(SFilter.not(SFilter.isNull("floorId"))).exec()
-
-//        for(floor in data){
-//            if(floor.floorIdList == null)
-//                floor.floorIdList = ArrayList()
-//            if(floor.floorIdList!!.isEmpty()){
-//                floor.floorIdList!!.add(floor.floorId!!)
-//            }
-//            dataService.floorModelService.update(floor, arrayListOf("floorIdList"))
-//        }
-    }
-}

+ 0 - 76
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/ExcelTest.kt

@@ -1,76 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.models.excel.IsPassedEnum
-import cn.sagacloud.server.algorithm.models.excel.nonBlockingReport.EquipNameCodeReport
-import cn.sagacloud.server.algorithm.services.excel.ExcelService
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-
-/**
- *
- *
- * @author jxing
- */
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class ExcelTest {
-
-    @Autowired
-    lateinit var excelService: ExcelService
-
-    @Before
-    fun readExcel(){
-        excelService.readBlockingExcel2007()
-    }
-
-    @Test
-    fun readTest(){
-        var arr = excelService.getSheetAtIndex(0)
-        print2DArr(arr)
-        arr = excelService.getSheetAtIndex(1)
-        print2DArr(arr)
-        arr = excelService.getSheetAtIndex(2)
-        print2DArr(arr)
-        arr = excelService.getSheetAtIndex(3)
-        print2DArr(arr)
-        arr = excelService.getSheetAtIndex(4)
-        print2DArr(arr)
-        arr = excelService.getSheetAtIndex(5)
-        print2DArr(arr)
-
-    }
-
-    @Test
-    fun randomWriteTest(){
-        excelService.randomWrite(0, 0, 1, 555)
-    }
-
-    @Test
-    fun writeSheet(){
-        var report = EquipNameCodeReport()
-        for(i in 0..99 step 1) {
-            var row = EquipNameCodeReport.Data()
-            row.floorName = "F${i}"
-            row.isPassed = IsPassedEnum.Pass
-            row.familyName = "Name $i"
-            row.note = "aaa"
-            report.rowValue.add(row)
-        }
-        excelService.insertReport(report)
-    }
-
-    fun print2DArr(arr : ArrayList<ArrayList<Any>>){
-        var index = 0
-        for(subArr in arr){
-            println("size: ${subArr.size}, row num: ${++index}")
-            for(value in subArr){
-                print("$value \t")
-            }
-            println("")
-        }
-    }
-}

+ 0 - 32
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/FastJsonTest.kt

@@ -1,32 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.models.message.MessageType
-import cn.sagacloud.server.algorithm.services.message.MessageService
-import com.alibaba.fastjson.JSON
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-
-/**
- *
- *
- * @author jxing
- */
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class FastJsonTest {
-
-    @Autowired
-    lateinit var messageService : MessageService
-
-    @Test
-    fun enumTest(){
-        var messageEntity = messageService.buildMessageEntity("test", MessageType.Success,
-                "Pj1101080001", arrayListOf("aaa", "bbb"), "测试消息, 没有下载", "下载", "", "test.xlsx")
-
-        println(JSON.toJSONString(messageEntity))
-
-    }
-}

+ 0 - 87
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/GeomTest.kt

@@ -1,87 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Point
-import cn.sagacloud.server.algorithm.services.CommonService
-import org.junit.Test
-
-class GeomTest{
-
-    @Test
-    fun testIsPointInPolygon(){
-        val point = Point(1.0, 0.999999999, .0)
-
-        val polygon = arrayListOf(
-                Point(.0, .0, .0),
-                Point(.0, 1.0, .0),
-                Point(1.0, 3.0, .0),
-                Point(2.0, 1.0, .0),
-                Point(2.0, .0, .0),
-                Point(1.0, 1.0, .0)
-        )
-        print(CommonService.isPointInPolygonCheckWithJdkGeneralPath(point, polygon))
-    }
-
-
-    @Test
-    fun testIsPolygonOverlap(){
-        val polygon1 = arrayListOf(
-                Point(.5, .0, .0),
-                Point(.5, .4, .0),
-                Point(1.5, .4, .0),
-                Point(1.5, .0, .0)
-        )
-
-        val polygon2 = arrayListOf(
-                Point(.5, .0, .0),
-                Point(.5, .5, .0),
-                Point(1.5, .5, .0),
-                Point(1.5, .0, .0)
-        )
-
-        val polygon3 = arrayListOf(
-                Point(.5, .0, .0),
-                Point(.5, .6, .0),
-                Point(1.5, .6, .0),
-                Point(1.5, .0, .0)
-        )
-
-        val polygon4 = arrayListOf(
-                Point(.0, .0, .0),
-                Point(.0, 1.0, .0),
-                Point(1.0, 2.0, .0),
-                Point(2.0, 1.0, .0),
-                Point(2.0, .0, .0),
-                Point(1.0, 1.0, .0)
-        )
-
-        val polygon5 = arrayListOf(
-                Point(.0, .0, .0),
-                Point(.0, 1.0, .0),
-                Point(1.0, 2.0, .0),
-                Point(2.0, 1.0, .0),
-                Point(2.0, .0, .0),
-                Point(1.0, 1.0, .0)
-        )
-        val polygon6 = arrayListOf(
-                Point(.0, 1.0, .0),
-                Point(1.0, 2.0, .0),
-                Point(2.0, 1.0, .0),
-                Point(2.0, .0, .0),
-                Point(1.0, 1.0, .0)
-        )
-        val polygon7 = arrayListOf(
-                Point(.5, 1.0, .0),
-                Point(.5, 1.5, .0),
-                Point(1.5, 1.5, .0),
-                Point(1.5, 1.0, .0)
-        )
-        println(CommonService.isPolygonOverlap(polygon1, polygon5))
-        println(CommonService.isPolygonOverlap(polygon1, polygon2))
-        println(CommonService.isPolygonOverlap(polygon2, polygon5))
-        println(CommonService.isPolygonOverlap(polygon3, polygon5))
-        println(CommonService.isPolygonOverlap(polygon4, polygon5))
-        println(CommonService.isPolygonOverlap(polygon5, polygon5))
-        println(CommonService.isPolygonOverlap(polygon6, polygon5))
-        println(CommonService.isPolygonOverlap(polygon7, polygon5))
-    }
-}

+ 0 - 71
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/JMSTest.kt

@@ -1,71 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.services.activemq.JMSComsumer
-import cn.sagacloud.server.algorithm.services.activemq.JMSProducer
-import org.apache.activemq.ActiveMQConnectionFactory
-import org.apache.activemq.command.ActiveMQTopic
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-import java.util.*
-import javax.jms.DeliveryMode
-import javax.jms.Session
-
-/**
- *
- *
- * @author jxing
- */
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class JMSTest {
-
-    @Autowired
-    lateinit var jmsComsumer: JMSComsumer
-
-    @Autowired
-    lateinit var producer: JMSProducer
-
-    @Test
-    fun producer(){
-        val conFactory = ActiveMQConnectionFactory("admin", "admin", "tcp://192.168.20.225:61616")
-        val conn = conFactory.createConnection() // 用户名和密码
-        val session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)
-
-        val destination = session.createTopic("myprivate")
-
-        val producer = session.createProducer(destination)
-
-        producer.deliveryMode = DeliveryMode.NON_PERSISTENT
-
-        conn.start()
-        val msg = session.createTextMessage("hello, world ,Time : ${Date()}")
-        producer.send(msg)
-
-        producer.close()
-        session.close()
-        conn.close()
-    }
-
-    @Test
-    fun consumer(){
-        val consumer = JMSComsumer()
-//        consumer.receiveMessage()
-        while (true){
-            Thread.sleep(1000)
-        }
-    }
-
-    @Test
-    fun newConsumer(){
-//        jmsComsumer.receiveTopic()
-    }
-
-    @Test
-    fun newProducer(){
-        val destination = ActiveMQTopic("model.manage")
-        producer.sendMessage(destination, "ggggg")
-    }
-}

+ 0 - 302
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/JavaTest.java

@@ -1,302 +0,0 @@
-package cn.sagacloud.server.algorithm.test;
-
-import com.alibaba.fastjson.JSON;
-import net.sourceforge.pinyin4j.PinyinHelper;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.URL;
-import java.text.DecimalFormat;
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class JavaTest <T>{
-
-    @Test
-    public void testAdd() {
-        double a = 0.05d;
-        double b = 0.01d;
-        System.out.println(0.05d+0.01d);
-        System.out.println(a + b);
-        System.out.println(1.0D-0.42D);
-        System.out.println(4.015D*100D);
-        System.out.println(123.3D/100D);
-    }
-    @Test
-    public void testGeneric(){
-        JavaTest<String> test = new JavaTest<>();
-        System.out.println(test.getTClass());
-    }
-    public Class<T> getTClass()
-    {
-        Class<T> tClass = (Class<T>)((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0];
-        return tClass;
-    }
-    public static Class getSuperClassGenricType(Class clazz) {
-        return getSuperClassGenricType(clazz, 0);
-    }
-
-    public static Class getSuperClassGenricType(Class clazz, int index)
-            throws IndexOutOfBoundsException {
-        Type genType = clazz.getGenericSuperclass();
-        if (!(genType instanceof ParameterizedType)) {
-            return Object.class;
-        }
-        Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
-        if (index >= params.length || index < 0) {
-            return Object.class;
-        }
-        if (!(params[index] instanceof Class)) {
-            return Object.class;
-        }
-        return (Class) params[index];
-    }
-
-    @Test
-    public void testTCPConn() throws IOException {
-//        String ip="127.0.0.1";   //服务器端ip地址
-//        String ip="192.168.20.225";   //服务器端ip地址
-        String ip="47.94.18.1";   //服务器端ip地址
-//        String ip="47.94.18.1";   //服务器端ip地址
-        int port=6666;        //端口号
-        Socket sck=new Socket(ip,port);
-        //2.传输内容
-//        String content="这是一个java模拟客户端";
-//        byte[] bstream=content.getBytes("utf8");  //转化为字节流
-//        OutputStream os= sck.getOutputStream();   //输出流
-//        os.write(bstream);
-
-        byte[] bstream = new byte[256];
-        InputStream inputStream = sck.getInputStream();
-        inputStream.read(bstream);
-        System.out.println(new String(bstream));
-        //3.关闭连接
-        sck.close();
-    }
-
-    @Test
-    public void testFastJSON() throws IOException {
-        InputStream inputStream = JavaTest.class.getClassLoader().getResourceAsStream("data_check.xlsx");
-        XSSFWorkbook workBook = new XSSFWorkbook(inputStream);
-        String str = JSON.toJSONString(workBook);
-        System.out.println(str);
-    }
-
-    @Test
-    public void testRegex(){
-        String line = "This order was placed for QT3000! OK?";
-//        String pattern = "(\\D*)(\\d+)(.*)";
-        String pattern = "(\\d+)";
-
-        // 创建 Pattern 对象
-        Pattern r = Pattern.compile(pattern);
-
-        // 现在创建 matcher 对象
-        Matcher m = r.matcher(line);
-        if (m.find( )) {
-            System.out.println("groupCount : " + m.groupCount());
-            for(int i = 0; i < m.groupCount(); ++i) {
-                System.out.println("Found value: " + m.group(i));
-//                System.out.println("Found value: " + m.group(1));
-//            System.out.println("Found value: " + m.group(2) );
-//            System.out.println("Found value: " + m.group(3) );
-            }
-        } else {
-            System.out.println("NO MATCH");
-        }
-    }
-
-
-    @Test
-    public void testMyRegex(){
-        ArrayList<String> arr = new ArrayList<String>(Arrays.asList("F1", "F22M", "F4M2", "B1", "B1M", "B3M24", "RF", "RFM", "RFM2", null));
-
-        // ^([F|B][1-9][0-9]{0,4}|RF)(M([1-9][0-9]{0,4})?)?$
-        String pattern = "(\\d+)((M)(\\d+))?";
-        pattern = "^((([F|B])([1-9][0-9]{0,4}))|RF)((M)([1-9]{1,4})?)?$";
-        // 创建 Pattern 对象
-        Pattern r = Pattern.compile(pattern);
-
-        // 现在创建 matcher 对象
-        arr.forEach(item ->{
-            Matcher m = r.matcher(item);
-            System.out.println();
-            System.out.println("txt : " + item);
-            if (m.find()) {
-                System.out.println("groupCount : " + m.groupCount());
-                for(int i = 0; i <= m.groupCount(); ++i) {
-                    System.out.println("Found value: " + m.group(i));
-                }
-            } else {
-                System.out.println("NO MATCH");
-            }
-        });
-    }
-
-    @Test
-    public void testFor(){
-        int min = 0, max = 100;
-        for(int i = min; i <= max; ++i){
-
-        }
-    }
-
-
-
-    @Test
-    public void testHttp() throws IOException {
-        String url = "http://47.93.33.207:28888/image-service/common/file_get?systemId=revit&key=export/008ad414673411eabc92c34d06c92241.zip";
-        url = "http://47.93.33.207:28888/image-service/common/file_get?systemId=revit&key=export/008ad414673411eabc92c34d06c9224钉钉1.zip";
-        int fileLength = getFileLength(url);
-        System.out.println(fileLength);
-
-    }
-
-    /**
-     * 获取网络文件大小
-     * @param url1
-     * @return
-     * @throws IOException
-     */
-    private int getFileLength(String url1) throws IOException{
-        int length=0;
-        URL url;
-        try {
-            url = new URL(url1);
-            HttpURLConnection   urlcon=(HttpURLConnection)url.openConnection();
-            //根据响应获取文件大小
-            length=urlcon.getContentLength();
-            urlcon.disconnect();
-        } catch (MalformedURLException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return length;
-    }
-
-
-    @Test
-    public void testPinyin() throws IOException {
-        String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray('单');
-//        Hanyu hanyu = new Hanyu()
-//        pinyinArray = PinyinHelper.("");
-
-        for(int i = 0; i < pinyinArray.length; ++i) {
-
-            System.out.println(pinyinArray[i]);
-
-        }
-
-    }
-
-
-    @Test
-    public void test207() {
-        Map<String, String> myMap = new HashMap<>();
-        String keyA = "A";
-        String keyB = "B";
-        String keyC = "C";
-        String keyD = "D";
-        String keyE = "E";
-        String keyF = "F";
-        String keyG = "G";
-        String keyH = "H";
-        myMap.put(keyA, "str01A");
-        myMap.put(keyB, "str01B");
-        myMap.put(keyC, "str01C");
-
-        System.out.println("myMap initial content:"+ myMap);
-
-        myMap.merge(keyA, "merge01", String::concat);
-        myMap.merge(keyD, "merge01", String::concat);
-        System.out.println("Map merge demo content:"+ myMap);
-
-        BiFunction<String, String, String> biFunc = new BiFunction<String, String, String>(){
-            @Override
-            public String apply(String t, String u) {
-                String result = t;
-                if (t == null) {
-                    result = u;
-                }
-                else {
-                    result += "," + u;
-                }
-                return result;
-            }
-        };
-
-        myMap.merge(keyA, "BiFuncMerge01", biFunc);
-        myMap.merge(keyE, "BiFuncMerge01", biFunc);
-        System.out.println("merge"+ myMap);
-
-        String msg = "msgCompute";
-        myMap.compute(keyB, (k, v) -> (v == null) ? msg : v.concat(msg));
-        myMap.compute(keyF, (k, v) -> (v == null) ? msg : v.concat(msg));
-        System.out.println("compute"+ myMap);
-
-        myMap.computeIfAbsent(keyC, k -> genValue(k));
-        myMap.computeIfAbsent(keyG, k -> genValue(k));
-        System.out.println("computeIfAbsent"+ myMap);
-
-        myMap.computeIfPresent(keyC, biFunc);
-        myMap.computeIfPresent(keyH, biFunc);
-        System.out.println("computeIfPresent"+ myMap);
-        //ThreadPoolExecutor
-    }
-
-    static String genValue(String str) {
-        System.out.println("===");
-        return str + "2";
-    }
-
-    @Test
-    public void testCubeRoot() {
-        System.out.println(getCubeRoot(27));
-        System.out.println(getCubeRoot(0));
-        System.out.println(getCubeRoot(100));
-        System.out.println(getCubeRoot(12));
-    }
-
-    public static double getCubeRoot(double input){
-        DecimalFormat df = new DecimalFormat();
-        df.setMaximumFractionDigits(1);
-        boolean is_negative = false;
-        if(input < 0){
-            is_negative = true;
-            input = -input;
-        }
-        double left = 0;
-        double right = input;
-        double delta = 0.00001;
-        double tmp = (left + right) / 2;
-        double result = tmp * tmp * tmp;
-        double last_min = 2d;
-        double current = 0d;
-        while (Math.abs(result - input) > last_min){
-            if(Math.abs(result - input) < last_min){
-                last_min = Math.abs(result - input);
-            }
-            if(result > input){
-                right = tmp;
-            }else{
-                left = tmp;
-            }
-            tmp =  (left + right) / 2;
-            String tmp1 =  df.format(tmp);
-            result = tmp * tmp * tmp;
-
-        }
-        return tmp;
-    }
-
-}

+ 0 - 61
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/RegexTest.kt

@@ -1,61 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import org.junit.Test
-import java.lang.StringBuilder
-import java.util.regex.Pattern
-
-/**
- *
- *
- * @author jxing
- */
-class RegexTest {
-    val floorNamePattern = "^([F|B][1-9][0-9]{0,4}|RF)(M([1-9][0-9]{0,4})?)?\$"
-
-    @Test
-    fun range(){
-        val s1 = "B1"
-        val s2 = "B1fd"
-        val s3 = "B1M"
-        val s4 = "N1"
-        val s5 = "F10M2"
-        val s6 = "F10N2"
-
-        println(Pattern.matches(floorNamePattern, s1))
-        println(Pattern.matches(floorNamePattern, s2))
-        println(Pattern.matches(floorNamePattern, s3))
-        println(Pattern.matches(floorNamePattern, s4))
-        println(Pattern.matches(floorNamePattern, s5))
-        println(Pattern.matches(floorNamePattern, s6))
-
-    }
-
-    var out : StringBuilder? = null
-
-    @Test
-    fun test2(){
-        out = StringBuilder()
-        if(out == null) {
-            return
-        }
-        out = out!!
-        if(out!= null)
-            out!!.append("")
-    }
-
-
-    @Test
-    fun test1(){
-        var inside : StringBuilder? = null
-        inside = StringBuilder()
-        inside.append("")
-        if(inside == null) {
-            return
-        }
-        inside = inside!!
-        if(inside!= null)
-            inside.append("")
-    }
-
-
-}

+ 0 - 53
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/StringBuilderTest.kt

@@ -1,53 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import org.junit.Test
-import java.lang.StringBuilder
-import kotlin.random.Random
-
-/**
- *
- *
- * @author jxing
- */
-class StringBuilderTest {
-
-    @Test
-    fun range(){
-        val sb = StringBuilder()
-        sb.append("123456,")
-    }
-
-    @Test
-    fun random(){
-        val rand = Random(99L)
-        var times = rand.nextInt(0, 0)
-        println(times)
-    }
-
-    @Test
-    fun split(){
-        var list = arrayListOf("F1M1", "F1", "B1", "B2M1")
-        list.forEach {
-            var arr = it.split("F|M|B".toRegex())
-            println("size : ${arr.size} : ")
-            arr.forEach{
-                println(it)
-            }
-        }
-    }
-    @Test
-    fun split1(){
-        val str = "1+2-3+5-64*25+25/65"
-        val array = str.split("\\+|-|\\*|/".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
-        print(array)
-    }
-
-    @Test
-    fun float(){
-        System.out.println(0.05+0.01);
-//        System.out.println(1.0-0.42);
-//        System.out.println(4.015*100);
-//        System.out.println(123.3/100);
-        System.out.println(0.7+0.1);
-    }
-}

+ 0 - 30
revit-algorithm/src/test/java/cn/sagacloud/server/algorithm/test/TaskTest.kt

@@ -1,30 +0,0 @@
-package cn.sagacloud.server.algorithm.test
-
-import cn.sagacloud.server.algorithm.services.modelCheck.TaskService
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.test.context.SpringBootTest
-import org.springframework.test.context.junit4.SpringRunner
-
-/**
- *
- *
- * @author jxing
- */
-@RunWith(SpringRunner::class)
-@SpringBootTest
-class TaskTest {
-
-    @Autowired
-    lateinit var taskService: TaskService
-
-
-    @Test
-    fun taskResultTest(){
-
-        val taskResultContent = taskService.queryTaskResult("377")
-
-        println(taskResultContent)
-    }
-}