فهرست منبع

场景模糊查询

wuweihao 4 سال پیش
والد
کامیت
3df67a0cde
50فایلهای تغییر یافته به همراه1773 افزوده شده و 148 حذف شده
  1. 6 0
      README.md
  2. 9 0
      laser/pom.xml
  3. 8 0
      laser/src/main/java/com/fdkankan/indoor/base/constant/CmdConstant.java
  4. 5 0
      laser/src/main/java/com/fdkankan/indoor/base/constant/ConfigConstant.java
  5. 3 0
      laser/src/main/java/com/fdkankan/indoor/base/constant/TypeConstant.java
  6. 3 2
      laser/src/main/java/com/fdkankan/indoor/base/convert/ConvertToVision.java
  7. 28 0
      laser/src/main/java/com/fdkankan/indoor/base/util/MyFileUtil.java
  8. 44 0
      laser/src/main/java/com/fdkankan/indoor/core/controller/CutModelController.java
  9. 1 1
      laser/src/main/java/com/fdkankan/indoor/core/controller/FilterController.java
  10. 12 2
      laser/src/main/java/com/fdkankan/indoor/core/controller/InitController.java
  11. 57 0
      laser/src/main/java/com/fdkankan/indoor/core/controller/MapSmallController.java
  12. 10 1
      laser/src/main/java/com/fdkankan/indoor/core/controller/PoiController.java
  13. 2 0
      laser/src/main/java/com/fdkankan/indoor/core/controller/PoiTypeGroupController.java
  14. 16 18
      laser/src/main/java/com/fdkankan/indoor/core/controller/SceneController.java
  15. 31 1
      laser/src/main/java/com/fdkankan/indoor/core/controller/SiteController.java
  16. 8 0
      laser/src/main/java/com/fdkankan/indoor/core/controller/TestController.java
  17. 24 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/CutModelEntity.java
  18. 15 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/InitEntity.java
  19. 26 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/MapSmallEntity.java
  20. 24 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/CropDto.java
  21. 40 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/CutModelDto.java
  22. 42 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/InitDto.java
  23. 12 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/MapSmallDto.java
  24. 26 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/PageDto.java
  25. 21 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/dto/SceneAgePageDto.java
  26. 274 0
      laser/src/main/java/com/fdkankan/indoor/core/entity/vo/ResponseScene.java
  27. 14 0
      laser/src/main/java/com/fdkankan/indoor/core/mapper/CutModelMapper.java
  28. 4 0
      laser/src/main/java/com/fdkankan/indoor/core/mapper/InitMapper.java
  29. 13 0
      laser/src/main/java/com/fdkankan/indoor/core/mapper/MapSmallMapper.java
  30. 21 0
      laser/src/main/java/com/fdkankan/indoor/core/service/CutModelService.java
  31. 4 1
      laser/src/main/java/com/fdkankan/indoor/core/service/InitService.java
  32. 24 0
      laser/src/main/java/com/fdkankan/indoor/core/service/MapSmallService.java
  33. 2 0
      laser/src/main/java/com/fdkankan/indoor/core/service/OwenService.java
  34. 2 0
      laser/src/main/java/com/fdkankan/indoor/core/service/PoiService.java
  35. 4 2
      laser/src/main/java/com/fdkankan/indoor/core/service/SceneService.java
  36. 9 0
      laser/src/main/java/com/fdkankan/indoor/core/service/SiteService.java
  37. 309 0
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/CutModelServiceImpl.java
  38. 5 2
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/FilterServiceImpl.java
  39. 18 0
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/IBaseServiceImpl.java
  40. 138 68
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/InitServiceImpl.java
  41. 261 0
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/MapSmallServiceImpl.java
  42. 25 0
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/OwenServiceImpl.java
  43. 15 0
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiServiceImpl.java
  44. 2 2
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiTypeGroupServiceImpl.java
  45. 7 1
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiTypeServiceImpl.java
  46. 79 10
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/SceneServiceImpl.java
  47. 57 35
      laser/src/main/java/com/fdkankan/indoor/core/service/impl/SiteServiceImpl.java
  48. 4 1
      laser/src/main/resources/application-dev.properties
  49. 5 1
      laser/src/main/resources/application-sit.properties
  50. 4 0
      laser/src/main/resources/data/cut_param.json

+ 6 - 0
README.md

@@ -99,6 +99,7 @@ t-p307mDm   /mnt/data/00001001/872174780395028480/74ee2a32dbde_20210803173654643
 aa-p307mDm
 
 db.getCollection('t_special_point').find({"sceneCode":"t-SNZRfWt"})
+db.getCollection('t_init').find({"_id":"t-gWKRICl"})
 
 
 t-gWKRICl /mnt/data/00001002/872519700045627392/74ee2a39e656_202108041610248900/results
@@ -107,5 +108,10 @@ t-gWKRICl /mnt/data/00001002/872519700045627392/74ee2a39e656_202108041610248900/
 t-RJlwqtc /mnt/data/00001002/872519700045627392/74ee2a39e656_202108041610248900/results
 
 
+
 t-p307mDm
+
+
+# doc
+ sit: http://test.4dkankan.com:9294/doc.html#/home
              

+ 9 - 0
laser/pom.xml

@@ -26,6 +26,7 @@
 		<aliyun.dysmsapi.version>1.1.0</aliyun.dysmsapi.version>
 		<aliyun.oss.version>2.5.0</aliyun.oss.version>
 		<spring.boot.version>2.3.4.RELEASE</spring.boot.version>
+		<pagehelper.version>1.2.5</pagehelper.version>
 	</properties>
 
 	<dependencies>
@@ -186,6 +187,14 @@
 			<version>1.1.3</version>
 		</dependency>
 
+		<!--&lt;!&ndash;分页插件&ndash;&gt;-->
+		<!--<dependency>-->
+			<!--<groupId>com.github.pagehelper</groupId>-->
+			<!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
+			<!--<version>${pagehelper.version}</version>-->
+		<!--</dependency>-->
+
+
 
 	</dependencies>
 

+ 8 - 0
laser/src/main/java/com/fdkankan/indoor/base/constant/CmdConstant.java

@@ -29,4 +29,12 @@ public class CmdConstant {
 
     public final static String OSSUTIL_UPLOAD_DIR = "bash /root/user/java/jar_run/ossupload.sh @uploadDir @target";
 
+
+    /**
+     * 2021-08-17
+     * 剪切模型命令, 这个需要在nas共享目录, 测试服务器,跟算法服务器是分开的
+     * bash /home/ubuntu/bin/PotreeConverter.sh /mnt/data/00001002/872819408496492544/74ee2a39e656_202108051135248650/results/laserData/laser.las /mnt/data/owen_test/indoor_cut.las /mnt/data/owen_test/cut_param.json
+     * bash /home/ubuntu/bin/PotreeConverter.sh inPath outPath inCutParam;
+     */
+    public final static String CUT_MODEL = "bash /home/ubuntu/bin/PotreeConverter.sh @inPath @outPath @cutParam";
 }

+ 5 - 0
laser/src/main/java/com/fdkankan/indoor/base/constant/ConfigConstant.java

@@ -20,6 +20,11 @@ public class ConfigConstant {
     @Value("${my.template.path}")
     public String templatePath;
 
+    /** 前端展示链接*/
+    @Value("${web.site}")
+    public String webSitePath;
+
+
     /**redis token前缀*/
 //    @Value("${redis.prefix}")
 //    public  String redisPrefix;

+ 3 - 0
laser/src/main/java/com/fdkankan/indoor/base/constant/TypeConstant.java

@@ -23,4 +23,7 @@ public class TypeConstant {
 
 
 
+
+
+
 }

+ 3 - 2
laser/src/main/java/com/fdkankan/indoor/base/convert/ConvertToVision.java

@@ -41,6 +41,7 @@ public class ConvertToVision {
 			JSONObject sweepItem = sweepLocations.getJSONObject(i);
 			//navvis��֧��id��0�����ε�
 			//int id = sweepItem.getInt("id");
+
 			int id = sweepItem.getInt("uuid");
 			JSONObject pose = sweepItem.getJSONObject("pose");
 			JSONObject rotation = pose.getJSONObject("rotation");
@@ -136,7 +137,7 @@ public class ConvertToVision {
 			
 			laserPanos.add(laserPano);
 			//firstView
-			if(id == 0) {
+			if(i == 0) {
 				//保存初始点的gis坐标
 				// _location 存入数据库
 				SpecialPointEntity pointEntity = new SpecialPointEntity();
@@ -226,7 +227,7 @@ public class ConvertToVision {
 
 			laserPanos.add(laserPano);
 			//firstView
-			if(id == 0) {
+			if(i == 0) {
 				//保存初始点的gis坐标
 				// _location 存入数据库
 //				// 经度 22 纬度 113

+ 28 - 0
laser/src/main/java/com/fdkankan/indoor/base/util/MyFileUtil.java

@@ -0,0 +1,28 @@
+package com.fdkankan.indoor.base.util;
+
+import cn.hutool.core.util.StrUtil;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by owen on 2021/8/17 0017 17:30
+ */
+public class MyFileUtil {
+
+
+
+
+
+//    @Test
+//    public void test() {
+//        String path = "F:\\test\\ngin\\age_camera_germany_data\\t810\\map\\tile";
+//
+//        List<String> strings = eachFile(path,"");
+//        System.out.println(strings);
+//
+//    }
+}

+ 44 - 0
laser/src/main/java/com/fdkankan/indoor/core/controller/CutModelController.java

@@ -0,0 +1,44 @@
+package com.fdkankan.indoor.core.controller;
+
+import com.fdkankan.indoor.base.aop.WebControllerLog;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.CropDto;
+import com.fdkankan.indoor.core.service.CutModelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * Created by owen on 2021/8/17 0017 15:10
+ */
+@Api(tags = "剪切模型")
+@RestController
+public class CutModelController {
+
+    @Autowired
+    CutModelService entityService;
+
+//    @ApiOperation("剪切模型")
+//    @GetMapping("indoor/{sceneCode}/cutModel")
+//    public Result cutModel(@PathVariable String sceneCode){
+//        return  entityService.cutModel(sceneCode);
+//    }
+
+
+    @WebControllerLog(description = "剪切模型-剪切模型")
+    @ApiOperation("剪切模型")
+    @PostMapping("indoor/{sceneCode}/api/pointcloud/crop")
+    public Object crop(@PathVariable String sceneCode, @RequestBody CropDto param){
+        Result result = entityService.crop(sceneCode, param);
+        return  result.getData();
+    }
+
+    @WebControllerLog(description = "剪切模型-查询详情")
+    @ApiOperation("查询详情")
+    @GetMapping("indoor/{sceneCode}/api/jobs/{dataId}")
+    public Object findByDataId(@PathVariable String sceneCode, @PathVariable Integer dataId){
+        Result result = entityService.findByDataId(sceneCode, dataId);
+        return  result.getData();
+    }
+}

+ 1 - 1
laser/src/main/java/com/fdkankan/indoor/core/controller/FilterController.java

@@ -20,7 +20,7 @@ import java.util.List;
  * 漫游点
  */
 @Slf4j
-@Api(tags = "热点(filter)")
+@Api(tags = "漫游点-filter")
 @RestController
 public class FilterController {
 

+ 12 - 2
laser/src/main/java/com/fdkankan/indoor/core/controller/InitController.java

@@ -2,6 +2,7 @@ package com.fdkankan.indoor.core.controller;
 
 import com.fdkankan.indoor.base.aop.WebControllerLog;
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.InitDto;
 import com.fdkankan.indoor.core.service.InitService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -37,9 +38,18 @@ public class InitController {
     @WebControllerLog(description = "创建初始数据")
     @ApiOperation(value = "创建初始数据")
     @GetMapping("indoor/{sceneCode}/api/init")
-    public Result initData(@PathVariable String sceneCode, String path, String title) {
-        return initService.initData(sceneCode, path, "age", title);
+    public Result initData(@PathVariable String sceneCode, InitDto param) {
+        param.setFrom("age");
+        param.setSceneCode(sceneCode);
+        return initService.initData(param);
     }
+//    @WebControllerLog(description = "创建初始数据")
+//    @ApiOperation(value = "创建初始数据")
+//    @GetMapping("indoor/{sceneCode}/api/init")
+//    public Result initData(@PathVariable String sceneCode, String path, String title) {
+//        return initService.initData(sceneCode, path, "age", title);
+//    }
+
 
     @WebControllerLog(description = "删除初始化数据")
     @ApiOperation(value = "删除初始化数据(手动删除)")

+ 57 - 0
laser/src/main/java/com/fdkankan/indoor/core/controller/MapSmallController.java

@@ -0,0 +1,57 @@
+package com.fdkankan.indoor.core.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.fdkankan.indoor.base.aop.WebControllerLog;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.MapDto;
+import com.fdkankan.indoor.core.entity.dto.MapSmallDto;
+import com.fdkankan.indoor.core.service.MapService;
+import com.fdkankan.indoor.core.service.MapSmallService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by owen on 2021/8/17 0002 20:39
+ * 跟志彬对接
+ *
+ */
+@Api(tags = "小地图(新) 2021-8-17")
+@RestController
+public class MapSmallController {
+
+    @Autowired
+    MapSmallService entityMap;
+
+    /**
+     * 多文件上传需要 @RequestParam 这个注解
+     * @param sceneCode
+     * @param file
+     * @return
+     */
+    @WebControllerLog(description = "小地图(新)-上传小地图")
+    @ApiOperation(value = "上传小地图")
+    @PostMapping("indoor/{sceneCode}/api/mapSmall/upload")
+    public Result upload(@PathVariable String sceneCode, @RequestParam Map<String, MultipartFile> file){
+        return entityMap.upload(sceneCode, file);
+    }
+
+    @WebControllerLog(description = "小地图(新)-获取详情")
+    @ApiOperation(value = "获取详情")
+    @PostMapping("indoor/{sceneCode}/api/mapSmall/detail")
+    public Result init(@PathVariable String sceneCode){
+        return entityMap.detail(sceneCode);
+    }
+
+    @WebControllerLog(description = "小地图(新)-更新坐标")
+    @ApiOperation(value = "更新坐标")
+    @PostMapping("indoor/{sceneCode}/api/update/coord")
+    public Result updateCoord(@PathVariable String sceneCode, @RequestBody MapSmallDto param){
+        return entityMap.updateCoord(sceneCode, param);
+    }
+}

+ 10 - 1
laser/src/main/java/com/fdkankan/indoor/core/controller/PoiController.java

@@ -20,7 +20,7 @@ import java.util.List;
  * 热点信息
  */
 @Slf4j
-@Api(tags = "poi数据接口")
+@Api(tags = "热点数据-poi")
 @RestController
 public class PoiController {
 
@@ -101,4 +101,13 @@ public class PoiController {
 
         return json;
     }
+
+
+    @WebControllerLog(description = "poi数据接口-删除热点")
+    @ApiOperation(value = "删除热点")
+    @DeleteMapping("indoor/{sceneCode}/api/pois/{dataId}")
+    public Object deleteByDataId(@PathVariable String sceneCode, @PathVariable Integer dataId){
+        Result result = poiService.deleteByDataId(sceneCode, dataId);
+        return result.getData();
+    }
 }

+ 2 - 0
laser/src/main/java/com/fdkankan/indoor/core/controller/PoiTypeGroupController.java

@@ -1,5 +1,6 @@
 package com.fdkankan.indoor.core.controller;
 
+import com.fdkankan.indoor.base.aop.WebControllerLog;
 import com.fdkankan.indoor.base.util.Result;
 import com.fdkankan.indoor.core.entity.dto.PoiTypeDto;
 import com.fdkankan.indoor.core.entity.dto.PoiTypeGroupDto;
@@ -28,6 +29,7 @@ public class PoiTypeGroupController {
         return result.getData();
     }
 
+    @WebControllerLog(description = "PoiTypeGroup-修改保存-put")
     @ApiOperation(value = "修改保存-put")
     @PutMapping("indoor/{sceneCode}/api/poi_type_groups")
     public Object editPut(@PathVariable String sceneCode, @RequestBody List<PoiTypeGroupDto> param){

+ 16 - 18
laser/src/main/java/com/fdkankan/indoor/core/controller/SceneController.java

@@ -2,44 +2,42 @@ package com.fdkankan.indoor.core.controller;
 
 import com.fdkankan.indoor.base.aop.WebControllerLog;
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.SceneAgePageDto;
 import com.fdkankan.indoor.core.service.SceneService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * Created by owen on 2021/7/26 0026 9:00
  */
 
 @Slf4j
-@Api(tags = "场景接口")
+@Api(tags = "场景-提供四维看看")
 @RestController
-@RequestMapping("indoor/scene")
 public class SceneController {
 
     @Autowired
     SceneService sceneService;
 
-    @WebControllerLog(description = "场景接口-创建场景码")
-    @ApiOperation(value = "创建场景码")
-    @GetMapping("getSceneCode")
-    public Object createSceneCode(){
-        Result search = sceneService.createSceneCode();
-        return search.getData();
-    }
 
-    @WebControllerLog(description = "场景接口-创建30万个场景码")
-    @ApiOperation(value = "创建30万个场景码")
-    @GetMapping("batchSceneCod")
-    public Object batchSceneCod(){
-        Result search = sceneService.batchSceneCod();
-        return search.getData();
+    @WebControllerLog(description = "场景接口-列表")
+    @ApiOperation(value = "列表")
+    @PostMapping("indoor/scene/list")
+    public Result list(@RequestBody SceneAgePageDto param){
+        return sceneService.list(param);
     }
 
+//    @WebControllerLog(description = "场景接口-创建30万个场景码")
+//    @ApiOperation(value = "创建30万个场景码")
+//    @GetMapping("batchSceneCod")
+//    public Object batchSceneCod(){
+//        Result search = sceneService.batchSceneCod();
+//        return search.getData();
+//    }
+
 
 
 }

+ 31 - 1
laser/src/main/java/com/fdkankan/indoor/core/controller/SiteController.java

@@ -3,6 +3,7 @@ package com.fdkankan.indoor.core.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.indoor.base.aop.WebControllerLog;
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.SiteDto;
 import com.fdkankan.indoor.core.entity.dto.SiteModelSearchDto;
 import com.fdkankan.indoor.core.service.SiteService;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@@ -13,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * @author Admin
  *
@@ -24,7 +27,7 @@ import org.springframework.web.bind.annotation.*;
  * 数据集的分类信息
  */
 @Slf4j
-@Api(tags = "Site数据接口")
+@Api(tags = "分类信息-SiteModel")
 @RestController
 @AllArgsConstructor
 public class SiteController {
@@ -148,6 +151,33 @@ public class SiteController {
     }
 
 
+    @WebControllerLog(description = "分类信息-更新")
+    @ApiOperation(value = "更新")
+    @PostMapping("indoor/{sceneCode}/api/site_model/validate")
+    public Object updateByDataId(@PathVariable String sceneCode, @RequestBody List<SiteDto> param) {
+        Result search = entityService.updateByDataId(sceneCode, param);
+        return search.getData();
+    }
+
+
+    @WebControllerLog(description = "分类信息-获取全部")
+    @ApiOperation(value = "获取全部")
+    @GetMapping("indoor/{sceneCode}/api/site_model")
+    public Object findAll(@PathVariable String sceneCode) {
+        Result search = entityService.findAll(sceneCode);
+        return search.getData();
+    }
+
+
+    @WebControllerLog(description = "分类信息-初始化表")
+    @ApiOperation(value = "初始化表", notes = "传入参数目前不处理")
+    @PostMapping("indoor/{sceneCode}/api/site_model/generate")
+    public Object initSiteModel(@PathVariable String sceneCode, @RequestBody List<SiteDto> param) {
+        Result search = entityService.initSiteModel(sceneCode);
+        return search.getData();
+    }
+
+
 
 
 }

+ 8 - 0
laser/src/main/java/com/fdkankan/indoor/core/controller/TestController.java

@@ -153,5 +153,13 @@ public class TestController {
     }
 
 
+    @ApiOperation("剪切模型")
+    @GetMapping("cutModel/{sceneCode}")
+    public Result cutModel(@PathVariable String sceneCode){
+        return  owenService.cutModel(sceneCode);
+
+
+    }
+
 
 }

+ 24 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/CutModelEntity.java

@@ -0,0 +1,24 @@
+package com.fdkankan.indoor.core.entity;
+
+import com.fdkankan.indoor.core.entity.dto.CutModelDto;
+import com.fdkankan.indoor.core.entity.dto.PoiHotDto;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.util.List;
+
+/**
+ * Created by owen on 2021/7/27 0027 10:42
+ * 剪切模型
+ */
+@Document(collection = "t_cut_model")
+@Data
+public class CutModelEntity extends BaseEntity {
+
+
+    private String sceneCode;
+
+    private List<CutModelDto> data;
+
+
+}

+ 15 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/InitEntity.java

@@ -36,4 +36,19 @@ public class InitEntity {
 
     @ApiModelProperty(value = "标题" )
     private String title;
+
+    private String childName;
+
+    @ApiModelProperty(value = "sn码")
+    private String snCode;
+
+    @ApiModelProperty(value = "拍摄时间")
+    private String shootTime;
+
+    @ApiModelProperty(value = "展示链接")
+    private String webSite;
+
+    @ApiModelProperty(value = "用户Id")
+    private Long userId;
+
 }

+ 26 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/MapSmallEntity.java

@@ -0,0 +1,26 @@
+package com.fdkankan.indoor.core.entity;
+
+import com.fdkankan.indoor.core.entity.po.MapPo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2021/8/17 0027 10:42
+ * 小地图信息- 新的 跟志彬对接
+ */
+@Document(collection = "t_map_small")
+@Data
+public class MapSmallEntity extends BaseEntity {
+
+    @ApiModelProperty(value = "路径")
+    private Object path;
+
+    @ApiModelProperty(value = "位置")
+    private Object position;
+
+
+}

+ 24 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/CropDto.java

@@ -0,0 +1,24 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import lombok.Data;
+
+/**
+ * Created by owen on 2021/8/17 0017 15:43
+ *
+ * 剪裁参数
+ */
+@Data
+public class CropDto {
+
+    private Integer[] datasets_ids;
+
+    private Double[] transformation_matrix;
+
+    private Integer reference_dataset_id;
+
+    private String file_extension;
+
+
+
+
+}

+ 40 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/CutModelDto.java

@@ -0,0 +1,40 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import lombok.Data;
+
+/**
+ * Created by owen on 2021/8/17 0017 15:23
+ */
+@Data
+public class CutModelDto {
+
+    private Integer id;
+
+    private Integer job_id;
+
+    private String name;
+
+    private String output;
+
+    private String last_output;
+
+    private Boolean busy;
+
+    private Boolean success;
+
+
+    private Integer status;
+
+    private Long start_time;
+
+    private Long end_time;
+
+    private String title;
+
+    private String errors;
+
+    private String output_file;
+
+}
+
+

+ 42 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/InitDto.java

@@ -0,0 +1,42 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * Created by owen on 2021/8/17 0017 8:49
+ */
+@Data
+public class InitDto {
+
+    @ApiModelProperty(value = "场景码", required = true)
+    private String sceneCode;
+
+    @ApiModelProperty(value = "文件地址")
+    private String path;
+
+    @ApiModelProperty(value = "场景名称")
+    private String title;
+
+    @ApiModelProperty(value = "来自", notes = "自己重算:recount, age:四维看看")
+    private String from;
+
+    private String childName;
+
+    @ApiModelProperty(value = "sn码")
+    private String snCode;
+
+    @ApiModelProperty(value = "拍摄时间")
+    private String createTime;
+
+    @ApiModelProperty(value = "展示链接")
+    private String webSite;
+
+    @ApiModelProperty(value = "用户Id")
+    private Long userId;
+
+
+
+}

+ 12 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/MapSmallDto.java

@@ -0,0 +1,12 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import lombok.Data;
+
+/**
+ * Created by owen on 2021/8/17 0017 15:23
+ */
+@Data
+public class MapSmallDto {
+
+    private Object param;
+}

+ 26 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/PageDto.java

@@ -0,0 +1,26 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 12:24
+ */
+@Data
+public class PageDto {
+
+
+    @ApiModelProperty(value = "起始页码,默认1为第一页", name = "pageNum")
+    private Integer pageNum;
+
+    @ApiModelProperty(value = "每页数量", name = "pageSize")
+    private Integer pageSize;
+
+    @ApiModelProperty(value = "搜索条件", name = "searchKey")
+    private String searchKey;
+
+
+
+
+}

+ 21 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/dto/SceneAgePageDto.java

@@ -0,0 +1,21 @@
+package com.fdkankan.indoor.core.entity.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 12:24
+ */
+@Data
+public class SceneAgePageDto extends PageDto {
+
+
+//    @ApiModelProperty(value = "用户id", required = true)
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+
+
+
+}

+ 274 - 0
laser/src/main/java/com/fdkankan/indoor/core/entity/vo/ResponseScene.java

@@ -0,0 +1,274 @@
+package com.fdkankan.indoor.core.entity.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+
+/**
+ * 四维看看返回值
+ */
+
+@Data
+public class ResponseScene implements Serializable {
+
+    private static final long serialVersionUID = 2454435822930272529L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "场景缩略图", name = "thumb")
+    private String thumb;
+
+    @ApiModelProperty(value = "大场景的密钥", name = "sceneKey")
+    private String sceneKey;
+
+    @ApiModelProperty(value = "场景名称", name = "sceneName")
+    private String sceneName;
+
+    @ApiModelProperty(value = "场景描述", name = "sceneDec")
+    private String sceneDec;
+
+    @ApiModelProperty(value = "0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居", name = "sceneType")
+    private int sceneType;
+
+    @ApiModelProperty(value = "场景封面图是否默认", name = "thumbImg")
+    private int thumbImg;
+
+    @ApiModelProperty(value = "版本", name = "version")
+    private int version;
+
+    @ApiModelProperty(value = "0表示默认,user表示自己上传", name = "markerLogo")
+    private String markerLogo;
+
+    @ApiModelProperty(value = "0表示默认,user表示自己上传", name = "floorLogo")
+    private String floorLogo;
+
+    @ApiModelProperty(value = "标记大小", name = "floorLogoSize")
+    private int floorLogoSize;
+
+    @ApiModelProperty(value = "表示初始点信息", name = "entry")
+    private String entry;
+
+    @ApiModelProperty(value = "创建时间", name = "createTime")
+    private String createTime;
+
+    @ApiModelProperty(value = "创建日期时间戳", name = "createDate")
+    private Long createDate;
+
+    @ApiModelProperty(value = "拍摄数量", name = "shootCount")
+    private int shootCount;
+
+    @ApiModelProperty(value = "0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示", name = "status")
+    private int status;
+
+    @ApiModelProperty(value = "模型贴图的风格", name = "sceneIndex")
+    private int sceneIndex;
+
+    @ApiModelProperty(value = "背景音乐名称", name = "hasBGM")
+    private String hasBGM;
+
+    @ApiModelProperty(value = "方案:1是双目,2是转台,3是六目", name = "cameraType")
+    private int cameraType;
+
+    @ApiModelProperty(value = "是否公开,0公开,1加密", name = "isPublic")
+    private int isPublic;
+
+    @ApiModelProperty(value = "要gps定位", name = "gps")
+    private String gps;
+
+    @ApiModelProperty(value = "相机的Mac地址", name = "childName")
+    private String childName;
+
+    @ApiModelProperty(value = "用户名", name = "userName")
+    private String userName;
+
+    @ApiModelProperty(value = "昵称", name = "nickName")
+    private String nickName;
+
+    @ApiModelProperty(value = "浏览次数", name = "viewCount")
+    private int viewCount;
+
+    @ApiModelProperty(value = "场景的链接地址", name = "webSite")
+    private String webSite;
+
+    @ApiModelProperty(value = "原始的大场景数据", name = "dataSource")
+    private String dataSource;
+
+    @ApiModelProperty(value = "0表示未付款,1表示付款了,-1表示欠费(八目场景指锁住),-2表示临时空间(八目场景)", name = "payStatus")
+    private int payStatus;
+
+    @ApiModelProperty(value = "手机id", name = "phoneId")
+    private String phoneId;
+
+    @ApiModelProperty(value = "大场景序号", name = "num")
+    private String num;
+
+    @ApiModelProperty(value = "1表示推荐,0表示正常", name = "recommend")
+    private int recommend;
+
+    @ApiModelProperty(value = "表示缩略图是否存在", name = "thumbStatus")
+    private int thumbStatus;
+
+    @ApiModelProperty(value = "要上传的热点的id集合,用逗号隔开", name = "hotsIds")
+    private String hotsIds;
+
+    @ApiModelProperty(value = "大场景初始点的id", name = "initialPointId")
+    private String initialPointId;
+
+    @ApiModelProperty(value = "风格", name = "style")
+    private int style;
+
+    @ApiModelProperty(value = "方案:1是双目,2是转台,3是六目", name = "sceneScheme")
+    private int sceneScheme;
+
+    @ApiModelProperty(value = "背景音乐名称", name = "bgMusic")
+    private String bgMusic;
+
+    @ApiModelProperty(value = "用户id", name = "userId")
+    private Long userId;
+
+    @ApiModelProperty(value = "相机id", name = "cameraId")
+    private Long cameraId;
+
+    @ApiModelProperty(value = "使用容量", name = "space")
+    private BigInteger space;
+
+
+
+    @ApiModelProperty(value = "分享的logo和生成二维码的logo", name = "shareLogo")
+    private String shareLogo;
+
+    @ApiModelProperty(value = "小地图浏览", name = "mapVisi")
+    private int mapVisi;
+
+    @ApiModelProperty(value = "自动导览", name = "tourVisi")
+    private int tourVisi;
+
+    @ApiModelProperty(value = "vr模式", name = "vrVisi")
+    private int vrVisi;
+    
+
+    /**
+     * 普通录屏文件地址
+     */
+    private String screencapVoiceSrc;
+
+    /**
+     * 录音文件地址
+     */
+    private String screencapVoiceSound;
+
+    /**
+     * 同步录音文件地址
+     */
+    private String screencapVoiceSoundsync;
+
+    /**
+     * 选择的类型,sound为screencapVoiceSound,file为screencapVoiceSrc
+     */
+    private String screencapVoiceType;
+
+    /**
+     * 录屏文件地址
+     */
+    private String playData;
+
+
+    /**
+     * 重新建模的版本
+     */
+    private int floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    private int floorPublishVer;
+
+    /**
+     * 录屏图片
+     */
+    private String screencapThumb;
+
+    /**
+     * cad平面图参数
+     */
+    private String cadInfo;
+
+    /**
+     * cad平面图参数
+     */
+    private String floorPlanPng;
+
+    /**
+     * 展示页面是否显示标尺
+     */
+    private int rulerVisi;
+
+    /**
+     * 展示页面cad图在平面图是否显示
+     */
+    private int cadImgVisi;
+
+    private int panoVisi;
+
+    private int m2dVisi;
+
+    private int m3dVisi;
+
+    private int measureVisi;
+
+    private String videos;
+
+    private String snCode;
+
+    private String overlay;
+
+    private Integer showLogoBottom;
+
+    private String recStatus;
+
+    private Integer needKey;
+
+    private String buildType;
+
+    private Integer imagesVersion;
+
+    private String bgMusicName;
+
+    /**
+     * 协作者用户id
+     */
+    private String cooperationUserId;
+
+    private String cooperationUserName;
+
+    private Integer sceneSource;
+
+    private boolean jumpScene;
+
+    /**
+     * 服务器的服务商
+     */
+    private String ecs;
+
+    /**
+     * 场景来源方式,为app提供,0相机,1用户,2协作者
+     */
+    private Integer sceneSourceType;
+
+    /**
+     * 随心装场景码
+     */
+    private String vrNum;
+
+    /**
+     * 旋转角度
+     */
+    private String floorPlanAngle;
+
+    private Integer isFolder;
+
+    private String videosUser;
+}

+ 14 - 0
laser/src/main/java/com/fdkankan/indoor/core/mapper/CutModelMapper.java

@@ -0,0 +1,14 @@
+package com.fdkankan.indoor.core.mapper;
+
+import com.fdkankan.indoor.core.entity.CutModelEntity;
+import com.fdkankan.indoor.core.entity.MapEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by owen on 2021/7/27 0027 15:19
+ */
+@Component
+public interface CutModelMapper extends MongoRepository<CutModelEntity, String> {
+
+}

+ 4 - 0
laser/src/main/java/com/fdkankan/indoor/core/mapper/InitMapper.java

@@ -1,6 +1,8 @@
 package com.fdkankan.indoor.core.mapper;
 
 import com.fdkankan.indoor.core.entity.InitEntity;
+import com.fdkankan.indoor.core.entity.vo.ResponseScene;
+import org.springframework.data.domain.Page;
 import org.springframework.data.mongodb.repository.MongoRepository;
 import org.springframework.stereotype.Component;
 
@@ -13,4 +15,6 @@ import java.util.List;
 public interface InitMapper extends MongoRepository<InitEntity, String> {
 
     List<InitEntity> findByStatus(Integer status);
+
+
 }

+ 13 - 0
laser/src/main/java/com/fdkankan/indoor/core/mapper/MapSmallMapper.java

@@ -0,0 +1,13 @@
+package com.fdkankan.indoor.core.mapper;
+
+import com.fdkankan.indoor.core.entity.MapSmallEntity;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by owen on 2021/7/27 0027 15:19
+ */
+@Component
+public interface MapSmallMapper extends MongoRepository<MapSmallEntity, String> {
+
+}

+ 21 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/CutModelService.java

@@ -0,0 +1,21 @@
+package com.fdkankan.indoor.core.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.CropDto;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Map;
+
+/**
+ * Created by owen on 2021/7/28 0028 20:05
+ */
+public interface CutModelService {
+
+
+    Result cutModel(String sceneCode);
+
+    Result crop(String sceneCode, CropDto param);
+
+    Result findByDataId(String sceneCode, Integer dataId);
+}

+ 4 - 1
laser/src/main/java/com/fdkankan/indoor/core/service/InitService.java

@@ -2,6 +2,7 @@ package com.fdkankan.indoor.core.service;
 
 import com.fdkankan.indoor.base.util.Result;
 import com.fdkankan.indoor.core.entity.InitEntity;
+import com.fdkankan.indoor.core.entity.dto.InitDto;
 
 import java.util.List;
 
@@ -9,7 +10,7 @@ import java.util.List;
  * Created by owen on 2021/7/28 0028 9:10
  */
 public interface InitService {
-    Result initData(String sceneCode, String path, String from, String title);
+    Result initData(InitDto param);
 
     void initDataStep2(String sceneCode);
 
@@ -24,4 +25,6 @@ public interface InitService {
     Result testRemove(String sceneCode);
 
     void testInitDataStep2(String id);
+
+    void initSiteModel(String sceneCode);
 }

+ 24 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/MapSmallService.java

@@ -0,0 +1,24 @@
+package com.fdkankan.indoor.core.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.MapDto;
+import com.fdkankan.indoor.core.entity.dto.MapSmallDto;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by owen on 2021/7/28 0028 20:05
+ */
+public interface MapSmallService {
+
+    Result upload(String sceneCode, Map<String, MultipartFile> file);
+
+    void remove(String sceneCode);
+
+    Result updateCoord(String sceneCode, MapSmallDto param);
+
+    Result detail(String sceneCode);
+}

+ 2 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/OwenService.java

@@ -20,4 +20,6 @@ public interface OwenService {
     Result readPoiTypeGroup(String sceneCode);
 
     Result controlPoint(String sceneCode);
+
+    Result cutModel(String sceneCode);
 }

+ 2 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/PoiService.java

@@ -24,4 +24,6 @@ public interface PoiService {
     void save(PoiEntity entity);
 
     void remove(String sceneCode);
+
+    Result deleteByDataId(String sceneCode, Integer dataId);
 }

+ 4 - 2
laser/src/main/java/com/fdkankan/indoor/core/service/SceneService.java

@@ -1,13 +1,15 @@
 package com.fdkankan.indoor.core.service;
 
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.dto.PageDto;
+import com.fdkankan.indoor.core.entity.dto.SceneAgePageDto;
 
 /**
  * Created by owen on 2021/7/26 0026 9:05
  */
 public interface SceneService {
 
-    Result createSceneCode();
 
-    Result batchSceneCod();
+
+    Result list(SceneAgePageDto param);
 }

+ 9 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/SiteService.java

@@ -3,6 +3,7 @@ package com.fdkankan.indoor.core.service;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.indoor.base.util.Result;
 import com.fdkankan.indoor.core.entity.SiteModelEntity;
+import com.fdkankan.indoor.core.entity.dto.SiteDto;
 import com.fdkankan.indoor.core.entity.dto.SiteModelSearchDto;
 
 import java.util.List;
@@ -26,4 +27,12 @@ public interface SiteService {
     void remove(String sceneCode);
 
     List<Integer> findBySceneCodeAndIdAndSon(String code, Integer site_model_entity);
+
+    Result updateByDataId(String sceneCode, List<SiteDto> param);
+
+    Result findAll(String sceneCode);
+
+    Result initSiteModel(String sceneCode);
+
+    SiteModelEntity findById(String sceneCode);
 }

+ 309 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/CutModelServiceImpl.java

@@ -0,0 +1,309 @@
+package com.fdkankan.indoor.core.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.indoor.base.constant.CmdConstant;
+import com.fdkankan.indoor.base.constant.MsgCode;
+import com.fdkankan.indoor.base.convert.ImageClipUtil;
+import com.fdkankan.indoor.base.exception.BaseRuntimeException;
+import com.fdkankan.indoor.base.util.AliYunOssUtil;
+import com.fdkankan.indoor.base.util.CmdUtils;
+import com.fdkankan.indoor.base.util.MyFileUtils;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.CutModelEntity;
+import com.fdkankan.indoor.core.entity.InitEntity;
+import com.fdkankan.indoor.core.entity.MapEntity;
+import com.fdkankan.indoor.core.entity.dto.CropDto;
+import com.fdkankan.indoor.core.entity.dto.CutModelDto;
+import com.fdkankan.indoor.core.entity.dto.MapDto;
+import com.fdkankan.indoor.core.entity.dto.PoiTypeDto;
+import com.fdkankan.indoor.core.entity.po.MapPo;
+import com.fdkankan.indoor.core.mapper.CutModelMapper;
+import com.fdkankan.indoor.core.mapper.InitMapper;
+import com.fdkankan.indoor.core.mapper.MapMapper;
+import com.fdkankan.indoor.core.service.CutModelService;
+import com.fdkankan.indoor.core.service.InitService;
+import com.fdkankan.indoor.core.service.MapService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * Created by owen on 2021/7/28 0028 20:05
+ */
+@Service
+@Slf4j
+public class CutModelServiceImpl extends IBaseServiceImpl implements CutModelService {
+
+
+    @Autowired
+    CutModelMapper entityMapper;
+
+    @Autowired
+    InitService initService;
+
+    @Autowired
+    AliYunOssUtil aliYunOssUtil;
+
+
+
+
+
+//    @Override
+//    public Result upload(String sceneCode, MultipartFile file) {
+//        if (file == null) {
+//            throw new BaseRuntimeException(5003, "文件不能为空");
+//        }
+//
+//        // step1: 保存小地图
+//        String suffix = MyFileUtils.getsuffix(file);
+//
+//        if (!".png".equals(suffix)){
+//            throw new BaseRuntimeException(5004, "非法文件");
+//        }
+//
+//        String basePath = configConstant.serverBasePath + "/" + sceneCode +"/map/";
+//        String savePath = basePath +  sceneCode+ "_map" + suffix;
+//        log.info("小地图保存路径: {}", savePath);
+//        try {
+//            FileUtil.writeFromStream(file.getInputStream(), savePath);
+//            log.info("小地图上传成功");
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//
+//        // step2: 切小地图
+//        String tilePath = basePath + "tile";
+//        clipImage(savePath, tilePath);
+//
+//        // step4: 切图上传oss
+//        ossUploadDir(sceneCode, tilePath);
+//
+//        Object ossPath =  sceneCode + "/data/tile/0/0/0.png";
+//        log.info("返回前端小地图oss地址:{}", ossPath);
+//        return Result.success(ossPath);
+//    }
+
+
+
+
+
+
+
+
+    /**
+     * 初始化小地图数据
+     * @param sceneCode
+     * @param tilePath
+     */
+    private void initMap(String sceneCode, String tilePath, MapDto param){
+
+        MapPo po = new MapPo();
+        po.setId(1);
+        po.setBundle_id(3);
+        po.setFile_path(tilePath);
+        po.setFile_name("$DEPTH/$X/$Y.png");
+        po.setFloor_id(11);
+        po.setMap_size_m(61.44);
+        po.setMax_depth(13);
+        po.setQuadtree("fccf7fffcff3bf7f");
+        // location、orientation 需要更新接口时把这两个值更新
+        po.setLocation(param.getLocation());
+        po.setOrientation(param.getOrientation());
+        po.setTile_size_px(256);
+        po.setType("TILED_PYRAMID");
+
+
+        MapEntity entity = new MapEntity();
+        entity.setId(sceneCode);
+        entity.setCreateTime(LocalDateTime.now());
+        entity.setData(Arrays.asList(po));
+//        entityM/apper.save(entity);
+        log.info("t_map初始化完成");
+
+    }
+
+    private void clipImage(String inPath, String outTilePath){
+
+        log.info("tile: {}", outTilePath);
+        ImageClipUtil.getTiles(inPath, outTilePath);//切片
+        log.info("切图完成");
+
+    }
+
+
+
+
+    @Override
+    public Result cutModel(String sceneCode) {
+        return null;
+    }
+
+    @Override
+    public Result crop(String sceneCode, CropDto param) {
+        Double[] transformation_matrix = param.getTransformation_matrix();
+        String matrix = format(transformation_matrix);
+        JSONObject pa = new JSONObject();
+        log.info("aa: {}", matrix);
+        pa.put("aabb", "b-0.5 -0.5 -0.5 0.5 0.5 0.5");
+        pa.put("cut_transformation", "b" + matrix);
+
+        InitEntity entity = initService.findById(sceneCode);
+        if (entity == null) {
+            throw new BaseRuntimeException("对象不存在");
+
+        }
+
+        String path = entity.getPath();
+        String basePath = path + "/laserData/";
+
+        String savePath = basePath + "cut_param.json";
+        log.info("剪切参数:{}", savePath);
+        FileUtil.writeUtf8String(pa.toJSONString(), savePath);
+        log.info("剪切参数json写入完成");
+
+        // 调用命令切模型
+        String cmd = CmdConstant.CUT_MODEL;
+        String inPath = basePath + "laser.las";
+
+        String time = DateUtil.format(LocalDateTime.now(), "yyyyMMdd_HHmmss");
+        String cutDir = basePath + "cut/";
+        String outPath = cutDir + time + ".las";
+        // 检查目录
+        if (!FileUtil.isFile(cutDir)) {
+            FileUtil.mkdir(cutDir);
+        }
+        String cutParam = basePath + "cut_param.json";
+
+        cmd = cmd.replace("@inPath", inPath);
+        cmd = cmd.replace("@outPath", outPath);
+        cmd = cmd.replace("@cutParam", cutParam);
+
+        CmdUtils.callLineSh(cmd);
+        log.info("剪切模型完成: {}", outPath);
+
+        // 将剪裁后的las上传oss
+        String ossPath = "data/" +sceneCode + "/data/chunk1/cut/" + time + ".las";
+        aliYunOssUtil.upload(outPath, ossPath);
+
+        String ossUrl = configConstant.ossDomain + ossPath;
+        log.info("剪切模型上传oss完成: {}", ossUrl);
+
+        // 保存数据到数据库
+        Integer maxId = 0;
+        CutModelEntity cutEntity = findById(sceneCode);
+        if (cutEntity == null) {
+            cutEntity = new CutModelEntity();
+            cutEntity.setId(sceneCode);
+            cutEntity.setCreateTime(LocalDateTime.now());
+            cutEntity.setData(initCutModelDto(ossUrl, null));
+            maxId = 1;
+        } else {
+            // 修改一次,加一条记录
+            cutEntity.setUpdateTime(LocalDateTime.now());
+
+
+
+            List<CutModelDto> data = getDataBySceneCode(sceneCode);
+            if (data.size() != 0){
+
+                // 遍历参数,获取id, 保存新list
+                List<Integer> collectId = data.stream().map(CutModelDto::getId).collect(Collectors.toList());
+                log.info("参数id: {}", collectId);
+                // 获取最大id
+                if (data.size() != 0) {
+                    Optional<CutModelDto> max = data.stream().max(Comparator.comparingInt(CutModelDto::getId));
+                    maxId = max.get().getId();
+                    maxId ++;
+                }
+
+            }
+
+
+            List<CutModelDto> cutModelDtos = initCutModelDto(ossUrl, maxId);
+            // 合并两个流,
+            data.addAll(cutModelDtos);
+            cutEntity.setData(data);
+
+        }
+        entityMapper.save(cutEntity);
+
+        JSONObject result = new JSONObject();
+        result.put("job_id", maxId);
+        return Result.success(result);
+    }
+
+    @Override
+    public Result findByDataId(String sceneCode, Integer dataId) {
+        List<CutModelDto> data = getDataBySceneCode(sceneCode);
+        data =  data.stream().filter(p-> dataId.equals(p.getId())).collect(Collectors.toList());
+        return Result.success(data.get(0));
+    }
+
+    private List<CutModelDto> getDataBySceneCode(String sceneCode){
+        CutModelEntity entity = findById(sceneCode);
+        if (entity != null) {
+            return entity.getData();
+        }
+        return null;
+    }
+
+    private List<CutModelDto> initCutModelDto(String ossUrl, Integer id){
+        CutModelDto dto = new CutModelDto();
+        id = id == null ? 1 : id;
+        dto.setId(id);
+        dto.setJob_id(dto.getId());
+        dto.setName("pointCloudCropJob");
+        dto.setOutput("");
+        dto.setLast_output("");
+        dto.setBusy(false);
+        dto.setSuccess(true);
+        dto.setStatus(-1);
+        dto.setStart_time(System.currentTimeMillis());
+        dto.setEnd_time(System.currentTimeMillis());
+        dto.setTitle("");
+        dto.setErrors("");
+        dto.setOutput_file(ossUrl);
+        List<CutModelDto> list = new ArrayList<>();
+        list.add(dto);
+        return list;
+    }
+
+    private void ossUploadDir(String sceneCode, String uploadDir){
+        String ossTarget = "data/" +sceneCode + "/data/chunk1";
+        String cmd = CmdConstant.OSSUTIL_UPLOAD_DIR;
+        cmd = cmd.replaceAll("@uploadDir", uploadDir);
+        cmd = cmd.replaceAll("@target", ossTarget);
+        CmdUtils.ossUploadDir(cmd);
+        log.info("切图上传oss完成");
+    }
+
+
+    private String format(Double[] param){
+        StringBuilder buffer = new StringBuilder();
+        int flag = 1;
+        for (Double a : param) {
+            if (flag == 1) {
+                buffer.append(a);
+            } else {
+                buffer.append(" ").append(a);
+            }
+            flag ++;
+
+        }
+        return buffer.toString();
+
+    }
+
+    private CutModelEntity findById(String sceneCode){
+        Optional<CutModelEntity> op = entityMapper.findById(sceneCode);
+        return op.orElse(null);
+    }
+}

+ 5 - 2
laser/src/main/java/com/fdkankan/indoor/core/service/impl/FilterServiceImpl.java

@@ -169,8 +169,11 @@ public class FilterServiceImpl implements FilterService {
         log.info("排序数量-输出数量:{}", data.size());
 
         Integer limit = param.getLimit();
-        limit = limit==null ? 10 : limit;
-        data = data.stream().limit(limit).collect(Collectors.toList());
+        if (limit != null){
+            data = data.stream().limit(limit).collect(Collectors.toList());
+        }
+//        limit = limit==null ? 10 : limit;
+
 
 
         log.info("输出数量:{}", data.size());

+ 18 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/IBaseServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fdkankan.indoor.core.service.impl;
 
 import com.fdkankan.indoor.base.constant.ConfigConstant;
+import com.fdkankan.indoor.core.entity.dto.PageDto;
 import com.fdkankan.indoor.core.entity.dto.SecurityDto;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +51,23 @@ public class IBaseServiceImpl {
         dto.setGroup_write(1);
         return dto;
     }
+
+    /**
+     * 设置请求分页数据
+     */
+    public PageDto startPage(PageDto param){
+        Integer pageNum = param.getPageNum();
+        Integer pageSize = param.getPageSize();
+        if (pageNum == null || pageNum <= 0) {
+            param.setPageNum(0);
+
+        }
+        if (pageSize == null || pageSize <= 0) {
+            param.setPageSize(10);
+        }
+        return param;
+    }
+
 }
 
 

+ 138 - 68
laser/src/main/java/com/fdkankan/indoor/core/service/impl/InitServiceImpl.java

@@ -95,25 +95,50 @@ public class InitServiceImpl implements InitService {
      * @return
      */
     @Override
-    public Result initData(String sceneCode, String path, String from, String title) {
+    public Result initData(InitDto param) {
+        String from = param.getFrom();
+        log.info("来自【{}】 初始化", from);
 
+        String sceneCode = param.getSceneCode();
         if (StrUtil.isAllEmpty(sceneCode)) {
             return Result.failure("场景码不能为空");
         }
 
+        String path = param.getPath();
+        String title = param.getTitle();
+
         // 防止为四维看看重复调用重算
         InitEntity init = findById(sceneCode);
         if (init != null) {
+            log.info("初始化数据已存在: {}", sceneCode);
 //            if ("age".equals(from)){
 //                log.error("场景:[{}] 已存在,不需要重算", sceneCode);
 //                return Result.failure(MsgCode.e3001, "场景已存在,不需要重算:" + sceneCode);
 //            }
 
             // 重算
+
             if ("recount".equals(from)){
                 path = init.getPath();
                 title = init.getTitle();
             }
+        } else {
+            // 新场景
+            init = new InitEntity();
+            init.setId(sceneCode);
+            init.setPath(path);
+            init.setCreateTime(LocalDateTime.now());
+            init.setTitle(title);
+            init.setChildName(param.getChildName());
+            init.setSnCode(param.getSnCode());
+            init.setShootTime(param.getCreateTime());
+            init.setStatus(0);
+            // https://testlaser.4dkankan.com/maxkk/ + 场景码
+            init.setWebSite(configConstant.webSitePath + sceneCode);
+            init.setUserId(param.getUserId());
+
+            initMapper.save(init);
+
         }
 
         // 删除旧数据, 重算使用
@@ -154,6 +179,7 @@ public class InitServiceImpl implements InitService {
         // step9 创建 t_measurement表, 测量表,空数据
         createMeasurement(sceneCode);
 
+        log.info("================== 初始化第一步完成 ==================");
 
         /**
          * 这方法很重要, 会自动初始化initData2 的说有方法
@@ -172,81 +198,50 @@ public class InitServiceImpl implements InitService {
         }
 
 
+        init.setUpdateTime(LocalDateTime.now());
+        init.setTitle(title);
+        Integer recount = init.getRecount();
+        recount = recount == null ? 1 : recount + 1;
+        init.setRecount(recount);
+
+//        // 保存initDataStep1 状态
+//        if (init == null) {
+//             init = new InitEntity();
+//            init.setId(sceneCode);
+//            init.setPath(path);
+//            init.setCreateTime(LocalDateTime.now());
+//            init.setTitle(title);
+//            init.setChildName(param.getChildName());
+//            init.setSnCode(param.getSnCode());
+//            init.setShootTime(param.getCreateTime());
+//            // https://testlaser.4dkankan.com/maxkk/ + 场景码
+//            init.setWebSite(configConstant.webSitePath + sceneCode);
+//
+//        } else {
+//            init.setUpdateTime(LocalDateTime.now());
+//            init.setTitle(title);
+//            Integer recount = init.getRecount();
+//            recount = recount == null ? 1 : recount + 1;
+//            init.setRecount(recount);
+//        }
 
 
-        // 保存initDataStep1 状态
-        if (init == null) {
-             init = new InitEntity();
-            init.setId(sceneCode);
-            init.setPath(path);
-            init.setCreateTime(LocalDateTime.now());
-            init.setTitle(title);
-        } else {
-            init.setUpdateTime(LocalDateTime.now());
-            init.setTitle(title);
-            Integer recount = init.getRecount();
-            recount = recount == null ? 1 : recount + 1;
-            init.setRecount(recount);
-        }
 
-        init.setStatus(0);
-        initMapper.save(init);
 
         if (flag){
+            init.setStatus(1);
             log.info("完全初始化完成");
         } else {
             log.info("initDataStep_1处理完成");
+            init.setStatus(0);
         }
 
+        initMapper.save(init);
+
         return Result.success();
     }
 
-    /**
-     * 初始化控制点
-     * @param sceneCode
-     * @param laserDataPath
-     */
-    private void createControlPoint(String sceneCode, String laserDataPath) {
-        String path = laserDataPath + "/controlPoint.json";
-        if (!cn.hutool.core.io.FileUtil.exist(path)){
-            throw new BaseRuntimeException("控制点文件不存在: " + path);
-        }
-
-        String s = cn.hutool.core.io.FileUtil.readUtf8String(path);
-        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(s);
-        com.alibaba.fastjson.JSONArray points = jsonObject.getJSONArray("points");
-
-        com.alibaba.fastjson.JSONObject poi_1 = points.getJSONObject(0);
-        com.alibaba.fastjson.JSONObject poi_2 = points.getJSONObject(1);
-
-        // 第一个点  经度:lon:113, [0] 纬度:lat:22, [1]
-        double gpsLon_1 = poi_1.getJSONObject("coordinate").getDouble("longitude");
-        double gpsLat_1 = poi_1.getJSONObject("coordinate").getDouble("latitude");
-        double ageX_1 = poi_1.getJSONObject("location").getDouble("x");
-        double ageY_1 = poi_1.getJSONObject("location").getDouble("y");
-
-        // 第二个点
-        double gpsLon_2 = poi_2.getJSONObject("coordinate").getDouble("longitude");
-        double gpsLat_2 = poi_2.getJSONObject("coordinate").getDouble("latitude");
-        double ageX_2 = poi_2.getJSONObject("location").getDouble("x");
-        double ageY_2 = poi_2.getJSONObject("location").getDouble("y");
-
-        double[] gpsCoord1 = {gpsLon_1, gpsLat_1 };
-        double[] gpsCoord2 = { gpsLon_2, gpsLat_2};
-        double[] ageLocation1 = {ageX_1, ageY_1};
-        double[] ageLocation2 = {ageX_2, ageY_2};
-
-        ControlPointEntity entity = new ControlPointEntity();
-        entity.setGpsControlCoordinate1(gpsCoord1);
-        entity.setGpsControlCoordinate2(gpsCoord2);
-        entity.setAgeControlLocation1(ageLocation1);
-        entity.setAgeControlLocation2(ageLocation2);
 
-        entity.setId(sceneCode);
-        entity.setCreateTime(LocalDateTime.now());
-        controlPointService.save(entity);
-        log.info("controlPoint控制点初始化完成");
-    }
 
 
     /**
@@ -300,8 +295,26 @@ public class InitServiceImpl implements InitService {
     }
 
 
+    @Override
+    public void initSiteModel(String sceneCode){
+        // step1: 获取控制点
+        ControlPointEntity controlPoint = getControlPoint(sceneCode);
+        if (controlPoint == null){
+            throw new BaseRuntimeException("控制点不存在:" + sceneCode);
+        }
+
+        // step2: init数据路径
+        InitEntity initEntity = this.findById(sceneCode);
+        if (initEntity == null) {
+            throw new BaseRuntimeException("初始化数据不存在:" + sceneCode);
+        }
+        String path = initEntity.getPath();
+        path = path + "/laserData";
+
+        processCould(sceneCode, path, controlPoint);
 
 
+    }
 
 
     /**
@@ -315,7 +328,6 @@ public class InitServiceImpl implements InitService {
         dataSetService.remove(sceneCode);
         siteService.remove(sceneCode);
 
-
         log.info("删除initDataStep2数据完成");
     }
 
@@ -330,9 +342,13 @@ public class InitServiceImpl implements InitService {
         // 删除旧数据
 //        this.initRemove(sceneCode);
 
-
+        log.info("执行手动重新:{}", sceneCode);
         // 重新初始化数据, 地址在里面处理
-        this.initData(sceneCode, null, "recount", null);
+        InitDto initDto = new InitDto();
+        initDto.setSceneCode(sceneCode);
+        initDto.setFrom("recount");
+//        this.initData(sceneCode, null, "recount", null);
+        this.initData(initDto);
 
 
         // 记录重算日志
@@ -341,7 +357,7 @@ public class InitServiceImpl implements InitService {
         infoEntity.setSceneCode(sceneCode);
         infoEntity.setCreateTime(LocalDateTime.now());
         recountInfoService.save(infoEntity);
-
+        log.info("手动重新完成:{}", sceneCode);
         return Result.success();
     }
 
@@ -381,6 +397,53 @@ public class InitServiceImpl implements InitService {
     }
 
 
+    /**
+     * 初始化控制点
+     * @param sceneCode
+     * @param laserDataPath
+     */
+    private void createControlPoint(String sceneCode, String laserDataPath) {
+        String path = laserDataPath + "/controlPoint.json";
+        if (!cn.hutool.core.io.FileUtil.exist(path)){
+            throw new BaseRuntimeException("控制点文件不存在: " + path);
+        }
+
+        String s = cn.hutool.core.io.FileUtil.readUtf8String(path);
+        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(s);
+        com.alibaba.fastjson.JSONArray points = jsonObject.getJSONArray("points");
+
+        com.alibaba.fastjson.JSONObject poi_1 = points.getJSONObject(0);
+        com.alibaba.fastjson.JSONObject poi_2 = points.getJSONObject(1);
+
+        // 第一个点  经度:lon:113, [0] 纬度:lat:22, [1]
+        double gpsLon_1 = poi_1.getJSONObject("coordinate").getDouble("longitude");
+        double gpsLat_1 = poi_1.getJSONObject("coordinate").getDouble("latitude");
+        double ageX_1 = poi_1.getJSONObject("location").getDouble("x");
+        double ageY_1 = poi_1.getJSONObject("location").getDouble("y");
+
+        // 第二个点
+        double gpsLon_2 = poi_2.getJSONObject("coordinate").getDouble("longitude");
+        double gpsLat_2 = poi_2.getJSONObject("coordinate").getDouble("latitude");
+        double ageX_2 = poi_2.getJSONObject("location").getDouble("x");
+        double ageY_2 = poi_2.getJSONObject("location").getDouble("y");
+
+        double[] gpsCoord1 = {gpsLon_1, gpsLat_1 };
+        double[] gpsCoord2 = { gpsLon_2, gpsLat_2};
+        double[] ageLocation1 = {ageX_1, ageY_1};
+        double[] ageLocation2 = {ageX_2, ageY_2};
+
+        ControlPointEntity entity = new ControlPointEntity();
+        entity.setGpsControlCoordinate1(gpsCoord1);
+        entity.setGpsControlCoordinate2(gpsCoord2);
+        entity.setAgeControlLocation1(ageLocation1);
+        entity.setAgeControlLocation2(ageLocation2);
+
+        entity.setId(sceneCode);
+        entity.setCreateTime(LocalDateTime.now());
+        controlPointService.save(entity);
+        log.info("controlPoint控制点初始化完成");
+    }
+
     private void createMeasurement(String sceneCode) {
         MeasurementEntity entity = new MeasurementEntity();
         entity.setCreateTime(LocalDateTime.now());
@@ -625,10 +688,14 @@ public class InitServiceImpl implements InitService {
 
         });
 
-        log.info("更新后的siteModel值: {}", siteModels.toArray());
+//        log.info("更新后的siteModel值: {}", siteModels.toArray());
+        SiteModelEntity modelEntity = siteService.findById(sceneCode);
+        if (modelEntity != null) {
+            siteService.remove(sceneCode);
+        }
         SiteModelEntity entity = new SiteModelEntity();
         entity.setId(sceneCode);
-        entity.setUpdateTime(LocalDateTime.now());
+        entity.setCreateTime(LocalDateTime.now());
         // 默认热点为空
         entity.setData(siteModels);
         siteService.save(entity);
@@ -769,6 +836,9 @@ public class InitServiceImpl implements InitService {
 
         // 根据场景码查询特殊点
         SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_FIRST_VIEW);
+        if (sp == null) {
+            throw new BaseRuntimeException("firstView点不存在,请检查特殊点表或者检查createVisionToFilter方法初始化");
+        }
         Double[] poi = sp.getPoi();
         log.info("firstView: {}" , sp.getPoi());
 

+ 261 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/MapSmallServiceImpl.java

@@ -0,0 +1,261 @@
+package com.fdkankan.indoor.core.service.impl;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.fdkankan.indoor.base.constant.CmdConstant;
+import com.fdkankan.indoor.base.constant.MsgCode;
+import com.fdkankan.indoor.base.convert.ImageClipUtil;
+import com.fdkankan.indoor.base.exception.BaseRuntimeException;
+import com.fdkankan.indoor.base.util.CmdUtils;
+import com.fdkankan.indoor.base.util.MyFileUtil;
+import com.fdkankan.indoor.base.util.MyFileUtils;
+import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.MapEntity;
+import com.fdkankan.indoor.core.entity.MapSmallEntity;
+import com.fdkankan.indoor.core.entity.dto.MapDto;
+import com.fdkankan.indoor.core.entity.dto.MapSmallDto;
+import com.fdkankan.indoor.core.entity.po.MapPo;
+import com.fdkankan.indoor.core.mapper.MapMapper;
+import com.fdkankan.indoor.core.mapper.MapSmallMapper;
+import com.fdkankan.indoor.core.service.MapService;
+import com.fdkankan.indoor.core.service.MapSmallService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * Created by owen on 2021/7/28 0028 20:05
+ */
+@Service
+@Slf4j
+public class MapSmallServiceImpl extends IBaseServiceImpl implements MapSmallService {
+
+    @Autowired
+    MapSmallMapper entityMapper;
+
+    @Override
+    public Result upload(String sceneCode, Map<String, MultipartFile> files) {
+        if (files == null) {
+            throw new BaseRuntimeException(5003, "文件不能为空");
+        }
+
+//        String basePath = configConstant.serverBasePath + "/" + sceneCode +"/mapSmall";
+        String basePath = configConstant.serverBasePath + File.separator + sceneCode + File.separator + "mapSmall";
+        String returnBasePath = "/maxkk/"  + sceneCode +"/mapSmall/";
+        log.info("小地图保存路径: {}", basePath);
+        List<String> path = new ArrayList<>();
+
+        MapSmallEntity entity = findById(sceneCode);
+        if (entity != null) {
+            // 删除旧数据, 重新上传 , 目录结尾是否有斜杠,会影响删除效果
+            log.info("删除目录:{}", basePath);
+            FileUtil.del(basePath);
+//            FileUtil.del(new File(basePath));
+        }
+
+       basePath =  basePath + "/";
+
+        int size = files.size();
+        // 只有一张时,使用切图工具切图
+        if (size == 1) {
+            for (Map.Entry<String, MultipartFile> entry : files.entrySet()){
+                String key = entry.getKey();
+                // 处理多级目录
+
+                if (key.contains("/") ) {
+                    key = StrUtil.subAfter(key, "/", true);
+                }
+                log.info("文件名:{}", key );
+                MultipartFile file = entry.getValue();
+//                String originalFilename = file.getOriginalFilename();
+                String savePath = basePath + key;
+                saveFile(file, savePath);
+
+                // step2: 切小地图
+                clipImage(savePath, basePath);
+
+                // step3: 把原图删除
+                log.info("删除原文件: {}", savePath);
+//                FileUtil.del(new File(savePath));
+                FileUtil.del(savePath);
+
+
+                // 获取小地图路径
+                path = tilePath(basePath, sceneCode);
+
+
+            }
+        } else {
+            // 上传文件
+            for (Map.Entry<String, MultipartFile> entry : files.entrySet()){
+                String key = entry.getKey();
+                MultipartFile file = entry.getValue();
+                String savePath = basePath + key;
+                saveFile(file, savePath);
+
+                // 存路径
+                path.add(returnBasePath + key);
+            }
+        }
+
+
+
+
+        log.info("小地图上传成功");
+
+
+        // 保存数据库
+        if (entity == null) {
+            entity = new MapSmallEntity();
+            entity.setId(sceneCode);
+            entity.setPath(path);
+            entity.setCreateTime(LocalDateTime.now());
+        } else {
+            entity.setPath(path);
+            entity.setUpdateTime(LocalDateTime.now());
+        }
+
+        entityMapper.save(entity);
+        return Result.success(findById(sceneCode));
+    }
+
+
+    /**
+     * 递归获取剪切后图片地址
+     * filterName 过滤这个文件
+     */
+    private List<String> tilePath(String inPath, String sceneCode){
+        if (FileUtil.isDirEmpty(new File(inPath))){
+            log.info("切图后的目录: {}", inPath);
+            throw new BaseRuntimeException("目录为空");
+        }
+
+
+        return eachFile(inPath,sceneCode);
+    }
+
+    private void clipImage(String inPath, String outTilePath){
+
+        log.info("tile: {}", outTilePath);
+        ImageClipUtil.getTiles(inPath, outTilePath);//切片
+        log.info("切图完成");
+
+    }
+
+    /**
+     *
+     * @param file
+     * @param path 保存路径+文件名
+     */
+    private void saveFile(MultipartFile file, String path){
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), path);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private MapSmallEntity findById(String sceneCode){
+        Optional<MapSmallEntity> op = entityMapper.findById(sceneCode);
+        return op.orElse(null);
+
+    }
+
+    @Override
+    public void remove(String sceneCode) {
+        entityMapper.deleteById(sceneCode);
+    }
+
+    @Override
+    public Result updateCoord(String sceneCode, MapSmallDto param) {
+
+
+        MapSmallEntity entity = findById(sceneCode);
+        if (entity == null) {
+            entity = new MapSmallEntity();
+            entity.setId(sceneCode);
+            entity.setCreateTime(LocalDateTime.now());
+        }
+        entity.setPosition(param.getParam());
+        entity.setUpdateTime(LocalDateTime.now());
+
+        entityMapper.save(entity);
+
+        return Result.success(findById(sceneCode));
+    }
+
+    @Override
+    public Result detail(String sceneCode) {
+        return Result.success(findById(sceneCode));
+    }
+
+
+    /***
+     * 遍历每一个文件路径
+     * dirPath :目录路径
+     * eachFile
+     * filterName: 过滤的文件名
+     * sceneCode: 用来做截取标识
+     *
+     * String returnBasePath = "/maxkk/"  + sceneCode +"/mapSmall/";
+     */
+    public static List<String> eachFile(String dirPath, String sceneCode)  {
+        File file = new File(dirPath);
+        List<String> path = new ArrayList<>();
+        dfs(file, path, sceneCode);
+        return path;
+    }
+
+
+    /**
+     * 递归解析
+     * @param file
+     * @return
+     * @throws IOException
+     * cutPath : 用来做截取标识
+     */
+    public static void dfs(File file, List<String> path, String cutPath)  {
+
+        File[] files = file.listFiles();
+
+        for (File every : files) {
+            // 是文件
+            if (every.isFile()) {
+
+                String filePath = every.getAbsolutePath();
+                // 需求截取成相对路径
+                filePath = StrUtil.subAfter(filePath, cutPath, true);
+//                if (filePath.contains("mapSmall" + File.separator + filterName)) {
+//                    log.info("filterName: {}", filePath);
+//                    continue;
+//                }
+                filePath = "/maxkk/"  + cutPath  + filePath;
+                path.add(filePath);
+
+
+                // 是目录
+            } else {
+                dfs(every, path, cutPath);
+            }
+
+        }
+    }
+
+
+    @Test
+    public void testDel(){
+        String path = "F:\\test\\ngin\\age_camera_germany_data\\t30\\mapSmall";
+        FileUtil.del(new File(path));
+    }
+
+
+}

+ 25 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/OwenServiceImpl.java

@@ -3,7 +3,9 @@ package com.fdkankan.indoor.core.service.impl;
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.indoor.base.constant.CmdConstant;
 import com.fdkankan.indoor.base.constant.ConfigConstant;
+import com.fdkankan.indoor.base.util.CmdUtils;
 import com.fdkankan.indoor.base.util.Result;
 import com.fdkankan.indoor.core.entity.ControlPointEntity;
 import com.fdkankan.indoor.core.entity.OwenEntity;
@@ -38,6 +40,11 @@ public class OwenServiceImpl implements OwenService {
     @Autowired
     PoiTypeGroupService poiTypeGroupService;
 
+
+
+
+
+
     /**
      * save: 新增或修改,若id存在侧修改, id不存在则新增
      * @param
@@ -140,5 +147,23 @@ public class OwenServiceImpl implements OwenService {
         return Result.success(entity);
     }
 
+    @Override
+    public Result cutModel(String sceneCode) {
+        String cmd = CmdConstant.CUT_MODEL;
+        String basePath = "/mnt/data/00001002/872819408496492544/74ee2a39e656_202108051135248650/results/laserData/";
+        String inPath = basePath + "laser.las";
+        String outPath = basePath + "indoor_cut.las";
+        String cutParam = basePath + "cut_param.json";
+
+        cmd = cmd.replace("@inPath", inPath);
+        cmd = cmd.replace("@outPath", outPath);
+        cmd = cmd.replace("@cutParam", cutParam);
+
+//        log.info("剪切模型cmd: {}", cmd);
+        CmdUtils.callLineSh(cmd);
+
+        return Result.success(cmd);
+    }
+
 
 }

+ 15 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.data.mongodb.core.query.Query;
 import org.springframework.data.mongodb.core.query.Update;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -45,6 +46,20 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
         entityMapper.deleteById(sceneCode);
     }
 
+    @Override
+    public Result deleteByDataId(String sceneCode, Integer dataId) {
+        PoiEntity entity = findById(sceneCode);
+        List<PoiHotDto> data = entity.getData();
+        data = data.stream().filter(p -> !dataId.equals(p.getId())).collect(Collectors.toList());
+
+        entity.setData(data);
+        entity.setUpdateTime(LocalDateTime.now());
+
+        this.save(entity);
+
+        return Result.success();
+    }
+
 
     @Override
     public Result findBySceneCodeAndId(String code, Integer id) {

+ 2 - 2
laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiTypeGroupServiceImpl.java

@@ -56,7 +56,7 @@ public class PoiTypeGroupServiceImpl extends IBaseServiceImpl implements PoiType
         List<PoiTypeGroupDto> data = entity.getData();
         // 最大id
         Integer maxId = 0;
-        if (data.size() == 0){
+        if (data.size() != 0){
 
             // 遍历参数,获取id, 保存新list
             List<Integer> collectId = param.stream().map(PoiTypeGroupDto::getId).collect(Collectors.toList());
@@ -91,7 +91,7 @@ public class PoiTypeGroupServiceImpl extends IBaseServiceImpl implements PoiType
         // 更新后数据保存数据库
         entity.setData(data);
 
-        save(entity);
+        this.save(entity);
 
         List<PoiTypeGroupDto> newData = changeById(sceneCode, resIds);
         if (isLogin()){

+ 7 - 1
laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiTypeServiceImpl.java

@@ -44,13 +44,19 @@ public class PoiTypeServiceImpl implements PoiTypeService {
     @Autowired
     PoiTypeMapper entityMapper;
 
+    /**
+     * 有id则修改, 否则新增
+     * @param sceneCode
+     * @param param
+     * @return
+     */
     @Override
     public Result edit(String sceneCode, List<PoiTypeDto> param) {
         PoiTypeEntity vo = findById(sceneCode);
         List<PoiTypeDto> data = vo.getData();
 
         Integer maxId = 0;
-        if (data.size() == 0){
+        if (data.size() != 0){
 
             // 遍历参数,获取id, 保存新list
             List<Integer> collectId = param.stream().map(PoiTypeDto::getId).collect(Collectors.toList());

+ 79 - 10
laser/src/main/java/com/fdkankan/indoor/core/service/impl/SceneServiceImpl.java

@@ -1,27 +1,96 @@
 package com.fdkankan.indoor.core.service.impl;
 
-import com.fdkankan.indoor.base.util.RandomUtils;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.PageUtil;
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.InitEntity;
+import com.fdkankan.indoor.core.entity.dto.PageDto;
+import com.fdkankan.indoor.core.entity.dto.SceneAgePageDto;
+import com.fdkankan.indoor.core.entity.vo.ResponseScene;
+import com.fdkankan.indoor.core.mapper.InitMapper;
+import com.fdkankan.indoor.core.service.InitService;
 import com.fdkankan.indoor.core.service.SceneService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.*;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
 /**
  * Created by owen on 2021/7/26 0026 9:05
  */
 @Slf4j
 @Service
-public class SceneServiceImpl implements SceneService {
-    @Override
-    public Result createSceneCode() {
-        Object laser = RandomUtils.createCode(9, "laser_");
-        log.info("sceneCode: {}", laser);
-        return Result.success(laser);
-    }
+public class SceneServiceImpl extends IBaseServiceImpl implements SceneService {
+
+
+    @Autowired
+    InitService initService;
+
+    @Autowired
+    InitMapper initMapper;
+
 
     @Override
-    public Result batchSceneCod() {
+    public Result list(SceneAgePageDto param) {
+        PageDto pageDto = new PageDto();
+        pageDto = startPage(pageDto);
+        param.setPageNum(pageDto.getPageNum());
+        param.setPageSize(pageDto.getPageSize());
+
+        // 这里的"recordNo"是实体类的主键,记住一定要是实体类的属性,而不能是数据库的字段
+        Sort sort = Sort.by(Sort.Direction.DESC, "createTime");
+        // (当前页, 每页记录数, 排序方式)
+        Pageable pageable = PageRequest.of(param.getPageNum() , param.getPageSize(), sort);
+
+        // 查询条件
+        InitEntity search = new InitEntity();
+        search.setTitle(param.getSearchKey());
+        // 必要的查询条件
+        search.setUserId(param.getUserId());
 
-        return null;
+        // 模糊查询条件
+        // 参考:https://blog.csdn.net/wonder_dog/article/details/82319216
+        ExampleMatcher matcher = ExampleMatcher.matching()
+                .withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING)  // 改变默认字符串匹配方式:模糊查询
+                .withIgnoreCase(true) // 改变默认大小写忽略方式: 忽略大小写
+                .withMatcher("title", ExampleMatcher.GenericPropertyMatchers.contains()); // 采用包含匹配
+
+
+        Example<InitEntity> example = Example.of(search, matcher);
+
+        // 分页查询
+//        Page<InitEntity> all = initMapper.findAll(pageable);
+        // 分页模糊查询
+        Page<InitEntity> all = initMapper.findAll(example, pageable);
+
+        // 转换对象, 可以有简写,等习惯后再改, 使用箭头函数
+        // 参考:https://www.136.la/shida/show-162572.html
+        Page<ResponseScene> map = all.map((new Function<InitEntity, ResponseScene>() {
+            @Override
+            public ResponseScene apply(InitEntity initEntity) {
+                ResponseScene scene = new ResponseScene();
+                scene.setNum(initEntity.getId());
+                scene.setWebSite(initEntity.getWebSite());
+                // 先用这个,到时要改成shootTime;
+                String createTime = DateUtil.format(initEntity.getCreateTime(), "yyyy-MM-dd HH:mm:ss");
+                scene.setCreateTime(createTime);
+                scene.setSnCode(initEntity.getSnCode());
+                scene.setChildName(initEntity.getChildName());
+                scene.setSceneName(initEntity.getTitle());
+
+                return scene;
+            }
+        }));
+
+        return Result.success(map);
     }
+
+
+
 }

+ 57 - 35
laser/src/main/java/com/fdkankan/indoor/core/service/impl/SiteServiceImpl.java

@@ -5,11 +5,15 @@ import com.fdkankan.indoor.base.convert.DistanceUtil;
 import com.fdkankan.indoor.base.exception.BaseRuntimeException;
 import com.fdkankan.indoor.base.util.GisUtils;
 import com.fdkankan.indoor.base.util.Result;
+import com.fdkankan.indoor.core.entity.ControlPointEntity;
 import com.fdkankan.indoor.core.entity.SiteModelEntity;
+import com.fdkankan.indoor.core.entity.dto.PoiTypeDto;
 import com.fdkankan.indoor.core.entity.dto.SiteDto;
 import com.fdkankan.indoor.core.entity.dto.SiteModelSearchDto;
 import com.fdkankan.indoor.core.entity.dto.SitePolygon;
 import com.fdkankan.indoor.core.mapper.SiteModelMapper;
+import com.fdkankan.indoor.core.service.ControlPointService;
+import com.fdkankan.indoor.core.service.InitService;
 import com.fdkankan.indoor.core.service.SiteService;
 import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
 import lombok.extern.slf4j.Slf4j;
@@ -22,6 +26,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.awt.geom.Point2D;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -38,6 +43,12 @@ public class SiteServiceImpl implements SiteService {
     @Autowired
     SiteModelMapper entityMapper;
 
+    @Autowired
+    ControlPointService controlPointService;
+
+    @Autowired
+    InitService initService;
+
     @Override
     public Result findBySceneCodeAndId(String sceneCode, Long id) {
         List list = getDataBySceneCode(sceneCode);
@@ -221,42 +232,53 @@ public class SiteServiceImpl implements SiteService {
         }
 
 
-//        System.out.println();
         return result;
     }
 
-//    /**
-//     * 递归获取对象id
-//     * @param siteDto
-//     * @return
-//     */
-//
-//    private Object test(){
-//        List<Integer> result = new ArrayList<>();
-//        // 父id符合, 子id必须加入
-//        boolean flag = false;
-//        SiteDto siteDto = new SiteDto();
-//        getRecursionIdAndSonId(siteDto);
-//
-//        return null;
-//    }
-//
-//    private void getRecursionIdAndSonId(SiteDto siteDto , boolean flag, List<Integer> result, Integer site_model_entity){
-//        Integer floorId = siteDto.getId();
-//
-//        if (flag) {
-//            result.add(floorId);
-//        } else {
-//            if (site_model_entity.equals(floorId)) {
-//                result.add(floorId);
-//                flag = true;
-//            }
-//        }
-//        if (siteDto.getChildren().size() > 0){
-//            getRecursionIdAndSonId()
-//        }
-//    }
+    @Override
+    public Result updateByDataId(String sceneCode, List<SiteDto> param) {
+        SiteModelEntity entity = findById(sceneCode);
+        List<SiteDto> data = entity.getData();
+
+
+        if (data.size() != 0){
+            // 遍历参数,获取id, 保存新list
+            List<Integer> collectId = param.stream().map(SiteDto::getId).collect(Collectors.toList());
+            log.info("参数id: {}", collectId);
+            // 判断原数据是否包含参数里的id, 包含则删除后重新添加
+            data = data.stream().filter(p -> !collectId.contains(p.getId())).collect(Collectors.toList());
+            log.info("过滤后数量: {}", data.size());
+        }
+
+       // 把更新后的数据添加到原数据
+        data.addAll(param);
+
+        entity.setData(data);
+        entity.setUpdateTime(LocalDateTime.now());
+
+        this.save(entity);
+
+        // 前端要求, 返回规定值
+        JSONObject res = new JSONObject();
+        res.put("site_model_error_list", new ArrayList<>());
+
+        return Result.success(res);
+    }
+
+    @Override
+    public Result findAll(String sceneCode) {
+        List<SiteDto> data = getDataBySceneCode(sceneCode);
+        return Result.success(data);
+    }
 
+    @Override
+    public Result initSiteModel(String sceneCode) {
+
+        initService.initSiteModel(sceneCode);
+        log.info("初始化siteModel完成: " + sceneCode);
+
+        return Result.success(getDataBySceneCode(sceneCode));
+    }
 
 
     // 判断的坐标在那个空间位置
@@ -388,11 +410,11 @@ public class SiteServiceImpl implements SiteService {
     }
 
 
-
-    private SiteModelEntity findById(String sceneCode){
+    @Override
+    public SiteModelEntity findById(String sceneCode){
         Optional<SiteModelEntity> optional = entityMapper.findById(sceneCode);
         if (!optional.isPresent()){
-            throw new BaseRuntimeException("SiteModel数据不存在");
+            throw new BaseRuntimeException("SiteModel数据不存在");
         }
         return optional.get();
     }

+ 4 - 1
laser/src/main/resources/application-dev.properties

@@ -26,4 +26,7 @@ oss.bucket=laser-data
 #oss.type=oss
 # \u524D\u7F00\u76EE\u5F55
 oss.file.path=data
-oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+
+# \u573A\u666F\u94FE\u63A5
+web.site=https://testlaser.4dkankan.com/maxkk/

+ 5 - 1
laser/src/main/resources/application-sit.properties

@@ -25,4 +25,8 @@ oss.bucket=laser-data
 #oss.type=oss
 # \u524D\u7F00\u76EE\u5F55
 oss.file.path=data
-oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+#oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+oss.domain=https://laser.4dkankan.com/
+
+# \u573A\u666F\u94FE\u63A5
+web.site=https://testlaser.4dkankan.com/maxkk/

+ 4 - 0
laser/src/main/resources/data/cut_param.json

@@ -0,0 +1,4 @@
+{
+  "aabb": "b-0.5 -0.5 -0.5 0.5 0.5 0.5",
+  "cut_transformation": "b@"
+}