LaserServiceImpl.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.fdkankan.scene.service.impl;
  2. import com.fdkankan.fyun.face.FYunFileServiceInterface;
  3. import com.fdkankan.rabbitmq.util.RabbitMqProducer;
  4. import com.fdkankan.scene.service.ILaserService;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.beans.factory.annotation.Value;
  8. import org.springframework.stereotype.Service;
  9. import java.util.HashMap;
  10. import java.util.Map;
  11. @Service
  12. @Slf4j
  13. public class LaserServiceImpl implements ILaserService {
  14. @Autowired
  15. RabbitMqProducer rabbitMqProducer;
  16. @Autowired
  17. private FYunFileServiceInterface fYunFileService;
  18. @Value("${4dkk.laserService.cloud-point-fyun-path:testdata/%s/data/bundle_%s/building/}")
  19. private String cloudPointFyunPath;
  20. @Value("${4dkk.laserService.bucket:laser-data}")
  21. private String bucket;
  22. @Value("${queue.application.laser.cloud-point-build:laser-cloud-point-build}")
  23. private String cloudPointBuild;
  24. @Value("${queue.application.laser.copy-scene:laser-copy-scene}")
  25. private String laserCopyScene;
  26. @Override
  27. public void copy(String oldNum, String newNum, String path, Boolean flag) {
  28. Map<String,Object> params = new HashMap<>();
  29. params.put("sceneCode", newNum);
  30. params.put("oldSceneCode", oldNum);
  31. params.put("path",path);
  32. params.put("init",flag);
  33. rabbitMqProducer.sendByWorkQueue(laserCopyScene,params);
  34. }
  35. @Override
  36. public void cloudPointBuild(String oldSceneCode,String sceneCode) {
  37. if (!fYunFileService.fileExist(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) +"vision_edit.txt")){
  38. return;
  39. }
  40. log.info("开始同步点云编辑文件");
  41. // 上传点云编辑文件,并通知激光系统
  42. fYunFileService.copyFileBetweenBucket(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) + "vision_edit.txt",
  43. bucket,String.format(cloudPointFyunPath,sceneCode,sceneCode) + "vision_edit.txt");
  44. fYunFileService.copyFileBetweenBucket(bucket,String.format(cloudPointFyunPath,oldSceneCode,oldSceneCode) + "uuidcloud",
  45. bucket,String.format(cloudPointFyunPath,sceneCode,sceneCode) + "uuidcloud");
  46. Map<String, Object> params = new HashMap<>();
  47. params.put("sceneNum", sceneCode);
  48. params.put("businessType", 0);
  49. rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
  50. }
  51. }