Commit 263093e5 by lzy

已绑定设备列表

parent dbe536d3
...@@ -33,4 +33,8 @@ public class PlatDeviceDTO { ...@@ -33,4 +33,8 @@ public class PlatDeviceDTO {
@ApiModelProperty(value = "床位名称") @ApiModelProperty(value = "床位名称")
private String bedName; private String bedName;
@ApiModelProperty(value = "床位Id")
private String bedId;
} }
...@@ -119,10 +119,12 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM ...@@ -119,10 +119,12 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
queryWrapper2.in(PlatBed::getId,listBedIds); queryWrapper2.in(PlatBed::getId,listBedIds);
List<PlatBed> listBeds = platBedService.list(queryWrapper2); List<PlatBed> listBeds = platBedService.list(queryWrapper2);
Map<String,String> map = listBeds.stream().collect(Collectors.toMap(PlatBed::getId,PlatBed::getName,(k1, k2)->k1)); Map<String,String> map = listBeds.stream().collect(Collectors.toMap(PlatBed::getId,PlatBed::getName,(k1, k2)->k1));
Map<String,String> mapName = new HashMap<>(); Map<String,String> mapName = new HashMap<>(20);
Map<String,String> mapBedId = new HashMap<>(20);
list.forEach(item->{ list.forEach(item->{
if(map.containsKey(item.getBedId())){ if(map.containsKey(item.getBedId())){
mapName.put(item.getDeviceId(),map.get(item.getBedId())); mapName.put(item.getDeviceId(),map.get(item.getBedId()));
mapBedId.put(item.getDeviceId(),item.getBedId());
} }
}); });
...@@ -136,6 +138,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM ...@@ -136,6 +138,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
data.forEach(item->{ data.forEach(item->{
item.setBedName(mapName.get(item.getId())); item.setBedName(mapName.get(item.getId()));
item.setBedId(mapBedId.get(item.getId()));
}); });
} }
return data; return data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment