TowerServiceImpl.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. package com.fdkankan.extend.service.impl;
  2. import cn.hutool.core.collection.CollUtil;
  3. import cn.hutool.core.date.DateUtil;
  4. import cn.hutool.core.exceptions.ExceptionUtil;
  5. import cn.hutool.core.io.FileUtil;
  6. import cn.hutool.core.util.StrUtil;
  7. import cn.hutool.core.util.ZipUtil;
  8. import cn.hutool.crypto.SecureUtil;
  9. import cn.hutool.crypto.symmetric.AES;
  10. import cn.hutool.http.HttpStatus;
  11. import cn.hutool.http.HttpUtil;
  12. import cn.hutool.jwt.signers.AlgorithmUtil;
  13. import com.alibaba.fastjson.JSON;
  14. import com.alibaba.fastjson.JSONArray;
  15. import com.alibaba.fastjson.JSONObject;
  16. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  17. import com.fdkankan.common.constant.CommonSuccessStatus;
  18. import com.fdkankan.common.constant.ErrorCode;
  19. import com.fdkankan.common.constant.SceneStatus;
  20. import com.fdkankan.common.exception.BusinessException;
  21. import com.fdkankan.common.util.AesUtil;
  22. import com.fdkankan.common.util.DateExtUtil;
  23. import com.fdkankan.extend.bean.TowerSceneBean;
  24. import com.fdkankan.extend.entity.Camera;
  25. import com.fdkankan.extend.entity.CameraDetail;
  26. import com.fdkankan.extend.entity.ScenePlus;
  27. import com.fdkankan.extend.httpclient.HttpClient;
  28. import com.fdkankan.extend.service.*;
  29. import com.fdkankan.extend.util.RsaCryptTools;
  30. import com.fdkankan.fyun.face.FYunFileServiceInterface;
  31. import com.fdkankan.model.constants.UploadFilePath;
  32. import com.fdkankan.model.utils.SceneUtil;
  33. import com.fdkankan.rabbitmq.util.RabbitMqProducer;
  34. import com.fdkankan.redis.constant.RedisKey;
  35. import com.fdkankan.redis.util.RedisUtil;
  36. import com.fdkankan.web.response.ResultData;
  37. import lombok.extern.slf4j.Slf4j;
  38. import org.springframework.amqp.rabbit.core.RabbitTemplate;
  39. import org.springframework.beans.factory.annotation.Autowired;
  40. import org.springframework.beans.factory.annotation.Value;
  41. import org.springframework.stereotype.Service;
  42. import org.springframework.web.multipart.MultipartFile;
  43. import javax.annotation.Resource;
  44. import javax.crypto.KeyGenerator;
  45. import javax.crypto.SecretKey;
  46. import java.io.File;
  47. import java.io.IOException;
  48. import java.util.*;
  49. import java.util.stream.Collectors;
  50. @Slf4j
  51. @Service
  52. public class TowerServiceImpl implements ITowerService {
  53. private static String parentPath = "/home/backend/4dkankan_v4/modeling-extend/download/";
  54. private static String ossParentPath = "customer-projects/china-tower/";
  55. private static String ossScenePoolFilePath = ossParentPath.concat("scene.txt");
  56. private static String ossCameraPoolFilePath = ossParentPath.concat("camera.txt");
  57. private static String pushLogPath = parentPath.concat("log.txt");
  58. public static final String TIE_TA_SCENE_PUSH_CALLBACK_QUEUE = "tie_ta_scene_push_callback_queue";
  59. /** 场景推送回调交换机*/
  60. public static final String TIE_TA_SCENE_PUSH_CALLBACK_EXCHANGE = "tie_ta_scene_push_callback_exchange";
  61. /** 场景推送回调交换机路由*/
  62. public static final String TIE_TA_SCENE_PUSH_CALLBACK_ROUTING = "tie_ta_scene_push_callback_routing";
  63. @Value("${tower.manufact}")
  64. private String manufact;
  65. @Value("${tower.private-key}")
  66. private String privateKey;
  67. @Value("${tower.url}")
  68. private String url;
  69. @Autowired
  70. private FYunFileServiceInterface fYunFileService;
  71. @Autowired
  72. private RedisUtil redisUtil;
  73. @Autowired
  74. private ICameraDetailService cameraDetailService;
  75. @Autowired
  76. private IScenePlusService scenePlusService;
  77. @Autowired
  78. private ITowerService towerService;
  79. @Autowired
  80. private ICameraService cameraService;
  81. @Autowired
  82. private ISsoService ssoService;
  83. @Resource
  84. private HttpClient httpClient;
  85. @Autowired
  86. private RabbitMqProducer rabbitMqProducer;
  87. @Autowired
  88. private RabbitTemplate rabbitTemplate;
  89. @Override
  90. public String packSceneDataHandler(String num, String title, String logId) throws Exception {
  91. //校验场景名称是否正确
  92. String sceneStr = fYunFileService.getFileContent(ossScenePoolFilePath);
  93. List<TowerSceneBean> towerSceneBeans = JSON.parseArray(sceneStr, TowerSceneBean.class);
  94. if(CollUtil.isEmpty(towerSceneBeans)){
  95. return null;
  96. }
  97. TowerSceneBean towerSceneBean = towerSceneBeans.stream().filter(bean -> title.equals(bean.getName())).findFirst().get();
  98. if(Objects.isNull(towerSceneBean)){
  99. return null;
  100. }
  101. log.info("开始下载:{}", num);
  102. //场景本地数据父目录
  103. String scenePath = parentPath.concat(num).concat("/");
  104. String sceneSourcePath = scenePath.concat(towerSceneBean.getSceneId()).concat("_").concat(towerSceneBean.getRoomId());
  105. String zipPath = sceneSourcePath.concat(".zip");
  106. //data数据下载
  107. String dataPath = sceneSourcePath + "/data/";
  108. String ossDataPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
  109. //下载floorplan.json
  110. fYunFileService.downloadFile(ossDataPath.concat("floorplan.json"), dataPath.concat("floorplan.json"));
  111. //下载scene.json
  112. String sceneJsonPath = dataPath.concat("scene.json");
  113. String sceneJson = redisUtil.get(String.format(RedisKey.SCENE_JSON, num));
  114. if(StrUtil.isEmpty(sceneJson)){
  115. sceneJson = fYunFileService.getFileContent(ossDataPath.concat("scene.json"));
  116. }
  117. JSONObject sceneJsonObj = JSON.parseObject(sceneJson);
  118. sceneJsonObj.put("sceneKind", "pano");
  119. FileUtil.writeUtf8String(sceneJsonObj.toJSONString(), sceneJsonPath);
  120. //下载mesh
  121. FileUtil.mkdir(dataPath.concat("mesh/"));
  122. List<String> meshList = fYunFileService.listRemoteFiles(ossDataPath.concat("mesh"));
  123. meshList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, dataPath.concat("mesh/")));
  124. //images数据下载
  125. String imagesPath = sceneSourcePath + "/images/";
  126. String ossImagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
  127. //下载high图
  128. List<String> highList = fYunFileService.listRemoteFiles(ossImagesPath.concat("pan/high/"));
  129. FileUtil.mkdir(imagesPath.concat("4k/"));
  130. highList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, imagesPath.concat("4k/")));
  131. //下载low图
  132. FileUtil.mkdir(imagesPath.concat("512/"));
  133. List<String> lowList = fYunFileService.listRemoteFiles(ossImagesPath.concat("pan/low/"));
  134. lowList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, imagesPath.concat("512/")));
  135. //下载vision.txt
  136. fYunFileService.downloadFile(ossImagesPath.concat("vision.txt"), imagesPath.concat("vision.txt"));
  137. //下载caches/images
  138. List<String> panoramaImageList = SceneUtil.getPanoramaImageList(imagesPath.concat("vision.txt"));
  139. log.info(JSON.toJSONString(panoramaImageList));
  140. List<String> imageList = fYunFileService.listRemoteFiles(String.format(UploadFilePath.scene_result_data_path, num).concat("caches/images/"));
  141. if(CollUtil.isNotEmpty(imageList)){
  142. imageList.stream().forEach(key->{
  143. if(panoramaImageList.contains(key.substring(key.lastIndexOf("/") + 1))){
  144. if(!FileUtil.exist(imagesPath.concat("8K"))){
  145. FileUtil.mkdir(imagesPath.concat("8K"));
  146. }
  147. fYunFileService.downloadFile(key, imagesPath.concat("8K"));
  148. }
  149. });
  150. // //移除非必须文件
  151. // List<String> fileNames = FileUtil.listFileNames(imagesPath.concat("8K/"));
  152. // fileNames.stream().forEach(name->{
  153. // if(!panoramaImageList.contains(name)){
  154. // FileUtil.del(imagesPath.concat("8K/") + name);
  155. // }
  156. // });
  157. }
  158. this.convertVisable(imagesPath.concat("vision.txt"));
  159. //打包
  160. ZipUtil.zip(sceneSourcePath, zipPath, true);
  161. log.info("结束下载,开始推送:{}", num);
  162. try {
  163. this.dataPush(num, towerSceneBean.getSceneId(), towerSceneBean.getRoomId(), zipPath);
  164. }finally {
  165. FileUtil.del(scenePath);
  166. }
  167. return zipPath;
  168. }
  169. private void convertVisable(String visionPath){
  170. String visionStr = FileUtil.readUtf8String(visionPath);
  171. JSONObject visionObj = JSON.parseObject(visionStr);
  172. JSONArray array = visionObj.getJSONArray("sweepLocations");
  173. Map<Integer, String> uuidMap = new HashMap<>();
  174. for(int i = 0; i < array.size(); i++){
  175. JSONObject o = (JSONObject)array.get(i);
  176. uuidMap.put(i, o.getString("uuid"));
  177. }
  178. for(int i = 0; i < array.size(); i++){
  179. JSONObject o = (JSONObject)array.get(i);
  180. JSONArray visibles = o.getJSONArray("visibles");
  181. o.put("visibles", this.convertVisableHandler(visibles,uuidMap));
  182. JSONArray visibles2 = o.getJSONArray("visibles2");
  183. o.put("visibles2", this.convertVisableHandler(visibles2,uuidMap));
  184. JSONArray visibles3 = o.getJSONArray("visibles3");
  185. o.put("visibles3", this.convertVisableHandler(visibles3,uuidMap));
  186. }
  187. FileUtil.writeUtf8String(JSON.toJSONString(visionObj), visionPath);
  188. }
  189. private String[] convertVisableHandler(JSONArray visibles, Map<Integer, String> uuidMap){
  190. int size = visibles.size();
  191. String[] visibleArr = new String[size];
  192. for(int j = 0; j < size; j++){
  193. int index = (Integer)visibles.get(j);
  194. String uuid = uuidMap.get(index);
  195. visibleArr[j] = uuid;
  196. }
  197. return visibleArr;
  198. }
  199. @Override
  200. public void packSceneData(Long companyId, List<String> nums) {
  201. String key = "tower:scene:data:download";
  202. List<ScenePlus> scenePlusList = null;
  203. if(Objects.nonNull(companyId)){
  204. //根据客户企业id查出所有相机
  205. List<CameraDetail> cameraDetailList = cameraDetailService.getByCompanyId(companyId);
  206. if(CollUtil.isEmpty(cameraDetailList)){
  207. return;
  208. }
  209. Set<Long> cameraIds = cameraDetailList.stream().map(detail -> detail.getCameraId()).collect(Collectors.toSet());
  210. //根据相机id查出所有待下载场景
  211. scenePlusList = scenePlusService.getByCameraIds(cameraIds);
  212. }else if(CollUtil.isNotEmpty(nums)){
  213. scenePlusList = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>().in(ScenePlus::getNum, nums));
  214. }else{
  215. String snCodeStr = fYunFileService.getFileContent(ossCameraPoolFilePath);
  216. List<String> snCodeList = Arrays.asList(snCodeStr.split(","));
  217. String sceneStr = fYunFileService.getFileContent(ossScenePoolFilePath);
  218. List<TowerSceneBean> towerSceneBeans = JSON.parseArray(sceneStr, TowerSceneBean.class);
  219. List<String> titleList = towerSceneBeans.stream().map(TowerSceneBean::getName).collect(Collectors.toList());
  220. scenePlusList = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>().in(ScenePlus::getTitle, titleList));
  221. List<String> dbTitleList = scenePlusList.stream().map(ScenePlus::getTitle).collect(Collectors.toList());
  222. List<String> notFindList = titleList.stream().filter(title -> {
  223. if (dbTitleList.contains(title)) {
  224. return false;
  225. }else{
  226. return true;
  227. }
  228. }).collect(Collectors.toList());
  229. if(CollUtil.isNotEmpty(notFindList)){
  230. fYunFileService.uploadFile(JSON.toJSONString(notFindList).getBytes(),
  231. ossParentPath.concat("notFind")
  232. .concat("-")
  233. .concat(DateExtUtil.format(new Date(), DateExtUtil.dateStyle7))
  234. .concat(".txt"));
  235. }
  236. }
  237. if(CollUtil.isEmpty(scenePlusList)){
  238. return;
  239. }
  240. String id = DateExtUtil.format(Calendar.getInstance().getTime(), "yyyyMMddHHmmss");
  241. //遍历场景列表开始下载
  242. scenePlusList.stream().forEach(plus -> {
  243. JSONObject jsonObject = new JSONObject();
  244. try {
  245. jsonObject = new JSONObject();
  246. jsonObject.put("title", plus.getTitle());
  247. jsonObject.put("num", plus.getNum());
  248. String zipPath = towerService.packSceneDataHandler(plus.getNum(), plus.getTitle(), id);
  249. jsonObject.put("status", CommonSuccessStatus.SUCCESS.code());
  250. jsonObject.put("zipPath", zipPath);
  251. redisUtil.hset(key, plus.getNum(), JSON.toJSONString(jsonObject));
  252. }catch (Exception e){
  253. log.error("推送失败,num:{},title:{}", plus.getNum(), plus.getTitle(), e);
  254. jsonObject.put("status", CommonSuccessStatus.FAIL.code());
  255. jsonObject.put("error", ExceptionUtil.stacktraceToString(e, 3000));
  256. redisUtil.hset(key, plus.getNum(), JSON.toJSONString(jsonObject));
  257. }
  258. });
  259. }
  260. @Override
  261. public JSONObject dataPush(String num, String sceneId, String roomId, String zipPath) throws Exception {
  262. JSONObject jsonObject = null;
  263. log.info("开始组装参数");
  264. String fileMd5 = com.fdkankan.extend.util.FileUtil.getMulFileMD5(FileUtil.getInputStream(zipPath));
  265. String compose = sceneId.concat("+").concat(roomId).concat("+").concat(fileMd5);
  266. String encrypt = RsaCryptTools.encryptData(compose, privateKey);
  267. Map<String, Object> params = new HashMap<>();
  268. params.put("stationCode", sceneId);
  269. params.put("roomEntityID", roomId);
  270. params.put("file", FileUtil.file(zipPath));
  271. params.put("manufact", manufact);
  272. params.put("encrypt", encrypt);
  273. params.put("upUserAcct", "xxx");
  274. log.info("private-key:{}", privateKey);
  275. log.info("manufact:{}", manufact);
  276. log.info("compose:{}", compose);
  277. log.info("encrypt:{}", encrypt);
  278. log.info("开始推送");
  279. try {
  280. String post = HttpUtil.post(url, params, 60*60*1000);
  281. jsonObject = JSON.parseObject(post);
  282. if(!jsonObject.containsKey("resultCode")){
  283. throw new RuntimeException("铁塔接口出参错误");
  284. }
  285. return jsonObject;
  286. }catch (Exception e){
  287. log.error("调用铁塔接口出错,场景:{}", num, e);
  288. jsonObject = new JSONObject();
  289. jsonObject.put("resultCode", -2);
  290. jsonObject.put("resultMsg", "调用铁塔接口出错");
  291. return jsonObject;
  292. }
  293. }
  294. private void dataPushLog(String num, String title, String resultCode, String resultMsg, String logId){
  295. Map<String, Object> log = new HashMap<>();
  296. log.put("num", num);
  297. log.put("title", title);
  298. log.put("resultCode", resultCode);
  299. log.put("resultMsg", resultMsg);
  300. String content = JSON.toJSONString(log).concat("\r\n");
  301. FileUtil.appendUtf8String(content, parentPath.concat("download").concat("-").concat(logId).concat(".log"));
  302. }
  303. public static void main(String[] args) {
  304. // System.out.println(AlgorithmUtil.getId("AES"));
  305. }
  306. @Override
  307. public ResultData sceneBatchMove(MultipartFile file, String origSnCode, String snCode) throws IOException {
  308. if(file.isEmpty()){
  309. throw new BusinessException(-1, "文件为空");
  310. }
  311. String origPath = "/home/backend/4dkankan_v4/modeling-extend/move/";
  312. String move_url = "https://www.4dkankan.com/service/manage/scene/move";
  313. String orgFileId = DateUtil.format(Calendar.getInstance().getTime(), DateExtUtil.dateStyle11);
  314. String orgFilePath = origPath.concat(orgFileId).concat(".txt");
  315. FileUtil.mkParentDirs(orgFilePath);
  316. file.transferTo(new File(orgFilePath));
  317. List<String> nums = FileUtil.readUtf8Lines(orgFilePath);
  318. if(CollUtil.isEmpty(nums)){
  319. throw new BusinessException(-1, "文件为空");
  320. }
  321. Camera camera = cameraService.findByChildName(origSnCode);
  322. if(Objects.isNull(camera)){
  323. throw new BusinessException(ErrorCode.CAMERA_BIND_NO_EXIST);
  324. }
  325. List<String> notExists = new ArrayList<>();
  326. for (String num : nums) {
  327. ScenePlus byCameraIdAndNum = scenePlusService.getByCameraIdAndNum(num, camera.getId());
  328. if(Objects.isNull(byCameraIdAndNum)){
  329. notExists.add(num);
  330. }
  331. }
  332. if(CollUtil.isNotEmpty(notExists)){
  333. throw new BusinessException(-1, "在原始相机下查询不到场景,请核查:".concat(JSON.toJSONString(notExists)));
  334. }
  335. //模拟登录
  336. Map<String, Object> headers = new HashMap<>();
  337. try {
  338. String token = ssoService.login("zhongwentong", "4Dage168");
  339. headers.put("token", token);
  340. }catch (Exception e){
  341. return ResultData.error(-1, "登录失败");
  342. }
  343. List<Map<String, Object>> result = new ArrayList<>();
  344. for (String num : nums) {
  345. Map<String, Object> param = new HashMap<>();
  346. param.put("num", num);
  347. param.put("snCode", snCode);
  348. ResultData<Map<String, Object>> resultData = httpClient.post(move_url, headers, param);
  349. Map<String, Object> item = new HashMap<>();
  350. item.put("num", num);
  351. item.put("code", resultData.getCode());
  352. item.put("message", resultData.getMessage());
  353. result.add(item);
  354. }
  355. return ResultData.ok(result);
  356. }
  357. @Override
  358. public void pushScene(TowerSceneBean towerSceneBean) throws Exception {
  359. JSONObject pushResult = null;
  360. String num = towerSceneBean.getNum();
  361. Map<String, Object> noticeContent = new HashMap<>();
  362. noticeContent.put("num", num);
  363. String scenePath = parentPath.concat(num).concat("/");
  364. try {
  365. //场景本地数据父目录
  366. String sceneSourcePath = scenePath.concat(towerSceneBean.getSceneId()).concat("_").concat(towerSceneBean.getRoomId());
  367. String zipPath = sceneSourcePath.concat(".zip");
  368. log.info("开始下载:{}", num);
  369. ScenePlus scenePlus = scenePlusService.getByNum(num);
  370. if(Objects.isNull(scenePlus)){
  371. throw new RuntimeException("查询不到此场景");
  372. }
  373. if(scenePlus.getSceneStatus() != SceneStatus.SUCCESS.code() && scenePlus.getSceneStatus() != SceneStatus.NO_DISPLAY.code()){
  374. throw new RuntimeException("场景计算中");
  375. }
  376. //data数据下载
  377. String dataPath = sceneSourcePath + "/data/";
  378. String ossDataPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
  379. //下载floorplan.json
  380. fYunFileService.downloadFile(ossDataPath.concat("floorplan.json"), dataPath.concat("floorplan.json"));
  381. // //下载scene.json
  382. String sceneJsonPath = dataPath.concat("scene.json");
  383. String sceneJson = fYunFileService.getFileContent(ossDataPath.concat("scene.json"));
  384. JSONObject sceneJsonObj = JSON.parseObject(sceneJson);
  385. sceneJsonObj.put("sceneKind", "pano");
  386. FileUtil.writeUtf8String(sceneJsonObj.toJSONString(), sceneJsonPath);
  387. //下载mesh
  388. FileUtil.mkdir(dataPath.concat("mesh/"));
  389. List<String> meshList = fYunFileService.listRemoteFiles(ossDataPath.concat("mesh"));
  390. meshList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, dataPath.concat("mesh/")));
  391. //images数据下载
  392. String imagesPath = sceneSourcePath + "/images/";
  393. String ossImagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
  394. //下载high图
  395. List<String> highList = fYunFileService.listRemoteFiles(ossImagesPath.concat("pan/high/"));
  396. FileUtil.mkdir(imagesPath.concat("4k/"));
  397. highList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, imagesPath.concat("4k/")));
  398. //下载low图
  399. FileUtil.mkdir(imagesPath.concat("512/"));
  400. List<String> lowList = fYunFileService.listRemoteFiles(ossImagesPath.concat("pan/low/"));
  401. lowList.parallelStream().forEach(key -> fYunFileService.downloadFile(key, imagesPath.concat("512/")));
  402. //下载vision.txt
  403. fYunFileService.downloadFile(ossImagesPath.concat("vision.txt"), imagesPath.concat("vision.txt"));
  404. //下载caches/images
  405. List<String> panoramaImageList = SceneUtil.getPanoramaImageList(imagesPath.concat("vision.txt"));
  406. log.info(JSON.toJSONString(panoramaImageList));
  407. List<String> imageList = fYunFileService.listRemoteFiles(String.format(UploadFilePath.scene_result_data_path, num).concat("caches/images/"));
  408. if(CollUtil.isNotEmpty(imageList)){
  409. imageList.stream().forEach(key->{
  410. if(panoramaImageList.contains(key.substring(key.lastIndexOf("/") + 1))){
  411. if(!FileUtil.exist(imagesPath.concat("8K"))){
  412. FileUtil.mkdir(imagesPath.concat("8K"));
  413. }
  414. fYunFileService.downloadFile(key, imagesPath.concat("8K"));
  415. }
  416. });
  417. }
  418. this.convertVisable(imagesPath.concat("vision.txt"));
  419. //打包
  420. ZipUtil.zip(sceneSourcePath, zipPath, true);
  421. log.info("打包成功,开始推送:{}", num);
  422. pushResult = this.dataPush(num, towerSceneBean.getSceneId(), towerSceneBean.getRoomId(), zipPath);
  423. }catch (Exception e){
  424. log.error("场景推送出错,未知异常", e);
  425. pushResult = new JSONObject();
  426. pushResult.put("resultCode", -3);
  427. pushResult.put("resultMsg", e.getMessage());
  428. } finally {
  429. noticeContent.put("result", pushResult);
  430. rabbitMqProducer.sendByWorkQueue(TIE_TA_SCENE_PUSH_CALLBACK_QUEUE, noticeContent);
  431. // rabbitTemplate.convertAndSend(TIE_TA_SCENE_PUSH_CALLBACK_EXCHANGE , TIE_TA_SCENE_PUSH_CALLBACK_ROUTING , noticeContent);
  432. FileUtil.del(scenePath);
  433. }
  434. }
  435. }