Browse Source

相机授权不支持四维看看

lyhzzz 2 years ago
parent
commit
5042e9f010

+ 1 - 0
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -83,6 +83,7 @@ public enum ResultCode  {
     CAMERA_SN_EXITS(50064, "授权相机sn重复!"),
     MACHINE_CODE_ERROR(50065, "机器码错误!"),
     SCENE_REBUILD_ERROR2(50066, "原始资源已冻结,重算失败。"),
+    CAMERA_AUTHORIZE_ERROR(50067, "相机授权目前不支持四维看看相机类型"),
 
     ;
 

+ 4 - 1
src/main/java/com/fdkankan/manage/service/impl/AuthorizeCameraServiceImpl.java

@@ -128,6 +128,9 @@ public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapp
                     if(cameraDetail == null){
                         throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
                     }
+                    if(cameraDetail.getType() == 1){
+                        throw new BusinessException(ResultCode.CAMERA_AUTHORIZE_ERROR);
+                    }
                     camRegDto.setCameraType(cameraDetail.getType());
                     camRegs.add(camRegDto);
                     AuthorizeCameraDetail detail = new AuthorizeCameraDetail();
@@ -146,7 +149,7 @@ public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapp
                 param.setAuthorizeKey(authorizeKey);
             }catch (Exception e){
                 log.info("授权相机:error:",e);
-                throw new BusinessException(ResultCode.GET_MACHINE_CODE_ERROR);
+                throw e;
             }
         }
         this.saveOrUpdate(param);