|
@@ -19,6 +19,7 @@ import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.contro.bean.SceneJsonBean;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
|
+import com.fdkankan.contro.service.ISceneAsynOperLogService;
|
|
|
import com.fdkankan.contro.service.*;
|
|
|
import com.fdkankan.contro.vo.SceneEditControlsVO;
|
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
@@ -73,6 +74,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
@Value("${model.type:#{null}}")
|
|
|
private String modelType;
|
|
|
|
|
|
+ @Value("${model.modelKind:dam}")
|
|
|
+ private String modelKind;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
@@ -113,6 +117,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Autowired
|
|
|
private ICompanyService companyService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneAsynOperLogService sceneAsynOperLogService;
|
|
|
|
|
|
@Override
|
|
|
public void buildScenePre(BuildSceneCallMessage message) {
|
|
@@ -286,8 +292,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
|
.forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
- //写scene.json
|
|
|
-
|
|
|
+ //重置异步操作记录
|
|
|
+ this.removeSceneAsynOperLog(sceneCode);
|
|
|
|
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
@@ -314,18 +320,39 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
String pushToken = fdageData.getString("pushToken");
|
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
-
|
|
|
+ //更新场景主表
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
|
|
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("场景计算结果处理出错!", e);
|
|
|
buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ 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);
|
|
|
//将全景图缓存到缓存目录
|
|
@@ -486,6 +513,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
sceneJson.setImgVersion(sceneEditInfo.getImgVersion());
|
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneJson.setSceneKind(scenePlusExt.getSceneKind());
|
|
|
+ sceneJson.setModelKind(scenePlusExt.getModelKind());
|
|
|
sceneJson.setVideos(JSON.toJSONString(videosJson));
|
|
|
sceneJson.setPayStatus(scenePlus.getPayStatus());
|
|
|
|
|
@@ -556,6 +584,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +".png";
|
|
|
String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +"_en.png";
|
|
|
QrConfig qrConfig = QrConfig.create();
|
|
|
+ qrConfig.setWidth(512);
|
|
|
+ qrConfig.setHeight(512);
|
|
|
if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
|
qrConfig.setImg(localLogoPath);
|
|
|
}
|
|
@@ -720,42 +750,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
|
|
|
}
|
|
|
|
|
|
- private void sealScene(Long scenePlusId){
|
|
|
- scenePlusService.update(
|
|
|
- new LambdaUpdateWrapper<ScenePlus>()
|
|
|
- .set(ScenePlus::getPayStatus, PayStatus.NO_CAPACITY.code())
|
|
|
- .eq(ScenePlus::getId, scenePlusId));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * <p>
|
|
|
- 双目场景更新数据库
|
|
|
- * </p>
|
|
|
- * @author dengsixing
|
|
|
- * @date 2022/3/21
|
|
|
- * @param num
|
|
|
- * @param space
|
|
|
- **/
|
|
|
- private void updateDb4Sm(String num, long space){
|
|
|
- List<ScenePlus> ScenePlusList = scenePlusService.list(
|
|
|
- new LambdaQueryWrapper<ScenePlus>().select(ScenePlus::getId).eq(ScenePlus::getNum, num));
|
|
|
-
|
|
|
- if(CollUtil.isEmpty(ScenePlusList)){
|
|
|
- return ;
|
|
|
- }
|
|
|
-
|
|
|
- List<Long> sceneIds = ScenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
-
|
|
|
- //更新场景创建时间
|
|
|
- scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>().in(ScenePlus::getId, sceneIds)
|
|
|
- .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
|
|
|
-
|
|
|
- //更新使用容量
|
|
|
- scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>().in(ScenePlusExt::getPlusId, sceneIds)
|
|
|
- .set(ScenePlusExt::getSpace, space)
|
|
|
- .set(ScenePlusExt::getAlgorithmTime, Calendar.getInstance().getTime()));
|
|
|
- }
|
|
|
-
|
|
|
private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
|
|
|
|
|
|
scenePlusExt.setSpace(space);
|
|
@@ -815,6 +809,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
|
|
|
sceneEditInfo.setVersion(sceneEditInfo.getVersion() + 1);
|
|
|
sceneEditInfo.setImgVersion(sceneEditInfo.getImgVersion() + 1);
|
|
|
+ sceneEditInfo.setIsUploadObj(CommonStatus.NO.code());
|
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
|
}
|
|
|
if(sceneEditControls == null){
|