wuweihao 4 年 前
コミット
348b040ba5

+ 7 - 1
README.md

@@ -101,5 +101,11 @@ aa-p307mDm
 db.getCollection('t_special_point').find({"sceneCode":"t-RJlwqtc"})
 
 
-t-gWKRICl
+t-gWKRICl /mnt/data/00001002/872519700045627392/74ee2a39e656_202108041610248900/results
+
+
+t-RJlwqtc /mnt/data/00001002/872519700045627392/74ee2a39e656_202108041610248900/results
+
+
+t-p307mDm
              

+ 73 - 20
laser/src/main/java/com/fdkankan/indoor/base/convert/ModifyCloud.java

@@ -14,23 +14,31 @@ public class ModifyCloud {
 
 //	public static String inputFilePath = "F:\\2021\\navvis\\���Ի���\\data\\cloud.js";
 //	public static String inputFilePath = "F:\\test\\project\\age_laser\\cloud.js";
-	
+
+
+	/**
+	 * 修改cloud.js 文件
+	 * @param path
+	 * @return
+	 * @throws IOException
+	 */
 	public static JSONObject fixCloud(String path) throws IOException {
 		String str = FileUtil.readStringFile(path);
 		JSONObject json = JSONObject.fromObject(str);
 		
-		String[] pointAttributes = {
-		                            "POSITION_CARTESIAN",
-		                            "COLOR_PACKED",
-		                            "NORMAL_OCT16"
-									};
 //		String[] pointAttributes = {
-//				"POSITION_CARTESIAN",
-//				"COLOR_PACKED",
-//				"NORMAL_OCT16",
-//				"INTENSITY",
-//				"CLASSIFICATION"
-//		};
+//		                            "POSITION_CARTESIAN",
+//		                            "COLOR_PACKED",
+//		                            "NORMAL_OCT16"
+//									};
+
+		String[] pointAttributes = {
+				"POSITION_CARTESIAN",
+				"COLOR_PACKED",
+				"NORMAL_OCT16",
+				"INTENSITY",
+				"CLASSIFICATION"
+		};
 		json.put("pointAttributes", pointAttributes);
 		return json;
 	}
@@ -44,8 +52,8 @@ public class ModifyCloud {
 		result.put("maxZ", boundingBox.getDouble("uz"));
 		
 		result.put("minX", boundingBox.getDouble("lx"));
-		result.put("minY", boundingBox.getDouble("lx"));
-		result.put("minZ", boundingBox.getDouble("lx"));
+		result.put("minY", boundingBox.getDouble("ly"));
+		result.put("minZ", boundingBox.getDouble("lz"));
 		
 		result.put("centreX", (boundingBox.getDouble("lx")+boundingBox.getDouble("ux"))/2);
 		result.put("centreY", (boundingBox.getDouble("ly")+boundingBox.getDouble("uy"))/2);
@@ -106,7 +114,16 @@ public class ModifyCloud {
 		result.put("centre", newCentre);
 		return result;
 	}
-	
+
+
+    /**
+     * 2021-08-05
+	 * 测试本地 cloud.js
+	 * 获取特殊点:原点、boundingBox_max、boundingBox_min、中心点
+	 *
+	 *
+     * @param args
+     */
 	public static void main(String args[]) {
 		String inputFilePath = "F:\\test\\project\\age_laser\\laserData\\webcloud\\cloud.js";
 		try
@@ -122,13 +139,37 @@ public class ModifyCloud {
 			 */
 			JSONObject boundingbox = getBoundingBox(info);
 
-			Object minZ = boundingbox.get("minZ");
+            JSONObject boundingBox = ModifyCloud.getBoundingBox(info);
+            Double maxX = boundingBox.getDouble("maxX");
+            Double maxY = boundingBox.getDouble("maxY");
+            Double maxZ = boundingBox.getDouble("maxZ");
 
+            Double minX = boundingBox.getDouble("minX");
+            Double minY = boundingBox.getDouble("minY");
+            Double minZ = boundingBox.getDouble("minZ");
 
-			JSONObject resJson = convertFromBoundingBox(boundingbox);//boundingbox_min,boundingbox_max,centre
-			Object max = resJson.get("max");
-			Object min = resJson.get("min");
-			Object centre = resJson.get("centre");
+            Double centreX = boundingBox.getDouble("centreX");
+            Double centreY = boundingBox.getDouble("centreY");
+            Double centreZ = boundingBox.getDouble("centreZ");
+
+
+            // 虚拟点坐标(四维看看坐标)
+            Double[] ageMax = {maxX,maxY,maxZ};
+            Double[] ageMin = {minX,minY,minZ};
+            Double[] ageCentre = {centreX,centreY,centreZ};
+
+            JSONObject resJson = ModifyCloud.convertFromBoundingBox(boundingBox);
+
+            Double[] gpsMax = getKey1(resJson, "max");
+            Double[] gpsMin = getKey1(resJson, "min");
+            Double[] gpsCentre = getKey1(resJson, "centre");
+
+
+
+			JSONObject gpsJson = convertFromBoundingBox(boundingbox);//boundingbox_min,boundingbox_max,centre
+			Object max = gpsJson.get("max");
+			Object min = gpsJson.get("min");
+			Object centre = gpsJson.get("centre");
 
 			JSONArray object = resJson.getJSONArray("max");
 			System.out.println();
@@ -144,4 +185,16 @@ public class ModifyCloud {
 		}
 
 	}
+
+    /**
+     * json数组转 double[]
+     * @param resJson
+     * @param key
+     * @return
+     */
+    private static Double[] getKey1(JSONObject resJson , String key){
+        JSONArray array = resJson.getJSONArray(key);
+        Double[] res = {array.getDouble(0), array.getDouble(1)};
+        return res;
+    }
 }

+ 1 - 1
laser/src/main/java/com/fdkankan/indoor/base/convert/ModifyDataSets.java

@@ -93,7 +93,7 @@ public class ModifyDataSets {
 		// 默认true
 		po.setSecurity(securityDto);
 
-		po.setId(0);
+		po.setId(1);
 		po.setBundle_id(1);
 		po.setType("4dage");
 		po.setName("chunk1");

+ 7 - 3
laser/src/main/java/com/fdkankan/indoor/core/controller/ControlPointController.java

@@ -3,7 +3,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.ControlPointEntity;
-import com.fdkankan.indoor.core.service.ConfigService;
 import com.fdkankan.indoor.core.service.ControlPointService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -15,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
  */
 @Api(tags = "控制点管理")
 @RestController
-//@RequestMapping("indoor/api/controlPoint")
 public class ControlPointController {
 
     @Autowired
@@ -58,5 +56,11 @@ public class ControlPointController {
     }
 
 
-
+    @WebControllerLog(description = "本地调试控制点")
+    @ApiOperation(value = "本地调试控制点")
+    @PostMapping("indoor/{sceneCode}/api/controlPoint/test")
+    public Result test(@PathVariable String sceneCode,  @RequestBody ControlPointEntity param) {
+        param.setId(sceneCode);
+        return entityService.testControlPoint(param);
+    }
 }

+ 7 - 0
laser/src/main/java/com/fdkankan/indoor/core/controller/InitController.java

@@ -54,4 +54,11 @@ public class InitController {
     public Result initRecount(@PathVariable String sceneCode){
         return  initService.initRecount(sceneCode);
     }
+
+    @WebControllerLog(description = "查询")
+    @ApiOperation(value = "查询")
+    @GetMapping("indoor/{sceneCode}/api/findById")
+    public Result findById(@PathVariable String sceneCode){
+        return  Result.success(initService.findById(sceneCode));
+    }
 }

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

@@ -16,4 +16,6 @@ public interface ControlPointService {
     Result unInitList();
 
     void remove(String sceneCode);
+
+    Result testControlPoint(ControlPointEntity param);
 }

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

@@ -22,4 +22,6 @@ public interface InitService {
     Result initRecount(String sceneCode);
 
     Result testRemove(String sceneCode);
+
+    void testInitDataStep2(String id);
 }

+ 14 - 0
laser/src/main/java/com/fdkankan/indoor/core/service/impl/ControlPointServiceImpl.java

@@ -88,4 +88,18 @@ public class ControlPointServiceImpl implements ControlPointService {
     public void remove(String sceneCode) {
         entityMapper.deleteById(sceneCode);
     }
+
+    @Override
+    public Result testControlPoint(ControlPointEntity param) {
+        param.setUpdateTime(LocalDateTime.now());
+        entityMapper.save(param);
+        log.info("控制点保存完成");
+
+        // 初始化step2 数据
+        // 场景码
+        String id = param.getId();
+        initService.testInitDataStep2(id);
+        log.info("初始化step2 完成");
+        return Result.success();
+    }
 }

+ 9 - 7
laser/src/main/java/com/fdkankan/indoor/core/service/impl/DataSetServiceImpl.java

@@ -50,10 +50,8 @@ public class DataSetServiceImpl extends IBaseServiceImpl implements DataSetServi
         log.info("db数据量: {}", data.size());
 
 
-        Integer maxId;
-        if (data.size() == 0){
-            maxId = 0;
-        } else {
+        Integer maxId = 0;
+        if (data.size() != 0){
             // 将热点id提取出来做过滤条件
             List<Integer> argIds = param.stream().map(DataSetPo::getId).collect(Collectors.toList());
             log.info("参数id数量: {}", argIds.size());
@@ -61,9 +59,13 @@ public class DataSetServiceImpl extends IBaseServiceImpl implements DataSetServi
             data = data.stream().filter(p -> !argIds.contains(p.getId())).collect(Collectors.toList());
             log.info("不需要更新的数据量: {}", data.size());
 
-            // 获取最大id
-            Optional<DataSetPo> max = data.stream().max(Comparator.comparingInt(DataSetPo::getId));
-            maxId = max.get().getId();
+            // 过滤后数据为空
+            if (data.size() != 0){
+                // 获取最大id
+                Optional<DataSetPo> max = data.stream().max(Comparator.comparingInt(DataSetPo::getId));
+                maxId = max.get().getId();
+            }
+
         }
 
         // 合并两个流, 处理id

+ 8 - 7
laser/src/main/java/com/fdkankan/indoor/core/service/impl/FilterServiceImpl.java

@@ -164,10 +164,8 @@ public class FilterServiceImpl implements FilterService {
         List<FilterHotDto> data = entity.getData();
         log.info("db数据量: {}", data.size());
 
-        Integer maxId;
-        if (data.size() == 0){
-            maxId = 0;
-        } else {
+        Integer maxId = 0;
+        if (data.size() != 0){
             // 将热点id提取出来做过滤条件
             List<Integer> argIds = param.stream().map(FilterHotDto::getId).collect(Collectors.toList());
             log.info("参数id数量: {}", argIds.size());
@@ -175,9 +173,12 @@ public class FilterServiceImpl implements FilterService {
             data = data.stream().filter(p -> !argIds.contains(p.getId())).collect(Collectors.toList());
             log.info("不需要更新的数据量: {}", data.size());
 
-            // 获取最大id
-            Optional<FilterHotDto> max = data.stream().max(Comparator.comparingInt(FilterHotDto::getId));
-            maxId = max.get().getId();
+            // 过滤后数据为空
+            if (data.size() != 0){
+                // 获取最大id
+                Optional<FilterHotDto> max = data.stream().max(Comparator.comparingInt(FilterHotDto::getId));
+                maxId = max.get().getId();
+            }
         }
 
         // 合并两个流, 处理id

+ 85 - 36
laser/src/main/java/com/fdkankan/indoor/core/service/impl/InitServiceImpl.java

@@ -95,26 +95,28 @@ public class InitServiceImpl implements InitService {
     @Override
     public Result initData(String sceneCode, String path, String from) {
 
-        if (StrUtil.isAllEmpty(sceneCode) || StrUtil.isAllEmpty(path)) {
-            return Result.failure("场景码或路径不能为空");
+        if (StrUtil.isAllEmpty(sceneCode)) {
+            return Result.failure("场景码不能为空");
         }
 
         // 防止为四维看看重复调用重算
-        InitEntity init = this.findById(sceneCode);
-        if ("age".equals(from)){
-            if (init != null){
+        InitEntity init = findById(sceneCode);
+        if (init != null) {
+            if ("age".equals(from)){
                 log.error("场景:[{}] 已存在,不需要重算", sceneCode);
-                return Result.success();
+                return Result.failure(MsgCode.e3001, "场景已存在,不需要重算:" + sceneCode);
             }
-        }
 
-        // 重算
-        if ("recount".equals(from)){
-            path = init.getPath();
+            // 重算
+            if ("recount".equals(from)){
+                path = init.getPath();
+            }
         }
 
-
-
+        // 路径在这里检测
+        if (StrUtil.isAllEmpty(path)) {
+            return Result.failure("路径不能为空");
+        }
 
 
         String laserDataPath = path + "/laserData";
@@ -126,10 +128,10 @@ public class InitServiceImpl implements InitService {
         // step3 创建poi表, 热点,默认没有
         createPoi(sceneCode);
 
-        // step4 创建poi_type表
+        // step4 创建poi_type表, 使用的是模板初始化
         createPoiType(sceneCode);
 
-        // step5 创建poi_type_group表
+        // step5 创建poi_type_group表, 使用的是模板初始化
         createPoiTypeGroup(sceneCode);
 
         // step7 复制静态资源
@@ -161,6 +163,7 @@ public class InitServiceImpl implements InitService {
 
 
     /**
+     * 这个方法可以本地调试
      * 需要控制点,才能完成以下操作
      * 重新输入控制点时, 把相应数据删除, 重新初始化
      *
@@ -175,9 +178,6 @@ public class InitServiceImpl implements InitService {
             throw new BaseRuntimeException(MsgCode.e3001,"此场景的数据初始化不存在");
         }
         InitEntity init = optional.get();
-//        if (init.getStatus() !=0) {
-//            throw new BaseRuntimeException("数据初始化失败");
-//        }
 
         // 输入控制点,需要删除旧数据,重新初始化
         removeInitDataStep2(sceneCode);
@@ -192,13 +192,13 @@ public class InitServiceImpl implements InitService {
         // step1: 处理vision.txt 创建filter表, 处理特殊点:firstView
         createFilter(sceneCode, laserDataPath, controlPoint);
 
-        // step2 处理could.js 创建site_model, 处理原点、中心点、最大点、最小点
+        // step2 处理could.js 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
         processCould(sceneCode, laserDataPath, controlPoint);
 
-        // step6 创建t_configs表 , 需要firstView;
+        // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
         createConfig(sceneCode);
 
-        // step7 创建t_datasets表, 需要处理原点之后执行
+        // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行
         createDataSet(sceneCode);
 
 
@@ -222,6 +222,9 @@ public class InitServiceImpl implements InitService {
         specialPointService.remove(sceneCode);
         configService.remove(sceneCode);
         dataSetService.remove(sceneCode);
+        siteService.remove(sceneCode);
+
+
         log.info("删除initDataStep2数据完成");
     }
 
@@ -304,10 +307,7 @@ public class InitServiceImpl implements InitService {
     @Override
     public InitEntity findById(String id) {
         Optional<InitEntity> optional = initMapper.findById(id);
-        if (!optional.isPresent()){
-            throw new BaseRuntimeException(MsgCode.e3001, "初始化数据不存在");
-        }
-        return optional.get();
+        return optional.orElse(null);
     }
 
     @Override
@@ -337,7 +337,50 @@ public class InitServiceImpl implements InitService {
         return Result.success();
     }
 
+    @Override
+    public void testInitDataStep2(String sceneCode) {
+
+        Optional<InitEntity> optional = initMapper.findById(sceneCode);
+        if (!optional.isPresent()){
+            throw new BaseRuntimeException(MsgCode.e3001,"此场景的数据初始化不存在");
+        }
+        InitEntity init = optional.get();
+
+        // 输入控制点,需要删除旧数据,重新初始化
+        removeInitDataStep2(sceneCode);
+
+        String path = "F:\\test\\project\\age_laser";
+        String laserDataPath = path + "/laserData";
+        log.info("laserDataPath: {}", laserDataPath);
+
+        // step:0 获取控制点
+        ControlPointEntity controlPoint = getControlPoint(sceneCode);
+
+        // step1: 处理vision.txt 创建filter表, 处理特殊点:firstView
+        createFilter(sceneCode, laserDataPath, controlPoint);
 
+        // step2 处理could.js 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
+        processCould(sceneCode, laserDataPath, controlPoint);
+
+        // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
+        createConfig(sceneCode);
+
+        // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行
+        createDataSet(sceneCode);
+
+
+        // step8 目录pano、pano_depth、webcloud上传oss,
+//        ossUploadDir(sceneCode, laserDataPath);
+
+        // 更新 initDataStep2 状态
+        init.setUpdateTime(LocalDateTime.now());
+        init.setStatus(1);
+        initMapper.save(init);
+        log.info("initDataStep_2处理完成");
+
+    }
+
+    // 这个不能本地调试
     private void createFilter(String sceneCode, String path, ControlPointEntity dto){
         path = path +"/vision.txt";
         if (!cn.hutool.core.io.FileUtil.isFile(path)){
@@ -374,7 +417,7 @@ public class InitServiceImpl implements InitService {
             JSONObject info = ModifyCloud.fixCloud(path);
 
             cn.hutool.core.io.FileUtil.writeUtf8String(info.toString(), path);
-            log.info("新的cloud.js写入完成:{}", path);
+            log.info("新的cloud.js写入服务器完成:{}", path);
 
             /**
              * 将boundingBox坐标转换成gis坐标, site_model需要
@@ -403,7 +446,7 @@ public class InitServiceImpl implements InitService {
 
             Double[] gpsMax = getKey(resJson, "max");
             Double[] gpsMin = getKey(resJson, "min");
-            Double[] gpsCentre = getKey(resJson, "centre");
+            Double[] gpsCentre = getKeyZ(resJson, "centre");
 
             // 将数据保存到db
             saveSpecialPoint(sceneCode, TypeConstant.POI_BOUNDINGBOX_MAX, ageMax, gpsMax);
@@ -434,10 +477,10 @@ public class InitServiceImpl implements InitService {
         Double[] peak_2 = {max[0],min[1]};
         Double[] peak_3 = {min[0],min[1]};
         Double[] peak_4 = {min[0],max[1]};
-//        List<Double[]> doubles = Arrays.asList(peak_1, peak_2, peak_3, peak_4);
         List<List<Double[]>> doubles = Arrays.asList(Arrays.asList(peak_1, peak_2, peak_3, peak_4));
 
         // centre 替换BUILDING、FLOOR、ROOM 的center
+        log.info("中心点:{}, {}, {}", centre[0], centre[1], centre[2]);
         siteModels.forEach(p -> {
             // 第一层:BUILDING,处理centre、coordinates
             p.setCenter(centre);
@@ -470,10 +513,8 @@ public class InitServiceImpl implements InitService {
 
         });
 
-        System.out.println();
-
+        log.info("更新后的siteModel值: {}", siteModels.toArray());
         SiteModelEntity entity = new SiteModelEntity();
-//        entity.setId(SnowFlakeUUidUtils.getUuid("SM"));
         entity.setId(sceneCode);
         entity.setUpdateTime(LocalDateTime.now());
         // 默认热点为空
@@ -483,7 +524,7 @@ public class InitServiceImpl implements InitService {
     }
 
     @Test
-    public void  test(){
+    public void  testSiteModel(){
         String content = MyFileUtils.getResourceContent("data/site_model.json");
         List<SiteDto> siteModels = JSON.parseArray(content, SiteDto.class);
 
@@ -492,6 +533,7 @@ public class InitServiceImpl implements InitService {
 
 
     /**
+     * 获取两个值的
      * json数组转 double[]
      * @param resJson
      * @param key
@@ -503,6 +545,18 @@ public class InitServiceImpl implements InitService {
         return res;
     }
 
+    /**
+     * 获取三个值的
+     * @param resJson
+     * @param key
+     * @return
+     */
+    private Double[] getKeyZ(JSONObject resJson , String key){
+        JSONArray array = resJson.getJSONArray(key);
+        Double[] res = {array.getDouble(0), array.getDouble(1), array.getDouble(2)};
+        return res;
+    }
+
     /***
      * 保存特质点
      * @param sceneCode 场景码
@@ -522,7 +576,6 @@ public class InitServiceImpl implements InitService {
 
     private void createPoi(String sceneCode){
         PoiEntity entity = new PoiEntity();
-//        entity.setId(SnowFlakeUUidUtils.getUuid("PO"));
         entity.setId(sceneCode);
         entity.setUpdateTime(LocalDateTime.now());
         // 默认热点为空
@@ -535,7 +588,6 @@ public class InitServiceImpl implements InitService {
 
     private void createPoiType(String sceneCode){
         PoiTypeEntity entity = new PoiTypeEntity();
-//        entity.setId(SnowFlakeUUidUtils.getUuid("PT"));
         entity.setId(sceneCode);
         entity.setUpdateTime(LocalDateTime.now());
         // 读取初始文件
@@ -548,7 +600,6 @@ public class InitServiceImpl implements InitService {
 
     private void createPoiTypeGroup(String sceneCode){
         PoiTypeGroupEntity entity = new PoiTypeGroupEntity();
-//        entity.setId(SnowFlakeUUidUtils.getUuid("PG"));
         entity.setId(sceneCode);
         entity.setUpdateTime(LocalDateTime.now());
         // 读取初始文件
@@ -573,14 +624,12 @@ public class InitServiceImpl implements InitService {
         entity.setId(sceneCode);
         entity.setUpdateTime(LocalDateTime.now());
         // 设置原点坐标,通过场景码查询特殊点表的原点
-//        SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_ORIGIN);
         List<SpecialPointEntity> spList =  specialPointService.findBySceneCode(sceneCode);
         // 正常是5条记录: db.getCollection('t_special_point').find({"sceneCode":"t97"})
         if (spList.size() != 5) {
             throw new BaseRuntimeException(MsgCode.e3001, "特殊点表坐标异常");
         }
 
-//        List<String> poiKey = Arrays.asList(TypeConstant.POI_ORIGIN, TypeConstant.POI_BOUNDINGBOX_MAX, TypeConstant.POI_BOUNDINGBOX_MIN);
         Map<String, Double[]> map = new HashMap<>();
         for (SpecialPointEntity sp : spList) {
             String key = sp.getPoiKey();

+ 8 - 7
laser/src/main/java/com/fdkankan/indoor/core/service/impl/PoiServiceImpl.java

@@ -95,10 +95,8 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
         PoiEntity entity = findById(sceneCode);
         List<PoiHotDto> data = entity.getData();
 
-        Integer maxId;
-        if (data.size() == 0){
-            maxId = 0;
-        } else {
+        Integer maxId = 0;
+        if (data.size() != 0){
             // 遍历参数,获取id, 保存新list
             List<Integer> collectId = param.stream().map(PoiHotDto::getId).collect(Collectors.toList());
             log.info("参数id: {}", collectId);
@@ -106,9 +104,12 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
             data = data.stream().filter(p -> !collectId.contains(p.getId())).collect(Collectors.toList());
             log.info("过滤后数量: {}", data.size());
 
-            // 获取最大id
-            Optional<PoiHotDto> max = data.stream().max(Comparator.comparingInt(PoiHotDto::getId));
-            maxId = max.get().getId();
+            if (data.size() != 0){
+                // 获取最大id
+                Optional<PoiHotDto> max = data.stream().max(Comparator.comparingInt(PoiHotDto::getId));
+                maxId = max.get().getId();
+            }
+
         }
 
 

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

@@ -54,10 +54,9 @@ public class PoiTypeGroupServiceImpl implements PoiTypeGroupService {
         PoiTypeGroupEntity entity = findById(sceneCode);
         List<PoiTypeGroupDto> data = entity.getData();
         // 最大id
-        Integer maxId;
+        Integer maxId = 0;
         if (data.size() == 0){
-            maxId = 0;
-        } else {
+
             // 遍历参数,获取id, 保存新list
             List<Integer> collectId = param.stream().map(PoiTypeGroupDto::getId).collect(Collectors.toList());
             log.info("参数id: {}", collectId);
@@ -65,8 +64,11 @@ public class PoiTypeGroupServiceImpl implements PoiTypeGroupService {
             data = data.stream().filter(p -> !collectId.contains(p.getId())).collect(Collectors.toList());
             log.info("过滤后数量: {}", data.size());
             // 获取最大id
-            Optional<PoiTypeGroupDto> max = data.stream().max(Comparator.comparingInt(PoiTypeGroupDto::getId));
-            maxId = max.get().getId();
+            if (data.size() != 0){
+                Optional<PoiTypeGroupDto> max = data.stream().max(Comparator.comparingInt(PoiTypeGroupDto::getId));
+                maxId = max.get().getId();
+            }
+
         }
 
 

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

@@ -48,10 +48,9 @@ public class PoiTypeServiceImpl implements PoiTypeService {
         PoiTypeEntity vo = findById(sceneCode);
         List<PoiTypeDto> data = vo.getData();
 
-        Integer maxId;
+        Integer maxId = 0;
         if (data.size() == 0){
-            maxId = 0;
-        } else {
+
             // 遍历参数,获取id, 保存新list
             List<Integer> collectId = param.stream().map(PoiTypeDto::getId).collect(Collectors.toList());
             log.info("参数id: {}", collectId);
@@ -59,8 +58,11 @@ public class PoiTypeServiceImpl implements PoiTypeService {
             data = data.stream().filter(p -> !collectId.contains(p.getId())).collect(Collectors.toList());
             log.info("过滤后数量: {}", data.size());
             // 获取最大id
-            Optional<PoiTypeDto> max = data.stream().max(Comparator.comparingInt(PoiTypeDto::getId));
-            maxId = max.get().getId();
+            if (data.size() != 0) {
+                Optional<PoiTypeDto> max = data.stream().max(Comparator.comparingInt(PoiTypeDto::getId));
+                maxId = max.get().getId();
+            }
+
         }
 
 

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

@@ -243,20 +243,14 @@ public class SiteServiceImpl implements SiteService {
      */
     private boolean pointIsArea(Double[] point, SiteDto param){
         // 获取多边行点
-//        Polygon polygon = param.getPolygon();
         SitePolygon polygon = param.getPolygon();
         if (polygon == null) {
             return false;
         }
-//        List<List<List<Double>>> coordinates = polygon.getCoordinates();
         List<List<Double[]>> coordinates = polygon.getCoordinates();
         if (CollectionUtils.isEmpty(coordinates)){
             return false;
         }
-//        List<List<Double>> lists = coordinates.get(0);
-//        if (CollectionUtils.isEmpty(lists)){
-//            return false;
-//        }
 
         List<Double[]> lists = coordinates.get(0);
         if (CollectionUtils.isEmpty(lists)){
@@ -267,8 +261,7 @@ public class SiteServiceImpl implements SiteService {
         pointDouble.setLocation(point[0], point[1]);
 
 
-//        List<Point2D.Double> allPoints = lists.stream()
-//                .map(points -> new Point2D.Double(points.get(0), points.get(1))).collect(Collectors.toList());
+
         List<Point2D.Double> allPoints = lists.stream()
                 .map(points -> new Point2D.Double(point[0], point[1])).collect(Collectors.toList());
 
@@ -302,14 +295,8 @@ public class SiteServiceImpl implements SiteService {
 
     }
 
-//    private SiteModelEntity findBySceneCode(String sceneCode){
-//        Query query = new Query();
-//        query.addCriteria(Criteria.where("sceneCode").is(sceneCode));
-//        SiteModelEntity vo = mongoTemplate.findOne(query, SiteModelEntity.class, "t_site_model");
-//        return vo;
-//    }
 
-//    private
+
     private SiteModelEntity findById(String sceneCode){
         Optional<SiteModelEntity> optional = entityMapper.findById(sceneCode);
         if (!optional.isPresent()){

+ 0 - 1
laser/src/main/java/com/fdkankan/indoor/core/service/impl/SpecialPointServiceImpl.java

@@ -27,7 +27,6 @@ public class SpecialPointServiceImpl implements SpecialPointService {
     @Override
     public SpecialPointEntity findBySceneCodeAndPoiKey(String sceneCode, String poiKey) {
         return entityMapper.findBySceneCodeAndPoiKey(sceneCode, poiKey);
-//        return entityMapper.findByIdAndPoiKey(sceneCode, poiKey);
     }
 
     @Override

+ 1 - 1
laser/src/main/resources/data/config.json

@@ -216,7 +216,7 @@
   },
   "id": 17,
   "name": "layers.map.visible",
-  "value": "true",
+  "value": "false",
   "type": "boolean",
   "length": null,
   "category": "layer.visibility",