|
@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.huimv.farm.musk.common.utils.Result;
|
|
import com.huimv.farm.musk.common.utils.Result;
|
|
import com.huimv.farm.musk.common.utils.ResultCode;
|
|
import com.huimv.farm.musk.common.utils.ResultCode;
|
|
|
|
+import com.huimv.farm.musk.entity.SysAccountMultilevel;
|
|
import com.huimv.farm.musk.entity.SysCamera;
|
|
import com.huimv.farm.musk.entity.SysCamera;
|
|
import com.huimv.farm.musk.entity.SysCameraBrand;
|
|
import com.huimv.farm.musk.entity.SysCameraBrand;
|
|
import com.huimv.farm.musk.entity.vo.*;
|
|
import com.huimv.farm.musk.entity.vo.*;
|
|
|
|
+import com.huimv.farm.musk.mapper.SysAccountMultilevelMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraAreaMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraAreaMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraBrandMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraBrandMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraMapper;
|
|
import com.huimv.farm.musk.mapper.SysCameraMapper;
|
|
@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -34,6 +37,8 @@ public class SysCameraServiceImpl extends ServiceImpl<SysCameraMapper, SysCamera
|
|
@Autowired
|
|
@Autowired
|
|
private SysCameraMapper cameraBaseMapper;
|
|
private SysCameraMapper cameraBaseMapper;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private SysAccountMultilevelMapper sysAccountMultilevelMapper;
|
|
|
|
+ @Autowired
|
|
private SysCameraAreaMapper cameraAreaMapper;
|
|
private SysCameraAreaMapper cameraAreaMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private SysCameraBrandMapper cameraBrandMapper;
|
|
private SysCameraBrandMapper cameraBrandMapper;
|
|
@@ -42,7 +47,7 @@ public class SysCameraServiceImpl extends ServiceImpl<SysCameraMapper, SysCamera
|
|
// private BaseScreenCameraAccountMapper cameraAccountMapper;
|
|
// private BaseScreenCameraAccountMapper cameraAccountMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result listPage(CameraListVo cameraListVo) {
|
|
|
|
|
|
+ public Result listPage(CameraListVo cameraListVo,Integer userId) {
|
|
Integer current = cameraListVo.getCurrent();
|
|
Integer current = cameraListVo.getCurrent();
|
|
String strchStr = cameraListVo.getStrchStr();
|
|
String strchStr = cameraListVo.getStrchStr();
|
|
Integer size = cameraListVo.getSize();
|
|
Integer size = cameraListVo.getSize();
|
|
@@ -57,6 +62,15 @@ public class SysCameraServiceImpl extends ServiceImpl<SysCameraMapper, SysCamera
|
|
wrapper.and(i -> i.like("camera_name", strchStr)
|
|
wrapper.and(i -> i.like("camera_name", strchStr)
|
|
.or().like("camera_ip", strchStr));
|
|
.or().like("camera_ip", strchStr));
|
|
}
|
|
}
|
|
|
|
+ if (userId != 1){
|
|
|
|
+ SysAccountMultilevel sysAccountMultilevel = sysAccountMultilevelMapper.selectById(userId);
|
|
|
|
+ String cameraIds = sysAccountMultilevel.getCameraIds();
|
|
|
|
+ List<String> list = new ArrayList();
|
|
|
|
+ if (StringUtils.isNotBlank(cameraIds)){
|
|
|
|
+ list = Arrays.asList(cameraIds);
|
|
|
|
+ }
|
|
|
|
+ wrapper.in("id",list);
|
|
|
|
+ }
|
|
|
|
|
|
if (farmId != null) {
|
|
if (farmId != null) {
|
|
wrapper.eq("farm_id", farmId);
|
|
wrapper.eq("farm_id", farmId);
|
|
@@ -85,8 +99,9 @@ public class SysCameraServiceImpl extends ServiceImpl<SysCameraMapper, SysCamera
|
|
return new Result(ResultCode.SUCCESS, page(new Page<>(current, size), wrapper));
|
|
return new Result(ResultCode.SUCCESS, page(new Page<>(current, size), wrapper));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
- public List getCameraDetails(CameraListsVo cameraListsVo) throws InterruptedException {
|
|
|
|
|
|
+ public List getCameraDetails(CameraListsVo cameraListsVo,Integer userId) throws InterruptedException {
|
|
List<Integer> cameraIds = cameraListsVo.getCameraIds();
|
|
List<Integer> cameraIds = cameraListsVo.getCameraIds();
|
|
CameraListVo cameraListVo = new CameraListsVo();
|
|
CameraListVo cameraListVo = new CameraListsVo();
|
|
cameraListVo.setCurrent(1);
|
|
cameraListVo.setCurrent(1);
|
|
@@ -100,7 +115,7 @@ public class SysCameraServiceImpl extends ServiceImpl<SysCameraMapper, SysCamera
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
List cameraDetailsList = new ArrayList();
|
|
List cameraDetailsList = new ArrayList();
|
|
- IPage<SysCamera> page = (IPage<SysCamera>) this.listPage(cameraListVo).getData();
|
|
|
|
|
|
+ IPage<SysCamera> page = (IPage<SysCamera>) this.listPage(cameraListVo, userId).getData();
|
|
List<SysCamera> list = page.getRecords();
|
|
List<SysCamera> list = page.getRecords();
|
|
int i = 0;
|
|
int i = 0;
|
|
final String farmAppPort = "8081";
|
|
final String farmAppPort = "8081";
|