|
@@ -0,0 +1,91 @@
|
|
|
+package com.fdkankan.contro.mq.service.impl;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.fdkankan.common.util.FileUtils;
|
|
|
+import com.fdkankan.contro.entity.*;
|
|
|
+import com.fdkankan.contro.mq.service.IBuildScenePostService;
|
|
|
+import com.fdkankan.contro.service.*;
|
|
|
+import com.fdkankan.fyun.config.FYunFileConfig;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
+import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
|
+import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * TODO
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author dengsixing
|
|
|
+ * @since 2022/4/20
|
|
|
+ **/
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+public class BuildObjScenePostServiceImpl implements IBuildScenePostService {
|
|
|
+
|
|
|
+ @Value("${main.url}")
|
|
|
+ private String mainUrl;
|
|
|
+ @Value("${scene.pro.new.url}")
|
|
|
+ private String sceneProNewUrl;
|
|
|
+
|
|
|
+ @Value("${4dkk.laserService.host}")
|
|
|
+ private String laserHost;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneFileBuildService sceneFileBuildService;
|
|
|
+ @Autowired
|
|
|
+ private ICameraDetailService cameraDetailService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneEditInfoService sceneEditInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneEditControlsService sceneEditControlsService;
|
|
|
+ @Autowired
|
|
|
+ private FYunFileServiceInterface fYunFileService;
|
|
|
+ @Autowired
|
|
|
+ private FYunFileConfig fYunFileConfig;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RedisUtil redisUtil;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneEditInfoExtService sceneEditInfoExtService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserIncrementService userIncrementService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFdkkLaserService fdkkLaserService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
|
+ // 去除 OnlyExportMeshObj
|
|
|
+ String path = message.getPath();
|
|
|
+ String dataFdagePath = path + File.separator + "capture" + File.separator + "data.fdage";
|
|
|
+ log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
|
|
|
+ String data = FileUtils.readFile(dataFdagePath);
|
|
|
+ //获取data.fdage的内容
|
|
|
+ JSONObject dataJson = new JSONObject();
|
|
|
+ if (data != null) {
|
|
|
+ dataJson = JSONObject.parseObject(data);
|
|
|
+ }
|
|
|
+ dataJson.remove("OnlyExportMeshObj");
|
|
|
+ FileUtils.writeFile(path + File.separator + "capture" + File.separator + "data.fdage", dataJson.toJSONString());
|
|
|
+ fYunFileService.uploadFile(path + File.separator + "capture" + File.separator + "data.fdage",
|
|
|
+ ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "") + "/data.fdage");
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<ScenePlus> updateWrapper = new LambdaUpdateWrapper<ScenePlus>()
|
|
|
+ .set(ScenePlus::getSceneStatus, -2).eq(ScenePlus::getNum, message.getSceneCode());
|
|
|
+ scenePlusService.update(updateWrapper);
|
|
|
+ }
|
|
|
+}
|