|
@@ -1,24 +1,26 @@
|
|
package com.fdkankan.contro.mq.service.impl;
|
|
package com.fdkankan.contro.mq.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
-import com.fdkankan.common.constant.*;
|
|
|
|
|
|
+import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
|
|
+import com.fdkankan.common.constant.PayStatus;
|
|
|
|
+import com.fdkankan.common.constant.SceneSource;
|
|
|
|
+import com.fdkankan.common.constant.SceneStatus;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
-import com.fdkankan.contro.entity.*;
|
|
|
|
|
|
+import com.fdkankan.contro.entity.RelocationBatch;
|
|
|
|
+import com.fdkankan.contro.entity.RelocationBatchDetail;
|
|
|
|
+import com.fdkankan.contro.entity.ScenePlus;
|
|
|
|
+import com.fdkankan.contro.entity.ScenePlusExt;
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.service.*;
|
|
-import com.fdkankan.fyun.config.FYunFileConfig;
|
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.model.constants.ConstantFileName;
|
|
import com.fdkankan.model.constants.ConstantFileName;
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
-import com.fdkankan.model.utils.SceneUtil;
|
|
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
@@ -32,7 +34,10 @@ import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@@ -49,23 +54,17 @@ import java.util.stream.Collectors;
|
|
@RefreshScope
|
|
@RefreshScope
|
|
public class BuildSxRelocationServiceImpl implements IBuildSceneService {
|
|
public class BuildSxRelocationServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
- @Value("${queue.modeling.modeling-call}")
|
|
|
|
- private String queueModelingCall;
|
|
|
|
@Value("${queue.modeling.sx-relocation-post:sx-relocation-post}")
|
|
@Value("${queue.modeling.sx-relocation-post:sx-relocation-post}")
|
|
private String queueModelingPost;
|
|
private String queueModelingPost;
|
|
@Value("${model.type:#{null}}")
|
|
@Value("${model.type:#{null}}")
|
|
private String modelType;
|
|
private String modelType;
|
|
@Value("${env:gn}")
|
|
@Value("${env:gn}")
|
|
private String env;
|
|
private String env;
|
|
- @Value("#{'${build.scene.post.not-delete-nas-nums:}'.split(',')}")
|
|
|
|
- private List<String> notDeleteNasNumList;
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
@Resource
|
|
@Resource
|
|
private FYunFileServiceInterface fYunFileService;
|
|
private FYunFileServiceInterface fYunFileService;
|
|
@Autowired
|
|
@Autowired
|
|
- private FYunFileConfig fYunFileConfig;
|
|
|
|
- @Autowired
|
|
|
|
private IScenePlusService scenePlusService;
|
|
private IScenePlusService scenePlusService;
|
|
@Autowired
|
|
@Autowired
|
|
private IScenePlusExtService scenePlusExtService;
|
|
private IScenePlusExtService scenePlusExtService;
|
|
@@ -74,10 +73,6 @@ public class BuildSxRelocationServiceImpl implements IBuildSceneService {
|
|
@Autowired
|
|
@Autowired
|
|
private ICommonService commonService;
|
|
private ICommonService commonService;
|
|
@Autowired
|
|
@Autowired
|
|
- private ISceneColdStorageService sceneColdStorageService;
|
|
|
|
- @Autowired
|
|
|
|
- private IntermitSceneService intermitSceneService;
|
|
|
|
- @Autowired
|
|
|
|
private IBuildService buildService;
|
|
private IBuildService buildService;
|
|
@Autowired
|
|
@Autowired
|
|
private IRelocationBatchDetailService relocationBatchDetailService;
|
|
private IRelocationBatchDetailService relocationBatchDetailService;
|
|
@@ -316,79 +311,4 @@ public class BuildSxRelocationServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8), dataViewPath + "status.json");
|
|
fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8), dataViewPath + "status.json");
|
|
}
|
|
}
|
|
-
|
|
|
|
- private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
|
|
|
|
-
|
|
|
|
- scenePlusExt.setSpace(space);
|
|
|
|
- scenePlusExt.setComputeTime(computeTime);
|
|
|
|
- scenePlusExt.setAlgorithmTime(new Date());
|
|
|
|
- scenePlusExt.setVideos(videosJson);
|
|
|
|
- scenePlusExt.setIsObj(isObj ? 1 : 0);
|
|
|
|
-
|
|
|
|
- if(ModelTypeEnums.TILE_CODE.equals(modelType)){
|
|
|
|
- scenePlusExt.setSceneScheme(3);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- switch (SceneSource.get(sceneSource)){
|
|
|
|
- case BM:
|
|
|
|
- scenePlusExt.setSceneResolution(SceneResolution.two_K.code());
|
|
|
|
- scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
|
|
|
|
- break;
|
|
|
|
- case SM:
|
|
|
|
- scenePlusExt.setSceneResolution(SceneResolution.one_k.code());
|
|
|
|
- scenePlusExt.setSceneFrom(SceneFrom.LITE.code());
|
|
|
|
- break;
|
|
|
|
- case ZT:
|
|
|
|
- scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
|
|
|
|
- scenePlusExt.setSceneFrom(SceneFrom.MINION.code());
|
|
|
|
- break;
|
|
|
|
- case JG:
|
|
|
|
- scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
|
|
|
|
- scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
|
|
|
|
- break;
|
|
|
|
- case SG:
|
|
|
|
- scenePlusExt.setSceneResolution(SceneResolution.four_K.code());
|
|
|
|
- scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
|
|
|
|
- scenePlusExt.setSceneKind(sceneKind);
|
|
|
|
-// scenePlusExt.setModelKind(modelKind);
|
|
|
|
-
|
|
|
|
- //统计点位数量
|
|
|
|
- scenePlusExt.setShootCount(this.getShootCount(scenePlusExt));
|
|
|
|
-
|
|
|
|
- scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private Integer getShootCount(ScenePlusExt scenePlusExt){
|
|
|
|
- Integer shootCount = null;
|
|
|
|
- String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
|
|
- JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
|
|
- if(Objects.nonNull(dataFdageObj)){
|
|
|
|
- JSONArray points = dataFdageObj.getJSONArray("points");
|
|
|
|
- if(CollUtil.isNotEmpty(points)){
|
|
|
|
- shootCount = points.size();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(Objects.nonNull(shootCount) && shootCount > 0){
|
|
|
|
- return shootCount;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
|
|
- JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
|
|
- if(Objects.nonNull(slamDataObj)){
|
|
|
|
- JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
|
|
- if(CollUtil.isNotEmpty(viewsInfo)){
|
|
|
|
- shootCount = viewsInfo.stream().mapToInt(info -> {
|
|
|
|
- return ((JSONObject) info).getJSONArray("list_pose").size();
|
|
|
|
- }).sum();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return shootCount;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|