Commit 83e47f38 by 朱淼

fix bug

parent a1e22ab0
...@@ -112,7 +112,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -112,7 +112,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
//上级空间 //上级空间
PlatSpace parentSpace = this.getById(dto.getParentId()); PlatSpace parentSpace = this.getById(dto.getParentId());
if(parentSpace.getParentPath().contains(dto.getId())){ if(parentSpace!=null && parentSpace.getParentPath().contains(dto.getId())){
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_SPACE_NOT_DEL); throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_SPACE_NOT_DEL);
} }
......
...@@ -160,7 +160,9 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -160,7 +160,9 @@ public class WorkStationServiceImpl implements WorkStationService {
if (spaces.isEmpty()) { if (spaces.isEmpty()) {
return new PageVO<>(); return new PageVO<>();
} }
List<String> spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList());
dto.setOrgIds(orgIds); dto.setOrgIds(orgIds);
dto.setSpaceIds(spaceIds);
} else { } else {
//获取父级的所有子级空间 //获取父级的所有子级空间
spaces = platSpaceService.listChild(dto.getSpaceIds()); spaces = platSpaceService.listChild(dto.getSpaceIds());
...@@ -172,6 +174,7 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -172,6 +174,7 @@ public class WorkStationServiceImpl implements WorkStationService {
.eq(StringUtil.isNotEmpty(dto.getAlarmType()), PlatAlarmRecord::getAlarmType, dto.getAlarmType()) .eq(StringUtil.isNotEmpty(dto.getAlarmType()), PlatAlarmRecord::getAlarmType, dto.getAlarmType())
.eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue()) .eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue())
.in(PlatAlarmRecord::getOrgId, dto.getOrgIds()) .in(PlatAlarmRecord::getOrgId, dto.getOrgIds())
.orderByDesc(PlatAlarmRecord::getAlarmDate)
); );
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds())) List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList()); .map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
...@@ -180,6 +183,9 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -180,6 +183,9 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIdList.addAll(Arrays.asList(e.split(","))); elderIdList.addAll(Arrays.asList(e.split(",")));
}); });
if(StringUtil.isNotEmpty(dto.getAlarmType())){ if(StringUtil.isNotEmpty(dto.getAlarmType())){
if(elderIdList.isEmpty()){
return new PageVO<>();
}
dto.setElderIds(elderIdList); dto.setElderIds(elderIdList);
} }
...@@ -238,17 +244,22 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -238,17 +244,22 @@ public class WorkStationServiceImpl implements WorkStationService {
if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType()) if(PlatAlarmConfigEnum.AlarmTypeEnum.HEART.getValue().equals(a.getAlarmType())
|| PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType()) || PlatAlarmConfigEnum.AlarmTypeEnum.BREATHE.getValue().equals(a.getAlarmType())
){ ){
if(typeMap.containsKey(a.getAlarmType())){ if(!typeMap.containsKey(a.getAlarmType())){
if(StringUtil.isNotEmpty(a.getRemark())){
String remark = typeMap.get(a.getAlarmType())+","+a.getRemark();
typeMap.put(a.getAlarmType(),remark);
}
}else {
if(StringUtil.isNotEmpty(a.getRemark())){ if(StringUtil.isNotEmpty(a.getRemark())){
typeMap.put(a.getAlarmType(),a.getRemark()); typeMap.put(a.getAlarmType(),a.getRemark());
} }
} }
// if(typeMap.containsKey(a.getAlarmType())){
// if(StringUtil.isNotEmpty(a.getRemark())){
// String remark = typeMap.get(a.getAlarmType())+","+a.getRemark();
// typeMap.put(a.getAlarmType(),remark);
// }
//
// }else {
// if(StringUtil.isNotEmpty(a.getRemark())){
// typeMap.put(a.getAlarmType(),a.getRemark());
// }
// }
} else { } else {
typeMap.put(a.getAlarmType(),""); typeMap.put(a.getAlarmType(),"");
} }
...@@ -348,6 +359,8 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -348,6 +359,8 @@ public class WorkStationServiceImpl implements WorkStationService {
if (spaces.isEmpty()) { if (spaces.isEmpty()) {
return new PageVO<>(); return new PageVO<>();
} }
List<String> spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList());
dto.setSpaceIds(spaceIds);
} else { } else {
//获取父级的所有子级空间 //获取父级的所有子级空间
spaces = platSpaceService.listChild(dto.getSpaceIds()); spaces = platSpaceService.listChild(dto.getSpaceIds());
...@@ -359,6 +372,7 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -359,6 +372,7 @@ public class WorkStationServiceImpl implements WorkStationService {
.eq(StringUtil.isNotEmpty(dto.getAlarmType()), PlatAlarmRecord::getAlarmType, dto.getAlarmType()) .eq(StringUtil.isNotEmpty(dto.getAlarmType()), PlatAlarmRecord::getAlarmType, dto.getAlarmType())
.eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue()) .eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue())
.in(PlatAlarmRecord::getOrgId, dto.getOrgIds()) .in(PlatAlarmRecord::getOrgId, dto.getOrgIds())
.orderByDesc(PlatAlarmRecord::getAlarmDate)
); );
List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds())) List<String> elderIds = alarmRecords.stream().filter(t -> StringUtil.isNotEmpty(t.getElderIds()))
.map(PlatAlarmRecord::getElderIds).collect(Collectors.toList()); .map(PlatAlarmRecord::getElderIds).collect(Collectors.toList());
...@@ -368,6 +382,9 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -368,6 +382,9 @@ public class WorkStationServiceImpl implements WorkStationService {
elderIdList.addAll(Arrays.asList(e.split(","))); elderIdList.addAll(Arrays.asList(e.split(",")));
}); });
if(StringUtil.isNotEmpty(dto.getAlarmType())){ if(StringUtil.isNotEmpty(dto.getAlarmType())){
if(elderIdList.isEmpty()){
return new PageVO<>();
}
dto.setElderIds(elderIdList); dto.setElderIds(elderIdList);
} }
......
...@@ -78,6 +78,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe ...@@ -78,6 +78,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
new QueryWrapper<PlatAlarmRecord>().lambda() new QueryWrapper<PlatAlarmRecord>().lambda()
.eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue()) .eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue())
.eq(PlatAlarmRecord::getOrgId, space.getOrgId()) .eq(PlatAlarmRecord::getOrgId, space.getOrgId())
.orderByDesc(PlatAlarmRecord::getAlarmDate)
); );
//长者对应的报警类型 //长者对应的报警类型
Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords); Map<String, Map<String,String>> elderAlarmTypeMap = workStationService.mapElderAlarmType(alarmRecords);
...@@ -133,6 +134,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe ...@@ -133,6 +134,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
new QueryWrapper<PlatAlarmRecord>().lambda() new QueryWrapper<PlatAlarmRecord>().lambda()
.eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue()) .eq(PlatAlarmRecord::getStatus, PlatAlarmRecordEnum.AlarmRecordStatusEnum.UNHANDLED.getValue())
.eq(PlatAlarmRecord::getOrgId, space.getOrgId()) .eq(PlatAlarmRecord::getOrgId, space.getOrgId())
.orderByDesc(PlatAlarmRecord::getAlarmDate)
); );
WorkStationQueryDTO queryDTO = new WorkStationQueryDTO(); WorkStationQueryDTO queryDTO = new WorkStationQueryDTO();
queryDTO.setSpaceIds(spaceIds); queryDTO.setSpaceIds(spaceIds);
......
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