|
@@ -2,10 +2,6 @@ package com.fdkankan.scene.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.date.TimeInterval;
|
|
|
-import cn.hutool.core.lang.Console;
|
|
|
-import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -16,25 +12,23 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
-import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.FileBizType;
|
|
|
import com.fdkankan.common.constant.OperationType;
|
|
|
import com.fdkankan.common.constant.SceneFrom;
|
|
|
import com.fdkankan.common.constant.SceneInfoReqType;
|
|
|
import com.fdkankan.common.constant.ServerCode;
|
|
|
-import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
-import com.fdkankan.scene.vo.BaseSceneParamVO;
|
|
|
-import com.fdkankan.web.response.ResultData;
|
|
|
-import com.fdkankan.model.utils.ComputerUtil;
|
|
|
-import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
|
-import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.common.util.FileMd5Util;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
-import com.fdkankan.model.utils.SceneUtil;
|
|
|
import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
+import com.fdkankan.model.constants.UploadFilePath;
|
|
|
+import com.fdkankan.model.utils.ComputerUtil;
|
|
|
+import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
|
+import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
+import com.fdkankan.model.utils.SceneUtil;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.constant.RedisLockKey;
|
|
|
import com.fdkankan.redis.util.RedisLockUtil;
|
|
@@ -69,6 +63,7 @@ import com.fdkankan.scene.service.ISceneUploadService;
|
|
|
import com.fdkankan.scene.vo.BallScreenVideoParamVO;
|
|
|
import com.fdkankan.scene.vo.BaseDataParamVO;
|
|
|
import com.fdkankan.scene.vo.BaseFileParamVO;
|
|
|
+import com.fdkankan.scene.vo.BaseSceneParamVO;
|
|
|
import com.fdkankan.scene.vo.DeleteFileParamVO;
|
|
|
import com.fdkankan.scene.vo.DeleteLinkPanParamVO;
|
|
|
import com.fdkankan.scene.vo.DeleteLinkSceneStylesParamVO;
|
|
@@ -86,6 +81,7 @@ import com.fdkankan.scene.vo.SceneEditInfoVO;
|
|
|
import com.fdkankan.scene.vo.SceneInfoParamVO;
|
|
|
import com.fdkankan.scene.vo.SceneInfoVO;
|
|
|
import com.fdkankan.scene.vo.UploadPanoramaVO;
|
|
|
+import com.fdkankan.web.response.ResultData;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.errorprone.annotations.Var;
|
|
|
import java.io.File;
|
|
@@ -96,7 +92,6 @@ import java.util.Arrays;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Comparator;
|
|
|
-import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
@@ -406,8 +401,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
**/
|
|
|
private SceneInfoVO getSceneInfo4Edit(String num) throws Exception{
|
|
|
|
|
|
- TimeInterval timer = DateUtil.timer();
|
|
|
-
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
@@ -433,8 +426,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO.setNum(num);
|
|
|
sceneInfoVO.setCreateTime(scenePlus.getCreateTime());
|
|
|
|
|
|
- log.info(String.valueOf(timer.intervalRestart()));
|
|
|
-
|
|
|
sceneInfoVO.setSceneResolution(scenePlusExt.getSceneResolution());
|
|
|
sceneInfoVO.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneInfoVO.setSceneKind(scenePlusExt.getSceneKind());
|
|
@@ -442,10 +433,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO.setMosaicList(this.getMosaicList(num));
|
|
|
|
|
|
this.SortBoxVideos(sceneInfoVO);
|
|
|
- log.info(String.valueOf(timer.intervalRestart()));
|
|
|
|
|
|
this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
- log.info(String.valueOf(timer.intervalRestart()));
|
|
|
|
|
|
return sceneInfoVO;
|
|
|
}
|
|
@@ -1659,8 +1648,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(exist){
|
|
|
return;
|
|
|
}
|
|
|
+ String uuid = cn.hutool.core.lang.UUID.randomUUID().toString();
|
|
|
String lockKey = String.format(RedisLockKey.LOCK_MOSAIC_DATA_SYNC, num);
|
|
|
- boolean lock = redisLockUtil.lock(lockKey, RedisKey.EXPIRE_TIME_1_MINUTE);
|
|
|
+ boolean lock = redisLockUtil.lock(lockKey, uuid, RedisKey.EXPIRE_TIME_1_MINUTE);
|
|
|
if(!lock){
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_BUSY);
|
|
|
}
|
|
@@ -1685,7 +1675,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
redisUtil.hmset(key, map);
|
|
|
}finally {
|
|
|
- redisLockUtil.unlockLua(lockKey);
|
|
|
+ redisLockUtil.unlockLua(lockKey, uuid);
|
|
|
}
|
|
|
}
|
|
|
|