lyhzzz il y a 1 jour
Parent
commit
b52ae8c137

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/CaseLiveController.java

@@ -33,7 +33,7 @@ public class CaseLiveController extends BaseController{
     @PostMapping("/getTakeLookRoom")
     public ResultData getTakeLookRoom(@RequestBody CaseLive caseLive){
         if (StringUtils.isNotBlank(caseLive.getNum())){
-            Boolean b = fdService.checkNum(caseLive.getNum(), "edit", StpUtil.getTokenValue());
+            Boolean b = fdService.checkNum(caseLive.getNum(), "view", StpUtil.getTokenValue());
             if(!b){
                 throw new BusinessException(ResultCode.NOT_PER);
             }

+ 4 - 4
src/main/java/com/fdkankan/fusion/down/FusionDownService.java

@@ -225,9 +225,9 @@ public class FusionDownService {
             SceneVo sceneData = fusionNumVo.getSceneData();
             //下载模型
             if(sceneData.getType() != 3 && StringUtils.isNotBlank(sceneData.getNum())){
-                repMap.put(sceneData.getCutModelPath(),sceneData.getCutModelPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
-                repMap.put(sceneData.getSceneJsonPath(),sceneData.getSceneJsonPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
-                repMap.put(sceneData.getSurveillancePath(),sceneData.getSurveillancePath().replace("/oss/","/swkk/"+sceneData.getNum() +"/wwwroot/"));
+                repMap.put(sceneData.getCutModelPath(),sceneData.getCutModelPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/env/wwwroot/"));
+                repMap.put(sceneData.getSceneJsonPath(),sceneData.getSceneJsonPath().replace("/oss/","/swkk/"+sceneData.getNum() +"/env/wwwroot/"));
+                repMap.put(sceneData.getSurveillancePath(),sceneData.getSurveillancePath().replace("/oss/","/swkk/"+sceneData.getNum() +"/env/wwwroot/"));
             }
 
             if(StringUtils.isNotBlank(sceneData.getModelGlbUrl())){
@@ -311,7 +311,7 @@ public class FusionDownService {
             }
         }
 
-        FileUtil.writeString(jsonObject.toJSONString(), caseOffPath+"/package/"+jsonDataName,"UTF-8");
+        FileUtil.writeString(jsonString, caseOffPath+"/package/"+jsonDataName,"UTF-8");
 
     }
 

+ 2 - 1
src/main/java/com/fdkankan/fusion/entity/SceneDownLog.java

@@ -115,7 +115,8 @@ public class SceneDownLog implements Serializable {
     @TableField("type")
     private String type;
 
-
+    @TableField("sy_version")
+    private String syVersion;
     public String getDeptLevelStr() {
         if(deptLevel != null){
             switch (deptLevel){

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ISceneDownLogService.java

@@ -16,5 +16,5 @@ public interface ISceneDownLogService extends IService<SceneDownLog> {
 
     Object pageList(SceneDownLogParam param);
 
-    SceneDownLog getByStatusAndNum(String sceneNum, Integer status);
+    SceneDownLog getByStatusAndNum(String sceneNum, Integer status,String syVersion);
 }

+ 9 - 5
src/main/java/com/fdkankan/fusion/service/impl/DownService.java

@@ -82,7 +82,7 @@ public class DownService implements IDownService {
         Integer sceneVersion = getSceneVersion(plus);
 
         DownVo downVo = new DownVo();
-        sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,1);
+        sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,1,"v4");
         //3下载过,并且没有修改过
         if(sceneDownloadLog != null && sceneDownloadLog.getVersion().intValue() == sceneVersion){
             downVo.setDownloadStatus(3);
@@ -97,7 +97,7 @@ public class DownService implements IDownService {
             redisUtil.del(String.format(redisKey,sceneNum));  // 清除旧的下载信息
             return downVo;
         }else {
-            sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0);
+            sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0,"v4");
             if(sceneDownloadLog != null){
                 downVo.setDownloadStatus(1);
                 return downVo;
@@ -123,10 +123,12 @@ public class DownService implements IDownService {
         Integer sceneType =  scenePlus.getSceneSource();
         Integer sceneVersion = getSceneVersion( scenePlus);
         log.info("down--sceneType:{},isObj:{}",sceneType,isObj);
-        saveLog(scenePlus,sceneVersion,type);
+
         if((sceneType == 4 || sceneType == 5) && isObj !=1){ //深时场景
+            saveLog(scenePlus,sceneVersion,type,"ss");
             return SSDownload(sceneNum,userId);
         }
+        saveLog(scenePlus,sceneVersion,type,"v4");
         String redisKeyProcess = RedisKey.PREFIX_DOWNLOAD_PROGRESS_V4;
         // 刪除下载进度
         redisUtil.del(String.format(redisKeyProcess,sceneNum));
@@ -142,7 +144,7 @@ public class DownService implements IDownService {
         return downVo;
     }
 
-    private void saveLog(ScenePlus scenePlus,Integer sceneVersion,String type){
+    private void saveLog(ScenePlus scenePlus,Integer sceneVersion,String type,String syVersion){
         //离线包调用,不记录场景下载日志
         SceneDownLog sceneDownloadLogEntity = new SceneDownLog();
 
@@ -164,6 +166,7 @@ public class DownService implements IDownService {
         sceneDownloadLogEntity.setStatus(0);
         sceneDownloadLogEntity.setVersion(sceneVersion);
         sceneDownloadLogEntity.setType(type);
+        sceneDownloadLogEntity.setSyVersion(syVersion);
         sceneDownloadLogService.save(sceneDownloadLogEntity);
     }
 
@@ -189,7 +192,7 @@ public class DownService implements IDownService {
         if(StringUtils.isEmpty(result)){
             return new DownloadProcessVo();
         }
-        SceneDownLog sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0);
+        SceneDownLog sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0,"v4");
 
         DownloadProcessVo downloadProcessVo = JSONObject.parseObject(result, DownloadProcessVo.class);
         if(sceneDownloadLog != null){
@@ -278,6 +281,7 @@ public class DownService implements IDownService {
             LambdaUpdateWrapper<SceneDownLog> wrapper = new LambdaUpdateWrapper<>();
             wrapper.eq(SceneDownLog::getSceneNum,sceneNum);
             wrapper.eq(SceneDownLog::getStatus,0);
+            wrapper.eq(SceneDownLog::getSyVersion,"ss");
             wrapper.set(SceneDownLog::getDownUrl,vo.getUrl());
             wrapper.set(SceneDownLog::getStatus,1);
             sceneDownloadLogService.update(wrapper);

+ 2 - 1
src/main/java/com/fdkankan/fusion/service/impl/SceneDownLogServiceImpl.java

@@ -71,10 +71,11 @@ public class SceneDownLogServiceImpl extends ServiceImpl<ISceneDownLogMapper, Sc
     }
 
     @Override
-    public SceneDownLog getByStatusAndNum(String sceneNum, Integer status) {
+    public SceneDownLog getByStatusAndNum(String sceneNum, Integer status,String syVersion) {
         LambdaQueryWrapper<SceneDownLog> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(SceneDownLog::getSceneNum,sceneNum);
         wrapper.eq(SceneDownLog::getStatus,status);
+        wrapper.eq(SceneDownLog::getSyVersion,syVersion);
         wrapper.orderByDesc(SceneDownLog::getId);
         List<SceneDownLog> list = this.list(wrapper);
         if(list != null && !list.isEmpty()){