|
@@ -81,6 +81,15 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+ public Camera getByWfiName(String snCode) {
|
|
|
+ LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(Camera::getWifiName,snCode);
|
|
|
+ List<Camera> list = this.list(wrapper);
|
|
|
+ if(list !=null && list.size() > 0){
|
|
|
+ return list.get(0);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public List<Camera> getCameraLikeSnCode(String snCode) {
|
|
@@ -252,12 +261,13 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
String[] snCodeArr = snCodes.split(",");
|
|
|
List<Long> cameraIds = new ArrayList<>();
|
|
|
for (String wifiName : snCodeArr) {
|
|
|
- String snCode = wifiName;
|
|
|
+ Camera camera = null;
|
|
|
if(wifiName.contains("_")){
|
|
|
- snCode = wifiName.split("_")[1];
|
|
|
+ camera = this.getByWfiName(wifiName);
|
|
|
+ }else {
|
|
|
+ camera = this.getBySnCode(wifiName);
|
|
|
}
|
|
|
|
|
|
- Camera camera = this.getBySnCode(snCode);
|
|
|
if(camera == null){
|
|
|
throw new BusinessException(AppConstant.FAILURE_CODE_4010, wifiName +"-"+ AppConstant.FAILURE_MSG_4010);
|
|
|
}
|