Explorar el Código

Merge branch 'release-mg-v2.9.0' into test

dengsixing hace 4 meses
padre
commit
13b8c1497e

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

@@ -13,7 +13,7 @@ import java.util.Date;
  * 客户企业logo信息
  * </p>
  *
- * @author 
+ * @author
  * @since 2021-12-24
  */
 @Getter
@@ -107,4 +107,7 @@ public class Company implements Serializable {
     @TableLogic("A")
     private String recStatus;
 
+    @TableField("can_up_website")
+    private Integer canUpWebsite;
+
 }

+ 19 - 0
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -252,6 +252,25 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             throw new BusinessException(ErrorCode.FAILURE_CODE_5047);
         }
 
+        Camera camera = cameraService.getBySnCode(mac);
+        if(Objects.isNull(camera)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
+        }
+        CameraDetail cameraDetail = cameraDetailService.getById(camera.getId());
+        if(Objects.isNull(cameraDetail)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
+        }
+        Long companyId = cameraDetail.getCompanyId();
+        if(Objects.nonNull(companyId)){
+            Company company = companyService.getById(companyId);
+            if(Objects.nonNull(company)){
+                Integer canUpWebsite = company.getCanUpWebsite();
+                if(Objects.nonNull(canUpWebsite) && canUpWebsite == CommonStatus.NO.code().intValue()){
+                    throw new BusinessException(ErrorCode.FAILURE_CODE_4006);
+                }
+            }
+        }
+
         log.info("mac:{} 准备上传文件,folderName:{}", mac, folderName);
         ResponseSceneFile responseSceneFile = new ResponseSceneFile();