|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|