dengsixing hace 2 semanas
padre
commit
7e018e1ac2
Se han modificado 1 ficheros con 26 adiciones y 56 borrados
  1. 26 56
      src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

+ 26 - 56
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -78,6 +78,12 @@ public class JmgaServiceImpl implements IJmgaService {
     private ICameraService cameraService;
     @Autowired
     private ICameraDetailService cameraDetailService;
+    @Autowired
+    private ISceneEditInfoService sceneEditInfoService;
+    @Autowired
+    private ISceneEditInfoExtService sceneEditInfoExtService;
+    @Autowired
+    private ISceneEditControlsService sceneEditControlsService;
 
     @Override
     public void checkFileWhole(String uuid, String dataSource, JSONObject fdageData) {
@@ -292,6 +298,26 @@ public class JmgaServiceImpl implements IJmgaService {
                 scenePlusExtService.save(scenePlusExt);
             }
 
+            SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
+            if(sceneEditInfo == null){
+                sceneEditInfo = new SceneEditInfo();
+                sceneEditInfo.setScenePlusId(scenePlus.getId());
+                sceneEditInfoService.save(sceneEditInfo);
+            }
+            SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
+            if(sceneEditInfoExt == null){
+                sceneEditInfoExt = new SceneEditInfoExt();
+                sceneEditInfoExt.setScenePlusId(scenePlus.getId());
+                sceneEditInfoExt.setEditInfoId(sceneEditInfo.getId());
+                sceneEditInfoExtService.save(sceneEditInfoExt);
+            }
+            SceneEditControls sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());
+            if(sceneEditControls == null){
+                sceneEditControls = new SceneEditControls();
+                sceneEditControls.setEditInfoId(sceneEditInfo.getId());
+                sceneEditControlsService.save(sceneEditControls);
+            }
+
         }else{//离线包
             String sceneJsonStr = com.fdkankan.contro.util.ZipUtil.readUtf8(zipDir + zipName, "scene.json");
             if(StrUtil.isEmpty(sceneJsonStr) || !JSONUtil.isJson(sceneJsonStr)){
@@ -329,62 +355,6 @@ public class JmgaServiceImpl implements IJmgaService {
         mqProducer.sendByWorkQueue("manage-upload-scene", content);
     }
 
-    private void checkUploadSceneOrig(JSONObject dataFdageJson, Long userId){
-        String uuidtime = dataFdageJson.getString("uuidtime");
-        ScenePlus scenePlus = scenePlusService.getByFileId(uuidtime);
-        if(scenePlus == null){
-            return;
-        }
-        if(scenePlus.getUserId() != null){
-            JyUser jyUser = jyUserService.getByUserId(scenePlus.getUserId());
-            if(jyUser != null && !jyUser.getId().equals(userId)){
-                throw  new BusinessException(60042, "此场景属于-" + jyUser.getRyNo());
-            }
-            if(jyUser != null){
-                throw  new BusinessException(60043, "此场景此前已上传过");
-            }
-        }
-    }
-
-    private void checkUploadSceneOffline(String zipPath) throws Exception {
-        String sceneJsonStr = com.fdkankan.contro.util.ZipUtil.readUtf8(zipPath, "scene.json");
-        if(StrUtil.isEmpty(sceneJsonStr) || !JSONUtil.isJson(sceneJsonStr)){
-            throw new BusinessException(60027, "scene.json文件数据异常");
-        }
-        JSONObject jsonObject = JSON.parseObject(sceneJsonStr);
-        //校验版本
-        String offlineVersion = jsonObject.getString("offlineVersion");
-        String platformVersion = "2.2.0";//从数据中获取
-        if (offlineVersion == null || platformVersion == null) {
-            throw new BusinessException(60127, "版本不匹配");
-        }
-
-        String[] offParts = offlineVersion.split(".");
-        String[] pfParts = platformVersion.split(".");
-
-        // 至少需要两位版本号
-        if (offParts.length < 2 || pfParts.length < 2) {
-            throw new BusinessException(60127, "版本不匹配");
-        }
-
-        // 比较前两位
-        if (!offParts[0].equals(pfParts[0]) || !offParts[1].equals(pfParts[1])) {
-            throw new BusinessException(60127, "版本不匹配");
-        }
-
-        // 前两位一致,检查第三位
-        if (!offParts[2].equals(pfParts[2])) {
-            throw new BusinessException(60128, "小版本版本不匹配");
-        }
-
-        String num = jsonObject.getString("num");
-        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
-        if(scenePlus != null){
-            throw new BusinessException(60128, "场景已存在,不能重复导入");
-        }
-    }
-
-
 
     @Override
     public void noticeBuildBd(String ossHost, String uuid, String dir) {