|
|
@@ -46,10 +46,18 @@ public class PlanReviewController {
|
|
|
return Result.error("无权限");
|
|
|
}
|
|
|
String status = (String) body.get("status");
|
|
|
- if (familyId == null) return Result.noFamily("请先创建或加入家庭");
|
|
|
+ Long filterFamilyId = familyId;
|
|
|
+ if ("admin".equals(role)) {
|
|
|
+ // 管理员可通过 body.familyId 指定家庭筛选;不指定则查看全部方案
|
|
|
+ filterFamilyId = ParamUtils.getLong(body.get("familyId"));
|
|
|
+ } else if (familyId == null) {
|
|
|
+ return Result.noFamily("请先创建或加入家庭");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<TaskPlanInstance> w = new LambdaQueryWrapper<TaskPlanInstance>()
|
|
|
- .eq(TaskPlanInstance::getFamilyId, familyId)
|
|
|
.orderByDesc(TaskPlanInstance::getCreatedAt);
|
|
|
+ if (filterFamilyId != null) {
|
|
|
+ w.eq(TaskPlanInstance::getFamilyId, filterFamilyId);
|
|
|
+ }
|
|
|
if (status != null && !status.isEmpty()) {
|
|
|
w.eq(TaskPlanInstance::getStatus, status);
|
|
|
}
|