SceneProServiceImpl.java 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. package com.fdkankan.manage.service.impl;
  2. import cn.dev33.satoken.stp.StpUtil;
  3. import cn.hutool.core.bean.BeanUtil;
  4. import cn.hutool.core.io.FileUtil;
  5. import cn.hutool.json.JSONUtil;
  6. import com.alibaba.fastjson.JSONArray;
  7. import com.alibaba.fastjson.JSONObject;
  8. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  9. import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  10. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  11. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12. import com.fdkankan.common.constant.SceneConstant;
  13. import com.fdkankan.fyun.face.FYunFileServiceInterface;
  14. import com.fdkankan.manage.common.*;
  15. import com.fdkankan.manage.constant.SceneTypeLabelEnum;
  16. import com.fdkankan.manage.exception.BusinessException;
  17. import com.fdkankan.common.util.*;
  18. import com.fdkankan.manage.httpClient.client.FdKKClient;
  19. import com.fdkankan.manage.httpClient.service.LaserService;
  20. import com.fdkankan.manage.entity.*;
  21. import com.fdkankan.manage.httpClient.service.OverallService;
  22. import com.fdkankan.manage.mapper.ISceneProMapper;
  23. import com.fdkankan.manage.mq.common.MqQueueUtil;
  24. import com.fdkankan.manage.mq.param.ScenePayStatusVo;
  25. import com.fdkankan.manage.mq.param.SceneRestStoreVo;
  26. import com.fdkankan.manage.service.*;
  27. import com.fdkankan.manage.util.CameraUtils;
  28. import com.fdkankan.manage.util.DateUtils;
  29. import com.fdkankan.manage.util.SceneStatusUtil;
  30. import com.fdkankan.manage.vo.request.SceneParam;
  31. import com.fdkankan.manage.vo.response.*;
  32. import com.fdkankan.rabbitmq.util.RabbitMqProducer;
  33. import com.fdkankan.redis.util.RedisUtil;
  34. import lombok.extern.slf4j.Slf4j;
  35. import org.apache.commons.lang3.StringUtils;
  36. import org.springframework.beans.factory.annotation.Autowired;
  37. import org.springframework.stereotype.Service;
  38. import java.util.*;
  39. import java.util.stream.Collectors;
  40. /**
  41. * <p>
  42. * pro场景表 服务实现类
  43. * </p>
  44. *
  45. * @author
  46. * @since 2022-06-16
  47. */
  48. @Service
  49. @Slf4j
  50. public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro> implements ISceneProService {
  51. @Autowired
  52. private ICameraService cameraService;
  53. @Autowired
  54. ICameraDetailService cameraDetailService;
  55. @Autowired
  56. ISceneService sceneService;
  57. @Autowired
  58. ISceneCopyLogService copyLogService;
  59. @Autowired
  60. IUserIncrementService userIncrementService;
  61. @Autowired
  62. IIncrementTypeService incrementTypeService;
  63. @Autowired
  64. ISceneProEditService sceneProEditService;
  65. @Autowired
  66. FYunFileServiceInterface fYunFileServiceInterface;
  67. @Autowired
  68. IScenePlusService scenePlusService;
  69. @Autowired
  70. IScene3dNumService scene3dNumService;
  71. @Autowired
  72. ISceneCopyLogService sceneCopyLogService;
  73. @Autowired
  74. IScenePlusExtService scenePlusExtService;
  75. @Autowired
  76. LaserService laserService;
  77. @Autowired
  78. FdKKClient fdKKClient;
  79. @Autowired
  80. IFolderSceneService folderSceneService;
  81. @Autowired
  82. ISceneBuildProcessLogService sceneBuildProcessLogService;
  83. @Autowired
  84. ISceneMoveLogService sceneMoveLogService;
  85. @Autowired
  86. ISceneResourceCameraService sceneResourceCameraService;
  87. @Autowired
  88. ISceneDelLogService sceneDelLogService;
  89. @Autowired
  90. RabbitMqProducer rabbitMqProducer;
  91. @Autowired
  92. RedisUtil redisUtil;
  93. @Autowired
  94. ISceneColdStorageService sceneColdStorageService;
  95. @Autowired
  96. ICommonService commonService;
  97. @Autowired
  98. IUserService userService;
  99. @Autowired
  100. IMqSendLogService mqSendLogService;
  101. @Autowired
  102. OverallService overallService;
  103. @Autowired
  104. ICameraTypeService cameraTypeService;
  105. @Override
  106. public ScenePro getByNum(String num) {
  107. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  108. wrapper.eq(ScenePro::getNum,num);
  109. wrapper.eq(ScenePro::getIsUpgrade,0);
  110. List<ScenePro> list = this.list(wrapper);
  111. if(list == null || list.size() <=0){
  112. return null;
  113. }
  114. return list.get(0);
  115. }
  116. @Override
  117. public HashMap<Long, Long> getCountGroupByUserId(List<Long> userIdList) {
  118. HashMap<Long,Long> map = new HashMap<>();
  119. List<GroupByCount> result = this.getBaseMapper().getCountGroupByUserId(userIdList);
  120. result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
  121. return map;
  122. }
  123. @Override
  124. public HashMap<Long, Long> getCountGroupByCameraId(List<Long> cameraIds) {
  125. HashMap<Long,Long> map = new HashMap<>();
  126. List<GroupByCount> result = this.getBaseMapper().getCountGroupByCameraId(cameraIds);
  127. result.forEach(entity ->map.put(entity.getId(),entity.getCount()));
  128. return map;
  129. }
  130. @Override
  131. public void unbindCamera(Long cameraId) {
  132. LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
  133. wrapper.set(ScenePro::getUserId,null)
  134. .eq(ScenePro::getCameraId,cameraId);
  135. wrapper.eq(ScenePro::getIsUpgrade,0);
  136. this.update(wrapper);
  137. }
  138. @Override
  139. public List<ScenePro> getListByCameraId(Long cameraId) {
  140. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  141. wrapper.eq(ScenePro::getCameraId,cameraId);
  142. wrapper.eq(ScenePro::getIsUpgrade,0);
  143. return this.list(wrapper);
  144. }
  145. /**
  146. * @param payStatus -2 封存,为 1 解封
  147. */
  148. @Override
  149. public void lockOrUnLockBySpace(CameraDetail cameraDetail) {
  150. if(cameraDetail == null ){
  151. return;
  152. }
  153. if(!"aws".equals(CacheUtil.uploadType) && cameraTypeService.isLaser(cameraDetail.getType())){
  154. return;
  155. }
  156. ScenePayStatusVo scenePayStatusVo = new ScenePayStatusVo(cameraDetail.getCameraId());
  157. Map<String, Object> map = BeanUtil.beanToMap(scenePayStatusVo);
  158. rabbitMqProducer.sendByWorkQueue(MqQueueUtil.ucenterScenePayStatusQueue, map);
  159. }
  160. @Override
  161. public void lockOrUnLockBySpace(Long cameraId) {
  162. CameraDetail cameraDetail = cameraDetailService.getByCameraId(cameraId);
  163. this.lockOrUnLockBySpace(cameraDetail);
  164. }
  165. /**
  166. * 从oss中获取文件,并重写,上传替换
  167. */
  168. private void updateOssStatus(String path,Integer payStatus,String updateStatus) {
  169. String localPath = String.format(OssPath.localStatusPath, path);
  170. try {
  171. if(!fYunFileServiceInterface.fileExist(path)){
  172. return;
  173. }
  174. String data = fYunFileServiceInterface.getFileContent(path);
  175. if(StringUtils.isBlank(data)){
  176. return;
  177. }
  178. JSONObject jsonObject = JSONObject.parseObject(data);
  179. jsonObject.put(updateStatus,payStatus);
  180. String json = JSONUtil.toJsonStr(jsonObject);
  181. FileUtils.writeFile(localPath,json);
  182. log.info("updateOssStatus--localPath:{},ossPath:{}",localPath,path);
  183. fYunFileServiceInterface.uploadFile(localPath,path);
  184. }catch (Exception e){
  185. e.printStackTrace();
  186. }finally {
  187. FileUtil.del(localPath);
  188. }
  189. }
  190. @Override
  191. public PageInfo pageList(SceneParam param) {
  192. SceneTypeLabelEnum sceneTypeLabelEnum = SceneTypeLabelEnum.getByLabelType(param.getType());
  193. if(sceneTypeLabelEnum == null){
  194. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  195. }
  196. if(param.getType() == 3){ //双目lite
  197. return sceneService.pageList(param);
  198. }
  199. //优化查询,去掉left join
  200. //snCode 查询,userName 查询,companyId查询
  201. //snCode回显,userName回显
  202. if(StringUtils.isNotBlank(param.getSnCode())){
  203. List<Camera> cameraList = cameraService.getLikeBySnCode(param.getSnCode());
  204. List<Long> cameraIds = cameraList.stream().map(Camera::getId).collect(Collectors.toList());
  205. param.setCameraIds(cameraIds);
  206. }
  207. if(StringUtils.isNotBlank(param.getUserName())){
  208. List<User> userList = userService.getLikeByUserName(param.getUserName());
  209. List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
  210. param.setUserIds(userIds);
  211. }
  212. if(param.getCompanyId() != null){
  213. List<CameraDetail> details = cameraDetailService.getListByCompanyId(param.getCompanyId());
  214. List<Long> cameraIds = details.stream().map(CameraDetail::getCameraId).collect(Collectors.toList());
  215. if(param.getCameraIds() == null || param.getCameraIds().isEmpty()){
  216. param.setCameraIds(cameraIds);
  217. }else {
  218. List<Long> intersection = cameraIds.stream().filter(param.getCameraIds()::contains).collect(Collectors.toList());
  219. param.setCameraIds(intersection);
  220. }
  221. }
  222. if((param.getCameraIds() != null && param.getCameraIds().size()<=0) || (param.getUserIds() != null && param.getUserIds().size()<=0)){
  223. return PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize());
  224. }
  225. HashMap<String, JSONObject> laserMap = new HashMap<>();
  226. param.setIsLaser(sceneTypeLabelEnum.getLaser());
  227. Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
  228. List<SceneVo> records = page.getRecords();
  229. HashMap<String,SceneCopyLog> map = null;
  230. HashMap<String,SceneColdStorage> coldStorageMap = null;
  231. HashMap<Long, User> userMap = null;
  232. HashMap<Long, Camera> cameraMap = null;
  233. HashMap<String,MqSendLog> mqSendLogMap = null;
  234. List<String> sceneNumList = page.getRecords().stream().map(SceneVo::getNum).collect(Collectors.toList());
  235. if(!records.isEmpty()){
  236. map = copyLogService.getByNewNumList(sceneNumList);
  237. coldStorageMap = sceneColdStorageService.getByNumList(sceneNumList);
  238. List<Long> userIds = records.parallelStream().map(SceneVo::getUserId).collect(Collectors.toList());
  239. userMap = userService.getByIds(userIds);
  240. List<Long> cameraIds = records.parallelStream().map(SceneVo::getCameraId).collect(Collectors.toList());
  241. cameraMap = cameraService.getByIds(cameraIds);
  242. if(param.getIsLaser()){
  243. laserMap = laserService.list(sceneNumList,sceneTypeLabelEnum.getSceneSource().get(0));
  244. }
  245. List<String> modelingNumList = page.getRecords().stream().filter(e -> e.getStatus() == 0).map(SceneVo::getNum).collect(Collectors.toList());
  246. if(!modelingNumList.isEmpty()){
  247. mqSendLogMap = mqSendLogService.getByNumList(modelingNumList);
  248. }
  249. }
  250. for (SceneVo record : page.getRecords()) {
  251. if(param.getIsLaser()){
  252. JSONObject ssObj = laserMap.get(record.getNum());
  253. if(ssObj!=null){
  254. record.setSceneName(ssObj.getString("title"));
  255. record.setThumb(ssObj.getString("thumb"));
  256. record.setWebSite(ssObj.getString("webSite"));
  257. record.setIsObj(ssObj.getInteger("buildObjStatus"));
  258. record.setViewCount(ssObj.getInteger("viewCount"));
  259. record.setStatus(toFdStatus(ssObj.getInteger("status")));
  260. record.setAlgorithmTime(ssObj.getString("algorithmTime"));
  261. }else if(record.getStatus() != 0){
  262. record.setStatus(-1);
  263. record.setWebSite(null);
  264. }
  265. }else {
  266. if(record.getSceneSource() != null && (SceneTypeLabelEnum.isLaserBySceneSource(record.getSceneSource()))){
  267. record.setComputeTime(record.getMeshComputeTime());
  268. }
  269. }
  270. if(record.getStatus() != -2){
  271. record.setComputeTime(null);
  272. record.setAlgorithmTime(null);
  273. }
  274. record.setStatusString(SceneStatusUtil.getStatusString(record));
  275. if(userMap != null){
  276. User user = userMap.get(record.getUserId());
  277. if(user != null){
  278. record.setUserName(user.getUserName());
  279. }
  280. }
  281. if(cameraMap != null){
  282. Camera camera = cameraMap.get(record.getCameraId());
  283. if(camera != null){
  284. record.setSnCode(camera.getSnCode());
  285. }
  286. }
  287. if(map !=null ){
  288. SceneCopyLog sceneCopyLog = map.get(record.getNum());
  289. if(sceneCopyLog != null){
  290. record.setCopyTime(sceneCopyLog.getCreateTime());
  291. record.setIsCopy(true);
  292. }
  293. }
  294. if(coldStorageMap != null){
  295. SceneColdStorage sceneColdStorage = coldStorageMap.get(record.getNum());
  296. if(sceneColdStorage != null){
  297. record.setIsColdStorage(true);
  298. }
  299. }
  300. if(record.getStatus() == -1){ //计算失败
  301. SceneBuildProcessLog sceneBuildProcessLog = sceneBuildProcessLogService.getByNum(record.getNum());
  302. String process = null;
  303. if(sceneBuildProcessLog !=null){
  304. process = sceneBuildProcessLog.getProcess();
  305. }
  306. record.setBuildErrorReason(SceneBuildProcessLogEnum.getReason(process));
  307. }
  308. //{"latitude":22.3672085,"longitude":113.595673,"altitude":9.275519,"horizontalAccuracy":65.0,"verticalAccuracy":10.0,"timestamp":1564381147.2775609}
  309. record.setAddressComponent(commonService.getAddressComponent(record.getGps()));
  310. if(mqSendLogMap!=null){
  311. MqSendLog mqSendLog = mqSendLogMap.get(record.getNum());
  312. if(mqSendLog != null){
  313. record.setStatusString("排队中");
  314. record.setStatus(-4);
  315. }
  316. }
  317. // if(record.getLocation() != null && (record.getLocation() == 5 || record.getLocation() == 6)){
  318. // if(record.getMixture() != 1){
  319. // record.setSlamCount(record.getShootCount());
  320. // record.setShootCount(null);
  321. // }
  322. // }
  323. }
  324. return PageInfo.PageInfo(page);
  325. }
  326. private Integer toFdStatus(Integer status) {
  327. //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
  328. switch (status) {
  329. case 0:
  330. case 4:
  331. return 0;
  332. case 2:
  333. return -2;
  334. case 3:
  335. return -3;
  336. default:
  337. return -1;
  338. }
  339. }
  340. @Override
  341. public synchronized Integer move(SceneParam param) {
  342. Camera camera = cameraService.getBySnCode(param.getSnCode());
  343. if(camera == null){
  344. throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
  345. }
  346. CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
  347. if(cameraDetail == null){
  348. throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
  349. }
  350. Integer successNum = 1;
  351. HashSet<Long> cameraIds = new HashSet<>();
  352. if(StringUtils.isNotBlank(param.getNum())){
  353. moveScene(param.getNum(),camera,cameraDetail,cameraIds);
  354. }else {
  355. successNum = param.getNumList().size();
  356. for (String num : param.getNumList()) {
  357. try {
  358. moveScene(num,camera,cameraDetail,cameraIds);
  359. }catch (Exception e){
  360. successNum --;
  361. log.info("move-scene-error:num:{},errorNum:{},error:{}",num,successNum,e.getMessage());
  362. }
  363. }
  364. }
  365. for (Long cameraId : cameraIds) {
  366. this.lockOrUnLockBySpace(cameraId);
  367. }
  368. return successNum;
  369. }
  370. private void moveScene(String num,Camera camera,CameraDetail cameraDetail, HashSet<Long> cameraIds){
  371. ScenePro scenePro = this.getByNum(num);
  372. ScenePlus scenePlus = scenePlusService.getByNum(num);
  373. if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
  374. throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  375. }
  376. Integer status = scenePro == null ? scenePlus.getSceneStatus() : scenePro.getStatus();
  377. if(status != -2){
  378. throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
  379. }
  380. Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
  381. Long space = scenePro == null ? 0 :scenePro.getSpace();
  382. String dataSource = scenePro == null ? null :scenePro.getDataSource();
  383. if(scenePlus !=null){
  384. ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
  385. space = scenePlusExt.getSpace();
  386. dataSource = scenePlusExt.getDataSource();
  387. }
  388. space = space == null ? 0 :space;
  389. Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail, space);
  390. //深时场景无限容量
  391. if( !checkSpace){
  392. throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
  393. }
  394. Camera oldCamera = cameraService.getById(sceneCameraId);
  395. if(oldCamera == null){
  396. throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
  397. }
  398. CameraDetail oldCameraDetail = cameraDetailService.getByCameraId(oldCamera.getId());
  399. if(oldCameraDetail == null){
  400. throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
  401. }
  402. if(oldCameraDetail.getCameraId().equals(cameraDetail.getCameraId())){
  403. throw new BusinessException(ResultCode.CAMERA_NOT_MOVE);
  404. }
  405. if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
  406. throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
  407. }
  408. Long oldUseSpace = oldCameraDetail.getUsedSpace() - space < 0 ? 0 : oldCameraDetail.getUsedSpace() - space;
  409. if("GB".equals(oldCameraDetail.getUnit())){
  410. oldUseSpace = 1L;
  411. }
  412. Long subSpace = oldCameraDetail.getTotalSpace() - oldUseSpace;
  413. if(scenePro!=null){
  414. LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
  415. wrapper.eq(ScenePro::getId,scenePro.getId());
  416. wrapper.set(ScenePro::getCameraId,camera.getId());
  417. wrapper.set(ScenePro::getUserId,cameraDetail.getUserId());
  418. // wrapper.set(ScenePro::getStatus,0);
  419. // this.updateOssStatus(String.format(OssPath.v3_statusPath,scenePro.getNum()),0,"status");
  420. this.update(wrapper);
  421. //场景迁移到另外的相机清除本身在的文件夹
  422. folderSceneService.delBySceneId(scenePro.getId());
  423. }
  424. if(scenePlus!=null){
  425. LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
  426. wrapper.eq(ScenePlus::getId,scenePlus.getId());
  427. wrapper.set(ScenePlus::getCameraId,camera.getId());
  428. wrapper.set(ScenePlus::getUserId,cameraDetail.getUserId());
  429. //wrapper.set(ScenePlus::getSceneStatus,0);
  430. //this.updateOssStatus(String.format(OssPath.v4_statusPath,scenePlus.getNum()),0,"status");
  431. scenePlusService.update(wrapper);
  432. folderSceneService.delBySceneId(scenePlus.getId());
  433. }
  434. //协作相机
  435. sceneResourceCameraService.setCooperationUser(cameraDetail,num);
  436. //String newDataSource = updateFdageNewDataSource(scenePro, scenePlus, oldCamera.getSnCode(), param.getSnCode(), dataSource);
  437. Boolean newIsLaser = cameraTypeService.isLaser(cameraDetail.getType());
  438. Boolean oldIsLaser = cameraTypeService.isLaser(oldCameraDetail.getType());
  439. if(newIsLaser){ //深时场景
  440. //迁移深时 dataSource
  441. //FileUtil.move(new File(dataSource +"_laserData"),new File(newDataSource+"_laserData"),true);
  442. laserService.move(num,oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId(),dataSource);
  443. }
  444. if(!"aws".equals(CacheUtil.uploadType) && !oldIsLaser && subSpace >0){ //有剩余容量解封容量内场景
  445. cameraIds.add(oldCameraDetail.getCameraId());
  446. }
  447. if(!"aws".equals(CacheUtil.uploadType) && !oldIsLaser){ //有剩余容量解封容量内场景
  448. cameraIds.add(cameraDetail.getCameraId());
  449. }
  450. if("aws".equals(CacheUtil.uploadType) && subSpace >0){ //有剩余容量解封容量内场景
  451. cameraIds.add(oldCameraDetail.getCameraId());
  452. }
  453. if("aws".equals(CacheUtil.uploadType)){ //有剩余容量解封容量内场景
  454. cameraIds.add(cameraDetail.getCameraId());
  455. }
  456. sceneMoveLogService.saveLog(scenePro,scenePlus,camera.getSnCode(),oldCamera.getSnCode(),dataSource,dataSource, null);
  457. laserService.moveWenBao(num,oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId(),dataSource);
  458. }
  459. private JSONObject updateFdageJson(JSONObject jsonObject,String newSnCode){
  460. JSONObject cam = jsonObject.getJSONObject("cam");
  461. if(cam != null){
  462. cam.put("uuid",newSnCode.toLowerCase()); //替换相机sn uuid
  463. }
  464. JSONArray points = jsonObject.getJSONArray("points"); //修改点位中的相机sn
  465. if(points !=null){
  466. for (Object point : points) {
  467. JSONObject jobj = (JSONObject) point;
  468. jobj.put("camera",newSnCode.toLowerCase());
  469. }
  470. }
  471. jsonObject.put("creator",newSnCode.toLowerCase()); //替换相机拍摄sn
  472. return jsonObject;
  473. }
  474. /**
  475. * 兼容,之前迁移,不使用旧snCode 替换新snCode。重写文件
  476. */
  477. public String updateFdageNewDataSource(ScenePro scenePro,ScenePlus scenePlus,String oldSnCode,String newSnCode,String dataSource) {
  478. String localPathFdage = null;
  479. try {
  480. newSnCode = newSnCode.toLowerCase();
  481. String fdagePaht = dataSource.replace("/mnt/data","home") +"/data.fdage";
  482. if(!fYunFileServiceInterface.fileExist(fdagePaht)){
  483. return dataSource;
  484. }
  485. localPathFdage = String.format(OssPath.localFdagePath,fdagePaht);
  486. String fileContent = fYunFileServiceInterface.getFileContent(fdagePaht);
  487. JSONObject jsonObject = updateFdageJson(JSONObject.parseObject(fileContent), newSnCode);
  488. FileUtils.writeFile(localPathFdage ,JSONObject.toJSONString(jsonObject));
  489. String oldFdagePaht = dataSource.replace("/mnt/data","home") ;
  490. String[] split = oldFdagePaht.split("/");
  491. String newFdagePath = split[0] +"/"+ newSnCode +"/"+ split[2] +"/"+ newSnCode +"_" + split[3].split("_")[1];
  492. String delPath = null;
  493. if(!oldFdagePaht.equals(newFdagePath)){
  494. log.info("updateFdageCopy--复制oss资源--oldFdagePaht:{},newFdagePath:{}",oldFdagePaht,newFdagePath);
  495. fYunFileServiceInterface.copyFileInBucket(oldFdagePaht,newFdagePath);
  496. delPath = oldFdagePaht;
  497. }
  498. fYunFileServiceInterface.uploadFile(localPathFdage,newFdagePath+"/data.fdage");
  499. log.info("updateFdage--localPathFdage:{},newFdagePath:{}",localPathFdage,newFdagePath);
  500. String newDataSource = newFdagePath.replace("home","/mnt/data");
  501. this.updateDataSource(scenePro,scenePlus,newDataSource);
  502. if(delPath != null){
  503. fYunFileServiceInterface.deleteFolder(oldFdagePaht);
  504. }
  505. sceneMoveLogService.saveLog(scenePro,scenePlus,oldSnCode,newSnCode,dataSource,newDataSource, fileContent);
  506. return newDataSource;
  507. }catch (Exception e){
  508. log.error("updateFdage-error:oldSnCode:{},newSnCode:{},dataSource:{}",oldSnCode,newSnCode,dataSource);
  509. log.error("updateFdage-error:",e);
  510. throw new BusinessException(ResultCode.MOVE_SCENE_ERROR);
  511. }finally {
  512. if(localPathFdage != null){
  513. FileUtil.del(localPathFdage);
  514. }
  515. if(scenePro!=null){
  516. LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
  517. wrapper.eq(ScenePro::getId,scenePro.getId());
  518. wrapper.set(ScenePro::getStatus,-2);
  519. this.update(wrapper);
  520. this.updateOssStatus(String.format(OssPath.v3_statusPath,scenePro.getNum()),-2,"status");
  521. }
  522. if(scenePlus!=null){
  523. LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
  524. wrapper.eq(ScenePlus::getId,scenePlus.getId());
  525. wrapper.set(ScenePlus::getSceneStatus,-2);
  526. scenePlusService.update(wrapper);
  527. this.updateOssStatus(String.format(OssPath.v4_statusPath,scenePlus.getNum()),-2,"status");
  528. }
  529. }
  530. }
  531. private void updateDataSource(ScenePro scenePro,ScenePlus scenePlus, String newDataSource) {
  532. if(scenePro !=null){
  533. LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
  534. wrapper.eq(ScenePro::getId,scenePro.getId());
  535. wrapper.eq(ScenePro::getIsUpgrade,0);
  536. wrapper.set(ScenePro::getDataSource,newDataSource);
  537. this.update(wrapper);
  538. }
  539. if(scenePlus !=null){
  540. LambdaUpdateWrapper<ScenePlusExt> wrapperPlus = new LambdaUpdateWrapper<>();
  541. wrapperPlus.eq(ScenePlusExt::getPlusId,scenePlus.getId());
  542. wrapperPlus.set(ScenePlusExt::getDataSource,newDataSource);
  543. scenePlusExtService.update(wrapperPlus);
  544. }
  545. }
  546. @Override
  547. public void copy(String sceneNum) {
  548. ScenePro scenePro = this.getByNum(sceneNum);
  549. ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
  550. if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
  551. throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
  552. }
  553. Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
  554. Camera camera = cameraService.getById(cameraId);
  555. if(camera == null){
  556. throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
  557. }
  558. CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
  559. if(detailEntity == null){
  560. throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
  561. }
  562. Integer sceneStatus = scenePro == null ? scenePlus.getSceneStatus() : scenePro.getStatus();
  563. if(sceneStatus != -2){
  564. throw new BusinessException(ResultCode.SCENE_IS_BUILDING);
  565. }
  566. Long needSpace = 0L;
  567. if(scenePro != null){
  568. needSpace = scenePro.getSpace();
  569. }
  570. if(scenePlus != null){
  571. ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
  572. if(scenePlusExt != null && scenePlusExt.getSpace() != null){
  573. needSpace = scenePlusExt.getSpace();
  574. }
  575. }
  576. Boolean checkSpace = cameraDetailService.checkSpace(detailEntity, needSpace);
  577. if(!checkSpace){
  578. throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
  579. }
  580. HashMap<String, Object> param = new HashMap<>();
  581. param.put("num",sceneNum);
  582. JSONObject jsonObject = fdKKClient.copyScene(param, "m_a_n_a_g_e");
  583. Integer code = jsonObject.getInteger("code");
  584. if(code != 0){
  585. throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
  586. }
  587. }
  588. @Override
  589. public void deleteByNum(String num) {
  590. Integer sceneSource = null;
  591. Long cameraId = null;
  592. ScenePro scenePro = this.getByNum(num);
  593. Scene scene = sceneService.getByNum(num);
  594. ScenePlus scenePlus = scenePlusService.getByNum(num);
  595. Integer status = null;
  596. if(scenePro!=null){
  597. cameraId = scenePro.getCameraId();
  598. sceneSource = scenePro.getSceneSource();
  599. status = scenePro.getStatus();
  600. }
  601. if(scene!=null){
  602. cameraId = scene.getCameraId();
  603. status = scene.getStatus();
  604. }
  605. if(scenePlus!=null){
  606. cameraId = scenePlus.getCameraId();
  607. sceneSource = scenePlus.getSceneSource();
  608. status = scenePlus.getSceneStatus();
  609. }
  610. HashMap<String, MqSendLog> mqSendLogHashMap = mqSendLogService.getByNumList(Arrays.asList(num));
  611. String redisKey = "mq-wait:queue:num:"+num;
  612. if(!mqSendLogHashMap.isEmpty()){
  613. for (String key : mqSendLogHashMap.keySet()) {
  614. if(!redisUtil.hasKey(redisKey)){
  615. mqSendLogService.removeById(mqSendLogHashMap.get(key).getId());
  616. status = -1;
  617. }
  618. }
  619. }
  620. if(status != null && status == 0){
  621. throw new BusinessException(ResultCode.CAN_NOT_DEL_MODELING_SCENE);
  622. }
  623. if(scenePro!=null){
  624. this.removeById(scenePro.getId());
  625. }
  626. if(scene!=null){
  627. sceneService.removeById(scene.getId());
  628. }
  629. if(scenePlus!=null){
  630. ScenePlusExt plusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
  631. if(plusExt != null){
  632. scenePlusExtService.delByPlus(scenePlus.getId());
  633. }
  634. scenePlusService.removeById(scenePlus.getId());
  635. }
  636. if(sceneSource != null && (sceneSource == 4 || sceneSource == 5 || sceneSource ==57)){
  637. laserService.delete(num);
  638. }
  639. //overallService.delete(num);
  640. if(cameraId != null){
  641. cameraDetailService.initSpace(cameraId);
  642. this.lockOrUnLockBySpace(cameraId);
  643. }
  644. sceneDelLogService.saveLog(num, StpUtil.getLoginId());
  645. }
  646. @Override
  647. public Long getKkCount(List<String> asList, String startTime) {
  648. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  649. wrapper.in(ScenePro::getSceneSource,asList);
  650. wrapper.eq(ScenePro::getIsUpgrade,0);
  651. wrapper.lt(ScenePro::getCreateTime,startTime);
  652. long count = this.count(wrapper);
  653. LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
  654. wrapper2.in(ScenePlus::getSceneSource,asList);
  655. wrapper2.lt(ScenePlus::getCreateTime,startTime);
  656. long count1 = scenePlusService.count(wrapper2);
  657. return count + count1;
  658. }
  659. @Override
  660. public Long getSsCount(List<String> asList, String startTime) {
  661. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  662. wrapper.in(ScenePro::getSceneSource,asList);
  663. wrapper.eq(ScenePro::getIsUpgrade,0);
  664. wrapper.lt(ScenePro::getCreateTime,startTime);
  665. LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
  666. wrapper2.in(ScenePlus::getSceneSource,asList);
  667. wrapper2.lt(ScenePlus::getCreateTime,startTime);
  668. long count = scenePlusService.count(wrapper2);
  669. return this.count(wrapper) + count;
  670. }
  671. @Override
  672. public Long getSsObjCount(List<String> asList, String startTime) {
  673. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  674. wrapper.in(ScenePro::getSceneSource,asList);
  675. wrapper.eq(ScenePro::getIsUpgrade,0);
  676. if(StringUtils.isNotBlank(startTime)){
  677. wrapper.lt(ScenePro::getCreateTime,startTime);
  678. }
  679. wrapper.eq(ScenePro::getIsObj,1);
  680. LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
  681. wrapper2.in(ScenePlus::getSceneSource,asList);
  682. if(StringUtils.isNotBlank(startTime)){
  683. wrapper2.lt(ScenePlus::getCreateTime,startTime);
  684. }
  685. List<ScenePlus> list = scenePlusService.list(wrapper2);
  686. List<Long> plusIds = list.stream().map(ScenePlus::getId).collect(Collectors.toList());
  687. long count = 0L;
  688. if(plusIds.size() >0){
  689. LambdaQueryWrapper<ScenePlusExt> wrapper3 = new LambdaQueryWrapper<>();
  690. wrapper3.in(ScenePlusExt::getPlusId,plusIds);
  691. wrapper3.eq(ScenePlusExt::getIsObj,1);
  692. count = scenePlusExtService.count(wrapper3);
  693. }
  694. return this.count(wrapper) + count;
  695. }
  696. @Override
  697. public HashMap<String, String> getSnCodeByNumList(Set<String> numList) {
  698. HashMap<String, Long> sceneMap = new HashMap<>();
  699. HashMap<Long, String> cameraMap = new HashMap<>();
  700. HashMap<String, String> snCodeMap = new HashMap<>();
  701. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  702. wrapper.eq(ScenePro::getIsUpgrade,0);
  703. wrapper.in(ScenePro::getNum,numList);
  704. List<ScenePro> list = this.list(wrapper);
  705. if(list.size() >0){
  706. list.forEach(entity -> sceneMap.put(entity.getNum(),entity.getCameraId()));
  707. }
  708. LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
  709. wrapper2.in(ScenePlus::getNum,numList);
  710. List<ScenePlus> list2 = scenePlusService.list(wrapper2);
  711. if(list2.size() >0){
  712. list2.forEach(entity -> sceneMap.put(entity.getNum(),entity.getCameraId()));
  713. }
  714. if(sceneMap.size() <=0){
  715. return snCodeMap;
  716. }
  717. Set<Long> cameraIds = list.stream().map(ScenePro::getCameraId).collect(Collectors.toSet());
  718. Set<Long> cameraIds2 = list2.stream().map(ScenePlus::getCameraId).collect(Collectors.toSet());
  719. cameraIds.addAll(cameraIds2);
  720. if(cameraIds.size() >0){
  721. List<Camera> cameraList = cameraService.listByIds(cameraIds);
  722. cameraList.forEach(entity -> cameraMap.put(entity.getId(),entity.getSnCode()));
  723. for (String num : numList) {
  724. Long cameraId = sceneMap.get(num);
  725. if(cameraId != null){
  726. snCodeMap.put(num,cameraMap.get(cameraId));
  727. }
  728. }
  729. List<CameraDetail> cameraIds1 = cameraDetailService.getByCameraIds(cameraList.stream().map(Camera::getId).collect(Collectors.toList()));
  730. for (CameraDetail cameraDetail : cameraIds1) {
  731. snCodeMap.put(cameraMap.get(cameraDetail.getCameraId()), CameraUtils.getCameraTypeStr(cameraDetail.getType()));
  732. }
  733. }
  734. return snCodeMap;
  735. }
  736. @Override
  737. public HashMap<Long,Long > getSpaceGroupByCameraId() {
  738. List<GroupByCount> proSum = this.getBaseMapper().getProSpaceGroupByCameraId();
  739. HashMap<Long,Long > map = new HashMap<>();
  740. for (GroupByCount groupByCount : proSum) {
  741. map.merge(groupByCount.getId(), groupByCount.getCount()==null?0:groupByCount.getCount(), Long::sum);
  742. }
  743. List<GroupByCount > plusSum = this.getBaseMapper().getPlusSpaceGroupByCameraId();
  744. for (GroupByCount groupByCount : plusSum) {
  745. map.merge(groupByCount.getId(), groupByCount.getCount()==null?0:groupByCount.getCount(), Long::sum);
  746. }
  747. return map;
  748. }
  749. @Override
  750. public void rebuildScene(String num,String from) {
  751. String redisKey2 = String.format(RedisKeyUtil.numShootKey, num);
  752. redisUtil.del(redisKey2);
  753. String dataSource = null;
  754. ScenePro scenePro = this.getByNum(num);
  755. if(scenePro!=null && scenePro.getSceneSource() != 4){
  756. throw new BusinessException(ResultCode.V3_SCENE_REBUILD);
  757. }
  758. ScenePlus scenePlus = scenePlusService.getByNum(num);
  759. if(scenePlus == null && scenePro == null){
  760. throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
  761. }
  762. if(scenePro != null){
  763. dataSource = scenePro.getDataSource();
  764. }
  765. if(scenePlus != null){
  766. ScenePlusExt scenePlusExt= scenePlusExtService.getByPlusId(scenePlus.getId());
  767. if(scenePlusExt!= null){
  768. dataSource = scenePlusExt.getDataSource();
  769. }
  770. }
  771. if(StringUtils.isBlank(dataSource)){
  772. throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
  773. }
  774. Long countByNewNum = sceneCopyLogService.getCountByNewNum(num);
  775. if(countByNewNum >0){
  776. throw new BusinessException(ResultCode.COPY_NUM_NOTREBUILD);
  777. }
  778. SceneColdStorage coldStorage = sceneColdStorageService.getByNum(num);
  779. if(coldStorage != null){
  780. throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR2);
  781. }
  782. if(!fYunFileServiceInterface.fileExist(dataSource.replace("/mnt/data","home")+"/data.fdage")){
  783. throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
  784. }
  785. HashMap<String,Object> paramMap = new HashMap<>();
  786. paramMap.put("num",num);
  787. paramMap.put("from",from == null ? "manage":from);
  788. try {
  789. JSONObject jsonObject = fdKKClient.rebuildScene(paramMap);
  790. Integer code = jsonObject.getInteger("code");
  791. if(code != 0){
  792. log.error("场景重算失败:{},{}",num,jsonObject);
  793. throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR.code(), jsonObject.getString("msg"));
  794. }
  795. }catch (Exception e){
  796. throw new BusinessException(ResultCode.SCENE_REBUILD_ERROR);
  797. }
  798. }
  799. @Override
  800. public void restStore(String num) {
  801. if(StringUtils.isBlank(num)){
  802. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  803. }
  804. String redisKey = String.format(RedisKeyUtil.restStoreKey, num);
  805. if(redisUtil.hasKey(redisKey)){
  806. throw new BusinessException(ResultCode.SCENE_STORE_ING);
  807. }
  808. SceneColdStorage sceneColdStorage = sceneColdStorageService.getByNum(num);
  809. if(sceneColdStorage == null){
  810. throw new BusinessException(ResultCode.SCENE_NOT_STORE);
  811. }
  812. String dataSource = scenePlusService.getDataSourceByNum(num);
  813. if(StringUtils.isBlank(dataSource)){
  814. throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
  815. }
  816. String homePath = dataSource.replace("/mnt/data","home");
  817. SceneRestStoreVo sceneRestStoreVo = new SceneRestStoreVo(num,sceneColdStorage.getColdBucket(),sceneColdStorage.getBucket(),homePath);
  818. Map<String, Object> map = BeanUtil.beanToMap(sceneRestStoreVo);
  819. redisUtil.set(redisKey,homePath);
  820. rabbitMqProducer.sendByWorkQueue(MqQueueUtil.sceneRestoreQueue,map);
  821. //threadService.checkRestore(num,sceneColdStorage.getColdBucket(),sceneColdStorage.getBucket(),homePath);
  822. }
  823. @Override
  824. public void restStoreSuccess(String num) {
  825. Integer sceneResource = null;
  826. ScenePro scenePro = this.getByNum(num);
  827. Date time = DateUtils.dateAddOneMonth(new Date(),-11);
  828. String date = DateUtils.getDate(time);
  829. if(scenePro!=null ){
  830. sceneResource = scenePro.getSceneSource();
  831. LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
  832. wrapper.eq(ScenePro::getId,scenePro.getId());
  833. wrapper.set(ScenePro::getCreateTime,date);
  834. this.update(wrapper);
  835. }
  836. ScenePlus scenePlus = scenePlusService.getByNum(num);
  837. if(scenePlus != null ){
  838. sceneResource = scenePlus.getSceneSource();
  839. ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
  840. if(scenePlusExt != null){
  841. LambdaUpdateWrapper<ScenePlusExt> wrapper = new LambdaUpdateWrapper<>();
  842. wrapper.eq(ScenePlusExt::getId,scenePlusExt.getId());
  843. wrapper.set(ScenePlusExt::getAlgorithmTime,date);
  844. scenePlusExtService.update(wrapper);
  845. }
  846. }
  847. //深时场景通知修改计算完成时间
  848. if(sceneResource != null && (sceneResource == 4 || sceneResource == 5)){
  849. HashMap<String,String> map = new HashMap<>();
  850. map.put("sceneCode",num);
  851. map.put("algorithmTime",date);
  852. rabbitMqProducer.sendByWorkQueue(MqQueueUtil.laserUnfreezeScene,map);
  853. }
  854. }
  855. @Override
  856. public Object getRestStoreProcess(String num) {
  857. if(StringUtils.isBlank(num)){
  858. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  859. }
  860. SceneColdStorage sceneColdStorage = sceneColdStorageService.getByNum(num);
  861. if(sceneColdStorage == null){
  862. throw new BusinessException(ResultCode.SCENE_NOT_STORE);
  863. }
  864. String dataSource = scenePlusService.getDataSourceByNum(num);
  865. if(StringUtils.isBlank(dataSource)){
  866. throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
  867. }
  868. String homePath = dataSource.replace("/mnt/data","home");
  869. return fYunFileServiceInterface.getRestoreFolderProcess(sceneColdStorage.getColdBucket(),homePath);
  870. }
  871. @Override
  872. public Long getSpaceSumByCameraId(Long cameraId) {
  873. return this.getBaseMapper().getSpaceSumByCameraId(cameraId);
  874. }
  875. @Override
  876. public Long getCountByCameraId(Long cameraId) {
  877. LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
  878. wrapper.eq(ScenePro::getIsUpgrade,0);
  879. wrapper.eq(ScenePro::getCameraId,cameraId);
  880. wrapper.in(ScenePro::getStatus,0,-2);
  881. return this.count(wrapper);
  882. }
  883. @Override
  884. public void updateTitleByNum(String sceneNum, String sceneNewTitle) {
  885. LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
  886. updateWrapper.eq(ScenePro::getNum,sceneNum);
  887. updateWrapper.set(ScenePro::getLaserTitle,sceneNewTitle);
  888. this.update(updateWrapper);
  889. }
  890. @Override
  891. public Object labelList() {
  892. return SceneTypeLabelEnum.getAllProperties();
  893. }
  894. }