|
@@ -126,6 +126,7 @@ public class RtkInfoServiceImpl extends ServiceImpl<IRtkInfoMapper, RtkInfo> imp
|
|
|
public void saveOrEditEntity(RtkInfo rtkInfo) {
|
|
|
RtkInfo dbRtkInfo = null;
|
|
|
RtkInfo dbRtkInfo2 = null;
|
|
|
+ RtkInfo dbRtkInfo3 = null;
|
|
|
Camera camera = null;
|
|
|
if(StringUtils.isNotBlank(rtkInfo.getRtkSnCode())){
|
|
|
dbRtkInfo = this.getByRtkSnCode(rtkInfo.getRtkSnCode());
|
|
@@ -135,6 +136,7 @@ public class RtkInfoServiceImpl extends ServiceImpl<IRtkInfoMapper, RtkInfo> imp
|
|
|
if(camera == null){
|
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
}
|
|
|
+ dbRtkInfo3 = this.getByCameraSnCode(rtkInfo.getCameraSnCode());
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(rtkInfo.getSgRtkSn())){
|
|
|
dbRtkInfo2 = this.getSgRtkSn(rtkInfo.getSgRtkSn());
|
|
@@ -147,6 +149,9 @@ public class RtkInfoServiceImpl extends ServiceImpl<IRtkInfoMapper, RtkInfo> imp
|
|
|
if(dbRtkInfo2 != null){
|
|
|
throw new BusinessException(ResultCode.SGRTK_SN_EXIST);
|
|
|
}
|
|
|
+ if(dbRtkInfo3 != null){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
|
|
|
+ }
|
|
|
rtkInfo.setCreateUserId(Long.valueOf((String) StpUtil.getLoginId()));
|
|
|
}else {
|
|
|
if( dbRtkInfo != null && !Objects.equals(dbRtkInfo.getId(), rtkInfo.getId()) ){
|
|
@@ -155,6 +160,9 @@ public class RtkInfoServiceImpl extends ServiceImpl<IRtkInfoMapper, RtkInfo> imp
|
|
|
if( dbRtkInfo2 != null && !Objects.equals(dbRtkInfo2.getId(), rtkInfo.getId()) ){
|
|
|
throw new BusinessException(ResultCode.SGRTK_SN_EXIST);
|
|
|
}
|
|
|
+ if( dbRtkInfo3 != null && !Objects.equals(dbRtkInfo3.getId(), rtkInfo.getId()) ){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_SN_EXIST);
|
|
|
+ }
|
|
|
rtkInfo.setUpdateUserId(Long.valueOf((String)StpUtil.getLoginId()));
|
|
|
}
|
|
|
|