新增功能

This commit is contained in:
Your Name
2026-03-14 15:39:34 +08:00
parent 4ddee40675
commit 4a853ba237
27 changed files with 2906 additions and 74 deletions
@@ -25,6 +25,17 @@ class OrderController extends BaseAdminController
return $this->dataLists(new OrderLists());
}
/**
* @notes 订单统计(挂号费/药品费用)
* @return \think\response\Json
*/
public function orderStats()
{
$params = $this->request->get();
$result = OrderLogic::orderStats($params);
return $this->data($result);
}
/**
* @notes 订单详情
* @return \think\response\Json
@@ -50,6 +50,17 @@ class DiagnosisController extends BaseAdminController
return $this->dataLists(new DiagnosisLists());
}
/**
* @notes 医助理诊单统计(按部门、按人)
* @return \think\response\Json
*/
public function assistantDiagnosisStats()
{
$params = $this->request->get();
$result = DiagnosisLogic::assistantDiagnosisStats($params);
return $this->data($result);
}
/**
* @notes 添加诊单
* @return \think\response\Json
@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace app\adminapi\controller\tcm;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\logic\tcm\PrescriptionLogic;
use app\adminapi\validate\tcm\PrescriptionValidate;
/**
* 中医处方单控制器
*/
class PrescriptionController extends BaseAdminController
{
/**
* @notes 添加处方
*/
public function add()
{
$params = (new PrescriptionValidate())->post()->goCheck('add');
$params['creator_id'] = $this->adminId;
$id = PrescriptionLogic::add($params, $this->adminId);
if ($id === null) {
return $this->fail(PrescriptionLogic::getError());
}
return $this->success('保存成功', ['id' => $id]);
}
/**
* @notes 处方详情
*/
public function detail()
{
$params = (new PrescriptionValidate())->get()->goCheck('detail');
$detail = PrescriptionLogic::detail((int)$params['id']);
if (!$detail) {
return $this->fail('处方不存在');
}
return $this->data($detail);
}
/**
* @notes 根据诊单获取处方列表
*/
public function listByDiagnosis()
{
$diagnosisId = (int)($this->request->get('diagnosis_id') ?? 0);
if (!$diagnosisId) {
return $this->fail('诊单ID不能为空');
}
$list = PrescriptionLogic::listByDiagnosis($diagnosisId);
return $this->data($list);
}
/**
* @notes 根据预约获取处方
*/
public function getByAppointment()
{
$appointmentId = (int)($this->request->get('appointment_id') ?? 0);
if (!$appointmentId) {
return $this->fail('预约ID不能为空');
}
$prescription = PrescriptionLogic::getByAppointment($appointmentId);
return $this->data($prescription ?? []);
}
}