add
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user