lyhzzz 4 月之前
父节点
当前提交
cb11084b00

+ 18 - 0
src/main/java/com/fdkankan/manage/config/ManageConfig.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage.config;
+
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Data
+@RefreshScope
+public class ManageConfig {
+
+
+    @Value("${manage.authRtkExTime:2025-06-30 00:00:00}")
+    private String authRtkExTime;
+
+}

+ 30 - 22
src/main/java/com/fdkankan/manage/inner/controller/InnerController.java

@@ -9,6 +9,7 @@ import com.fdkankan.common.util.SecurityUtil;
 import com.fdkankan.manage.common.CacheUtil;
 import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.config.ManageConfig;
 import com.fdkankan.manage.controller.BaseController;
 import com.fdkankan.manage.entity.*;
 import com.fdkankan.manage.exception.BusinessException;
@@ -42,6 +43,20 @@ public class InnerController extends BaseController {
     private ISceneProService sceneProService;
     @Autowired
     IServiceUpTipService serviceUpTipService;
+    @Autowired
+    ManageConfig manageConfig;
+    @Autowired
+    IRtkInfoService rtkInfoService;
+    @Autowired
+    IRtkAccountService rtkAccountService;
+    @Autowired
+    IRtkDeviceService rtkDeviceService;
+    @Autowired
+    IRtkUseLogService rtkUseLogService;
+    @Autowired
+    IRtkUpdateLogService rtkUpdateLogService;
+    @Autowired
+    IAuthorizeRtkService authorizeRtkService;
 
     @PostMapping("/move")
     public ResultData move(@RequestBody SceneParam param){
@@ -80,18 +95,7 @@ public class InnerController extends BaseController {
     }
 
 
-    @Autowired
-    IRtkInfoService rtkInfoService;
-    @Autowired
-    IRtkAccountService rtkAccountService;
-    @Autowired
-    IRtkDeviceService rtkDeviceService;
-    @Autowired
-    IRtkUseLogService rtkUseLogService;
-    @Autowired
-    IRtkUpdateLogService rtkUpdateLogService;
-    @Autowired
-    IAuthorizeRtkService authorizeRtkService;
+
 
     /**
      * 相机开启rtk获取账号
@@ -110,18 +114,22 @@ public class InnerController extends BaseController {
         if(rtkDevice.getAccountType() ==2){
             List<AuthorizeRtk> authorizeRtks = authorizeRtkService.getByRtkId(rtkDevice.getId());
             if(authorizeRtks == null || authorizeRtks.isEmpty()){
-                throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
-            }
-            Boolean flag = false;
-            Date now = new Date();
-            for (AuthorizeRtk authorizeRtk : authorizeRtks) {
-                if(DateUtil.isIn(now,authorizeRtk.getValidStartTime(),authorizeRtk.getValidEndTime())){
-                    flag = true;
-                    break;
+                if(new Date().getTime() > DateUtil.parse(manageConfig.getAuthRtkExTime(),"yyyy-MM-dd HH:mm:ss").getTime()){
+                    throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
                 }
             }
-            if(!flag){
-                throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
+            if (authorizeRtks !=null && !authorizeRtks.isEmpty()){
+                Boolean flag = false;
+                Date now = new Date();
+                for (AuthorizeRtk authorizeRtk : authorizeRtks) {
+                    if(DateUtil.isIn(now,authorizeRtk.getValidStartTime(),authorizeRtk.getValidEndTime())){
+                        flag = true;
+                        break;
+                    }
+                }
+                if(!flag){
+                    throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_AUTH);
+                }
             }
 
         }

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

@@ -685,7 +685,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         if(sceneSource != null && (sceneSource == 4 || sceneSource == 5 || sceneSource ==57)){
             laserService.delete(num);
         }
-        overallService.delete(num);
+        //overallService.delete(num);
         if(cameraId != null){
             cameraDetailService.initSpace(cameraId);
             this.lockOrUnLockBySpace(cameraId);