Commit ec6fce06 by 朱淼

fix bug

parent efb31b22
package com.makeit.enums.platform.workstation;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum PlatAlarmRecordType {
FALL("fall","长者跌倒"),
BEHAVIOR("behavior","行为异常");
private final String value;
private final String name;
}
......@@ -27,7 +27,7 @@ public interface PlatBedMapper extends BaseMapper<PlatBed> {
long countByOrdIdsAndType(@Param("orgIds") List<String> orgIds, @Param("orgType")String orgType);
List<WorkStationInstitutionBedVO> selectByRoomIds(@Param("roomIds")List<String> roomIds);
List<WorkStationInstitutionBedVO> selectByRoomIds(@Param("roomIds")List<String> roomIds, @Param("elderIds")List<String> elderIds, @Param("elderName")String elderName);
List<WorkStationHomeBedVO> selectByCondition(@Param("dto")WorkStationQueryDTO dto);
......
......@@ -65,7 +65,7 @@ public interface PlatBedService extends IService<PlatBed> {
long countByOrdIds(List<String> orgIds);
List<WorkStationInstitutionBedVO> selectByRoomIds(List<String> roomIds);
List<WorkStationInstitutionBedVO> selectByRoomIds(List<String> roomIds, List<String> elderIds, String elderName);
List<WorkStationHomeBedVO> selectByCondition(WorkStationQueryDTO dto);
......
......@@ -186,8 +186,8 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
@Override
public List<WorkStationInstitutionBedVO> selectByRoomIds(List<String> roomIds) {
return baseMapper.selectByRoomIds(roomIds);
public List<WorkStationInstitutionBedVO> selectByRoomIds(List<String> roomIds, List<String> elderIds, String elderName) {
return baseMapper.selectByRoomIds(roomIds, elderIds, elderName);
}
@Override
......
......@@ -14,15 +14,14 @@ import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import com.makeit.enums.platform.alarm.PlatAlarmRecordEnum;
import com.makeit.enums.platform.auth.PlatOrgEnum;
import com.makeit.enums.platform.elder.PlatElderRealtimeReportEnum;
import com.makeit.enums.platform.space.PlatBedStatusEnum;
import com.makeit.enums.platform.workstation.PlatAlarmRecordType;
import com.makeit.enums.platform.workstation.WorkStationStatusEnum;
import com.makeit.enums.saas.ModelManageTypeEnum;
import com.makeit.module.iot.enums.DeviceInfoContentBreatheEnum;
......@@ -46,7 +45,6 @@ import com.makeit.utils.data.validate.CollectionUtils;
import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.vo.platform.elder.realtime.PlatElderCoordinateVO;
import com.makeit.vo.platform.elder.realtime.PlatElderRealTimeNowVO;
import com.makeit.vo.platform.space.PlatBedVo;
import com.makeit.vo.platform.workstation.*;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -226,7 +224,7 @@ public class WorkStationServiceImpl implements WorkStationService {
}
List<String> roomIds = roomVOList.stream().map(WorkStationInstitutionRoomVO::getRoomId).collect(Collectors.toList());
//获取床号及长者/设备
List<WorkStationInstitutionBedVO> bedVos = platBedService.selectByRoomIds(roomIds);
List<WorkStationInstitutionBedVO> bedVos = platBedService.selectByRoomIds(roomIds,dto.getElderIds(),dto.getElderName());
Map<String, List<WorkStationInstitutionBedVO>> bedMap = bedVos.stream().collect(Collectors.groupingBy(WorkStationInstitutionBedVO::getRoomId));
JoinUtil.joinSplit(roomVOList, platSpaceService, WorkStationInstitutionRoomVO::getSpacePath, PlatSpace::getId, (e, l) -> {
......@@ -381,8 +379,10 @@ public class WorkStationServiceImpl implements WorkStationService {
typeMap.put(a.getAlarmType(),a.getRemark());
}
}
} else {
typeMap.put(a.getAlarmType(),"");
} else if(PlatAlarmConfigEnum.AlarmTypeEnum.FALL.getValue().equals(a.getAlarmType())){
typeMap.put(a.getAlarmType(), PlatAlarmRecordType.FALL.getName());
} else if(PlatAlarmConfigEnum.AlarmTypeEnum.BEHAVIOR.getValue().equals(a.getAlarmType())){
typeMap.put(a.getAlarmType(), PlatAlarmRecordType.BEHAVIOR.getName());
}
map.put(e, typeMap);
......
......@@ -166,7 +166,7 @@ public class PlatElderCenterWechatServiceImpl implements PlatElderCenterWechatSe
List<String> roomIds = roomVOList.stream().map(WorkStationInstitutionRoomVO::getRoomId).collect(Collectors.toList());
//获取床号及长者/设备
List<WorkStationInstitutionBedVO> bedVos = platBedService.selectByRoomIds(roomIds);
List<WorkStationInstitutionBedVO> bedVos = platBedService.selectByRoomIds(roomIds, null, null);
Map<String, List<WorkStationInstitutionBedVO>> bedMap = bedVos.stream().collect(Collectors.groupingBy(WorkStationInstitutionBedVO::getRoomId));
JoinUtil.joinSplit(roomVOList, platSpaceService, WorkStationInstitutionRoomVO::getSpacePath, PlatSpace::getId, (e, l) -> {
......
......@@ -63,6 +63,15 @@
#{item}
</foreach>
</if>
<if test="elderIds != null and elderIds.size() > 0 ">
AND pe.id IN
<foreach collection="elderIds" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
<if test="elderName != null and elderName != ''">
AND pe.name LIKE CONCAT('%',#{elderName},'%')
</if>
</where>
</select>
......
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