Browse Source

修改V3场景判断逻辑

tianboguang 2 years ago
parent
commit
71f79490d4

+ 4 - 0
src/main/java/com/fdkankan/contro/entity/Company.java

@@ -96,6 +96,10 @@ public class Company implements Serializable {
     @TableField("update_time")
     private Date updateTime;
 
+
+    @TableField("scene_version")
+    private String sceneVersion;
+
     /**
      * A正常,I删除
      */

+ 10 - 4
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -549,10 +549,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         }
         log.info("相机详情:{}",JSONObject.toJSONString(cameraDetail));
         // 判断是否是正顺的场景,如果是正顺的场景,则发送到原来的系统进行计算
-        if (!ObjectUtils.isEmpty(cameraDetail.getCompanyId())
-                && (cameraDetail.getCompanyId().equals(1L) || cameraDetail.getCompanyId().equals(15L))) {
-            callV3Service(preParams);
-            return ResultData.ok();
+        if (!ObjectUtils.isEmpty(cameraDetail.getCompanyId())) {
+            Company company = companyService.getById(cameraDetail.getCompanyId());
+            if(ObjectUtils.isEmpty(company)){
+                log.error("企业配置有误:" + cameraName);
+                throw new BusinessException(CameraConstant.FAILURE_6003);
+            }
+            if (ObjectUtils.isEmpty(company.getSceneVersion()) && company.getSceneVersion().equals("V3")) {
+                callV3Service(preParams);
+                return ResultData.ok();
+            }
         }
 
         // 判断是否是V3的场景