|
@@ -2,13 +2,18 @@ package com.fdkankan.manage.controller;
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
|
+import com.fdkankan.manage.common.ResultCode;
|
|
import com.fdkankan.manage.common.ResultData;
|
|
import com.fdkankan.manage.common.ResultData;
|
|
import com.fdkankan.manage.entity.AgentAudit;
|
|
import com.fdkankan.manage.entity.AgentAudit;
|
|
|
|
+import com.fdkankan.manage.entity.Camera;
|
|
import com.fdkankan.manage.entity.RtkInfo;
|
|
import com.fdkankan.manage.entity.RtkInfo;
|
|
|
|
+import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.service.IAgentAuditService;
|
|
import com.fdkankan.manage.service.IAgentAuditService;
|
|
|
|
+import com.fdkankan.manage.service.ICameraService;
|
|
import com.fdkankan.manage.service.IRtkInfoService;
|
|
import com.fdkankan.manage.service.IRtkInfoService;
|
|
import com.fdkankan.manage.vo.request.AgentAuditListParam;
|
|
import com.fdkankan.manage.vo.request.AgentAuditListParam;
|
|
import com.fdkankan.manage.vo.request.RtkInfoParam;
|
|
import com.fdkankan.manage.vo.request.RtkInfoParam;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -26,6 +31,8 @@ public class RtkInfoController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
IRtkInfoService rtkInfoService;
|
|
IRtkInfoService rtkInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICameraService cameraService;
|
|
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
public ResultData list(@RequestBody RtkInfoParam param){
|
|
public ResultData list(@RequestBody RtkInfoParam param){
|
|
@@ -39,6 +46,13 @@ public class RtkInfoController {
|
|
}else {
|
|
}else {
|
|
rtkInfo.setUpdateUserId(Long.valueOf((String)StpUtil.getLoginId()));
|
|
rtkInfo.setUpdateUserId(Long.valueOf((String)StpUtil.getLoginId()));
|
|
}
|
|
}
|
|
|
|
+ if(StringUtils.isBlank(rtkInfo.getCameraSnCode())){
|
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+ Camera camera = cameraService.getBySnCode(rtkInfo.getCameraSnCode());
|
|
|
|
+ if(camera == null){
|
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
|
+ }
|
|
rtkInfoService.saveOrEdit(rtkInfo);
|
|
rtkInfoService.saveOrEdit(rtkInfo);
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|