|
@@ -17,8 +17,7 @@ import com.gis.common.util.RedisUtil;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.WorkOfflineDTO;
|
|
|
import com.gis.domain.dto.WorkOfflineDoneDTO;
|
|
|
-import com.gis.domain.entity.WorkEntity;
|
|
|
-import com.gis.domain.entity.WorkNavigationEntity;
|
|
|
+import com.gis.domain.entity.*;
|
|
|
import com.gis.domain.vo.WorkIdVO;
|
|
|
import com.gis.domain.vo.WorkViewVo;
|
|
|
import com.gis.oss.constant.CmdConstant;
|
|
@@ -80,6 +79,17 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
|
|
|
|
|
|
@Value("${other-bucket.fdkk}")
|
|
|
String fdkkBucket;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WorkHotService workHotService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ WorkHotsFodderService workHotsFodderService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ FodderService fodderService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@LogAnnotation
|
|
|
public void onMessage(Message message, Channel channel) throws Exception {
|
|
@@ -134,6 +144,19 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
|
|
|
String meshBasePath = param.getPath() + File.separator + "mesh";
|
|
|
redisUtil.set(progressKey, 20);
|
|
|
|
|
|
+ //下载热点资源
|
|
|
+
|
|
|
+ List<WorkHotsFodderEntity> workHotsFodderEntityList = workHotsFodderService.findAllByWorkId(param.getWorkId());
|
|
|
+ workHotsFodderEntityList.forEach(workHotsFodderEntity -> {
|
|
|
+ FodderEntity fodderEntity = fodderService.getById(workHotsFodderEntity.getFodderId());
|
|
|
+ if (ObjUtil.isNotEmpty(fodderEntity)&&fodderEntity.getStatus()==3){
|
|
|
+ log.info("下载热点资源:{}", fodderEntity.getOssPath());
|
|
|
+ String ossKeyHot = fodderEntity.getOssPath().replaceAll(fileStorageTemplate.calculateUrl(""), "");
|
|
|
+ String defaultDataPath =basePath+File.separator+ossKeyHot;
|
|
|
+ fileStorageTemplate.ossDownloadFileToLocal(ossKeyHot, defaultDataPath);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 处理关联的作品和场景
|
|
|
List<WorkNavigationEntity> workNavigationEntities = workNavigationService.selectByWorkId(workEntity.getId());
|
|
|
|
|
@@ -147,6 +170,7 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
|
|
|
String PanoOssKey = baseOssKey + "/" + workNavigationEntity.getSceneCode();
|
|
|
log.info("下载作品类-全景图:{},下载路径-PanoOssKey", workNavigationEntity.getSceneCode(), PanoOssKey);
|
|
|
OssShUtil.yunDownload(PanoOssKey, basePath + File.separator + baseOssKey);
|
|
|
+
|
|
|
} else if (workNavigationEntity.getType().equalsIgnoreCase("4dkk")) {
|
|
|
// 整合离线包
|
|
|
String zipPath = meshBasePath + File.separator + workNavigationEntity.getSceneCode() + ".zip";
|
|
@@ -199,11 +223,11 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
|
|
|
CmdUtils.callLineSh(zipCmd);
|
|
|
|
|
|
log.info("开始将文件上传OSS");
|
|
|
- String zipOssKey = "720yun_fd_manage/"+workEntity.getId()+"/" + zipName;
|
|
|
+ String zipOssKey = "720yun_fd_manage/offline/"+workEntity.getId()+"/" + zipName;
|
|
|
redisUtil.set(progressKey, 90);
|
|
|
OssShUtil.yunUpload(param.getPath() + File.separator + zipName,zipOssKey);
|
|
|
redisUtil.set(progressKey, 100);
|
|
|
- String ossUrl = fileStorageTemplate.calculateUrl(zipOssKey);
|
|
|
+ String ossUrl = fileStorageTemplate.calculateUrl(zipOssKey)+"?t="+System.currentTimeMillis();
|
|
|
log.info("上传OSS完成,{}", ossUrl );
|
|
|
workService.updateOfflineStatusAndUrl(param.getWorkId(), 3,ossUrl);
|
|
|
WorkOfflineDoneDTO workOfflineDoneDTO=new WorkOfflineDoneDTO();
|