|
@@ -1,12 +1,10 @@
|
|
|
package com.bizmatics.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.bizmatics.common.core.bean.CommonPage;
|
|
|
-import com.bizmatics.common.core.util.DateUtils;
|
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
import com.bizmatics.model.Device;
|
|
|
import com.bizmatics.model.DeviceAnalogVariableList;
|
|
@@ -20,22 +18,18 @@ import com.bizmatics.service.DeviceService;
|
|
|
import com.bizmatics.service.enums.DeviceStatusCode;
|
|
|
import com.bizmatics.service.enums.DeviceType;
|
|
|
import com.bizmatics.service.util.SecurityUtils;
|
|
|
-import com.bizmatics.service.vo.CommonIcoVO;
|
|
|
import com.bizmatics.service.vo.CorrespondDeviceVOT;
|
|
|
import com.bizmatics.service.vo.DeviceCountVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
/**
|
|
|
- * <p>
|
|
|
- * 服务实现类
|
|
|
- * </p>
|
|
|
+ * 设备
|
|
|
*
|
|
|
* @author ya
|
|
|
* @since 2021-07-07
|
|
@@ -156,9 +150,9 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
@Override
|
|
|
public CommonPage<CorrespondDeviceVO> correspondDeviceList(String deviceName, int size, int current) {
|
|
|
List<CorrespondDeviceVO> correspondDeviceListOne = baseMapper.CorrespondDeviceList(deviceName, null, null);
|
|
|
- int total=0;
|
|
|
- if (correspondDeviceListOne.size()>0){
|
|
|
- total= correspondDeviceListOne.size();
|
|
|
+ int total = 0;
|
|
|
+ if (correspondDeviceListOne.size() > 0) {
|
|
|
+ total = correspondDeviceListOne.size();
|
|
|
}
|
|
|
int startCurrent = (size - 1) * current;
|
|
|
List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, current);
|
|
@@ -166,11 +160,11 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CorrespondDeviceListVO> correspondDeviceListEcho(int id){
|
|
|
+ public List<CorrespondDeviceListVO> correspondDeviceListEcho(int id) {
|
|
|
LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(Device::getEnable, 1).eq(Device::getId, id);
|
|
|
List<Device> deviceList = this.list(queryWrapper);
|
|
|
- LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
queryWrapperOne.eq(DeviceAnalogVariableList::getStatus, 1).eq(DeviceAnalogVariableList::getCommunicationEquipment, deviceList.get(0).getId());
|
|
|
List<DeviceAnalogVariableList> deviceAnalogVariableList = deviceAnalogVariableListService.list(queryWrapperOne);
|
|
|
|
|
@@ -184,14 +178,14 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonPage<Device> videoMonitoringDeviceList(String deviceName,Integer deviceType,Integer siteId, Integer size, Integer current){
|
|
|
+ public CommonPage<Device> videoMonitoringDeviceList(String deviceName, Integer deviceType, Integer siteId, Integer size, Integer current) {
|
|
|
IPage<Device> page = new Page<Device>(size, current);
|
|
|
LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(Device::getSiteId, siteId).eq(Device::getEnable, 1);
|
|
|
- if (deviceType != null && deviceType!=0) {
|
|
|
+ if (deviceType != null && deviceType != 0) {
|
|
|
queryWrapper.eq(Device::getDeviceType, deviceType);
|
|
|
}
|
|
|
- if (deviceName!=null && !deviceName.equals("") && !deviceName.equals(null)){
|
|
|
+ if (deviceName != null && !deviceName.equals("") && !deviceName.equals(null)) {
|
|
|
queryWrapper.like(Device::getDeviceName, deviceName);
|
|
|
}
|
|
|
|
|
@@ -201,5 +195,4 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|