소스 검색

fix bug:补充空间坐标时导致最后一个坐标不正确的问题

lijie 3 년 전
부모
커밋
bc5b36cb15

+ 4 - 2
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/common/utils/SpaceAffectUtil.kt

@@ -10,7 +10,6 @@ import cn.sagacloud.server.algorithm.models.modelFile.ModelFile
 import cn.sagacloud.server.algorithm.services.BaseDataService.modelFileService
 import cn.sagacloud.server.algorithm.services.BaseDataService.spaceService
 import cn.sagacloud.server.algorithm.services.datacenter.DataCenterRequest
-import com.alibaba.fastjson.JSON
 import com.sybotan.service.SObjectService
 import com.sybotan.service.models.SCascadeQuery
 import com.sybotan.service.models.requests.SQueryRequest
@@ -23,6 +22,7 @@ import org.locationtech.jts.geom.GeometryFactory
 import org.locationtech.jts.geom.LinearRing
 import org.locationtech.jts.geom.Polygon
 import org.slf4j.LoggerFactory
+import org.springframework.beans.BeanUtils
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.stereotype.Component
 import java.util.*
@@ -173,7 +173,9 @@ class SpaceAffectUtil {
             try {
                 ring = createRing(geometryFactory,list)
             }catch (ingroed:IllegalArgumentException){
-                list!!.add(list[0])
+                val newPoint=Point()
+                BeanUtils.copyProperties(list!![0],newPoint)
+                list.add(newPoint)
                 ring = createRing(geometryFactory,list)
             }
         }catch (e:Exception){}

+ 1 - 1
revit-algorithm/src/main/resources-dev/application.yml

@@ -127,8 +127,8 @@ properties:
 
   datacenter:
     #url:                                http://39.105.112.36/datacenter/
-    url:                                http://develop.ysbdtp.com/datacenter/
     #url:                                http://develop.ysbdtp.com/datacenter/
+    url:                                http://localhost:8876/
     # 设备相关接口
     equipCreate: ${properties.datacenter.url}object/equip/create
     equipDelete: ${properties.datacenter.url}object/equip/delete