Commit 9589116e by 朱淼

fix bug

parent 4f6e42f6
......@@ -323,19 +323,9 @@ public class DataScreenServiceImpl implements DataScreenService {
.isNotNull(PlatElder::getBedId)
.in(PlatElder::getOrgId, dto.getOrgIds()));
for(PlatElder elder : elders){
if(StringUtil.isNotEmpty(elder.getStreetSpaceId())){
elder.setSpaceId(elder.getStreetSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getBuildingSpaceId())) {
elder.setSpaceId(elder.getBuildingSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getUnitSpaceId())){
elder.setSpaceId(elder.getUnitSpaceId());
}else {
if(StringUtil.isNotEmpty(elder.getFloorSpaceId())){
elder.setSpaceId(elder.getFloorSpaceId());
}
}
if(StringUtil.isNotEmpty(elder.getSpacePath())){
if(Arrays.asList(elder.getSpacePath().split(",")).size()>0){
elder.setSpaceId(Arrays.asList(elder.getSpacePath().split(",")).get(0));
}
}
}
......
......@@ -30,5 +30,5 @@ public interface WorkStationService {
List<PlatSpaceVO> spaceTree(PlatOrgDTO dto);
Map<String, Map<String,List<String>>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords);
Map<String, Map<String,String>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords);
}
......@@ -167,15 +167,13 @@ public class WorkStationServiceImpl implements WorkStationService {
);
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
if (elderIds.isEmpty()) {
return new PageVO<>();
}
elderIds.forEach(e -> {
elderIdList.addAll(Arrays.asList(e.split(",")));
});
dto.setElderIds(elderIdList);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Page<WorkStationInstitutionRoomVO> pages = platRoomService.workStationPage(
new Page<>(page.getPage(),page.getLimit()), page.getData());
List<WorkStationInstitutionRoomVO> roomVOList = pages.getRecords();
......@@ -218,47 +216,44 @@ public class WorkStationServiceImpl implements WorkStationService {
}
@Override
public Map<String, Map<String,List<String>>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords) {
Map<String, Map<String,List<String>>> map = new HashMap<>();
public Map<String, Map<String,String>> mapElderAlarmType(List<PlatAlarmRecord> alarmRecords) {
Map<String, Map<String,String>> map = new HashMap<>();
alarmRecords.forEach(a -> {
if (StringUtil.isNotEmpty(a.getElderIds())) {
List<String> elderIds = Arrays.asList(a.getElderIds().split(","));
elderIds.forEach(e -> {
if(map.containsKey(e)){
Map<String,List<String>> typeMap = map.get(e);
Map<String,String> typeMap = map.get(e);
if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType())
|| PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType())
){
if(typeMap.containsKey(a.getAlarmType())){
if(StringUtil.isNotEmpty(a.getRemark())){
typeMap.get(a.getAlarmType()).add(a.getRemark());
typeMap.put(a.getAlarmType(),typeMap.get(a.getAlarmType()));
String remark = typeMap.get(a.getAlarmType())+","+a.getRemark();
typeMap.put(a.getAlarmType(),remark);
}
}else {
if(StringUtil.isNotEmpty(a.getRemark())){
List<String> stautsList = new ArrayList<>();
stautsList.add(a.getRemark());
typeMap.put(a.getAlarmType(),stautsList);
typeMap.put(a.getAlarmType(),a.getRemark());
}
}
} else {
typeMap.put(a.getAlarmType(), new ArrayList<>());
typeMap.put(a.getAlarmType(),"");
}
map.put(e, typeMap);
}else {
Map<String,List<String>> typeMap = new HashMap<>();
Map<String,String> typeMap = new HashMap<>();
if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType())
|| PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType())
){
if(StringUtil.isNotEmpty(a.getRemark())){
List<String> stautsList = new ArrayList<>();
stautsList.add(a.getRemark());
typeMap.put(a.getAlarmType(),stautsList);
typeMap.put(a.getAlarmType(),a.getRemark());
}
} else {
typeMap.put(a.getAlarmType(), new ArrayList<>());
typeMap.put(a.getAlarmType(), "");
}
map.put(e, typeMap);
}
......@@ -350,9 +345,7 @@ public class WorkStationServiceImpl implements WorkStationService {
);
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
if (elderIds.isEmpty()) {
return new PageVO<>();
}
elderIds.forEach(e -> {
elderIdList.addAll(Arrays.asList(e.split(",")));
......@@ -360,7 +353,7 @@ public class WorkStationServiceImpl implements WorkStationService {
dto.setElderIds(elderIdList);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = mapElderAlarmType(alarmRecords);
Page<WorkStationHomeBedVO> pages = platBedService.selectByConditionPage(
new Page<>(page.getPage(),page.getLimit()), page.getData());
List<WorkStationHomeBedVO> list = pages.getRecords();
......
......@@ -80,7 +80,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
.eq(PlatAlarmRecord::getOrgId, space.getOrgId())
);
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
WorkStationQueryDTO queryDTO = new WorkStationQueryDTO();
queryDTO.setSpaceIds(spaceIds);
......@@ -154,7 +154,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
});
//长者对应的报警类型
Map<String, Map<String,List<String>>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
for (WorkStationInstitutionRoomVO vo : roomVOList) {
vo.setPathName(vo.getPathName() + "-" + vo.getRoomName());
......
......@@ -57,5 +57,5 @@ public class WorkStationHomeBedVO {
private Integer respiratoryRate;
@ApiModelProperty(value = "告警类型")
private Map<String,List<String>> alarmTypeMap;
private Map<String,String> alarmTypeMap;
}
......@@ -42,5 +42,5 @@ public class WorkStationInstitutionBedVO {
private String elderStatus;
@ApiModelProperty(value = "告警类型")
private Map<String,List<String>> alarmTypeMap;
private Map<String,String> alarmTypeMap;
}
......@@ -66,7 +66,7 @@
</select>
<select id="selectByCondition" resultType="com.makeit.vo.platform.workstation.WorkStationHomeBedVO">
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pb.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pe.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
FROM plat_bed pb
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
......@@ -122,7 +122,7 @@
</select>
<select id="selectByConditionPage" resultType="com.makeit.vo.platform.workstation.WorkStationHomeBedVO">
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pb.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pe.name as elderName, prbd.device_id,pm.id as roomId,pm.name as roomName ,pm.space_path,pb.status
FROM plat_bed pb
LEFT JOIN plat_room pm ON pm.id = pb.room_id
LEFT JOIN plat_space ps ON ps.id = pm.space_id
......
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