|
|
@@ -2,6 +2,7 @@ package com.fdkankan.manage.inner.controller;
|
|
|
|
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
|
import cn.hutool.log.Log;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
|
import com.fdkankan.manage.common.CacheUtil;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
@@ -14,6 +15,8 @@ import com.fdkankan.manage.entity.RtkUseLog;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
import com.fdkankan.manage.util.RsaUtils;
|
|
|
+import com.fdkankan.manage.vo.request.RtkDeviceInParam;
|
|
|
+import com.fdkankan.manage.vo.request.RtkInfoParam;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -133,4 +136,30 @@ public class InnerController extends BaseController {
|
|
|
rtkAccountService.stop(rtkDevice,clientIP,cameraSn);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/updateRtkInfo")
|
|
|
+ public ResultData updateRtkInfo(@RequestBody RtkInfo param){
|
|
|
+ if(StringUtils.isNotBlank(param.getRtkSnCode())){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(param.getRtkSnCode());
|
|
|
+ if(rtkDevice == null){
|
|
|
+ throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
|
|
|
+ }
|
|
|
+ if(rtkDevice.getAccountType() == 0){ //账号池
|
|
|
+ throw new BusinessException(ResultCode.RTK_UPDATE_ERROR);
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<RtkDevice> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(RtkDevice::getId,rtkDevice.getId());
|
|
|
+ wrapper.set(RtkDevice::getUserName,param.getUserName());
|
|
|
+ wrapper.set(RtkDevice::getPassword,param.getPassword());
|
|
|
+ wrapper.set(RtkDevice::getIpAddr,param.getIpAddr());
|
|
|
+ wrapper.set(RtkDevice::getPort,param.getPort());
|
|
|
+ wrapper.set(RtkDevice::getMountPoint,param.getMountPoint());
|
|
|
+ wrapper.set(RtkDevice::getFailureTime,null);
|
|
|
+ rtkDeviceService.update(wrapper);
|
|
|
+
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
}
|