pending_logic = new PendingLogic(); } /** * 获取缴费记录列表 * @param Request $request * @param string $patient_id * @return JsonResponse * @throws GeneralException */ public function lists(Request $request, string $patient_id): JsonResponse { $response = $this->pending_logic->getLists($patient_id); return jsonResponse(Response::HTTP_OK, 'success', PendingListsResource::make($response)->toArray()); } /** * 获取待缴费详情 * @param Request $request * @param string $patient_id * @param string $serial_no * @return JsonResponse * @throws GeneralException */ public function details(Request $request, string $patient_id, string $serial_no): JsonResponse { $validated = $request->validate([ 'prescription_ids' => 'required', 'reg_id' => 'required', ], [ 'prescription_ids.required' => '请选择要缴纳的处方', 'reg_id.required' => '请选择要缴纳的处方', ]); $response = $this->pending_logic->getDetails($patient_id, $serial_no, $validated['prescription_ids'], $validated['reg_id']); return jsonResponse(Response::HTTP_OK, 'success.', PendingDetailsResource::make($response)->toArray()); } }