Commit 5e70e13b by 杨伟程

关联工具类更新

parent 43083b57
......@@ -50,9 +50,9 @@ public class JoinUtil {
join(list, service, null, getNidList, getMid, consumerList);
}
public static <T, M extends BaseEntity> void join(List<T> list, IService<M> service, List<Function<T, String>> getNidList, List<BiConsumer<T, M>> consumerList) {
join(list, service, null, getNidList, BaseEntity::getId, consumerList);
}
// public static <T, M extends BaseEntity> void join(List<T> list, IService<M> service, List<Function<T, String>> getNidList, List<BiConsumer<T, M>> consumerList) {
// join(list, service, null, getNidList, BaseEntity::getId, consumerList);
// }
public static <T, M> void join(List<T> list, IService<M> service, Consumer<LambdaQueryWrapper<M>> extQuery, List<Function<T, String>> getNidList, SFunction<M, String> getMid, List<BiConsumer<T, M>> consumerList) {
if (list.isEmpty()) {
......@@ -81,9 +81,9 @@ public class JoinUtil {
join(list, service, null, getNid, getMid, consumer);
}
public static <T, M extends BaseEntity> void join(List<T> list, IService<M> service, Function<T, String> getNid, BiConsumer<T, M> consumer) {
join(list, service, null, getNid, BaseEntity::getId, consumer);
}
// public static <T, M extends BaseEntity> void join(List<T> list, IService<M> service, Function<T, String> getNid, BiConsumer<T, M> consumer) {
// join(list, service, null, getNid, BaseEntity::getId, consumer);
// }
public static <T, M> void join(List<T> list, IService<M> service, Consumer<LambdaQueryWrapper<M>> extQuery, Function<T, String> getNid, SFunction<M, String> getMid, BiConsumer<T, M> consumer) {
if (list.isEmpty()) {
......
......@@ -45,6 +45,18 @@ public class PlatElderReportDayController {
return null;
}
@ApiOperation("心率异常记录")
@PostMapping("heartExceptionRecordList")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationRecordVO>> heartExceptionRecordList(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("呼吸率异常记录")
@PostMapping("respiratoryExceptionRecordList")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationRecordVO>> respiratoryExceptionRecordList(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("心率呼吸率")
@PostMapping("heartRespiratory")
public ApiResponseEntity<PlatElderRealTimeHeartRespiratoryVO> heartRespiratory(@RequestBody PlatElderIdDTO platElderIdDTO) {
......
package com.makeit.module.controller.elder;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.dto.platform.elder.PlatElderIdDTO;
import com.makeit.vo.platform.elder.report.day.*;
import com.makeit.vo.platform.elder.report.week.PlatElderComprehensiveEvaluationVO;
import com.makeit.vo.platform.elder.report.week.PlatElderRealTimeHeartRespiratoryWeekVO;
import com.makeit.vo.platform.elder.report.week.PlatElderSleepDiagramWeekVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 长者基本信息 前端控制器
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Api(tags = "长者报告-周报")
@RestController
@RequestMapping("/plat/elder/report/week")
public class PlatElderReportMonthController {
@ApiOperation("综合评价")
@PostMapping("comprehensiveEvaluation")
public ApiResponseEntity<PlatElderComprehensiveEvaluationVO> comprehensiveEvaluation(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("睡眠评价")
@PostMapping("sleepEvaluation")
public ApiResponseEntity<PlatElderSleepEvaluationVO> sleepEvaluation(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("心率呼吸评价")
@PostMapping("heartRespiratoryEvaluation")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationVO>> heartRespiratoryEvaluation(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
}
......@@ -6,6 +6,7 @@ import com.makeit.dto.platform.elder.PlatElderIdDTO;
import com.makeit.vo.platform.elder.realtime.PlatElderRealTimeHeartRespiratoryVO;
import com.makeit.vo.platform.elder.report.week.PlatElderComprehensiveEvaluationVO;
import com.makeit.vo.platform.elder.report.day.*;
import com.makeit.vo.platform.elder.report.week.PlatElderRealTimeHeartRespiratoryWeekVO;
import com.makeit.vo.platform.elder.report.week.PlatElderSleepDiagramWeekVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -49,13 +50,25 @@ public class PlatElderReportWeekController {
@ApiOperation("心率呼吸评价")
@PostMapping("heartRespiratoryEvaluation")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationVO>> heartRespiratoryEvaluation(@RequestBody PlatElderIdDTO platElderIdDTO) {
public ApiResponseEntity<PlatElderHeartRespiratoryEvaluationVO> heartRespiratoryEvaluation(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("心率异常记录")
@PostMapping("heartExceptionRecordList")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationRecordVO>> heartExceptionRecordList(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("呼吸率异常记录")
@PostMapping("respiratoryExceptionRecordList")
public ApiResponseEntity<List<PlatElderHeartRespiratoryEvaluationRecordVO>> respiratoryExceptionRecordList(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
@ApiOperation("心率呼吸率")
@PostMapping("heartRespiratory")
public ApiResponseEntity<PlatElderRealTimeHeartRespiratoryVO> heartRespiratory(@RequestBody PlatElderIdDTO platElderIdDTO) {
public ApiResponseEntity<PlatElderRealTimeHeartRespiratoryWeekVO> heartRespiratory(@RequestBody PlatElderIdDTO platElderIdDTO) {
return null;
}
......
......@@ -72,12 +72,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(page.getRecords(), PlatDeviceListVO.class);
JoinUtil.join(voList, platOrgService, PlatDeviceListVO::getOrgId, (d, o) -> {
JoinUtil.join(voList, platOrgService, PlatDeviceListVO::getOrgId, PlatOrg::getId, (d, o) -> {
d.setOrgName(o.getName());
});
JoinUtil.joinSplit(voList, platOrgService, PlatDeviceListVO::getOrgPath, (d, o) -> {
d.setOrgName(StreamUtil.join(o, PlatOrg::getName));
JoinUtil.joinSplit(voList, platOrgService, PlatDeviceListVO::getOrgPath, PlatOrg::getId, (d, o) -> {
d.setOrgPathName(StreamUtil.join(o, PlatOrg::getName));
});
return PageUtil.toPageVO(voList, page);
......
......@@ -62,12 +62,12 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
c.setElderName(StreamUtil.join(e, PlatElder::getName));
});
JoinUtil.join(voList, platOrgService, PlatElderChildrenInfoListVO::getOrgId, (d, o) -> {
JoinUtil.join(voList, platOrgService, PlatElderChildrenInfoListVO::getOrgId, PlatOrg::getId, (d, o) -> {
d.setOrgName(o.getName());
});
JoinUtil.joinSplit(voList, platOrgService, PlatElderChildrenInfoListVO::getOrgPath, (d, o) -> {
d.setOrgName(StreamUtil.join(o, PlatOrg::getName));
JoinUtil.joinSplit(voList, platOrgService, PlatElderChildrenInfoListVO::getOrgPath, PlatOrg::getId, (d, o) -> {
d.setOrgPathName(StreamUtil.join(o, PlatOrg::getName));
});
}
......
......@@ -116,23 +116,23 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
List<PlatElderListVO> list = BeanDtoVoUtils.listVo(voList, PlatElderListVO.class);
JoinUtil.join(list, platOrgService, PlatElderListVO::getOrgId, (d, o) -> {
JoinUtil.join(list, platOrgService, PlatElderListVO::getOrgId, PlatOrg::getId, (d, o) -> {
d.setOrgName(o.getName());
});
JoinUtil.joinSplit(list, platOrgService, PlatElderListVO::getOrgPath, (d, o) -> {
d.setOrgName(StreamUtil.join(o, PlatOrg::getName));
JoinUtil.joinSplit(list, platOrgService, PlatElderListVO::getOrgPath, PlatOrg::getId, (d, o) -> {
d.setOrgPathName(StreamUtil.join(o, PlatOrg::getName));
});
JoinUtil.joinSplit(list, platSpaceService, PlatElderListVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platSpaceService, PlatElderListVO::getSpacePath, PlatSpace::getId, (e, l) -> {
e.setSpacePathName(StreamUtil.join(l, Objects::nonNull, PlatSpace::getName));
});
JoinUtil.joinSplit(list, platRoomService, PlatElderListVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platRoomService, PlatElderListVO::getSpacePath, PlatRoom::getId, (e, l) -> {
e.setSpacePathName(e.getSpacePathName() + "," + StreamUtil.join(l, Objects::nonNull, PlatRoom::getName));
});
JoinUtil.joinSplit(list, platBedService, PlatElderListVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platBedService, PlatElderListVO::getSpacePath, PlatBed::getId, (e, l) -> {
e.setSpacePathName(e.getSpacePathName() + "," + StreamUtil.join(l, Objects::nonNull, PlatBed::getName));
});
......@@ -142,7 +142,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
PlatElderListVO::getBuildingSpaceId,
PlatElderListVO::getUnitSpaceId,
PlatElderListVO::getFloorSpaceId
), Arrays.asList(
), PlatSpace::getId, Arrays.asList(
(e, s) -> e.setSpaceName(s.getName()),
(e, s) -> e.setStreetSpaceName(s.getName()),
(e, s) -> e.setBuildingSpaceName(s.getName()),
......@@ -150,11 +150,11 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
(e, s) -> e.setFloorSpaceName(s.getName())
));
JoinUtil.join(list, platRoomService, PlatElderListVO::getRoomId, (e, l) -> {
JoinUtil.join(list, platRoomService, PlatElderListVO::getRoomId, PlatRoom::getId, (e, l) -> {
e.setRoomName(l.getName());
});
JoinUtil.join(list, platBedService, PlatElderListVO::getBedId, (e, l) -> {
JoinUtil.join(list, platBedService, PlatElderListVO::getBedId, PlatBed::getId, (e, l) -> {
e.setBedName(l.getName());
});
......@@ -207,18 +207,18 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
PlatElderExportVO::getBuildingSpaceId,
PlatElderExportVO::getUnitSpaceId,
PlatElderExportVO::getFloorSpaceId
), Arrays.asList(
), PlatSpace::getId, Arrays.asList(
(e, s) -> e.setStreetSpaceName(s.getName()),
(e, s) -> e.setBuildingSpaceName(s.getName()),
(e, s) -> e.setUnitSpaceName(s.getName()),
(e, s) -> e.setFloorSpaceName(s.getName())
));
JoinUtil.join(list, platRoomService, PlatElderExportVO::getRoomId, (e, l) -> {
JoinUtil.join(list, platRoomService, PlatElderExportVO::getRoomId, PlatRoom::getId, (e, l) -> {
e.setRoomName(l.getName());
});
JoinUtil.join(list, platBedService, PlatElderExportVO::getBedId, (e, l) -> {
JoinUtil.join(list, platBedService, PlatElderExportVO::getBedId, PlatBed::getId, (e, l) -> {
e.setBedName(l.getName());
});
......@@ -558,15 +558,15 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
List<PlatElderDTOVO> list = Arrays.asList(vo);
JoinUtil.joinSplit(list, platSpaceService, PlatElderDTOVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platSpaceService, PlatElderDTOVO::getSpacePath, PlatSpace::getId, (e, l) -> {
e.setSpacePathName(StreamUtil.join(l, Objects::nonNull, PlatSpace::getName));
});
JoinUtil.joinSplit(list, platRoomService, PlatElderDTOVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platRoomService, PlatElderDTOVO::getSpacePath, PlatRoom::getId, (e, l) -> {
e.setSpacePathName(e.getSpacePathName() + "," + StreamUtil.join(l, Objects::nonNull, PlatRoom::getName));
});
JoinUtil.joinSplit(list, platBedService, PlatElderDTOVO::getSpacePath, (e, l) -> {
JoinUtil.joinSplit(list, platBedService, PlatElderDTOVO::getSpacePath, PlatBed::getId, (e, l) -> {
e.setSpacePathName(e.getSpacePathName() + "," + StreamUtil.join(l, Objects::nonNull, PlatBed::getName));
});
......@@ -576,7 +576,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
PlatElderDTOVO::getBuildingSpaceId,
PlatElderDTOVO::getUnitSpaceId,
PlatElderDTOVO::getFloorSpaceId
), Arrays.asList(
), PlatSpace::getId, Arrays.asList(
(e, s) -> e.setSpaceName(s.getName()),
(e, s) -> e.setStreetSpaceName(s.getName()),
(e, s) -> e.setBuildingSpaceName(s.getName()),
......@@ -584,11 +584,11 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
(e, s) -> e.setFloorSpaceName(s.getName())
));
JoinUtil.join(list, platRoomService, PlatElderDTOVO::getRoomId, (e, l) -> {
JoinUtil.join(list, platRoomService, PlatElderDTOVO::getRoomId, PlatRoom::getId, (e, l) -> {
e.setRoomName(l.getName());
});
JoinUtil.join(list, platBedService, PlatElderDTOVO::getBedId, (e, l) -> {
JoinUtil.join(list, platBedService, PlatElderDTOVO::getBedId, PlatBed::getId, (e, l) -> {
e.setBedName(l.getName());
});
......
......@@ -23,10 +23,4 @@ public class PlatElderHeartRespiratoryEvaluationVO {
@ApiModelProperty("呼吸率")
private Integer respiratoryRate;
@ApiModelProperty("心率异常记录")
private List<PlatElderHeartRespiratoryEvaluationRecordVO> heartList;
@ApiModelProperty("呼吸率异常记录")
private List<PlatElderHeartRespiratoryEvaluationRecordVO> respiratoryList;
}
package com.makeit.vo.platform.elder.report.day;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PlatElderReportMonthVO {
@ApiModelProperty("睡眠结果")
private String sleepResult;
@ApiModelProperty("心率")
private Integer heartRate;
@ApiModelProperty("呼吸率")
private Integer respiratoryRate;
@ApiModelProperty("跌倒次数")
private Integer failCount;
@ApiModelProperty("心率异常次数")
private Integer heartExceptionCount;
@ApiModelProperty("呼吸异常次数")
private Integer respiratoryExceptionCount;
@ApiModelProperty("跌倒次数")
private Integer beExceptionCount;
}
......@@ -9,7 +9,17 @@ public class PlatElderSleepEvaluationVO {
@ApiModelProperty("得分")
private Integer score;
@ApiModelProperty("结果")
private String result;
@ApiModelProperty("评价")
private String evaluation;
@ApiModelProperty(value = "睡眠时长")
private Integer sleepDuration;
@ApiModelProperty(value = "休息时长")
private Integer restDuration;
}
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