更新
This commit is contained in:
@@ -20,6 +20,7 @@ use app\adminapi\logic\tcm\TrackingNoteLogic;
|
||||
use app\adminapi\logic\doctor\DoctorNoteLogic;
|
||||
use app\common\model\tcm\Prescription;
|
||||
use app\common\service\wechat\WechatWorkAppMessageService;
|
||||
use app\common\service\tcm\RevisitDueHook;
|
||||
use app\common\model\dict\DictData;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
@@ -404,6 +405,9 @@ class AppointmentLogic extends BaseLogic
|
||||
$summary
|
||||
);
|
||||
|
||||
// 事务提交后刷新复诊到期快照(新挂号 → 已约自动关闭;钩子内部吞异常)
|
||||
RevisitDueHook::onAppointmentChanged((int) $params['patient_id'], $newId, 'create');
|
||||
|
||||
return ['id' => $newId];
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
@@ -467,6 +471,9 @@ class AppointmentLogic extends BaseLogic
|
||||
$summary
|
||||
);
|
||||
|
||||
// 刷新复诊到期快照(取消挂号 → 已约行重开;钩子内部吞异常)
|
||||
RevisitDueHook::onAppointmentChanged($diagId, $aptId, 'cancel');
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
self::setError($e->getMessage());
|
||||
@@ -618,6 +625,9 @@ class AppointmentLogic extends BaseLogic
|
||||
Log::warning('完成挂号后系统代开处方失败: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// 刷新复诊到期快照(面诊完成 → 已面诊关闭;钩子内部吞异常)
|
||||
RevisitDueHook::onAppointmentChanged((int) $appointment->patient_id, (int) $appointment->id, 'complete');
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
self::setError($e->getMessage());
|
||||
@@ -1161,6 +1171,9 @@ class AppointmentLogic extends BaseLogic
|
||||
);
|
||||
self::appendDiagnosisGuahaoLog($patientId, $id, $adminId, $adminInfo, 'admin_edit', $summary);
|
||||
|
||||
// 事务提交后刷新复诊到期快照(日期/状态变更影响已约/过号/已面诊判定;钩子内部吞异常)
|
||||
RevisitDueHook::onAppointmentChanged($patientId, $id, 'admin_edit');
|
||||
|
||||
return true;
|
||||
} catch (\Throwable $e) {
|
||||
Db::rollback();
|
||||
|
||||
Reference in New Issue
Block a user