This commit is contained in:
王子琦
2026-01-20 14:05:18 +08:00
parent 438eb0b635
commit ec6ec210d2
15 changed files with 132 additions and 28 deletions

View File

@@ -73,7 +73,7 @@ public class FamilyController {
}
}
if (!allowed) {
throw new ApiException("no access to this elder");
throw new ApiException("无权访问该亲属");
}
return ApiResponse.success(careRecordMapper.listByElderId(elderId));
}
@@ -89,7 +89,7 @@ public class FamilyController {
}
}
if (!allowed) {
throw new ApiException("no access to this elder");
throw new ApiException("无权访问该亲属");
}
return ApiResponse.success(healthRecordMapper.listByElderId(elderId));
}
@@ -105,7 +105,7 @@ public class FamilyController {
}
}
if (!allowed) {
throw new ApiException("no access to this elder");
throw new ApiException("无权访问该亲属");
}
return ApiResponse.success(billService.listByElderId(elderId));
}
@@ -115,7 +115,7 @@ public class FamilyController {
Long familyId = Long.valueOf(StpUtil.getLoginId().toString());
Bill bill = billMapper.findById(id);
if (bill == null) {
throw new ApiException("bill not found");
throw new ApiException("账单不存在");
}
boolean allowed = false;
for (FamilyElder relation : familyService.listRelations(familyId)) {
@@ -125,10 +125,10 @@ public class FamilyController {
}
}
if (!allowed) {
throw new ApiException("no access to this bill");
throw new ApiException("无权访问该账单");
}
if ("PAID".equals(bill.getStatus())) {
throw new ApiException("bill already paid");
throw new ApiException("账单已支付");
}
BigDecimal amount = bill.getTotal() == null ? BigDecimal.ZERO : bill.getTotal();
billService.payBill(id, familyId, request.getMethod(), amount);