|
@@ -148,7 +148,6 @@ public class InitServiceImpl implements InitService {
|
|
|
init.setTitle(title);
|
|
|
init.setUpdateTime(LocalDateTime.now());
|
|
|
init.setUseStatus(1);
|
|
|
-// initMapper.save(init);
|
|
|
}
|
|
|
} else {
|
|
|
// 新场景
|
|
@@ -175,76 +174,7 @@ public class InitServiceImpl implements InitService {
|
|
|
InitEntity finalInit = init;
|
|
|
String traceId = MDC.get("TRACE_ID");
|
|
|
log.info("链路id: {}", traceId);
|
|
|
- ThreadUtil.execAsync(() -> initDataStep1(finalInit, traceId));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// String laserDataPath = path + "/laserData";
|
|
|
-// String laserDataPath = path ;
|
|
|
-// log.info("laserDataPath: {}", laserDataPath);
|
|
|
-//
|
|
|
-// // step1 创建t_route表(路径规划)
|
|
|
-// createRoute(sceneCode, laserDataPath);
|
|
|
-//
|
|
|
-// // step3 创建poi表, 热点,默认没有
|
|
|
-// createPoi(sceneCode);
|
|
|
-//
|
|
|
-// // step4 创建poi_type表, 使用的是模板初始化
|
|
|
-// createPoiType(sceneCode);
|
|
|
-//
|
|
|
-// // step5 创建poi_type_group表, 使用的是模板初始化
|
|
|
-// createPoiTypeGroup(sceneCode);
|
|
|
-//
|
|
|
-// // step7 复制静态资源
|
|
|
-// copyDefault(sceneCode);
|
|
|
-//
|
|
|
-//
|
|
|
-// //step8 替换index.html、/locat/addDataSet.html的场景码, @replace, @title
|
|
|
-// replaceHtml(sceneCode, title);
|
|
|
-//
|
|
|
-// // step9 创建 t_measurement表, 测量表,空数据
|
|
|
-// createMeasurement(sceneCode);
|
|
|
-
|
|
|
-
|
|
|
-// log.info("================== 初始化第一步完成 ==================");
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 这方法很重要, 会自动初始化initData2 的说有方法
|
|
|
-// * step10 创建控制点表 t_controlPoint, 读取服务器controlPoint.json文件
|
|
|
-// */
|
|
|
-//
|
|
|
-// String controlPointPath = laserDataPath + "/controlPoint.json";
|
|
|
-// log.info("控制点文件路径:{}", controlPointPath);
|
|
|
-// boolean flag = false;
|
|
|
-// if (cn.hutool.core.io.FileUtil.exist(controlPointPath)) {
|
|
|
-// log.info("处理控制点逻辑");
|
|
|
-// createControlPoint(sceneCode, laserDataPath);
|
|
|
-// flag = true;
|
|
|
-// } else {
|
|
|
-// log.info("控制点文件不存在:{}", controlPointPath);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
- // 2021-09-23 地址需要更新
|
|
|
-// init.setUpdateTime(LocalDateTime.now());
|
|
|
-// Integer recount = init.getRecount();
|
|
|
-// recount = recount == null ? 1 : recount + 1;
|
|
|
-// init.setRecount(recount);
|
|
|
-
|
|
|
-
|
|
|
-// if (flag) {
|
|
|
-// init.setStatus(1);
|
|
|
-// log.info("完全初始化完成");
|
|
|
-// } else {
|
|
|
-// log.info("initDataStep_1处理完成");
|
|
|
-// init.setStatus(0);
|
|
|
-// }
|
|
|
-//
|
|
|
-// initMapper.save(init);
|
|
|
+ ThreadUtil.execAsync(() -> initDataStep1(finalInit, traceId, param.getIsUploadImg()));
|
|
|
|
|
|
return Result.success();
|
|
|
}
|
|
@@ -253,8 +183,10 @@ public class InitServiceImpl implements InitService {
|
|
|
/**
|
|
|
* 初始化数据第一步
|
|
|
* @param initParam
|
|
|
+ * @param isUploadImag: 默认true
|
|
|
+ *
|
|
|
*/
|
|
|
- public void initDataStep1(InitEntity initParam, String traceId){
|
|
|
+ public void initDataStep1(InitEntity initParam, String traceId, boolean isUploadImag){
|
|
|
// 链路id
|
|
|
MDC.put("TRACE_ID", traceId);
|
|
|
log.info("异步初始化数据开始");
|
|
@@ -302,6 +234,11 @@ public class InitServiceImpl implements InitService {
|
|
|
if (cn.hutool.core.io.FileUtil.exist(controlPointPath)) {
|
|
|
log.info("处理控制点逻辑");
|
|
|
createControlPoint(sceneCode, laserDataPath);
|
|
|
+
|
|
|
+ // 执行initData2 初始化
|
|
|
+ this.initDataStep2(sceneCode, "age", isUploadImag);
|
|
|
+
|
|
|
+
|
|
|
flag = true;
|
|
|
} else {
|
|
|
log.info("控制点文件不存在:{}", controlPointPath);
|
|
@@ -333,10 +270,12 @@ public class InitServiceImpl implements InitService {
|
|
|
* 需要控制点,才能完成以下操作
|
|
|
* 重新输入控制点时, 把相应数据删除, 重新初始化
|
|
|
*
|
|
|
+ * isUploadImag: 默认上传
|
|
|
+ *
|
|
|
* @param sceneCode
|
|
|
*/
|
|
|
@Override
|
|
|
- public void initDataStep2(String sceneCode, String from) {
|
|
|
+ public void initDataStep2(String sceneCode, String from, boolean isUploadImag) {
|
|
|
|
|
|
Optional<InitEntity> optional = initMapper.findById(sceneCode);
|
|
|
if (!optional.isPresent()) {
|
|
@@ -379,7 +318,10 @@ public class InitServiceImpl implements InitService {
|
|
|
|
|
|
|
|
|
// step8 目录pano、pano_depth、webcloud上传oss, 初始化合并场景码跟原来的一样
|
|
|
- ossUploadDirByLaserData(sceneCode, laserDataPath, sceneCode);
|
|
|
+ if (isUploadImag){ // 2021-12-13 如果静态资源数据是正确的,只是重置控制带你,可以不用上传静态资源
|
|
|
+ log.info("初始化-initDataStep2: 上传pano、pano_depth、webcloud");
|
|
|
+ ossUploadDirByLaserData(sceneCode, laserDataPath, sceneCode);
|
|
|
+ }
|
|
|
|
|
|
// 更新 initDataStep2 状态
|
|
|
init.setUpdateTime(LocalDateTime.now());
|
|
@@ -436,7 +378,7 @@ public class InitServiceImpl implements InitService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result initRecount(String sceneCode) {
|
|
|
+ public Result initRecount(String sceneCode, String isUploadImg) {
|
|
|
|
|
|
|
|
|
log.info("执行手动重新:{}", sceneCode);
|
|
@@ -451,7 +393,11 @@ public class InitServiceImpl implements InitService {
|
|
|
initDto.setFrom("recount");
|
|
|
initDto.setSceneCode(sceneCode);
|
|
|
initDto.setPhone(initEntity.getUserName());
|
|
|
-
|
|
|
+ initDto.setIsUploadImg(true);
|
|
|
+ if (StringUtils.isNotBlank(isUploadImg)){
|
|
|
+ initDto.setIsUploadImg(false);
|
|
|
+ log.info("不上传深度图、点云数据等静态资源");
|
|
|
+ }
|
|
|
this.initData(initDto);
|
|
|
|
|
|
|
|
@@ -569,8 +515,8 @@ public class InitServiceImpl implements InitService {
|
|
|
controlPointService.saveEntity(entity);
|
|
|
log.info("算法控制点保存完成");
|
|
|
|
|
|
- // 执行initData2 初始化
|
|
|
- this.initDataStep2(sceneCode, "age");
|
|
|
+// // 执行initData2 初始化
|
|
|
+// this.initDataStep2(sceneCode, "age", isUploadImag);
|
|
|
|
|
|
log.info("controlPoint控制点初始化完成");
|
|
|
}
|