|
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
|
import cn.hutool.extra.qrcode.QrConfig;
|
|
|
+import cn.hutool.http.ContentType;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -38,6 +39,7 @@ import com.fdkankan.redis.util.RedisUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.http.HttpHeaders;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
@@ -89,9 +91,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
@Value("4dkk.laserService.bucket")
|
|
|
private String laserBucket;
|
|
|
|
|
|
- @Value("${4dkk.laserService.dir}")
|
|
|
- private String laserDir;
|
|
|
-
|
|
|
@Autowired
|
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
@@ -208,7 +207,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
}
|
|
|
ext.put("128G", 1);
|
|
|
}
|
|
|
- mqProducer.sendByWorkQueue(queueModelingCall, message);
|
|
|
|
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
@@ -287,6 +285,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
log.info("开始上传场景计算结果数据,num:{}", sceneCode);
|
|
|
//由于3dtiles算法mesh文件发生变化,所以这里需要先清除一下oss的mesh目录,避免存在旧算法obj文件
|
|
|
fYunFileService.deleteFolder(String.format(UploadFilePath.DATA_VIEW_PATH, sceneCode) + "mesh");
|
|
|
+ fYunFileService.deleteFolder(String.format(UploadFilePath.IMG_VIEW_PATH, sceneCode) + ModelKind.THREE_D_TILE.code());
|
|
|
//上传文件
|
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
|
|
|
@@ -310,7 +309,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
commonService.uploadFloorplanJson(sceneCode, path);
|
|
|
|
|
|
//重置异步操作记录
|
|
|
- this.removeSceneAsynOperLog(sceneCode);
|
|
|
+ commonService.removeSceneAsynOperLog(sceneCode);
|
|
|
|
|
|
//清除用户编辑业务数据
|
|
|
Set<String> bizs = new HashSet<>();
|
|
@@ -395,26 +394,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void removeSceneAsynOperLog(String num){
|
|
|
- List<SceneAsynOperLog> list = sceneAsynOperLogService.list(new LambdaQueryWrapper<SceneAsynOperLog>().eq(SceneAsynOperLog::getNum, num));
|
|
|
- if(CollUtil.isEmpty(list)){
|
|
|
- return;
|
|
|
- }
|
|
|
- //删除数据库记录
|
|
|
- List<Long> deleteIdList = list.parallelStream().map(item -> item.getId()).collect(Collectors.toList());
|
|
|
- sceneAsynOperLogService.removeByIds(deleteIdList);
|
|
|
-
|
|
|
- list.parallelStream().forEach(item -> {
|
|
|
- if(StrUtil.isNotEmpty(item.getUrl())){
|
|
|
- try {
|
|
|
- fYunFileService.deleteFile(item.getUrl());
|
|
|
- } catch (IOException e) {
|
|
|
- log.warn("删除oss全景图下载压缩包失败,key:{}", item.getUrl());
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
// private void cachePanorama(String dataSource, String num){
|
|
|
// String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
// //将全景图缓存到缓存目录
|
|
@@ -600,7 +579,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
statusJson.put("sceneScheme", scenePlusExt.getSceneScheme());
|
|
|
FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", statusJson.toString());
|
|
|
|
|
|
- fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8), dataViewPath + "status.json");
|
|
|
+ Map<String,String> headers = new HashMap<>();
|
|
|
+ headers.put(HttpHeaders.CONTENT_TYPE, ContentType.JSON.getValue());
|
|
|
+ fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", dataViewPath + "status.json", headers);
|
|
|
}
|
|
|
|
|
|
private void createQrCode(String num, ScenePlusExt scenePlusExt, String qrLogo) {
|