|
@@ -13,6 +13,7 @@ import com.bizmatics.model.DeviceStatus;
|
|
|
import com.bizmatics.model.system.SysUser;
|
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
|
+import com.bizmatics.model.vo.DeviceOneVo;
|
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
|
import com.bizmatics.service.DeviceAnalogVariableListService;
|
|
|
import com.bizmatics.service.DeviceService;
|
|
@@ -104,17 +105,33 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Device> dataManagementDeviceList(int siteId, int deviceType) {
|
|
|
+ public List<DeviceOneVo> dataManagementDeviceList(int siteId, int deviceType) {
|
|
|
+ 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);
|
|
|
+ List<DeviceAnalogVariableList> deviceAnalogVariableList = baseMapper.deviceAnalogVariableList(siteId);
|
|
|
+
|
|
|
+ if (deviceList.size()>0){
|
|
|
+ for (int i = 0; i < deviceList.size(); i++) {
|
|
|
+ DeviceOneVo deviceOneVoOne = new DeviceOneVo();
|
|
|
+ List<DeviceAnalogVariableList> deviceAnalogVariableListTwo = new ArrayList<>();
|
|
|
+ deviceOneVoOne.setId(deviceList.get(i).getId());
|
|
|
+ deviceOneVoOne.setDeviceCode(deviceList.get(i).getDeviceCode());
|
|
|
+ deviceOneVoOne.setDeviceName(deviceList.get(i).getDeviceName());
|
|
|
+ if (deviceAnalogVariableList.size()>0){
|
|
|
+ for (int j = 0; j < deviceAnalogVariableList.size(); j++) {
|
|
|
+ if (deviceList.get(i).getId()==deviceAnalogVariableList.get(j).getCommunicationEquipment()){
|
|
|
+ deviceAnalogVariableListTwo.add(deviceAnalogVariableList.get(j));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deviceOneVoOne.setDeviceAnalogVariableList(deviceAnalogVariableListTwo);
|
|
|
+ deviceOneVo.add(deviceOneVoOne);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-// LambdaQueryWrapper<DeviceAnalogVariableList> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
-// queryWrapperOne.eq(DeviceAnalogVariableList::getStatus, 1).eq(DeviceAnalogVariableList::getSiteId, siteId);
|
|
|
-// List<DeviceAnalogVariableList> deviceAnalogVariableList = this.list(queryWrapperOne);
|
|
|
-
|
|
|
-
|
|
|
- return deviceList;
|
|
|
+ return deviceOneVo;
|
|
|
}
|
|
|
|
|
|
@Override
|