|
@@ -257,14 +257,20 @@ public class HealthReportController {
|
|
|
@PostMapping("/report/list")
|
|
@PostMapping("/report/list")
|
|
|
public Result<List<HealthReport>> listReports(
|
|
public Result<List<HealthReport>> listReports(
|
|
|
@RequestBody Map<String, Object> params,
|
|
@RequestBody Map<String, Object> params,
|
|
|
- @RequestAttribute(value = "currentMemberId", required = false) Long currentMemberId) {
|
|
|
|
|
|
|
+ @RequestAttribute(value = "currentMemberId", required = false) Long currentMemberId,
|
|
|
|
|
+ @RequestAttribute(value = "familyId", required = false) Long familyId) {
|
|
|
Long memberId = params.get("memberId") != null
|
|
Long memberId = params.get("memberId") != null
|
|
|
? Long.valueOf(params.get("memberId").toString()) : currentMemberId;
|
|
? Long.valueOf(params.get("memberId").toString()) : currentMemberId;
|
|
|
- if (memberId == null) {
|
|
|
|
|
- return Result.error("memberId不能为空");
|
|
|
|
|
|
|
+ if (memberId != null) {
|
|
|
|
|
+ List<HealthReport> reports = healthReportService.getUserReports(memberId);
|
|
|
|
|
+ return Result.success(reports);
|
|
|
}
|
|
}
|
|
|
- List<HealthReport> reports = healthReportService.getUserReports(memberId);
|
|
|
|
|
- return Result.success(reports);
|
|
|
|
|
|
|
+ // 未指定 memberId 时,回退到家庭报告列表
|
|
|
|
|
+ if (familyId != null) {
|
|
|
|
|
+ List<HealthReport> reports = healthReportService.getFamilyReports(familyId);
|
|
|
|
|
+ return Result.success(reports);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Result.error("memberId不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取全家健康报告列表(方案页选择用)")
|
|
@Operation(summary = "获取全家健康报告列表(方案页选择用)")
|