|
@@ -1,4 +1,5 @@
|
|
|
package com.fdkankan.manage_jp.service.impl;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
@@ -71,6 +72,16 @@ public class CameraServiceImpl extends MPJBaseServiceImpl<ICameraMapper, Camera>
|
|
|
|
|
|
@Override
|
|
|
public void add(CameraAddParam param) {
|
|
|
+ if(StringUtils.isBlank(param.getChildName()) && StringUtils.isBlank(param.getSnCode())){
|
|
|
+ throw new BusinessException(ResultCode.PARAM_ERROR);
|
|
|
+ }
|
|
|
+ if(!param.getChildName().equals(param.getSnCode())){
|
|
|
+ throw new BusinessException(ResultCode.PARAM_ERROR);
|
|
|
+ }
|
|
|
+ List<Camera> byChildNames = this.getByChildNames(Arrays.asList(param.getChildName()));
|
|
|
+ if(byChildNames !=null && byChildNames.size() >0){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_IN);
|
|
|
+ }
|
|
|
Camera camera = new Camera();
|
|
|
camera.setChildName(param.getChildName());
|
|
|
camera.setChildPassword(Constant.CHILD_PASSWORD_VALUE);
|