|
@@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
|
import cn.hutool.extra.qrcode.QrConfig;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.constant.SceneVersionType;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
@@ -11,8 +12,8 @@ import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
-import com.fdkankan.ucenter.entity.SceneResource;
|
|
|
-import com.fdkankan.ucenter.service.IScene3dNumService;
|
|
|
+import com.fdkankan.ucenter.entity.*;
|
|
|
+import com.fdkankan.ucenter.service.*;
|
|
|
import com.fdkankan.ucenter.util.SceneResourcePath;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
@@ -21,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.function.ObjDoubleConsumer;
|
|
@@ -246,4 +249,66 @@ public class SceneCommonService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ISceneProService sceneProService;
|
|
|
+ @Autowired
|
|
|
+ ICameraDetailService cameraDetailService;
|
|
|
+ @Autowired
|
|
|
+ ICameraTypeService cameraTypeService;
|
|
|
+ @Autowired
|
|
|
+ IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ IScenePlusExtService scenePlusExtService;
|
|
|
+
|
|
|
+ public void copyResult(String newNum) {
|
|
|
+ ScenePro scenePro = sceneProService.getByNum(newNum);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByNum(newNum);
|
|
|
+ if(scenePro == null && scenePlus == null){
|
|
|
+ log.info("复制失败:{}",newNum);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
+ Integer location = null;
|
|
|
+ Long space = 0L;
|
|
|
+ if(scenePlus != null){
|
|
|
+ ScenePlusExt plusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ if(plusExt == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ location = plusExt.getLocation();
|
|
|
+ space = plusExt.getSpace();
|
|
|
+
|
|
|
+ }
|
|
|
+ if(scenePro != null){
|
|
|
+ space = scenePro.getSpace();
|
|
|
+ }
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(cameraId);
|
|
|
+ CameraType cameraType = cameraTypeService.getByCameraType(cameraDetail.getType());
|
|
|
+
|
|
|
+ Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail,cameraType);
|
|
|
+ if(!checkSpace){
|
|
|
+ List<String> panoNumList = new ArrayList<>();
|
|
|
+ if(location != null && location == 7){
|
|
|
+ panoNumList.add(scenePlus.getNum());
|
|
|
+ }
|
|
|
+ sceneProService.lockOrUnLockScenes(new ArrayList<>(), Arrays.asList(newNum),-2,cameraType.getIsLaser(),panoNumList);
|
|
|
+ }
|
|
|
+ cameraDetailService.addUsedSpace(cameraDetail,space);
|
|
|
+
|
|
|
+
|
|
|
+ if(cameraType.getIsLaser() == 1 && scenePlus != null){
|
|
|
+ LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(ScenePlus::getId,scenePlus.getId());
|
|
|
+ wrapper.set(ScenePlus::getSceneStatus,-2);
|
|
|
+ scenePlusService.update(wrapper);
|
|
|
+ }
|
|
|
+ if(cameraType.getIsLaser() == 1 && scenePro != null){
|
|
|
+ LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(ScenePro::getId,scenePro.getId());
|
|
|
+ wrapper.set(ScenePro::getStatus,-2);
|
|
|
+ sceneProService.update(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|