|
@@ -15,16 +15,14 @@ import com.bizmatics.common.core.util.BeanMapperUtils;
|
|
import com.bizmatics.common.core.util.FileUtils;
|
|
import com.bizmatics.common.core.util.FileUtils;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
import com.bizmatics.common.spring.util.GlobalUtils;
|
|
import com.bizmatics.common.spring.util.GlobalUtils;
|
|
-import com.bizmatics.model.Device;
|
|
|
|
-import com.bizmatics.model.DeviceAnalogVariableList;
|
|
|
|
-import com.bizmatics.model.DeviceList;
|
|
|
|
-import com.bizmatics.model.DeviceStatus;
|
|
|
|
|
|
+import com.bizmatics.model.*;
|
|
import com.bizmatics.model.system.SysUser;
|
|
import com.bizmatics.model.system.SysUser;
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
import com.bizmatics.model.vo.DeviceOneVo;
|
|
import com.bizmatics.model.vo.DeviceOneVo;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
import com.bizmatics.service.DeviceAnalogVariableListService;
|
|
import com.bizmatics.service.DeviceAnalogVariableListService;
|
|
|
|
+import com.bizmatics.service.DeviceAttributeService;
|
|
import com.bizmatics.service.DeviceService;
|
|
import com.bizmatics.service.DeviceService;
|
|
import com.bizmatics.service.DeviceStatusService;
|
|
import com.bizmatics.service.DeviceStatusService;
|
|
import com.bizmatics.service.enums.DeviceStatusCode;
|
|
import com.bizmatics.service.enums.DeviceStatusCode;
|
|
@@ -61,6 +59,8 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
private DeviceAnalogVariableListService deviceAnalogVariableListService;
|
|
private DeviceAnalogVariableListService deviceAnalogVariableListService;
|
|
@Autowired
|
|
@Autowired
|
|
private DeviceStatusService deviceStatusService;
|
|
private DeviceStatusService deviceStatusService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private DeviceAttributeService deviceAttributeService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public DeviceCountVO selectDeviceCount(Date startTime, Date endTime) {
|
|
public DeviceCountVO selectDeviceCount(Date startTime, Date endTime) {
|
|
@@ -122,9 +122,9 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
@Override
|
|
@Override
|
|
public List<DeviceOneVo> dataManagementDeviceList(int siteId, int deviceType) {
|
|
public List<DeviceOneVo> dataManagementDeviceList(int siteId, int deviceType) {
|
|
List<DeviceOneVo> deviceOneVo = new ArrayList<>();
|
|
List<DeviceOneVo> deviceOneVo = new ArrayList<>();
|
|
- LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
- queryWrapper.eq(Device::getEnable, 1).eq(Device::getSiteId, siteId);
|
|
|
|
- List<Device> deviceList = this.list(queryWrapper);
|
|
|
|
|
|
+ LambdaQueryWrapper<DeviceAttribute> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.eq(DeviceAttribute::getStatus, 1).eq(DeviceAttribute::getSiteId, siteId);
|
|
|
|
+ List<DeviceAttribute> deviceList = deviceAttributeService.list(queryWrapper);
|
|
List<DeviceAnalogVariableList> deviceAnalogVariableList = baseMapper.deviceAnalogVariableList(siteId);
|
|
List<DeviceAnalogVariableList> deviceAnalogVariableList = baseMapper.deviceAnalogVariableList(siteId);
|
|
|
|
|
|
if (deviceList.size() > 0) {
|
|
if (deviceList.size() > 0) {
|
|
@@ -132,11 +132,11 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
DeviceOneVo deviceOneVoOne = new DeviceOneVo();
|
|
DeviceOneVo deviceOneVoOne = new DeviceOneVo();
|
|
List<DeviceAnalogVariableList> deviceAnalogVariableListTwo = new ArrayList<>();
|
|
List<DeviceAnalogVariableList> deviceAnalogVariableListTwo = new ArrayList<>();
|
|
deviceOneVoOne.setId(deviceList.get(i).getId());
|
|
deviceOneVoOne.setId(deviceList.get(i).getId());
|
|
- deviceOneVoOne.setDeviceCode(deviceList.get(i).getDeviceCode());
|
|
|
|
- deviceOneVoOne.setDeviceName(deviceList.get(i).getDeviceName());
|
|
|
|
|
|
+ deviceOneVoOne.setDeviceCode(deviceList.get(i).getMonitorDeviceCode());
|
|
|
|
+ deviceOneVoOne.setDeviceName(deviceList.get(i).getMonitorDeviceName());
|
|
if (deviceAnalogVariableList.size() > 0) {
|
|
if (deviceAnalogVariableList.size() > 0) {
|
|
for (int j = 0; j < deviceAnalogVariableList.size(); j++) {
|
|
for (int j = 0; j < deviceAnalogVariableList.size(); j++) {
|
|
- if (deviceList.get(i).getId().equals(deviceAnalogVariableList.get(j).getCommunicationEquipment())) {
|
|
|
|
|
|
+ if (deviceList.get(i).getId().equals(deviceAnalogVariableList.get(j).getMonitoringEquipment())) {
|
|
deviceAnalogVariableListTwo.add(deviceAnalogVariableList.get(j));
|
|
deviceAnalogVariableListTwo.add(deviceAnalogVariableList.get(j));
|
|
}
|
|
}
|
|
}
|
|
}
|