|
@@ -47,16 +47,23 @@ public class RtkInfoController {
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
RtkInfo dbRtkInfo = rtkInfoService.getByRtkSnCode(rtkInfo.getRtkSnCode());
|
|
|
+ RtkInfo dbRtkInfo2 = rtkInfoService.getByCameraSnCode(rtkInfo.getCameraSnCode());
|
|
|
if(rtkInfo.getId() == null){
|
|
|
rtkInfo.setCreateUserId(Long.valueOf((String)StpUtil.getLoginId()));
|
|
|
if(dbRtkInfo != null){
|
|
|
throw new BusinessException(ResultCode.RTK_SN_EXIST);
|
|
|
}
|
|
|
+ if(dbRtkInfo2 != null){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
|
|
|
+ }
|
|
|
}else {
|
|
|
rtkInfo.setUpdateUserId(Long.valueOf((String)StpUtil.getLoginId()));
|
|
|
if( dbRtkInfo != null && !Objects.equals(dbRtkInfo.getId(), rtkInfo.getId()) ){
|
|
|
throw new BusinessException(ResultCode.RTK_SN_EXIST);
|
|
|
}
|
|
|
+ if( dbRtkInfo2 != null && !Objects.equals(dbRtkInfo2.getId(), rtkInfo.getId()) ){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
|
|
|
+ }
|
|
|
}
|
|
|
if(rtkInfo.getRtkType() == 0){
|
|
|
rtkInfo.setIpAddr(null);
|