更新
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# e签宝 403 安全诊断
|
||||
|
||||
已在 `server/app/common/service/esign/EsignClient.php` 增加可选的结构化 `EsignProviderException::$reason`,保留原来的 `operation` 和 `providerCode`。
|
||||
|
||||
- `APPLICATION_ACCESS_DENIED`:仅匹配供应商顶层字符串 `msg` 中的“该应用无权调用此接口”。
|
||||
- `IP_WHITELIST_MISMATCH`:仅匹配明确的 IP 不在白名单、IP 白名单不匹配或校验失败短语。
|
||||
- `SIGNATURE_MISMATCH`:仅匹配独立的 `SignatureDoesNotMatch` 标识。
|
||||
- 其他消息、单独的 `FORBIDDEN`、非字符串消息仍为 `null`,创建账号 403 保留原有接口权限及 IP 白名单的通用提示。不对其他供应商错误码应用 403 分类。
|
||||
|
||||
异常只包含固定提示和固定枚举值,不复制、存储或记录供应商消息中的身份证号、姓名、密钥或其他附加文本。未知枚举值也会被构造函数拒绝。未增加任何自动重试。SDK 初始化、认证请求及先前本地修改保持原状。
|
||||
|
||||
验证:
|
||||
|
||||
- `php server/tests/EsignClientTest.php`:297 项离线检查通过。
|
||||
- 两个 PHP 文件语法检查通过。
|
||||
- `git diff --check -- server/app/common/service/esign/EsignClient.php server/tests/EsignClientTest.php`:通过。
|
||||
|
||||
本任务仅修改以上两个 PHP 文件并增加本说明;没有修改 service/controller 其他文件、运行 spool、供应商文件、数据库或环境配置,也没有调用真实供应商接口。真实接口的本次原因仍需由后续请求中识别到的固定枚举判断。
|
||||
@@ -0,0 +1,53 @@
|
||||
# e签宝 SDK 3.0 addPerson 业务错误码 403:官方资料核验
|
||||
|
||||
日期:2026-11-18。范围:只读公开文档和公开错误码查询工具;没有读取项目密钥、环境变量、业务数据库或用户数据,没有调用认证、开户、签署等业务接口。
|
||||
|
||||
## 结论
|
||||
|
||||
- 官方错误码工具查询 `403` 返回三个不同场景,不能把该数字直接等同于 HTTP 403,也不能仅凭数字断定实名信息不匹配。
|
||||
- 其中一项的错误内容为“该应用无权调用此接口”。官方给出的处理方向是:该应用缺少相应接口访问权限,携带 AppID 联系交付顾问开通。
|
||||
- 另两项分别是文件流上传的 HTTP 403 / SignatureDoesNotMatch,以及 FORBIDDEN / IP 白名单不匹配。前者明确属于文件上传 HTTP 状态,不适用于已知的 HTTP 200、JSON `errCode=403` 的 addPerson 响应;后者尚需匹配完整错误信息和实际产品层。
|
||||
- 查询结果没有标出 SDK 版本或接口适用范围。若原始 JSON 的 `msg` 只有 `403` 或缺少描述,公开资料尚不足以对本次 addPerson 失败作唯一归因。
|
||||
- 主任务提供的同一 SDK 查询账号接口返回账号不存在业务码,以及认证成功、checkWillingness 有效等证据,使“应用缺少创建个人签署账号接口权限”成为值得供应商重点核查的候选原因;这是结合现场信息的推断,不是官方对本次请求的诊断。其他接口成功不能证明 addPerson 的权限已开通。
|
||||
|
||||
## 官方错误码工具的可复核查询
|
||||
|
||||
入口:[e签宝错误码查询](https://open.esign.cn/tools/error-code)。公开页面无需登录即可输入错误码查询。
|
||||
|
||||
页面公开资源:
|
||||
|
||||
- [应用 JavaScript](https://asset.tsign.cn/apps/open-platform-front-ssr/prod/4.0.8/js/chunk/app.d912f481.js):配置生产 BASE_URL 为 `https://tapi.esign.cn`,`featchErrorQuery` 使用 POST `/open/public/standard/error/query`。
|
||||
- [错误码页面 JavaScript](https://asset.tsign.cn/apps/open-platform-front-ssr/prod/4.0.8/js/chunk/40.7260f97e.js):按 code 查询时提交 `{"errorCode": 输入值}`;页面展示返回项的 `bizKeyId`、`description` 和 `errorCodeExplanation`。
|
||||
|
||||
本次请求严格按照公开页面逻辑,只发送数字错误码,没有 Cookie、Token、AppID、密钥、姓名或证件号:
|
||||
|
||||
```http
|
||||
POST https://tapi.esign.cn/open/public/standard/error/query
|
||||
Content-Type: application/json;charset=UTF-8
|
||||
|
||||
{"errorCode":"403"}
|
||||
```
|
||||
|
||||
响应 HTTP 200,顶层 `success=true`、`message=执行成功`,`data` 中三个结果摘要如下:
|
||||
|
||||
| bizKeyId | description | 官方排查方向摘要 |
|
||||
| --- | --- | --- |
|
||||
| 403 | SignatureDoesNotMatch | 文件上传 HTTP 状态码;核对 PUT 上传头的 Content-MD5 与取得上传地址时的值,并核对请求方法。 |
|
||||
| 403 | 该应用无权调用此接口 | 该应用缺少该接口访问权限;提供 AppID 联系交付顾问开通。 |
|
||||
| 403 | FORBIDDEN / IP白名单不匹配 | 核对应用的服务器公网出口 IP 白名单配置。 |
|
||||
|
||||
本次记录没有为诊断而更改白名单,也没有提交工单或向第三方发送项目应用标识。
|
||||
|
||||
## SDK 3.0 接口文档核对
|
||||
|
||||
[创建个人签署账号(非 Java / SDK Service)](https://open.esign.cn/doc/opendoc/paas_sdk_3/feq5f4b4x450i0ya) 的官方搜索索引正文对应 `/timevale/account/addPerson`:接口以 `errCode` 表示业务结果,0 成功,其他失败,`msg` 为对应说明。文档建议先完成个人核身认证,创建账号的姓名及证件号应与认证通过的信息一致。
|
||||
|
||||
限制:直接网页读取时当前页面正文只渲染到标题和提示;上述接口细节来自同一官方 URL 的搜索索引正文(索引显示旧更新时间 2026-08-27,直接页面显示 2026-11-10)。因此它可以支持接口的基本语义和一般前提,不能用来推定当前 403 的具体定义。
|
||||
|
||||
本地身份证校验位通过只证实字符串符合本地校验规则,不能替代上述服务端核身结果,也不是 403 的解释。现有公开错误码查询结果不包含姓名或证件号不匹配这一说明。
|
||||
|
||||
## 可交付供应商核查的信息范围
|
||||
|
||||
在用户授权的已有技术支持渠道,提供应用所属环境、SDK 版本、接口路径、响应时间及关联请求标识、HTTP 状态和完整业务错误码/消息;请求核查该环境 AppID 的 addPerson 接口权限以及后端拒绝原因。无需提供应用 Secret 或未经脱敏的身份证号。
|
||||
|
||||
本研究未执行这一对外沟通,仅给出后续定位所需的最小证据方向。
|
||||
@@ -0,0 +1,28 @@
|
||||
# Admin in-system eSign verification
|
||||
|
||||
Implemented in:
|
||||
- admin/src/components/EsignPrescriptionPanel.vue
|
||||
- admin/src/api/tcm.ts
|
||||
- admin/src/utils/prescription-esign.ts
|
||||
- admin/tests/prescription-esign.test.cjs
|
||||
|
||||
## Behavior
|
||||
|
||||
The explicit “核身并签署” action opens an Element Plus dialog in the current application. The user is told that successful server-confirmed identity verification will sign the current prescription automatically. The iframe accepts only the existing exact HTTPS eSign host allowlist, has `allow-forms allow-scripts allow-same-origin` sandbox permissions and `no-referrer`; it has no popup or outer-window navigation permission. No new tab, external link, manual “return and complete” action, frame-content access or frame-message trust remains.
|
||||
|
||||
After a successful start, a single-flight GET `/tcm.prescription/esignIdentityStatus` runs every five seconds after each reply, bounded to ten minutes. Only a validated full status DTO with `identity_status: SUCCESS`, `can_complete: true`, `status: authenticating` and `can_sign: true` can submit completion. The component consumes the explicit intent before the POST, clears timers and never automatically repeats a failed, timed-out or uncertain completion request. The transport also disables retries.
|
||||
|
||||
Close, unmount, deactivation, prescription replacement, independently replaced source state, hidden document, timeout, invalid response, provider failure and terminal state revoke intent and abort readiness reads. Generation checks discard late responses. Parent echoes of this component’s accepted DTO are ignored. Refresh is read-only, revokes automatic signing intent and requires a new explicit action to resume.
|
||||
|
||||
The verified original PDF and SHA-256 download checks are preserved.
|
||||
|
||||
## Validation
|
||||
|
||||
- `node --test tests/prescription-esign.test.cjs` in admin: 46 passed, 0 failed, including the previous 17 tests.
|
||||
- Coverage includes the complete lifecycle, read-only query transport, five-second single-flight cadence, ten-minute bound, stale SUCCESS rejection, hidden/closed/unmounted states, exactly one pending completion, unknown/failed states, official URL validation, no external navigation, Vue SFC compilation, original PDF bytes and hash validation.
|
||||
- `npm run type-check`: repository has 62 existing TypeScript diagnostics, exactly matching `admin/tests/esign-typecheck.log`; no diagnostics reference the modified API, utility or component. Current output: `admin/tests/esign-embedded-typecheck.log`.
|
||||
- LF normalized; scoped `git diff --check` passed.
|
||||
|
||||
## Integration boundary
|
||||
|
||||
No vendor requests or server mutations were performed by this work. New provider requests are configured by the backend owner for SMS-only in-system verification. Existing stored URLs do not identify their previous verification channel. They remain sandboxed; an inline explanation and “核身页面不可用” action stop the flow if an old provider page requires unsupported external navigation. Browsers do not reliably report cross-origin CSP/X-Frame-Options or in-frame provider errors to the parent; no successful embedded provider journey is claimed from local mocked tests. There is deliberately no new-window fallback.
|
||||
@@ -0,0 +1,44 @@
|
||||
# Doctor desktop embedded eSign delivery
|
||||
|
||||
Implemented the shared prescription signing dialog as a 1040 × 800 in-system screen (minimum 900 × 700). The doctor explicitly chooses **核身并签署** and sees that successful authentication will continue signing. The official authentication URL opens only in the embedded QtWebEngine view. There is no external-browser action or fallback.
|
||||
|
||||
## Safety and lifecycle
|
||||
|
||||
- Each authentication view uses an off-the-record, memory-cache profile with no persistent cookies and no application bridge. The profile outlives its page and is deleted after page teardown.
|
||||
- HTTPS navigation and network resources are restricted to official `*.esign.cn` / `*.tsign.cn` hosts; port 8890 is allowed only for the existing official `smlfront.esign.cn` sandbox host. Initial URLs retain the existing exact official entry-host allowlist.
|
||||
- Popups, custom app schemes, external navigation, uploads, downloads, clipboard privileges, device permission requests and invalid TLS certificates are denied. Blocked flows show an actionable inline error. Provider console messages are not logged.
|
||||
- Missing QtWebEngine produces an inline repair/update instruction before a start request is sent.
|
||||
- A visible, explicitly started authentication uses one read-only `GET esignIdentityStatus` at a time, every 5 seconds, bounded to 10 minutes. Its ApiClient call has `max_retries=0`; default retry behavior for unrelated GETs remains unchanged.
|
||||
- Signing is dispatched once only after a structurally valid server response has `identity_status=SUCCESS`, `can_complete=true`, `status=authenticating`, and current actor signing permission. Browser loads, redirects and client events cannot authorize completion.
|
||||
- The completion latch is set before dispatch. A timeout, error, ambiguous response or manual refresh never resubmits the signing POST from the same dialog.
|
||||
- Hide, close, failure, terminal server state and timeout stop polling. Generation checks reject stale results; callbacks verify the dialog still exists. Old webview errors cannot affect a new explicit flow. The close action remains usable during requests.
|
||||
- Manual recheck performs the identity GET and preserves an already-loaded SMS form. Signed-PDF downloads retain authoritative recheck and SHA-256 validation.
|
||||
|
||||
## Changed files
|
||||
|
||||
- `app/src/doctor_workstation/ui/dialogs/prescription_esign.py`
|
||||
- `app/src/doctor_workstation/ui/dialogs/esign_webview.py` (new)
|
||||
- `app/src/doctor_workstation/core/esign.py`
|
||||
- `app/src/doctor_workstation/services/repository.py`
|
||||
- `app/src/doctor_workstation/services/mock_repository.py`
|
||||
- `app/src/doctor_workstation/services/api_client.py` (parent-authorized per-call retry override)
|
||||
- `app/tests/test_prescription_esign.py`
|
||||
- `app/tests/test_esign_webview.py` (new)
|
||||
|
||||
Added lines use LF; unchanged baseline line endings in the large repository modules are preserved to avoid unrelated churn. `app/src/doctor_workstation/__init__.py` was not edited.
|
||||
|
||||
## Verification
|
||||
|
||||
164 passed in 1.91 seconds across `test_prescription_esign.py`, `test_esign_webview.py`, `test_api_client.py`, `test_repository_parity.py`, and `test_mock_repository.py`. Targeted Ruff checks passed. Tests cover in-system entry, no external browser, identity DTO validation, permission gating, single-flight polling, one-shot signing, timeout/error recovery, stale/hide/close callbacks, no completion on browser loads, unchanged GET retry defaults, navigation/permission/TLS restrictions and original download validation. No vendor requests or real authentication were performed by this agent.
|
||||
|
||||
Native QtWebEngine construction in the restricted execution sandbox exits with Windows code `-2147483645` at `QWebEngineProfile(parent)`, both with `offscreen` and ordinary `windows` platforms; this also reproduces with bare Qt classes outside the application code. The parent will verify the real visible launcher outside that execution restriction. No Chromium `--no-sandbox` workaround or TLS relaxation was introduced.
|
||||
|
||||
## Native initialization follow-up
|
||||
|
||||
The parent's elevated visible launch exposed a real Qt lifecycle issue: adding the first WebEngine view to an already visible dialog asynchronously recreates the native parent window. Qt emits a non-spontaneous hide/show pair after the start handler returns. The original hide handler invalidated the pending start response and removed the embedded page.
|
||||
|
||||
The fix now scopes a native-window ID check to creation of a fresh identity view. During the transient hide, polling and completion pause, and pending response callbacks defer. The flow resumes only if the same dialog is visible again with a different native-window ID. A still-hidden window, same-ID hide/show, explicit `hide()`, minimize, close, or already-completed initialization continues to cancel the flow. Normal `hideEvent` safety remains in force outside that narrow initialization transition. Renderer initialization is not identity proof and never authorizes signing.
|
||||
|
||||
Verification after this fix: **167 passed, 2 opt-in native tests skipped** in the targeted delivery set; **2 native Windows Qt tests passed in 4.38 seconds** when run elevated with `ESIGN_NATIVE_QT_TEST=1` and `QT_QPA_PLATFORM=windows`. The native test constructs the actual embedded WebEngine, verifies the native handle really changed, verifies authentication state/polling survive, and verifies a genuine user hide cancels. Both tests replace provider URL loading and use a fake repository; no provider calls occur. Ruff passed. The reproducible native tests are in `app/tests/test_esign_native_lifecycle.py`.
|
||||
|
||||
An optional combined run including `test_prescription_security_ui.py` aborted in that existing suite at line 157 (`application.processEvents()`). The isolated 164-test delivery set above subsequently passed. This broader suite was not modified.
|
||||
@@ -0,0 +1,23 @@
|
||||
# 管理端核身后补充证书绑定信息
|
||||
|
||||
## 实现
|
||||
|
||||
- `admin/src/api/tcm.ts`:只读核身 DTO 增加可选布尔值 `identity_details_required`;`esignComplete` 支持可选 `identity_number`,未提供时请求体只含 `id`,保留 180 秒超时及禁用重试配置。
|
||||
- `admin/src/utils/prescription-esign.ts`:旧服务省略标志时默认 `false`;拒绝非布尔类型、与 `can_complete` 同时为真,以及与 `SUCCESS / authenticating / can_sign` 不一致的结果。
|
||||
- `admin/src/components/EsignPrescriptionPanel.vue`:收到可信补录要求后停止核身轮询、移除核身 iframe,保留原有十分钟截止时间,在系统内显示密码式身份证号输入框及“绑定证书并签署”按钮。说明补录只用于匹配本次已完成认证的证书账户。无需外部跳转。
|
||||
- `admin/tests/prescription-esign.test.cjs`:扩充传输、校验、等待、提交和生命周期回归测试。
|
||||
|
||||
## 隐私和提交约束
|
||||
|
||||
身份证号只保存在单独的短期输入状态中,不放入签署状态 DTO、组件事件、浏览器存储或日志。提交时先清空输入;关闭、隐藏页面、卸载、组件停用、刷新、处方/来源状态更换、超时均清空并撤销意图。输入为密码类型,关闭自动补全且没有明文切换按钮。测试仅使用合成身份证号。
|
||||
|
||||
前端校验 18 位大陆身份证号形状,将末位小写 `x` 规范为大写;日期和校验位由服务端权威校验。补录不会自动发送,也不会由输入事件触发:必须在有效、可见、未过期的当前会话中点击按钮。提交前消费既有单次完成标记,网络错误、超时或不确定结果均不自动重试。证件补录请求异常使用固定错误说明,不将异常对象中的身份证号或供应商消息显示在组件中。服务端同样须提供脱敏状态和错误信封,避免共享请求拦截器回显原始供应商信息。
|
||||
|
||||
## 验证
|
||||
|
||||
- `node --test tests/prescription-esign.test.cjs`(`admin`):63 通过,0 失败;含原有 46 项测试及 17 项新增测试。
|
||||
- 覆盖等待补录期间不再轮询且不签署、明确点击只提交一次、单次标记在未返回请求期间生效、可选请求字段、错误 DTO、无可信授权时不能提交、非法输入清空、八类退出/超时清空、过期响应不能恢复补录、错误/不确定结果不重试和不显示号码,以及 Vue SFC 编译。
|
||||
- `git diff --check -- admin/src/api/tcm.ts admin/src/utils/prescription-esign.ts admin/src/components/EsignPrescriptionPanel.vue admin/tests/prescription-esign.test.cjs`:通过。
|
||||
- `npm run type-check`:退出码 2,共 62 条既有 TypeScript 诊断;与 `admin/tests/esign-embedded-typecheck.log` 完全一致,修改的 API、工具函数和组件均无诊断。当前记录为 `admin/tests/esign-identity-binding-typecheck.log`。
|
||||
|
||||
未调用供应商、访问数据库或读取凭据。仓库 `.trellis` 不存在,保留此前管理端修改及其他工作区改动;本任务不修改 `server`、`app` 或 `.spool`。
|
||||
@@ -0,0 +1,36 @@
|
||||
# eSign identity binding backend verification
|
||||
|
||||
Date: 2026-11-18. Scope: server changes and offline tests only; no real provider call, account, credentials or production database accessed.
|
||||
|
||||
## Behavior
|
||||
|
||||
- `esignIdentityStatus` remains read-only. A successful individual flow with literal `indivInfo: null` and no SDK account returns `identity_details_required: true` and `can_complete: false`.
|
||||
- `esignComplete` accepts an optional POST `identity_number`. For that precise null/unbound case, it checks mainland format, birth date, sequence and (18-digit) checksum, then passes the frozen server doctor name, transient number and validated flow ID to existing SDK `addPerson` via `createPerson`.
|
||||
- The supplemental number is input for SDK verification, not identity proof. Signing and account insertion require SDK binding success; willingness must still be valid.
|
||||
- Missing or invalid local input leaves authentication usable and requests correction. An SDK rejection cannot bind or sign.
|
||||
- Existing SDK-bound flows with null details can continue only when the current doctor account exactly matches the account ID captured when authentication began. Replacement, deletion and concurrent first-time binding remain blocked.
|
||||
- Missing, empty, masked, malformed or explicitly mismatched returned identities cannot be replaced with caller input. Wrong flow/app/object type also fails closed.
|
||||
- Snapshot, creator, environment, operation-token, final account recheck, no-resign and archival behavior are retained. Readiness and detail-required flags are mutually exclusive.
|
||||
|
||||
## Privacy
|
||||
|
||||
- No full identity number is written to prescription evidence, doctor account, PDF, DTO or server-generated error messages.
|
||||
- The completion controller rejects non-string input and never echoes it. SDK adapter exceptions contain only an operation label and a validated numeric provider code, omitting raw provider messages and bodies.
|
||||
- The existing generic operation audit listener (currently disabled in `adminapi/event.php`) now allowlists only prescription ID for completion and strips URL query parameters, including if it is re-enabled later.
|
||||
- Middleware review found no request-body logging in the active common/admin middleware. SDK transport has no body/credential logging and no automatic retry.
|
||||
- This report covers application PHP code. SDK/JVM and reverse-proxy log settings are deployment concerns handled separately by the parent task.
|
||||
|
||||
## Verification
|
||||
|
||||
All checks passed using synthetic fixtures, fake provider transport and isolated temporary SQLite, without loading `.env`:
|
||||
|
||||
- `php tests/PrescriptionEsignFlowTest.php`: **129 checks**. Null/read-only readiness, missing/invalid input, SDK rejection, verified binding input, bound-null success, binding changes, malformed/mismatched provider identity, wrong app/object, expired willingness, stale flow and privacy, plus existing signing/recovery invariants.
|
||||
- `php tests/EsignClientTest.php`: **175 checks**. Includes raw provider rejection containing a synthetic number: exception redacted; exactly one binding attempt.
|
||||
- `php tests/EsignIdentityPrivacyTest.php`: **7 checks**. Actual controller forwards only POST input/current actor, compatibility without input, array/GET rejection, response privacy and actual audit-listener persistence redaction via an in-memory model double.
|
||||
- PHP syntax checks passed for all six changed/new PHP files.
|
||||
|
||||
## Contract and project context
|
||||
|
||||
SDK contract reviewed from `.spool/esign-docs/sdk3-addperson-contract.txt`, cached by the parent from [official SDK addPerson documentation](https://open.esign.cn/doc/opendoc/paas_sdk_3/feq5f4b4x450i0ya): `name` and `idNo` must match authenticated identity, `identityAuthId` links the completed flow, and the provider limits its use to 30 minutes. No new endpoint or database schema is required.
|
||||
|
||||
`.trellis/workflow.md` is absent in this checkout, so no Trellis task/spec files could be read. No commit or deployment was performed by this worker. The tests validate implementation behavior, not a real provider signature.
|
||||
@@ -0,0 +1,33 @@
|
||||
# Desktop supplementary certificate identity binding
|
||||
|
||||
Implemented 2026-11-18 in the existing in-system prescription signature dialog.
|
||||
|
||||
## Behavior and contract
|
||||
|
||||
- `esign_identity_status` accepts optional `identity_details_required` and normalizes an absent field to `False`. Present values must be booleans. A true value is accepted only with `identity_status=SUCCESS`, `status=authenticating`, enabled/required/can_sign all true, and `can_complete=False`. Conflicting flags fail closed. The client never changes `can_complete` to authorize signing.
|
||||
- Only the validated identity-readiness GET can expose the supplementary form. Ordinary signature status responses cannot do so. The dialog stops its timer, drops the previous signing intent, and disposes the embedded authentication view while awaiting input.
|
||||
- The form explains one-time certificate binding and the requirement to match the completed authentication. It uses a password-mode `QLineEdit` with sensitive input hints and the explicit action **绑定证书并签署**. Enter in the input does not submit binding.
|
||||
- Input validation accepts the ASCII shape of legacy 15-digit or modern 18-character mainland identity numbers, with an optional final X in the latter. Client validation does not establish identity; server date/checksum/authentication matching remains authoritative.
|
||||
- Submission clears the input before asynchronous dispatch and sets the existing one-completion latch first. Invalid input clears the entry and stays in the form without dispatch. Cancel, refresh, hide, reject, and close clear the entry. No identity value is added to dialog state, persisted, or logged by this change.
|
||||
- `DoctorRepository`, `RemoteDoctorRepository`, and the demo repository accept `complete_prescription_esign(prescription_id, identity_number="")`. An absent number preserves the original one-argument/no-extra-field behavior. A supplied number is sent only in the existing completion POST body. Existing API transport behavior already prevents POST retry; no `ApiClient` change was needed for this task.
|
||||
- Completion timeout or ambiguity keeps the latch set. Manual refresh cannot repeat signing within the same dialog. Generation and deadline checks reject stale callbacks. Existing Qt native initialization hide/show handling is retained.
|
||||
|
||||
## Verification
|
||||
|
||||
From `D:\web\zyt\app`:
|
||||
|
||||
```powershell
|
||||
& .venv/Scripts/python.exe -m pytest tests/test_prescription_esign.py tests/test_esign_webview.py tests/test_esign_native_lifecycle.py tests/test_repository_parity.py tests/test_api_client.py --basetemp=.pytest-tmp-esign-identity-binding-final
|
||||
```
|
||||
|
||||
Result: **191 passed, 2 skipped** in 4.43 seconds. The skipped cases are opt-in native Qt tests. Coverage includes required-input/no-auto-sign, one explicit completion, input clearing before dispatch and across lifecycle changes, invalid shape rejection, conflicting capabilities, legacy DTO compatibility, stale callbacks, timeout uncertainty, body-only identity transmission, no POST retry, repository parity, and existing embedded-browser behavior.
|
||||
|
||||
Ruff passed for all modified Python files. `git diff --check` passed for the modified desktop files.
|
||||
|
||||
Real Windows Qt verification used `ESIGN_NATIVE_QT_TEST=1`, `QT_QPA_PLATFORM=windows`, and the existing `test_esign_native_lifecycle.py`. Each parameterized case passed in its own process outside the process-restricted sandbox: normal native recreation **1 passed in 3.34 seconds**; genuine user hide **1 passed in 2.83 seconds**. These tests use a fake repository and replace provider URL loading.
|
||||
|
||||
The sandbox native run aborted while initializing WebEngine. An elevated combined run reached both passing assertion markers but exited with code 1 before pytest's final summary; it is not counted as a clean combined pass. The isolated native runs completed with exit code 0. No test or application native-lifecycle implementation was changed to suppress that behavior.
|
||||
|
||||
## Scope
|
||||
|
||||
Changed only desktop core validation, repository interfaces/implementation, signature dialog, tests, and this report. Preserved the existing user change to `app/src/doctor_workstation/__init__.py`. No provider requests, real identity numbers, signing operations, or business database operations were used for this work. The live wrapper and server implementation are separate deliverables; this report does not claim an end-to-end live signature succeeded.
|
||||
@@ -0,0 +1,41 @@
|
||||
# e签宝 SDK3 身份信息返回核对
|
||||
|
||||
核对日期:2026-11-18。范围仅为官方公开文档及既有公开文档缓存;未读取凭据、调用业务 API 或访问数据库。根任务已确认当前响应为 `SUCCESS / INDIVIDUAL / indivInfo: null`,并已核对应用归属。
|
||||
|
||||
## 结论
|
||||
|
||||
**没有找到官方支持的“仅凭 identityAuthId 创建个人签署账号”或“由 SDK 根据 flowId 反查完整姓名、证件号”的接口。** 当前公开协议仍要求 `name`、`idNo`,且必须与认证信息一致。`indivInfo: null` 无法通过 JSON 解码、换子流程接口或取消一致性校验解决。
|
||||
|
||||
当前可落实的处理是:保留认证成功状态,但在取得与该流程一致的完整身份信息前阻止创建/绑定签署账号;由 e签宝技术顾问核查该应用/流程为何未返回个人基本信息及授权配置。**“平台隐私配置导致 null”目前只是待核实假设,不能写成已确认原因,也没有查到可直接添加的公开返回开关。** 不需要要求用户在聊天中发送身份证号。
|
||||
|
||||
## 已核实的协议
|
||||
|
||||
| 核对项 | 官方协议与实际意义 |
|
||||
| --- | --- |
|
||||
| `GET /v2/identity/auth/api/common/{flowId}/detail` | 请求只有路径 `flowId`。`data.indivInfo` 类型为可选 object,包含 `name`、`certNo`、`certType`;不是 JSON 字符串或密文协议。示例证件号带星号,但文档没有说明这代表真实响应的固定脱敏规则,不能用示例推出必须能拿到完整号码。[查询认证信息](https://open.esign.cn/doc/opendoc/identity_service/duoa44) |
|
||||
| 个人信息返回权限 | 查询文档对照片、视频、银行卡开户行/地明确列有额外开通条件;对 `name` / `certNo` 未说明类似开关。不能把影像权限当作个人基本信息返回权限。[查询认证信息](https://open.esign.cn/doc/opendoc/identity_service/duoa44) |
|
||||
| SDK3 `account/addPerson` | `name` 和 `idNo` 均必填。`identityAuthId` 是认证成功的 `flowId`,须在 30 分钟内使用,并保证姓名、证件号与流程一致。3.1.13 起只放宽了 `identityAuthId` 必填性,没有放宽姓名/证件号。`encrypt` 控制本接口的用户信息传输加密,不是 `/detail` 的解密开关。[创建个人签署账号](https://open.esign.cn/doc/opendoc/paas_sdk_3/feq5f4b4x450i0ya) |
|
||||
| SDK3.1.26 | 2026-11-12 变更新增部分证件类型及企业授权 `applyCert`;没有 flowId 单参数建号能力的更新。[SDK3 更新日志](https://open.esign.cn/doc/opendoc/paas_sdk_3/gt8ahfp92gd5mwkd) |
|
||||
| SDK3 `auth/queryWillingnessValidity` | 根据 `willingnessId` 查询可用性、过期时间、剩余次数;没有姓名或证件号响应字段。[查询个人认证 ID 有效性](https://open.esign.cn/doc/opendoc/paas_sdk_3/lza8ew9a1ha5xnko) |
|
||||
| 主流程与子流程 | `/outline` 返回流程、关联流程及子流程状态;`/process?subFlowId=…` 返回步骤类型、状态与时间。二者用于对账,没有个人基本信息,不能作为补取身份证号接口。[主流程](https://open.esign.cn/doc/opendoc/identity_service/dkbcel)、[子流程](https://open.esign.cn/doc/opendoc/identity_service/btvruu) |
|
||||
| 认证完成回调 | 返回 `flowId`、`success`、上下文等;明确核身认证不返回 `accountId`。没有姓名/证件号。旧版实名回调示例中的 accountId 不适用于当前核身流程。[个人认证完成通知](https://open.esign.cn/doc/opendoc/identity_service/giq1w40lx67vwofr)、[常见 QA](https://open.esign.cn/doc/opendoc/identity_service/shimingqa) |
|
||||
| 创建账号后认证 | `indivAuthUrl` 支持 `sdkAccountId`,会校验账号与用户信息一致后绑定数字证书。这适用于已合法持有完整身份信息、先建号的流程,不能解决现有 null 响应中的身份信息缺失。`usageType` 是证书发放用途,不是身份信息返回开关。[获取个人核身认证地址](https://open.esign.cn/doc/opendoc/identity_service/sg2nty) |
|
||||
|
||||
SDK3 官方接入说明仍指向身份服务的详情查询与完成回调,没有另列 SDK 专属认证信息补取接口。[个人核身认证和数字证书申领](https://open.esign.cn/doc/opendoc/paas_sdk_3/adq41ivoxu30t0kr)
|
||||
|
||||
## 供应商核查需要确认的具体问题
|
||||
|
||||
1. 在应用与流程归属一致、`status=SUCCESS`、`objectType=INDIVIDUAL` 时,`indivInfo=null` 是否由该沙箱应用配置、认证通道或流程异常导致?公开沙箱说明未记载这是模拟环境的预期行为。[身份服务沙箱说明](https://open.esign.cn/doc/opendoc/identity_service/so4gfc)
|
||||
2. 该应用是否获准通过 `/detail` 读取认证成功主体的完整 `name/certNo`;如果需要额外授权或配置,请提供官方配置名、适用环境及对应文档。
|
||||
3. SDK3 `addPerson` 必须保持实名一致性;若完整身份信息不允许返回,供应商是否提供已正式支持的服务端绑定接口或流程?需要明确接口、版本和参数,不能自行猜测。
|
||||
|
||||
通过供应商的受控支持渠道提交应用 ID、流程 ID、认证方式及脱敏状态摘要即可定位;不在研究文件或聊天中保存真实身份证号、姓名、认证链接、凭据或原始个人响应。
|
||||
|
||||
## 可复核的公开缓存
|
||||
|
||||
- `.spool/esign-docs/esign-identity-query.{txt,html}`:既有官方详情协议。
|
||||
- `.spool/esign-docs/sdk3-addperson-contract.txt`、`sdk3-auth-validity-contract.txt`:本次下载的创建账号/有效性协议。
|
||||
- `.spool/esign-docs/identity-main.txt`、`identity-child.txt`、`identity-callback.txt`、`identity-qa.txt`:替代查询路径核对。
|
||||
- `.spool/esign-docs/sdk3-auth.txt`、`sdk3-guide.txt`、`sdk3-changelog.txt`、`identity-sandbox.txt`、`sdk3-sandbox.txt`:接入、版本及环境说明。
|
||||
|
||||
说明:仓库 `.trellis/workflow.md` 不存在;本子任务仅生成研究材料,没有修改业务代码。
|
||||
@@ -0,0 +1,106 @@
|
||||
# e签宝真实沙箱联调入口
|
||||
|
||||
入口:`.spool/esign-live/harness.php`。它调用项目真实 `EsignClient`、`PrescriptionEsignService`、`PrescriptionEsignPolicy`、`PrescriptionPdf` 与 ThinkPHP ORM,不替换供应商响应。
|
||||
|
||||
本机执行请使用 `.spool/esign-live/run.ps1`,它仅为当前 PHP 子进程配置经过校验的 CA 证书集,保持 TLS 校验开启;不改全局 php.ini。
|
||||
|
||||
## 隔离范围
|
||||
|
||||
- 只创建 `.spool/esign-live/fixture.sqlite`,不初始化 ThinkPHP 应用,不加载业务数据库配置,不连接或写入现有业务数据库。
|
||||
- 仅从 `server/.env` 读取 `[ESIGN]` 段;不修改文件。内存配置 `enabled=true`,强制 `sandbox` 和 `http://127.0.0.1:8091/paas-sdk-service`。
|
||||
- SDK 初始化由已有独立运行流程负责。入口核对 `.spool/esign-runtime/` 的进程及初始化凭证,不执行 SDK initialize,也不自动重启。
|
||||
- SQLite 结构取自项目流程测试采用的方法与正式迁移。使用一个独立随机医生 ID、一条固定持久化虚构处方;后续调用复用同一记录,姓名不同的 prepare 被拒绝,不提供 reset/delete/自动恢复命令。
|
||||
- 固定合成患者为“沙箱固定虚构患者001”,药材为“测试药材”,临床诊断和医嘱明确“非诊疗、禁止服用和发药”。源 PDF 由真实项目渲染器生成。
|
||||
|
||||
## 操作
|
||||
|
||||
在项目根目录执行:
|
||||
|
||||
```powershell
|
||||
.\.spool\esign-live\run.ps1 prepare --doctor-name=医生完整实名
|
||||
.\.spool\esign-live\run.ps1 start
|
||||
.\.spool\esign-live\run.ps1 status
|
||||
.\.spool\esign-live\run.ps1 identity-status
|
||||
.\.spool\esign-live\run.ps1 complete
|
||||
.\.spool\esign-live\run.ps1 download
|
||||
.\.spool\esign-live\run.ps1 verify
|
||||
```
|
||||
|
||||
也可在 `.spool/esign-live/doctor.private.json` 放置仅含 `doctor_name` 的对象,然后运行:
|
||||
|
||||
```powershell
|
||||
php .spool/esign-live/harness.php prepare --doctor-file=.spool/esign-live/doctor.private.json
|
||||
```
|
||||
|
||||
不要在参数或 JSON 中提供证件号码。JSON 仅接受 `doctor_name` 字段。`prepare --dry-run` 使用内存 SQLite,仅检查构建与服务状态,不建立持久 fixture,也不联网。
|
||||
|
||||
| 命令 | 行为 | 供应商网络调用 |
|
||||
| --- | --- | --- |
|
||||
| prepare | 创建或核对唯一隔离 fixture,本地渲染检查 | 无 |
|
||||
| status | 真实服务只读状态、已知流水与证据摘要;SQLite query_only | 无 |
|
||||
| start | 显式创建或复用核身流程,输出可信认证 URL | 核身发起;复用状态时不重发 |
|
||||
| identity-status | 读取核身 API,仅输出 status、flow_id;SQLite query_only | 只读核身查询 |
|
||||
| complete | 核身、意愿、账号、签章、签署、归档和验签的真实服务流程 | 依服务状态执行;无自动重试 |
|
||||
| download | 获取本地归档的供应商签署原件并验证 SHA-256;SQLite query_only | 无 |
|
||||
| verify | 对已签原件重新请求真实验签,并检查本地规则 | 真实验签,不重签 |
|
||||
|
||||
`start` 只有在用户明确授权发起时执行。用户在供应商页面完成核身后,再运行 `identity-status` 与 `complete`。默认请求超时为 300 秒,可使用 `--timeout=1..300`;发生超时后先查看状态,不自动重复 complete。入口使用非阻塞独占锁,拒绝并发 CLI 命令。
|
||||
|
||||
## 输出与完成检查
|
||||
|
||||
- `status` 不输出 auth_url。仅 `start` 输出该 URL;报告与本文均不保存核身链接。
|
||||
- `identity-status` 不输出姓名、证件号、证书或供应商原始对象。服务收到的完整身份证号码仅在内存中用于绑定账号,不持久化到业务证据表或 harness 输出。
|
||||
- stdout 不输出配置、凭据、原始响应或异常堆栈。供应商异常只保留安全 operation/code;其他异常使用通用错误,已知服务提示还会进行 URL、证件格式和配置值脱敏。
|
||||
- 状态摘要保留实际状态、存储状态、flow_id、已知 sign_service_id、账号是否绑定、冻结快照摘要、源文件和签署文件摘要、归档标记与时间,以排查 failed、signing、uncertain。
|
||||
- `uncertain` 不会被本入口清空或自动恢复,不会触发自动重签。`failed` 也不自动重试,需要人工阅读诊断后显式决定后续动作。
|
||||
- `complete` 达到 signed 后自动检查:`assertSignedById` 允许审核、沙箱发药被拒绝、`assertMutable` 拒绝修改、已签 complete 重放返回 signed 且完整签署证据未变化。真实服务的 signed 分支在供应商调用前返回。
|
||||
- `download` 将原始字节保存为 `.spool/esign-live/downloaded-signed.pdf`,比较服务返回 SHA-256、内存字节 SHA-256 和落盘 SHA-256;已有不同文件拒绝覆盖。
|
||||
- `verify` 仅接受 signed,不恢复 uncertain;调用真实供应商验签后记录有效签名数量与上述本地规则结果到 `.spool/esign-live/verification-summary.json`,不保存供应商证书或章图原始响应。
|
||||
|
||||
## 本轮已执行验证
|
||||
|
||||
2026-11-18:PHP 语法检查通过;`prepare --doctor-name=本地校验医生 --dry-run` 成功使用内存 SQLite,真实服务返回 pending,当前内容与初始快照一致;随后 `status` 返回 prepared=false,确认尚未建立持久 fixture。未执行 start、identity-status、complete 或 verify,未触发核身、签署或其他供应商调用。
|
||||
|
||||
后续根代理真实联调:已按用户提供的实名准备唯一虚构处方,原 PDF 已生成并渲染检查。首次核身调用因 PHP 未配置 CA 证书集而失败(cURL 60);从 `https://curl.se/ca/cacert.pem` 下载官方 CA 集并核对官方 SHA-256,摘要为 `427c064216761a1e72a8b30f0d954d08cb6e4435a82091fb865afd20c8497285`。通过 `run.ps1` 为当前子进程设置 `curl.cainfo` 后,真实核身流程创建成功,服务状态 `authenticating`。已将供应商链接交给用户本人操作,当前核身 API 返回 `INIT`;签署与下载验签尚待核身完成。
|
||||
|
||||
同时将 `EsignClient::startIdentity` 的认证用途明确设为 `CERTAPPLY`。离线适配器 169 项、隔离流程 64 项检查通过。
|
||||
|
||||
## 覆盖边界
|
||||
|
||||
本入口覆盖真实供应商适配器与真实业务服务、ORM、文件归档和审核/发药规则的隔离联调。它没有经过网页登录、真实管理员令牌、HTTP 控制器/中间件、前端认证弹窗/轮询或实际业务 MySQL,因此不能据此宣称真实网页登录端到端验收完成。真实核身、实际签署和下载验签结果,应由后续显式调用的状态与证据确认。
|
||||
|
||||
## 系统内交互入口(2026-11-18)
|
||||
|
||||
用户明确要求系统内核身后,增加 `.spool/esign-live/launch_embedded.py`,直接实例化医生工作站实际的 `PrescriptionEsignDialog`,通过本地 PHP CLI 调用上述同一条隔离处方与真实供应商服务,不替换业务签署代码。运行方式为 `app/.venv/Scripts/pythonw.exe .spool/esign-live/launch_embedded.py`。该窗口标题明确标注“隔离沙箱联调”,不影响已打开的日常业务窗口。
|
||||
|
||||
配套 `ui-status` 返回当前医生的完整签署 DTO,`ui-identity-status` 调用真实业务的只读核身接口,仅额外返回 `identity_status` 和 `can_complete`。身份证信息不返回该窗口;签署仍须通过服务端重新校验。新的供应商核身请求限定短信三要素方式;已经存在的核身流程保留原供应商配置,不伪造其认证方式或结果。
|
||||
|
||||
后端适配器 170 项、隔离业务流程 82 项检查通过;真实沙箱核身查询返回 `INIT` / `can_complete=false`。网页内嵌组件 46 项检查通过。桌面相关 167 项及另外 2 项真实 Qt 初始化测试通过。
|
||||
|
||||
已在本机启动实际桌面组件,修复 Qt 首次创建 WebEngine 导致原窗口隐藏/重建而错误取消流程的问题。修复后重新启动,并通过桌面 UI 首次点击“核身并签署”,观察到真实 e签宝“个人实名认证”页面、姓名锁定字段、手机认证选项和证书协议均显示在工作站内部。未打开外部浏览器;未代替本人填写证件或接受协议。
|
||||
|
||||
用户随后在内嵌页面选择手机号认证并尝试继续,供应商弹窗明确返回“该认证方式余额不足”“请联系管理员进行充值后再试”。只读取错误提示,未记录用户证件或手机号。当前真实阻塞为沙箱手机号认证可用额度;处方仍为 `authenticating`,没有签署流水或签后文件。官方[沙箱 SDK 说明](https://open.esign.cn/doc/opendoc/paas_sdk_3/pndhqggzc2mar20y)要求将 App ID 与产品名称告知 e签宝工作人员申请免费调试套餐。未支付费用或发送对外消息。额度补充后继续本人核身、签署、验签和原件下载。
|
||||
|
||||
该交互入口覆盖实际桌面组件及业务服务,但仍绕过线上 HTTP 登录及真实业务 MySQL。网页 iframe 对真实供应商的完整人工认证也尚未验收。仓库整体 TypeScript 检查仍有原有 62 项诊断,本次修改文件没有新增诊断。
|
||||
|
||||
## 核身成功后的证书绑定(2026-11-18)
|
||||
|
||||
用户开通沙箱认证额度后,在系统内嵌页面以支付宝扫码完成本人核身。真实详情接口已返回 `SUCCESS / INDIVIDUAL`,流程与应用匹配,但 `indivInfo` 为 literal `null`。原实现要求完整个人信息,因此在创建账号前阻断,没有发出 PDF 签署调用。官方查询协议把个人信息标为可选对象;不能把空值报告成实际实名不匹配,也不能只凭 `SUCCESS` 跳过证书绑定。
|
||||
|
||||
官方 SDK 创建个人账号仍要求姓名、证件号码和匹配的 `identityAuthId`。系统补充步骤由医生在遮挡输入框输入证件号,使用服务端冻结姓名与现有流程交给 SDK 校验绑定。该值只经子进程 stdin 传入 `complete-with-identity`,不进入命令参数、环境变量、JSON 文件、SQLite 或响应;绑定、签署仍由真实业务服务完成。详情缺失与明确返回不匹配分别处理,不允许补充输入覆盖明确的身份不一致。
|
||||
|
||||
本机 SDK 自带日志原先可能记录业务请求。已将所有 Log4j2 appender 的消息及异常正文移除,仅保留时间、级别和日志类;60 秒配置热重载后,使用既有无身份信息的未签 PDF 验签请求验证 `default.log` 和 `error.log` 均只记录 `[SDK payload omitted for identity privacy]`。原有日志没有删除。PHP 适配器继续只输出安全操作名及错误码。
|
||||
|
||||
本节记录实施过程,最终签署、验签和下载结果以运行证据及后续验收记录为准。
|
||||
|
||||
## 当前实际验收结果
|
||||
|
||||
2026-11-18 14:01:54–14:01:55(UTC+8),本人在实际桌面组件内填写补充证件信息并显式点击绑定签署。服务端通过本地证件格式、日期、校验位及真实授权有效性检查,随后真实 `createPerson` 返回 `PROVIDER_403`,服务记录为 `failed`。没有账号绑定、签署流水或签后 PDF,冻结内容与原快照一致;因此签署、验签和下载尚未跑通。未自动重发账号创建或签署。
|
||||
|
||||
只读对照查询不存在的测试账号时,同一 SDK 返回 `331003`,证明账号查询链路可达。官方公开错误码工具对 403 有接口权限、IP 白名单及文件上传等不同解释,不能把数字等同于实名不一致。当前优先核查该应用的 SDK 创建账号接口授权,具体原因仍需供应商定位。可转交材料见 `artifacts/esign-sandbox-support-request.md`;未代发消息或工单。
|
||||
|
||||
本轮离线校验:业务流程 129 项、适配器最终 181 项、控制器/日志隐私 7 项;网页签署 63 项;桌面相关套件 191 项通过、2 项原生 opt-in 跳过,两个原生场景分别独立通过。根侧补充窗口截止时间及中性核身提示后,签署窗口 114 项回归通过;Ruff 与全局 diff 空白检查通过。组合原生测试曾在两个断言通过后异常退出,未计为干净通过;网页整体 TypeScript 保留原有 62 条诊断。
|
||||
|
||||
权限确认后的续测:原核身授权仍有效,真实服务恢复到补充证书信息状态;用户在系统中再次提交后仍为 403。随后优雅重启 SDK、重新初始化成功,再次系统内提交于 14:17:35–14:17:36 仍被拒绝。已增加严格白名单式安全原因分类,适配器 297 项离线检查通过;此次未识别到明确原因。已确认 e签宝 SDK 连接经过本机 TUN 后命中 DIRECT,国内出口查询仍为 123.14.175.249,没有修改代理设置。详见 `artifacts/esign-network-diagnosis.md`。签署、验签、下载仍未完成,不能把失败记录标成已签。
|
||||
|
||||
新版三步流程在 2026-11-18 15:13:43(北京时间)实际完成签署账号绑定,但 PDF 签署返回 `PROVIDER_10002`。该签署错误码在 e签宝公开工具中对应签署次数不足。已为签署调用补上额度提示,SDK 初始化错误沿用独立处理。当前处方仍保留原始 PDF、内容摘要和账号绑定,后续新建的核身流程已查到 `INIT`。需先补齐电子签名 SDK 3.0 沙箱签署次数,再由本人继续核身并确认签名。尚无可用于验签、下载的签后原件。
|
||||
@@ -0,0 +1,22 @@
|
||||
# e签宝沙箱出口与 403 复核
|
||||
|
||||
时间:2026-11-18,Asia/Shanghai。
|
||||
|
||||
## 实测网络路径
|
||||
|
||||
- Windows 显式代理关闭,WinHTTP 为 Direct access。当前 Java SDK JVM 没有 HTTP、HTTPS、SOCKS 或系统代理属性。
|
||||
- 本机 `Mihomo / Meta Tunnel` 网卡为 Up,存在覆盖公网的 TUN 路由;`smlopenapi.esign.cn` 解析为 `198.18.0.10`。不能仅凭系统代理开关关闭判断流量未进入代理软件。
|
||||
- 通过现有 Mihomo 本地控制管道只读查询 `/connections`,实际 SDK 连接 `smlitsm.tsign.cn` 与 `smltech.tsign.cn` 均显示 `chains=["DIRECT"]`、`rule=RuleSet`、`rulePayload=ChinaMax-NoIPv6`。这些连接经过 TUN 后最终直连,没有选择代理节点。
|
||||
- 国内公网 IP 查询返回 `123.14.175.249`,与先前提供的白名单地址一致。e签宝服务端记录的具体请求源 IP仍应由其后台日志确认。
|
||||
- 未修改代理、TUN、DNS、路由、规则、系统设置或应用白名单。控制密钥仅在内存中用于已有本地只读接口,没有输出或保存。
|
||||
|
||||
## 权限确认后的真实重试
|
||||
|
||||
- 用户确认权限与白名单后,系统内提交仍得到 `createPerson / PROVIDER_403`。
|
||||
- 本机 SDK 已优雅重启,新 JVM 沙箱初始化成功,排除了继续沿用原 JVM 配置的情况。
|
||||
- 刷新后的系统内提交在 `2026-11-18 14:17:35–14:17:36 +08:00` 仍返回 `createPerson / PROVIDER_403`。安全分类器未识别到明确的接口授权、IP 白名单或签名不匹配短语,不能依数字或默认提示认定原因。
|
||||
- 账号未绑定,`sign_service_id` 为空,签后 PDF 未生成;尚未进入 PDF 签署阶段。原件与冻结摘要不变,没有自动重发签署。
|
||||
|
||||
需要 e签宝按应用、核身流程、接口和准确时间定位服务端拒绝说明。当前不能将“代理节点 IP 不在白名单”或“接口权限未开通”作为已证实原因。
|
||||
|
||||
核查信息见 [供应商排查材料](esign-sandbox-support-request.md)。仅整理证据,未发送对外消息或工单。
|
||||
@@ -32,9 +32,9 @@ BT /F1 11 Tf 1 0 0 1 45 648 Tm <836f54c100200031ff1a752891cf0020003100300020002f
|
||||
BT /F1 11 Tf 1 0 0 1 45 630 Tm <4ee3714eff1a5426> Tj ET
|
||||
0.7 w 45 133 m 550 133 l S
|
||||
BT /F1 12 Tf 1 0 0 1 45 110 Tm <5f0065b9533b5e08ff1a6d4b8bd5533b5e08> Tj ET
|
||||
BT /F1 11 Tf 1 0 0 1 420 117 Tm <533b5e0875355b507b7e7ae0> Tj ET
|
||||
BT /F1 11 Tf 1 0 0 1 420 104 Tm <533b5e0875355b507b7e7ae0> Tj ET
|
||||
BT /F1 8 Tf 1 0 0 1 45 58 Tm <590465b95feb71670020005300480041002d003200350036> Tj ET
|
||||
BT /F1 7 Tf 1 0 0 1 45 44 Tm <0063006200660063003000640039003500630062006600620062003600360037006400620062006500300064003400390038003700320064003500350030006300660062006200360031003400310063003900650066006100640036003200370032003100320038003200620038006100340038006400650036006600650030> Tj ET
|
||||
BT /F1 7 Tf 1 0 0 1 45 44 Tm <0039003300660065006100390065006300610063003400310064003700300031003400370032006200330036003800610036006400350030003000330035003400330033003400620034006300390032003600370035006600320066006100300062003800660033003300370036006100380063006100320036003000300032> Tj ET
|
||||
BT /F1 9 Tf 1 0 0 1 515 30 Tm <00310020002f00200031> Tj ET
|
||||
endstream
|
||||
endobj
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# e签宝本机 PaaS-SDK-Service 运行环境
|
||||
|
||||
准备日期:2026-11-17。完成便携 Java 与 Tomcat 下载、校验、解压和本机配置;本次没有取得或启动 SDK WAR,没有初始化应用或读取 `.env`。以下状态是运行环境准备完成时的快照,不代表后续 SDK 部署结果。
|
||||
安装日期:2026-11-17;最后验证:2026-11-18。官方 SDK 3.1.26 已部署并运行,沙箱初始化成功。合成未签 PDF 的真实验签接口检查通过;医生核身和处方实签尚未执行。
|
||||
|
||||
## 同日后续部署结果
|
||||
## 部署与验证结果
|
||||
|
||||
根侧已通过用户登录后的[供应商官方附件页](https://qianxiaoxia.yuque.com/opendoc/helper/venkq12cg9vxgf3f?singleDoc)下载 2026-11-11 发布的 **3.1.26** Windows All-In-One 包,159 个应用文件已部署至下述 Tomcat 的 `webapps/paas-sdk-service/`。包内是展开应用,核心依赖为 `paas-sdk-core-3.1.26.jar`。未运行包内旧版 Java;使用本文安装的 Temurin 与 Tomcat。
|
||||
|
||||
@@ -10,14 +10,17 @@
|
||||
- 本机计算的 SHA256:`f107a5f67c0ebf7e1e1e1e0d012b6111637b26ce8599445090ffb931ebcf1b8d`。供应商页面未提供独立校验值,此哈希用于记录取得的文件,不代表独立签名验证。
|
||||
- 删除分发包中的示例应用凭据;`autoInit=false`,改为沙箱 HTTPS 初始化地址,`httpRetryTimes=0`。实际凭据仅由服务端忽略的 `.env` 读取后用于初始化,不写入命令行或启动脚本。
|
||||
- 已在隐藏窗口启动并确认服务首页 HTTP **200**,标题 `PaaS-SDK-Service`;仅 `127.0.0.1:8091` 和 `127.0.0.1:8092` 监听。
|
||||
- 已通过项目真实 PHP 适配器请求初始化,SDK 联系到 e签宝云端,返回 **338005:应用 IP 白名单未配置**。尚不能宣称初始化成功或完成签署。等待用户配置云端应用的白名单。
|
||||
- 2026-11-17 首次初始化返回 `338005`(应用 IP 白名单未配置)。2026-11-18 用户完成白名单配置后,使用项目真实 PHP 适配器重试,**沙箱初始化成功**。同一进程再次执行初始化助手会直接跳过,已验证没有重复调用初始化。
|
||||
- 真实调用 `/timevale/verify/pdf` 上传新生成的虚构未签 PDF,SDK 完成解析并返回 `70003`(文件没有盖章),符合负向测试预期。该检查验证 HTTP、multipart 和 PDF 解析,不能代替已签原件的验签。
|
||||
- 初始化后的本地日志未检出应用 secret。未连接业务数据库、创建签署账号或签署处方;业务开关仍为关闭。
|
||||
- 已实际验证正常停服和再次隐藏启动,重启后首页仍为 HTTP 200;修正 PowerShell JSON 自动日期转换造成的进程时间比较问题,PID 与 Java 路径核验保持有效。
|
||||
|
||||
白名单配置完成后运行:
|
||||
SDK 每次启动后初始化;同一进程重复运行会安全跳过:
|
||||
|
||||
```powershell
|
||||
php 'D:\web\zyt\.spool\esign-runtime\initialize-sdk.php'
|
||||
# 可选:仅使用新生成的虚构未签 PDF 检查文件接口
|
||||
php 'D:\web\zyt\.spool\esign-runtime\check-sdk.php'
|
||||
```
|
||||
|
||||
此助手仅初始化本机沙箱,不启动业务框架或连接业务数据库。成功后记录当前 SDK 进程,重复执行会跳过相同进程的重复初始化;更换应用配置需先重启 SDK。SDK 每次重启后,先执行本文件的启动脚本,再执行初始化助手。该运行目录不是临时缓存,不要清理 `.spool/esign-runtime`;未设置开机自启。
|
||||
@@ -43,7 +46,7 @@ php 'D:\web\zyt\.spool\esign-runtime\initialize-sdk.php'
|
||||
|
||||
选择仍维护的 Tomcat 9,保留 Java EE / `javax.servlet` 兼容体系;不采用已结束维护的 Tomcat 8.5,也不迁移到 `jakarta.servlet`。Apache 的[版本对照](https://tomcat.apache.org/whichversion.html)确认 Tomcat 9.0.124 支持 Java 8 及以上,8.5 已结束支持。Java 使用官方 API 当日提供的 Java 8 补丁版 Temurin 8u512-b09。
|
||||
|
||||
**尚待验证:** 这个组合符合 Java 8 与 Java EE 的运行时基线,但并非供应商列出的精确测试组合。须拿到官方 WAR 后验证部署、SDK 沙箱初始化、调用及 PDF 输出,不能由 Java/Tomcat 版本检查推断业务兼容性。
|
||||
**兼容性验证范围:** 已完成官方应用部署、真实沙箱初始化和未签 PDF 解析检查。医生核身、实际签署、签后 PDF 验签与下载的完整业务闭环尚待测试医生参与验证。
|
||||
|
||||
## 官方下载和校验
|
||||
|
||||
@@ -100,4 +103,4 @@ cfe11a042e5c3acc02ca4715ef80f3de599980e46729556be08e2a4078a61c9fed625cc804b1660b
|
||||
- 通过 `org.apache.catalina.util.ServerInfo` 读取包版本成功:Tomcat `9.0.124`,构建日期 2026-11-09,APR 未加载。该命令未启动服务器。
|
||||
- 两个 PowerShell 脚本通过语法解析,XML 可解析,只有一个 HTTP connector。
|
||||
- 检查时 `webapps` 为空,8091 和 8092 都没有监听进程。
|
||||
- 未运行 Tomcat 启动、SDK 初始化、核身、签署或真实业务调用。
|
||||
- 后续已完成 Tomcat 启停、真实沙箱初始化和未签 PDF 解析,结果见本文开头;未执行核身或签署。
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# 沙箱 SDK 创建签署账号 403 核查信息
|
||||
|
||||
可复制给现有 e签宝实施/交付顾问。本文件仅整理材料,未代为发送任何消息或工单。
|
||||
|
||||
更新:用户已确认接口权限及白名单。SDK 已重启且重新初始化成功,但 `2026-11-18 14:17:35–14:17:36 +08:00` 的系统内实际提交仍返回 `createPerson / PROVIDER_403`。Mihomo 实时连接显示 SDK 域名 `smlitsm.tsign.cn`、`smltech.tsign.cn` 都是 `DIRECT`,国内公网查询为 `123.14.175.249`;没有走代理节点。请按这次准确时间查询服务端拒绝日志、实际源 IP 和具体拒绝说明,而不只是重复确认控制台勾选状态。完整实测见 `artifacts/esign-network-diagnosis.md`。
|
||||
|
||||
---
|
||||
|
||||
请协助核查以下沙箱 SDK 3.0 接入问题:
|
||||
|
||||
- 应用 ID:`7439151893`,企业自用应用,SDK 3.0 方案。
|
||||
- 服务版本:官方 PaaS-SDK-Service / core `3.1.26`。
|
||||
- 失败时间:`2026-11-18 14:01:54–14:01:55 +08:00`。
|
||||
- 调用接口:`POST /paas-sdk-service/timevale/account/addPerson`。
|
||||
- 实际响应:HTTP `200`,JSON `errCode=403`;应用记录为 `createPerson / PROVIDER_403`。出于身份信息保护,没有保存原始响应正文,因此未记录原始 `msg`。
|
||||
- 前置状态:SDK 沙箱初始化成功;本人在系统内以支付宝扫码完成核身;认证查询为 `SUCCESS / INDIVIDUAL`,应用和流程一致;提交绑定前 `queryWillingnessValidity` 校验通过。
|
||||
- 核身流程 ID:`4868530341519822468`。
|
||||
- 核身查询补充问题:该成功流程的 `indivInfo` 返回 `null`,没有姓名和证件信息。请同时确认这是应用/通道的预期行为,还是返回配置异常。
|
||||
- 绑定参数包含服务端冻结姓名、本人在系统中补充的证件号、`idNoType=MAINLAND` 和该 `identityAuthId`。未省略核身流程来绕过认证。证件号未写入本材料或业务库。
|
||||
- 只读连通性对照:同一 SDK 的 `account/queryByAccountId` 对固定不存在的测试标识返回正常业务码 `331003`(账号信息异常或不存在),并非所有 SDK 账号接口均失败。
|
||||
- 当前没有取得账号 ID,没有发起 PDF 签署,没有签署流水或签后 PDF。
|
||||
|
||||
请核查:
|
||||
|
||||
1. 该沙箱应用是否已获准调用 SDK 3 的创建个人签署账号、证书申请及个人 PDF 签署接口,尤其是 `addPerson` 所需的接口权限。
|
||||
2. 请根据上述时间、应用、流程定位 403 的实际拒绝原因,并复核该请求所见公网出口 IP 与对应 SDK 应用白名单。
|
||||
3. 如果是接口权限缺失,请开通本次已申请的 SDK 处方签署沙箱联调能力;如果另有条件,请提供准确错误说明与操作步骤。
|
||||
|
||||
核查无需应用 Secret、身份证号码、手机验证码或完整个人信息。
|
||||
|
||||
---
|
||||
|
||||
依据:[官方错误码查询](https://open.esign.cn/tools/error-code)对 403 给出多种场景,包括“该应用无权调用此接口”和 IP 白名单不匹配。当前“接口权限优先核查”是结合现场证据的排查判断,尚未得到供应商确认。
|
||||
@@ -0,0 +1,207 @@
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timezone, timedelta
|
||||
import configparser
|
||||
import hashlib
|
||||
import html
|
||||
import json
|
||||
import sys
|
||||
|
||||
import pymysql
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
OUT = Path(__file__).resolve().parent
|
||||
TZ = timezone(timedelta(hours=8))
|
||||
ORDER_NOS = ['PO20261024092136816172', 'PO20260924112640923356', 'PO20260908142548426588']
|
||||
|
||||
|
||||
def date_time(value):
|
||||
return datetime.fromtimestamp(int(value), TZ).strftime('%Y-%m-%d %H:%M:%S') if value else '—'
|
||||
|
||||
|
||||
def add_dates(rows):
|
||||
for row in rows:
|
||||
for key, value in list(row.items()):
|
||||
if (key.endswith('_time') or key in ('created_at', 'updated_at', 'claimed_at', 'completed_at', 'failed_at')) and isinstance(value, (int, type(None))):
|
||||
row[key + '_beijing'] = date_time(value)
|
||||
return rows
|
||||
|
||||
|
||||
cfg = configparser.ConfigParser(interpolation=None, strict=False)
|
||||
cfg.read_string('[root]\n' + (ROOT / 'server/.env').read_text(encoding='utf-8-sig'))
|
||||
settings = {k: v.strip().strip(chr(34)).strip(chr(39)) for k, v in cfg['database'].items()}
|
||||
db = pymysql.connect(host=settings['hostname'], port=int(settings.get('hostport', '3306')),
|
||||
user=settings['username'], password=settings['password'], database=settings['database'],
|
||||
charset='utf8mb4', connect_timeout=8, read_timeout=30, write_timeout=5,
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
queries = []
|
||||
try:
|
||||
with db.cursor() as cur:
|
||||
cur.execute('START TRANSACTION READ ONLY')
|
||||
|
||||
def query(title, sql, args=None):
|
||||
queries.append('-- ' + title + '\n' + cur.mogrify(sql, args) + ';')
|
||||
cur.execute(sql, args)
|
||||
return add_dates(list(cur.fetchall()))
|
||||
|
||||
orders = query('指定三个处方业务订单(不包含收货电话与地址)', '''
|
||||
SELECT id,order_no,prescription_id,diagnosis_id,creator_id,amount,paid,fee_type,
|
||||
medication_days,dose_unit,dose_count,ship_mode,tracking_number,express_company,
|
||||
gancao_reciperl_order_no,gancao_submit_time,ej_pharmacy_order_no,ej_pharmacy_submit_time,
|
||||
ej_pharmacy_status,ej_pharmacy_review_status,ej_pharmacy_current_step,
|
||||
prescription_audit_status,prescription_audit_remark,payment_slip_audit_status,
|
||||
payment_slip_audit_remark,fulfillment_status,create_time,update_time,delete_time
|
||||
FROM zyt_tcm_prescription_order WHERE order_no IN (%s,%s,%s)''', ORDER_NOS)
|
||||
assert {o['order_no'] for o in orders} == set(ORDER_NOS), '三个订单未全部命中'
|
||||
order_ids = [o['id'] for o in orders]
|
||||
rx_ids = [o['prescription_id'] for o in orders]
|
||||
prescriptions = query('关联处方当前记录;创建时间不是独立操作日志', '''
|
||||
SELECT id,sn,patient_name,doctor_name,creator_id,assistant_id,is_system_auto,
|
||||
prescription_name,prescription_type,prescription_date,dose_count,dose_unit,
|
||||
usage_days,times_per_day,amount,create_time,update_time,
|
||||
audit_status,audit_time,audit_by,audit_by_name,audit_remark,
|
||||
void_status,void_time,void_by_name,delete_time
|
||||
FROM zyt_tcm_prescription WHERE id IN (%s,%s,%s)''', rx_ids)
|
||||
logs = query('全部订单流水,原始日志姓名保持不变', '''
|
||||
SELECT id,prescription_order_id,admin_id,admin_name,action,summary,create_time
|
||||
FROM zyt_tcm_prescription_order_log WHERE prescription_order_id IN (%s,%s,%s)
|
||||
ORDER BY prescription_order_id,create_time,id''', order_ids)
|
||||
callbacks = query('对应洛阳药房回传', '''
|
||||
SELECT id,event_id,pharmacy_order_no,source_order_no,event_type,status_version,
|
||||
payload,process_status,processed_time,error_message,create_time,update_time
|
||||
FROM zyt_ej_pharmacy_callback_inbox WHERE source_order_no IN (%s,%s,%s) ORDER BY id''', ORDER_NOS)
|
||||
payload_fields = {'status','event_id','event_type','occurred_at','review_status','source_system',
|
||||
'status_version','express_company','source_order_no','source_revision',
|
||||
'tracking_number','pharmacy_order_no','current_step','operator_name','pharmacist_name'}
|
||||
for row in callbacks:
|
||||
payload = json.loads(row.pop('payload') or '{}')
|
||||
row['payload_selected_fields'] = {k: v for k, v in payload.items() if k in payload_fields}
|
||||
ai_events = query('处方分析触发元数据,仅用于辅助核对,不等同开方日志', '''
|
||||
SELECT id,prescription_id,prescription_revision,doctor_id,actor_id,trigger_type,
|
||||
reason,status,validity,created_at,updated_at
|
||||
FROM zyt_prescription_ai_batch WHERE prescription_id IN (%s,%s,%s) ORDER BY id''', rx_ids)
|
||||
staff_ids = sorted({v for o in orders for v in [o['creator_id']]} |
|
||||
{v for r in prescriptions for v in [r['creator_id'],r['assistant_id'],r['audit_by']]} |
|
||||
{l['admin_id'] for l in logs if l['admin_id']})
|
||||
staff = query('相关账号当前名称及角色;不覆盖历史日志署名', '''
|
||||
SELECT a.id,a.name,GROUP_CONCAT(r.name ORDER BY r.id SEPARATOR '、') AS roles
|
||||
FROM zyt_admin a LEFT JOIN zyt_admin_role ar ON ar.admin_id=a.id
|
||||
LEFT JOIN zyt_system_role r ON r.id=ar.role_id
|
||||
WHERE a.id IN (''' + ','.join(['%s']*len(staff_ids)) + ') GROUP BY a.id,a.name', staff_ids)
|
||||
coverage = query('后台操作日志表覆盖范围', '''
|
||||
SELECT COUNT(*) AS total,MIN(create_time) AS earliest_time,MAX(create_time) AS latest_time
|
||||
FROM zyt_operation_log''')[0]
|
||||
operation_candidates = query('后台处方端点的历史请求候选,只输出日志元信息与关联所需标识', '''
|
||||
SELECT id,admin_id,admin_name,action,type,SUBSTRING_INDEX(url,'?',1) AS endpoint,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.id')) AS request_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.prescription_id')) AS request_prescription_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.diagnosis_id')) AS request_diagnosis_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(result),result,'{}'),'$.data.id')) AS response_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(result),result,'{}'),'$.code')) AS response_code,
|
||||
create_time
|
||||
FROM zyt_operation_log WHERE LOWER(url) LIKE %s ORDER BY create_time,id''', ('%tcm.prescription%',))
|
||||
operation_logs = []
|
||||
for row in operation_candidates:
|
||||
is_order = 'prescriptionorder/' in row['endpoint'].lower()
|
||||
ids = set(map(str, order_ids if is_order else rx_ids))
|
||||
if row['request_id'] in ids or row['response_id'] in ids or row['request_prescription_id'] in set(map(str,rx_ids)) or row['request_diagnosis_id'] in set(map(str,[o['diagnosis_id'] for o in orders])):
|
||||
operation_logs.append(row)
|
||||
freshness = query('当前库订单表最新创建记录的时间(不代表同步时间)', 'SELECT MAX(create_time) AS latest_order_create_time FROM zyt_tcm_prescription_order')[0]
|
||||
finally:
|
||||
db.rollback()
|
||||
db.close()
|
||||
|
||||
notes = [
|
||||
'来源:项目 server/.env 指向的本机 MySQL 数据库 zyt(127.0.0.1:3306)。未核实与生产库同步情况;本报告仅证明当前查询库中保存的记录。',
|
||||
'所有展示时间均为北京时间 UTC+08:00;JSON 同时保留 Unix 原始时间戳。查询使用只读事务,未修改业务数据。',
|
||||
'开方栏取自处方主记录 doctor_name、creator_id、create_time;它是当前处方记录,并非独立的开方保存、修改操作流水。',
|
||||
'审方日志原始 admin_name 三笔均为“药房”。本报告另列同一账号 ID 对应的处方 audit_by_name,以及同单相邻操作日志署名,保留来源差异。',
|
||||
'账号 116 当前名为“药房1”,账号 119 当前名为“药房”;当前角色为下单等。焦珂、李思佳为审核字段/历史日志署名,不据此认定实名登录人或执业资质。',
|
||||
'当前代码 server/app/adminapi/event.php 的 HttpEnd 监听器为空,关闭了通用后台操作日志写入;这不能证明历史所有时段均关闭。',
|
||||
'药房回调的日志时间为本系统落库时间;如载荷提供 occurred_at,则在回传明细中另列原值。'
|
||||
]
|
||||
if not operation_logs:
|
||||
notes.append('未检索到关联这三个订单/处方的通用后台请求日志,不能提供完整的逐次开方、修改请求历史。')
|
||||
if not ai_events:
|
||||
notes.append('处方 AI 批次表中也未检索到这三个处方的分析触发记录。')
|
||||
|
||||
data = {'export_time_beijing':datetime.now(TZ).isoformat(timespec='seconds'),
|
||||
'source':{'config':'server/.env','host':settings['hostname'],'port':int(settings.get('hostport','3306')),
|
||||
'database':settings['database'],'production_sync_verified':False},
|
||||
'requested_order_numbers':ORDER_NOS,'notes':notes,'orders':orders,'prescriptions':prescriptions,
|
||||
'order_logs':logs,'pharmacy_callbacks':callbacks,'operation_logs':operation_logs,
|
||||
'prescription_ai_events':ai_events,'staff_current':staff,'operation_log_coverage':coverage,
|
||||
'source_freshness_indicator':freshness}
|
||||
json_path = OUT / '处方订单及日志_原始字段.json'
|
||||
json_path.write_text(json.dumps(data, ensure_ascii=False, indent=2, default=str)+'\n',encoding='utf-8')
|
||||
(OUT/'只读查询.sql').write_text('SET time_zone = \'+08:00\';\nSTART TRANSACTION READ ONLY;\n\n'+'\n\n'.join(queries)+'\n\nROLLBACK;\n',encoding='utf-8')
|
||||
|
||||
by_rx = {r['id']:r for r in prescriptions}
|
||||
by_staff = {s['id']:s for s in staff}
|
||||
audit_actions = {'audit_rx_approve','audit_rx_reject','revoke_rx_audit','manual_log'}
|
||||
status_names = {1:'待双审通过',2:'履约中',3:'已完成',4:'已取消',5:'已发货',6:'已签收'}
|
||||
lines = ['三个处方业务订单:开方记录与药房操作日志', '导出时间:'+data['export_time_beijing'], '']
|
||||
lines.extend(notes)
|
||||
lines.extend(['',f"当前库订单表最新创建时间:{freshness['latest_order_create_time_beijing']}(仅供判断数据范围,不代表同步时间)",
|
||||
f"订单操作日志共 {len(logs)} 条;匹配后台请求日志 {len(operation_logs)} 条;AI 触发记录 {len(ai_events)} 条;洛阳药房原始回传 {len(callbacks)} 条。",''])
|
||||
summaries = []
|
||||
for no in ORDER_NOS:
|
||||
order = next(o for o in orders if o['order_no']==no)
|
||||
rx = by_rx[order['prescription_id']]
|
||||
own_logs = [l for l in logs if l['prescription_order_id']==order['id']]
|
||||
own_audits = [l for l in own_logs if l['action'] in audit_actions]
|
||||
summaries.append({'order_no':no,'patient_name':rx['patient_name'],'doctor_name':rx['doctor_name'],
|
||||
'prescription_create_time':rx['create_time_beijing'],'audit_by_name':rx['audit_by_name'],
|
||||
'audit_time':rx['audit_time_beijing'],'logs':len(own_logs)})
|
||||
lines.extend(['='*88,no,
|
||||
f"患者:{rx['patient_name']};诊单 ID:{order['diagnosis_id']};业务订单 ID:{order['id']}",
|
||||
f"处方:{rx['sn']}(ID {rx['id']});类型:{rx['prescription_type']};名称:{rx['prescription_name']}",
|
||||
f"处方记录医生:{rx['doctor_name']}(creator_id={rx['creator_id']});创建时间:{rx['create_time_beijing']};处方日期:{rx['prescription_date']}",
|
||||
f"业务订单创建人:{by_staff.get(order['creator_id'],{}).get('name','未知')}(ID {order['creator_id']});创建时间:{order['create_time_beijing']}",
|
||||
f"金额:{order['amount']};已付:{order['paid']};状态:{status_names.get(order['fulfillment_status'],order['fulfillment_status'])}",
|
||||
f"处方审核字段:{rx['audit_by_name']}(账号 ID {rx['audit_by']});{rx['audit_time_beijing']};audit_status={rx['audit_status']};{rx['audit_remark']}",
|
||||
f"发货方式:{order['ship_mode']};甘草订单:{order['gancao_reciperl_order_no'] or '无'};洛阳药房订单:{order['ej_pharmacy_order_no'] or '无'}",'',
|
||||
f"审方/撤审/人工补记日志({len(own_audits)} 条)"])
|
||||
for log in own_audits:
|
||||
lines.append(f"{log['create_time_beijing']} | 日志 {log['id']} | 原始署名 {log['admin_name']} / 账号 {log['admin_id']} | {log['action']} | {log['summary']}")
|
||||
lines.extend(['',f'完整订单操作流水({len(own_logs)} 条,按时间、日志 ID 升序)'])
|
||||
for log in own_logs:
|
||||
lines.append(f"{log['create_time_beijing']} | 日志 {log['id']} | {log['admin_name']} / 账号 {log['admin_id']} | {log['action']} | {log['summary']}")
|
||||
lines.append('')
|
||||
lines.extend(['='*88,'洛阳药房回传明细',json.dumps(callbacks,ensure_ascii=False,indent=2,default=str),
|
||||
'关联开方/修改后台请求日志',json.dumps(operation_logs,ensure_ascii=False,indent=2,default=str),
|
||||
'关联 AI 分析触发元数据(不等同开方日志)',json.dumps(ai_events,ensure_ascii=False,indent=2,default=str)])
|
||||
text_path = OUT/'处方订单及日志_完整明细.txt'
|
||||
text_path.write_text('\n'.join(lines)+'\n',encoding='utf-8-sig')
|
||||
|
||||
|
||||
def table(headers, rows):
|
||||
return '<table><thead><tr>'+''.join('<th>'+html.escape(str(h))+'</th>' for h in headers)+'</tr></thead><tbody>'+''.join('<tr>'+''.join('<td>'+html.escape(str(v if v is not None else '—'))+'</td>' for v in row)+'</tr>' for row in rows)+'</tbody></table>'
|
||||
|
||||
|
||||
parts = ['<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>三个处方订单日志</title>',
|
||||
'<style>body{font-family:system-ui,"Microsoft YaHei",sans-serif;color:#202733;background:#f7f8fa;margin:0;padding:32px}main{max-width:1400px;margin:auto}h1{font-size:28px}h2{margin-top:36px;font-size:22px}p,li{line-height:1.8}table{width:100%;border-collapse:collapse;background:white;margin:18px 0;font-size:14px}th,td{border:1px solid #d9dfe6;padding:10px;text-align:left;vertical-align:top}th{background:#edf1f5}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:white;padding:20px;border:1px solid #d9dfe6}.note{color:#525c6d}a{color:#155c9e}@media print{body{padding:0;background:white}tr{break-inside:avoid}h2{break-before:page}}</style><main>',
|
||||
'<h1>三个处方业务订单 · 开方记录与药房日志</h1>',
|
||||
'<p>导出时间:'+html.escape(data['export_time_beijing'])+'。全部时间为北京时间。</p>',
|
||||
'<ul class="note">'+''.join('<li>'+html.escape(n)+'</li>' for n in notes)+'</ul>',
|
||||
table(['业务订单','患者','处方记录医生','处方创建时间','审核字段署名','审核时间','订单日志数'],
|
||||
[[s[k] for k in ['order_no','patient_name','doctor_name','prescription_create_time','audit_by_name','audit_time','logs']] for s in summaries]),
|
||||
'<p>订单流水共 '+str(len(logs))+' 条。<a href="处方订单及日志_完整明细.txt">完整文本</a> · <a href="处方订单及日志_原始字段.json">JSON 原始字段</a> · <a href="只读查询.sql">只读 SQL</a></p>']
|
||||
for no in ORDER_NOS:
|
||||
order=next(o for o in orders if o['order_no']==no);rx=by_rx[order['prescription_id']]
|
||||
parts.extend(['<h2>'+html.escape(no)+'</h2>',
|
||||
table(['字段','记录值'],[['业务订单 ID',order['id']],['处方号 / ID',f"{rx['sn']} / {rx['id']}"],
|
||||
['医生及处方创建时间',f"{rx['doctor_name']} / {rx['create_time_beijing']}"],
|
||||
['业务订单创建人及时间',f"{by_staff.get(order['creator_id'],{}).get('name','未知')} / {order['create_time_beijing']}"],
|
||||
['处方审核字段',f"{rx['audit_by_name']} / 账号 {rx['audit_by']} / {rx['audit_time_beijing']} / {rx['audit_remark']}"],
|
||||
['金额 / 已付 / 状态',f"{order['amount']} / {order['paid']} / {status_names.get(order['fulfillment_status'],order['fulfillment_status'])}"]]),
|
||||
table(['时间','日志 ID','原始署名','账号 ID','动作','内容'],
|
||||
[[l['create_time_beijing'],l['id'],l['admin_name'],l['admin_id'],l['action'],l['summary']] for l in logs if l['prescription_order_id']==order['id']])])
|
||||
parts.extend(['<h2>补充来源与回传记录</h2><pre>'+html.escape(json.dumps({'operation_log_coverage':coverage,'source_freshness_indicator':freshness,'pharmacy_callbacks':callbacks,'matched_operation_logs':operation_logs,'ai_trigger_events':ai_events},ensure_ascii=False,indent=2,default=str))+'</pre></main></html>'])
|
||||
html_path=OUT/'处方订单及日志_查看版.html'
|
||||
html_path.write_text('\n'.join(parts),encoding='utf-8')
|
||||
manifest={p.name:hashlib.sha256(p.read_bytes()).hexdigest() for p in [json_path,text_path,html_path,OUT/'只读查询.sql']}
|
||||
(OUT/'sha256.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
|
||||
print(json.dumps({'summary':summaries,'order_log_count':len(logs),'operation_log_count':len(operation_logs),
|
||||
'ai_event_count':len(ai_events),'callback_count':len(callbacks),'report_path':str(html_path),
|
||||
'freshness':freshness,'coverage':coverage},ensure_ascii=False,default=str,indent=2))
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"处方订单及日志_原始字段.json": "b80563ad72a27cc9bb7779c669358e2e6f1a7fc5bad34c6d33f6fb793f1537eb",
|
||||
"处方订单及日志_完整明细.txt": "66d6cf807138681511e034cf35a8bbeda9fcc6cb10f2a8341c0930b72f556dec",
|
||||
"处方订单及日志_查看版.html": "1556be7f8109e2d1fefd3bed62ec96943c574a8049dfb2689df1cd872871a17e",
|
||||
"只读查询.sql": "5e925ce06a803ace2a13dadc825cf91be9746c105e81778c7cf45a11744fa262"
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
SET time_zone = '+08:00';
|
||||
START TRANSACTION READ ONLY;
|
||||
|
||||
-- 指定三个处方业务订单(不包含收货电话与地址)
|
||||
|
||||
SELECT id,order_no,prescription_id,diagnosis_id,creator_id,amount,paid,fee_type,
|
||||
medication_days,dose_unit,dose_count,ship_mode,tracking_number,express_company,
|
||||
gancao_reciperl_order_no,gancao_submit_time,ej_pharmacy_order_no,ej_pharmacy_submit_time,
|
||||
ej_pharmacy_status,ej_pharmacy_review_status,ej_pharmacy_current_step,
|
||||
prescription_audit_status,prescription_audit_remark,payment_slip_audit_status,
|
||||
payment_slip_audit_remark,fulfillment_status,create_time,update_time,delete_time
|
||||
FROM zyt_tcm_prescription_order WHERE order_no IN ('PO20261024092136816172','PO20260924112640923356','PO20260908142548426588');
|
||||
|
||||
-- 关联处方当前记录;创建时间不是独立操作日志
|
||||
|
||||
SELECT id,sn,patient_name,doctor_name,creator_id,assistant_id,is_system_auto,
|
||||
prescription_name,prescription_type,prescription_date,dose_count,dose_unit,
|
||||
usage_days,times_per_day,amount,create_time,update_time,
|
||||
audit_status,audit_time,audit_by,audit_by_name,audit_remark,
|
||||
void_status,void_time,void_by_name,delete_time
|
||||
FROM zyt_tcm_prescription WHERE id IN (9787,10615,11945);
|
||||
|
||||
-- 全部订单流水,原始日志姓名保持不变
|
||||
|
||||
SELECT id,prescription_order_id,admin_id,admin_name,action,summary,create_time
|
||||
FROM zyt_tcm_prescription_order_log WHERE prescription_order_id IN (3751,4087,4583)
|
||||
ORDER BY prescription_order_id,create_time,id;
|
||||
|
||||
-- 对应洛阳药房回传
|
||||
|
||||
SELECT id,event_id,pharmacy_order_no,source_order_no,event_type,status_version,
|
||||
payload,process_status,processed_time,error_message,create_time,update_time
|
||||
FROM zyt_ej_pharmacy_callback_inbox WHERE source_order_no IN ('PO20261024092136816172','PO20260924112640923356','PO20260908142548426588') ORDER BY id;
|
||||
|
||||
-- 处方分析触发元数据,仅用于辅助核对,不等同开方日志
|
||||
|
||||
SELECT id,prescription_id,prescription_revision,doctor_id,actor_id,trigger_type,
|
||||
reason,status,validity,created_at,updated_at
|
||||
FROM zyt_prescription_ai_batch WHERE prescription_id IN (9787,10615,11945) ORDER BY id;
|
||||
|
||||
-- 相关账号当前名称及角色;不覆盖历史日志署名
|
||||
|
||||
SELECT a.id,a.name,GROUP_CONCAT(r.name ORDER BY r.id SEPARATOR '、') AS roles
|
||||
FROM zyt_admin a LEFT JOIN zyt_admin_role ar ON ar.admin_id=a.id
|
||||
LEFT JOIN zyt_system_role r ON r.id=ar.role_id
|
||||
WHERE a.id IN (12,28,116,119,203,204,279,284) GROUP BY a.id,a.name;
|
||||
|
||||
-- 后台操作日志表覆盖范围
|
||||
|
||||
SELECT COUNT(*) AS total,MIN(create_time) AS earliest_time,MAX(create_time) AS latest_time
|
||||
FROM zyt_operation_log;
|
||||
|
||||
-- 后台处方端点的历史请求候选,只输出日志元信息与关联所需标识
|
||||
|
||||
SELECT id,admin_id,admin_name,action,type,SUBSTRING_INDEX(url,'?',1) AS endpoint,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.id')) AS request_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.prescription_id')) AS request_prescription_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(params),params,'{}'),'$.diagnosis_id')) AS request_diagnosis_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(result),result,'{}'),'$.data.id')) AS response_id,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(IF(JSON_VALID(result),result,'{}'),'$.code')) AS response_code,
|
||||
create_time
|
||||
FROM zyt_operation_log WHERE LOWER(url) LIKE '%tcm.prescription%' ORDER BY create_time,id;
|
||||
|
||||
-- 当前库订单表最新创建记录的时间(不代表同步时间)
|
||||
SELECT MAX(create_time) AS latest_order_create_time FROM zyt_tcm_prescription_order;
|
||||
|
||||
ROLLBACK;
|
||||
@@ -0,0 +1,896 @@
|
||||
{
|
||||
"export_time_beijing": "2026-11-18T16:50:09+08:00",
|
||||
"source": {
|
||||
"config": "server/.env",
|
||||
"host": "127.0.0.1",
|
||||
"port": 3306,
|
||||
"database": "zyt",
|
||||
"production_sync_verified": false
|
||||
},
|
||||
"requested_order_numbers": [
|
||||
"PO20261024092136816172",
|
||||
"PO20260924112640923356",
|
||||
"PO20260908142548426588"
|
||||
],
|
||||
"notes": [
|
||||
"来源:项目 server/.env 指向的本机 MySQL 数据库 zyt(127.0.0.1:3306)。未核实与生产库同步情况;本报告仅证明当前查询库中保存的记录。",
|
||||
"所有展示时间均为北京时间 UTC+08:00;JSON 同时保留 Unix 原始时间戳。查询使用只读事务,未修改业务数据。",
|
||||
"开方栏取自处方主记录 doctor_name、creator_id、create_time;它是当前处方记录,并非独立的开方保存、修改操作流水。",
|
||||
"审方日志原始 admin_name 三笔均为“药房”。本报告另列同一账号 ID 对应的处方 audit_by_name,以及同单相邻操作日志署名,保留来源差异。",
|
||||
"账号 116 当前名为“药房1”,账号 119 当前名为“药房”;当前角色为下单等。焦珂、李思佳为审核字段/历史日志署名,不据此认定实名登录人或执业资质。",
|
||||
"当前代码 server/app/adminapi/event.php 的 HttpEnd 监听器为空,关闭了通用后台操作日志写入;这不能证明历史所有时段均关闭。",
|
||||
"药房回调的日志时间为本系统落库时间;如载荷提供 occurred_at,则在回传明细中另列原值。",
|
||||
"未检索到关联这三个订单/处方的通用后台请求日志,不能提供完整的逐次开方、修改请求历史。"
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 3751,
|
||||
"order_no": "PO20260908142548426588",
|
||||
"prescription_id": 9787,
|
||||
"diagnosis_id": 12167,
|
||||
"creator_id": 279,
|
||||
"amount": "1400.00",
|
||||
"paid": "1400.00",
|
||||
"fee_type": 3,
|
||||
"medication_days": 14,
|
||||
"dose_unit": "剂",
|
||||
"dose_count": 1,
|
||||
"ship_mode": "direct",
|
||||
"tracking_number": "JDVE18948527288",
|
||||
"express_company": "auto",
|
||||
"gancao_reciperl_order_no": "",
|
||||
"gancao_submit_time": 0,
|
||||
"ej_pharmacy_order_no": null,
|
||||
"ej_pharmacy_submit_time": 0,
|
||||
"ej_pharmacy_status": "",
|
||||
"ej_pharmacy_review_status": "",
|
||||
"ej_pharmacy_current_step": "",
|
||||
"prescription_audit_status": 1,
|
||||
"prescription_audit_remark": "",
|
||||
"payment_slip_audit_status": 1,
|
||||
"payment_slip_audit_remark": "",
|
||||
"fulfillment_status": 3,
|
||||
"create_time": 1788848748,
|
||||
"update_time": 1790492528,
|
||||
"delete_time": null,
|
||||
"gancao_submit_time_beijing": "—",
|
||||
"ej_pharmacy_submit_time_beijing": "—",
|
||||
"create_time_beijing": "2026-09-08 14:25:48",
|
||||
"update_time_beijing": "2026-09-27 15:02:08",
|
||||
"delete_time_beijing": "—"
|
||||
},
|
||||
{
|
||||
"id": 4087,
|
||||
"order_no": "PO20260924112640923356",
|
||||
"prescription_id": 10615,
|
||||
"diagnosis_id": 12167,
|
||||
"creator_id": 284,
|
||||
"amount": "1800.00",
|
||||
"paid": "0.00",
|
||||
"fee_type": 7,
|
||||
"medication_days": 21,
|
||||
"dose_unit": "剂",
|
||||
"dose_count": 10,
|
||||
"ship_mode": "gancao",
|
||||
"tracking_number": "SF5155771371889",
|
||||
"express_company": "auto",
|
||||
"gancao_reciperl_order_no": "G17902378442302734",
|
||||
"gancao_submit_time": 1790237844,
|
||||
"ej_pharmacy_order_no": null,
|
||||
"ej_pharmacy_submit_time": 0,
|
||||
"ej_pharmacy_status": "",
|
||||
"ej_pharmacy_review_status": "",
|
||||
"ej_pharmacy_current_step": "",
|
||||
"prescription_audit_status": 1,
|
||||
"prescription_audit_remark": "",
|
||||
"payment_slip_audit_status": 1,
|
||||
"payment_slip_audit_remark": "",
|
||||
"fulfillment_status": 3,
|
||||
"create_time": 1790220400,
|
||||
"update_time": 1790468903,
|
||||
"delete_time": null,
|
||||
"gancao_submit_time_beijing": "2026-09-24 16:17:24",
|
||||
"ej_pharmacy_submit_time_beijing": "—",
|
||||
"create_time_beijing": "2026-09-24 11:26:40",
|
||||
"update_time_beijing": "2026-09-27 08:28:23",
|
||||
"delete_time_beijing": "—"
|
||||
},
|
||||
{
|
||||
"id": 4583,
|
||||
"order_no": "PO20261024092136816172",
|
||||
"prescription_id": 11945,
|
||||
"diagnosis_id": 12167,
|
||||
"creator_id": 284,
|
||||
"amount": "1800.00",
|
||||
"paid": "1800.00",
|
||||
"fee_type": 7,
|
||||
"medication_days": 21,
|
||||
"dose_unit": "剂",
|
||||
"dose_count": 10,
|
||||
"ship_mode": "direct",
|
||||
"tracking_number": "JDVE19405836801",
|
||||
"express_company": "auto",
|
||||
"gancao_reciperl_order_no": "",
|
||||
"gancao_submit_time": 0,
|
||||
"ej_pharmacy_order_no": "EJ202610261004182FA855",
|
||||
"ej_pharmacy_submit_time": 1792980258,
|
||||
"ej_pharmacy_status": "PENDING_REVIEW",
|
||||
"ej_pharmacy_review_status": "PENDING",
|
||||
"ej_pharmacy_current_step": "",
|
||||
"prescription_audit_status": 1,
|
||||
"prescription_audit_remark": "",
|
||||
"payment_slip_audit_status": 1,
|
||||
"payment_slip_audit_remark": "",
|
||||
"fulfillment_status": 3,
|
||||
"create_time": 1792804896,
|
||||
"update_time": 1793434806,
|
||||
"delete_time": null,
|
||||
"gancao_submit_time_beijing": "—",
|
||||
"ej_pharmacy_submit_time_beijing": "2026-10-26 10:04:18",
|
||||
"create_time_beijing": "2026-10-24 09:21:36",
|
||||
"update_time_beijing": "2026-10-31 16:20:06",
|
||||
"delete_time_beijing": "—"
|
||||
}
|
||||
],
|
||||
"prescriptions": [
|
||||
{
|
||||
"id": 9787,
|
||||
"sn": "RX202609078921",
|
||||
"patient_name": "雷柏生",
|
||||
"doctor_name": "赵俊霞",
|
||||
"creator_id": 28,
|
||||
"assistant_id": 279,
|
||||
"is_system_auto": 0,
|
||||
"prescription_name": "系统代开",
|
||||
"prescription_type": "浓缩水丸",
|
||||
"prescription_date": "2026-09-07",
|
||||
"dose_count": 14,
|
||||
"dose_unit": "剂",
|
||||
"usage_days": 14,
|
||||
"times_per_day": 3,
|
||||
"amount": "0.00",
|
||||
"create_time": 1788774166,
|
||||
"update_time": 1788925728,
|
||||
"audit_status": 1,
|
||||
"audit_time": 1788925728,
|
||||
"audit_by": 116,
|
||||
"audit_by_name": "焦珂",
|
||||
"audit_remark": "业务订单处方审核通过",
|
||||
"void_status": 0,
|
||||
"void_time": null,
|
||||
"void_by_name": "",
|
||||
"delete_time": null,
|
||||
"create_time_beijing": "2026-09-07 17:42:46",
|
||||
"update_time_beijing": "2026-09-09 11:48:48",
|
||||
"audit_time_beijing": "2026-09-09 11:48:48",
|
||||
"void_time_beijing": "—",
|
||||
"delete_time_beijing": "—"
|
||||
},
|
||||
{
|
||||
"id": 10615,
|
||||
"sn": "RX202609238774",
|
||||
"patient_name": "雷柏生",
|
||||
"doctor_name": "赵俊霞",
|
||||
"creator_id": 28,
|
||||
"assistant_id": 284,
|
||||
"is_system_auto": 0,
|
||||
"prescription_name": "系统代开",
|
||||
"prescription_type": "浓缩水丸",
|
||||
"prescription_date": "2026-09-23",
|
||||
"dose_count": 21,
|
||||
"dose_unit": "剂",
|
||||
"usage_days": 21,
|
||||
"times_per_day": 3,
|
||||
"amount": "0.00",
|
||||
"create_time": 1790156255,
|
||||
"update_time": 1790237839,
|
||||
"audit_status": 1,
|
||||
"audit_time": 1790237839,
|
||||
"audit_by": 116,
|
||||
"audit_by_name": "焦珂",
|
||||
"audit_remark": "业务订单处方审核通过",
|
||||
"void_status": 0,
|
||||
"void_time": null,
|
||||
"void_by_name": "",
|
||||
"delete_time": null,
|
||||
"create_time_beijing": "2026-09-23 17:37:35",
|
||||
"update_time_beijing": "2026-09-24 16:17:19",
|
||||
"audit_time_beijing": "2026-09-24 16:17:19",
|
||||
"void_time_beijing": "—",
|
||||
"delete_time_beijing": "—"
|
||||
},
|
||||
{
|
||||
"id": 11945,
|
||||
"sn": "RX202610233553",
|
||||
"patient_name": "雷柏生",
|
||||
"doctor_name": "霍桢毅",
|
||||
"creator_id": 12,
|
||||
"assistant_id": 284,
|
||||
"is_system_auto": 0,
|
||||
"prescription_name": "系统代开",
|
||||
"prescription_type": "浓缩水丸",
|
||||
"prescription_date": "2026-10-23",
|
||||
"dose_count": 21,
|
||||
"dose_unit": "剂",
|
||||
"usage_days": 21,
|
||||
"times_per_day": 3,
|
||||
"amount": "0.00",
|
||||
"create_time": 1792748278,
|
||||
"update_time": 1792980254,
|
||||
"audit_status": 1,
|
||||
"audit_time": 1792980254,
|
||||
"audit_by": 119,
|
||||
"audit_by_name": "李思佳",
|
||||
"audit_remark": "业务订单处方审核通过",
|
||||
"void_status": 0,
|
||||
"void_time": null,
|
||||
"void_by_name": "",
|
||||
"delete_time": null,
|
||||
"create_time_beijing": "2026-10-23 17:37:58",
|
||||
"update_time_beijing": "2026-10-26 10:04:14",
|
||||
"audit_time_beijing": "2026-10-26 10:04:14",
|
||||
"void_time_beijing": "—",
|
||||
"delete_time_beijing": "—"
|
||||
}
|
||||
],
|
||||
"order_logs": [
|
||||
{
|
||||
"id": 52702,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 279,
|
||||
"admin_name": "董肖妍",
|
||||
"action": "create",
|
||||
"summary": "创建业务订单",
|
||||
"create_time": 1788848748,
|
||||
"create_time_beijing": "2026-09-08 14:25:48"
|
||||
},
|
||||
{
|
||||
"id": 52953,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "set_ship_mode",
|
||||
"summary": "发货类型:甘草药房 → 洛阳药房",
|
||||
"create_time": 1788922716,
|
||||
"create_time_beijing": "2026-09-09 10:58:36"
|
||||
},
|
||||
{
|
||||
"id": 53013,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "edit",
|
||||
"summary": "编辑了业务订单及相关信息",
|
||||
"create_time": 1788925616,
|
||||
"create_time_beijing": "2026-09-09 11:46:56"
|
||||
},
|
||||
{
|
||||
"id": 53014,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 116,
|
||||
"admin_name": "药房",
|
||||
"action": "audit_rx_approve",
|
||||
"summary": "处方审核通过",
|
||||
"create_time": 1788925728,
|
||||
"create_time_beijing": "2026-09-09 11:48:48"
|
||||
},
|
||||
{
|
||||
"id": 53015,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "audit_pay_approve",
|
||||
"summary": "支付单审核通过",
|
||||
"create_time": 1788925731,
|
||||
"create_time_beijing": "2026-09-09 11:48:51"
|
||||
},
|
||||
{
|
||||
"id": 53255,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 204,
|
||||
"admin_name": "徐云云",
|
||||
"action": "ship",
|
||||
"summary": "确认发货(药房直发),运单:JDVE18948527288(auto)",
|
||||
"create_time": 1789005730,
|
||||
"create_time_beijing": "2026-09-10 10:02:10"
|
||||
},
|
||||
{
|
||||
"id": 54095,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 0,
|
||||
"admin_name": "系统",
|
||||
"action": "auto_sign",
|
||||
"summary": "物流签收(运单:JDVE18948527288),订单状态自动更新为「已签收」",
|
||||
"create_time": 1789183814,
|
||||
"create_time_beijing": "2026-09-12 11:30:14"
|
||||
},
|
||||
{
|
||||
"id": 58339,
|
||||
"prescription_order_id": 3751,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "complete",
|
||||
"summary": "订单完成,状态变更为「已完成」,实付金额更新为 ¥1400",
|
||||
"create_time": 1790492528,
|
||||
"create_time_beijing": "2026-09-27 15:02:08"
|
||||
},
|
||||
{
|
||||
"id": 57681,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 284,
|
||||
"admin_name": "晁婷婷",
|
||||
"action": "create",
|
||||
"summary": "创建业务订单",
|
||||
"create_time": 1790220400,
|
||||
"create_time_beijing": "2026-09-24 11:26:40"
|
||||
},
|
||||
{
|
||||
"id": 57792,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "set_ship_mode",
|
||||
"summary": "发货类型:甘草药房 → 洛阳药房",
|
||||
"create_time": 1790237688,
|
||||
"create_time_beijing": "2026-09-24 16:14:48"
|
||||
},
|
||||
{
|
||||
"id": 57793,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "set_ship_mode",
|
||||
"summary": "发货类型:洛阳药房 → 甘草药房",
|
||||
"create_time": 1790237694,
|
||||
"create_time_beijing": "2026-09-24 16:14:54"
|
||||
},
|
||||
{
|
||||
"id": 57798,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "edit",
|
||||
"summary": "编辑了业务订单及相关信息",
|
||||
"create_time": 1790237811,
|
||||
"create_time_beijing": "2026-09-24 16:16:51"
|
||||
},
|
||||
{
|
||||
"id": 57799,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "edit",
|
||||
"summary": "编辑了业务订单及相关信息",
|
||||
"create_time": 1790237815,
|
||||
"create_time_beijing": "2026-09-24 16:16:55"
|
||||
},
|
||||
{
|
||||
"id": 57801,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "药房",
|
||||
"action": "audit_rx_approve",
|
||||
"summary": "处方审核通过",
|
||||
"create_time": 1790237839,
|
||||
"create_time_beijing": "2026-09-24 16:17:19"
|
||||
},
|
||||
{
|
||||
"id": 57802,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "audit_pay_approve",
|
||||
"summary": "支付单审核通过",
|
||||
"create_time": 1790237841,
|
||||
"create_time_beijing": "2026-09-24 16:17:21"
|
||||
},
|
||||
{
|
||||
"id": 57803,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 116,
|
||||
"admin_name": "焦珂",
|
||||
"action": "gancao_submit",
|
||||
"summary": "上传甘草药房成功 G17902378442302734",
|
||||
"create_time": 1790237844,
|
||||
"create_time_beijing": "2026-09-24 16:17:24"
|
||||
},
|
||||
{
|
||||
"id": 57817,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:系统审核通过",
|
||||
"create_time": 1790238558,
|
||||
"create_time_beijing": "2026-09-24 16:29:18"
|
||||
},
|
||||
{
|
||||
"id": 57818,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:派单 | 药房:G郑州调配中心",
|
||||
"create_time": 1790238558,
|
||||
"create_time_beijing": "2026-09-24 16:29:18"
|
||||
},
|
||||
{
|
||||
"id": 57829,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:打印快递 | 药房:G郑州调配中心",
|
||||
"create_time": 1790239757,
|
||||
"create_time_beijing": "2026-09-24 16:49:17"
|
||||
},
|
||||
{
|
||||
"id": 57830,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:审方 | 药房:G郑州调配中心",
|
||||
"create_time": 1790239757,
|
||||
"create_time_beijing": "2026-09-24 16:49:17"
|
||||
},
|
||||
{
|
||||
"id": 57831,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:系统审核通过",
|
||||
"create_time": 1790239757,
|
||||
"create_time_beijing": "2026-09-24 16:49:17"
|
||||
},
|
||||
{
|
||||
"id": 57841,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:煎药调配 | 药房:G郑州调配中心",
|
||||
"create_time": 1790240210,
|
||||
"create_time_beijing": "2026-09-24 16:56:50"
|
||||
},
|
||||
{
|
||||
"id": 57850,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:打粉调配 | 药房:G郑州调配中心",
|
||||
"create_time": 1790240369,
|
||||
"create_time_beijing": "2026-09-24 16:59:29"
|
||||
},
|
||||
{
|
||||
"id": 57852,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:煎药复核 | 药房:G郑州调配中心",
|
||||
"create_time": 1790240405,
|
||||
"create_time_beijing": "2026-09-24 17:00:05"
|
||||
},
|
||||
{
|
||||
"id": 57855,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:打粉复核 | 药房:G郑州调配中心",
|
||||
"create_time": 1790240470,
|
||||
"create_time_beijing": "2026-09-24 17:01:10"
|
||||
},
|
||||
{
|
||||
"id": 57872,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:粗碎 | 药房:G郑州调配中心",
|
||||
"create_time": 1790240996,
|
||||
"create_time_beijing": "2026-09-24 17:09:56"
|
||||
},
|
||||
{
|
||||
"id": 57956,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:浸泡 | 药房:G郑州调配中心",
|
||||
"create_time": 1790242854,
|
||||
"create_time_beijing": "2026-09-24 17:40:54"
|
||||
},
|
||||
{
|
||||
"id": 57977,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:煎药开始 | 药房:G郑州调配中心",
|
||||
"create_time": 1790244547,
|
||||
"create_time_beijing": "2026-09-24 18:09:07"
|
||||
},
|
||||
{
|
||||
"id": 57995,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:煎药结束 | 药房:G郑州调配中心",
|
||||
"create_time": 1790248163,
|
||||
"create_time_beijing": "2026-09-24 19:09:23"
|
||||
},
|
||||
{
|
||||
"id": 58016,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:浓缩开始 | 药房:G郑州调配中心",
|
||||
"create_time": 1790296481,
|
||||
"create_time_beijing": "2026-09-25 08:34:41"
|
||||
},
|
||||
{
|
||||
"id": 58017,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:浓缩结束 | 药房:G郑州调配中心",
|
||||
"create_time": 1790296485,
|
||||
"create_time_beijing": "2026-09-25 08:34:45"
|
||||
},
|
||||
{
|
||||
"id": 58024,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:打粉 | 药房:G郑州调配中心",
|
||||
"create_time": 1790300804,
|
||||
"create_time_beijing": "2026-09-25 09:46:44"
|
||||
},
|
||||
{
|
||||
"id": 58030,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:拌粉开始 | 药房:G郑州调配中心",
|
||||
"create_time": 1790303162,
|
||||
"create_time_beijing": "2026-09-25 10:26:02"
|
||||
},
|
||||
{
|
||||
"id": 58034,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:拌粉 | 药房:G郑州调配中心",
|
||||
"create_time": 1790303789,
|
||||
"create_time_beijing": "2026-09-25 10:36:29"
|
||||
},
|
||||
{
|
||||
"id": 58035,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:制丸 | 药房:G郑州调配中心",
|
||||
"create_time": 1790303810,
|
||||
"create_time_beijing": "2026-09-25 10:36:50"
|
||||
},
|
||||
{
|
||||
"id": 58037,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:抛光 | 药房:G郑州调配中心",
|
||||
"create_time": 1790304415,
|
||||
"create_time_beijing": "2026-09-25 10:46:55"
|
||||
},
|
||||
{
|
||||
"id": 58074,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:烘干完成并过筛 | 药房:G郑州调配中心",
|
||||
"create_time": 1790326640,
|
||||
"create_time_beijing": "2026-09-25 16:57:20"
|
||||
},
|
||||
{
|
||||
"id": 58076,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:发货 | 药房:G郑州调配中心",
|
||||
"create_time": 1790328640,
|
||||
"create_time_beijing": "2026-09-25 17:30:40"
|
||||
},
|
||||
{
|
||||
"id": 58077,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:发货 | 药房:G郑州调配中心",
|
||||
"create_time": 1790328640,
|
||||
"create_time_beijing": "2026-09-25 17:30:40"
|
||||
},
|
||||
{
|
||||
"id": 58084,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889",
|
||||
"create_time": 1790337614,
|
||||
"create_time_beijing": "2026-09-25 20:00:14"
|
||||
},
|
||||
{
|
||||
"id": 58085,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889",
|
||||
"create_time": 1790338204,
|
||||
"create_time_beijing": "2026-09-25 20:10:04"
|
||||
},
|
||||
{
|
||||
"id": 58086,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889",
|
||||
"create_time": 1790338204,
|
||||
"create_time_beijing": "2026-09-25 20:10:04"
|
||||
},
|
||||
{
|
||||
"id": 58087,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:订单药房流转制作中 | 流程:寄出 | 药房:G郑州调配中心",
|
||||
"create_time": 1790338204,
|
||||
"create_time_beijing": "2026-09-25 20:10:04"
|
||||
},
|
||||
{
|
||||
"id": 58182,
|
||||
"prescription_order_id": 4087,
|
||||
"admin_id": 0,
|
||||
"admin_name": "甘草系统",
|
||||
"action": "gancao_callback",
|
||||
"summary": "甘草回调:完成 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889",
|
||||
"create_time": 1790468903,
|
||||
"create_time_beijing": "2026-09-27 08:28:23"
|
||||
},
|
||||
{
|
||||
"id": 64682,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 284,
|
||||
"admin_name": "晁婷婷",
|
||||
"action": "create",
|
||||
"summary": "创建业务订单",
|
||||
"create_time": 1792804896,
|
||||
"create_time_beijing": "2026-10-24 09:21:36"
|
||||
},
|
||||
{
|
||||
"id": 64957,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "李思佳",
|
||||
"action": "set_ship_mode",
|
||||
"summary": "发货类型:甘草药房 → 洛阳药房",
|
||||
"create_time": 1792978377,
|
||||
"create_time_beijing": "2026-10-26 09:32:57"
|
||||
},
|
||||
{
|
||||
"id": 64975,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "李思佳",
|
||||
"action": "edit",
|
||||
"summary": "编辑了业务订单及相关信息",
|
||||
"create_time": 1792980124,
|
||||
"create_time_beijing": "2026-10-26 10:02:04"
|
||||
},
|
||||
{
|
||||
"id": 64976,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "药房",
|
||||
"action": "audit_rx_approve",
|
||||
"summary": "处方审核通过",
|
||||
"create_time": 1792980254,
|
||||
"create_time_beijing": "2026-10-26 10:04:14"
|
||||
},
|
||||
{
|
||||
"id": 64978,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "李思佳",
|
||||
"action": "audit_pay_approve",
|
||||
"summary": "支付单审核通过",
|
||||
"create_time": 1792980256,
|
||||
"create_time_beijing": "2026-10-26 10:04:16"
|
||||
},
|
||||
{
|
||||
"id": 64979,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "李思佳",
|
||||
"action": "ej_pharmacy_submit",
|
||||
"summary": "上传洛阳药房成功 EJ202610261004182FA855",
|
||||
"create_time": 1792980258,
|
||||
"create_time_beijing": "2026-10-26 10:04:18"
|
||||
},
|
||||
{
|
||||
"id": 64981,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 0,
|
||||
"admin_name": "洛阳药房ERP",
|
||||
"action": "ej_pharmacy_callback",
|
||||
"summary": "洛阳药房回传:订单已创建;远端状态:待审核;履约状态:待发货/发货与履约 → 待发货/发货与履约;(版本已处理,保留回传日志)",
|
||||
"create_time": 1792980361,
|
||||
"create_time_beijing": "2026-10-26 10:06:01"
|
||||
},
|
||||
{
|
||||
"id": 65003,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 203,
|
||||
"admin_name": "张卫霞",
|
||||
"action": "ship",
|
||||
"summary": "确认发货(药房直发),运单:JDVE19405836801(auto)",
|
||||
"create_time": 1792983095,
|
||||
"create_time_beijing": "2026-10-26 10:51:35"
|
||||
},
|
||||
{
|
||||
"id": 65616,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 0,
|
||||
"admin_name": "系统",
|
||||
"action": "auto_sign",
|
||||
"summary": "物流签收(运单:JDVE19405836801),订单状态自动更新为「已签收」",
|
||||
"create_time": 1793161807,
|
||||
"create_time_beijing": "2026-10-28 12:30:07"
|
||||
},
|
||||
{
|
||||
"id": 66872,
|
||||
"prescription_order_id": 4583,
|
||||
"admin_id": 119,
|
||||
"admin_name": "李思佳",
|
||||
"action": "complete",
|
||||
"summary": "订单完成,状态变更为「已完成」,实付金额更新为 ¥1800",
|
||||
"create_time": 1793434806,
|
||||
"create_time_beijing": "2026-10-31 16:20:06"
|
||||
}
|
||||
],
|
||||
"pharmacy_callbacks": [
|
||||
{
|
||||
"id": 913,
|
||||
"event_id": "170ed91e-3c32-4fef-841d-ad85ff39f59f",
|
||||
"pharmacy_order_no": "EJ202610261004182FA855",
|
||||
"source_order_no": "PO20261024092136816172",
|
||||
"event_type": "ORDER_CREATED",
|
||||
"status_version": 1,
|
||||
"process_status": "PROCESSED",
|
||||
"processed_time": 1792980361,
|
||||
"error_message": "",
|
||||
"create_time": 1792980361,
|
||||
"update_time": 1792980361,
|
||||
"processed_time_beijing": "2026-10-26 10:06:01",
|
||||
"create_time_beijing": "2026-10-26 10:06:01",
|
||||
"update_time_beijing": "2026-10-26 10:06:01",
|
||||
"payload_selected_fields": {
|
||||
"status": "PENDING_REVIEW",
|
||||
"event_id": "170ed91e-3c32-4fef-841d-ad85ff39f59f",
|
||||
"event_type": "ORDER_CREATED",
|
||||
"occurred_at": "2026-10-26T10:04:18+08:00",
|
||||
"review_status": "PENDING",
|
||||
"source_system": "zyt",
|
||||
"status_version": 1,
|
||||
"express_company": "",
|
||||
"source_order_no": "PO20261024092136816172",
|
||||
"source_revision": 1,
|
||||
"tracking_number": "",
|
||||
"pharmacy_order_no": "EJ202610261004182FA855"
|
||||
}
|
||||
}
|
||||
],
|
||||
"operation_logs": [],
|
||||
"prescription_ai_events": [
|
||||
{
|
||||
"id": 2952,
|
||||
"prescription_id": 10615,
|
||||
"prescription_revision": 1,
|
||||
"doctor_id": 28,
|
||||
"actor_id": 28,
|
||||
"trigger_type": "source_update",
|
||||
"reason": "患者资料或问诊转写已更新",
|
||||
"status": "partial",
|
||||
"validity": "source_updated",
|
||||
"created_at": 1792028463,
|
||||
"updated_at": 1792115017,
|
||||
"created_at_beijing": "2026-10-15 09:41:03",
|
||||
"updated_at_beijing": "2026-10-16 09:43:37"
|
||||
},
|
||||
{
|
||||
"id": 3265,
|
||||
"prescription_id": 10615,
|
||||
"prescription_revision": 1,
|
||||
"doctor_id": 28,
|
||||
"actor_id": 28,
|
||||
"trigger_type": "source_update",
|
||||
"reason": "患者资料或问诊转写已更新",
|
||||
"status": "partial",
|
||||
"validity": "current",
|
||||
"created_at": 1792204634,
|
||||
"updated_at": 1792206221,
|
||||
"created_at_beijing": "2026-10-17 10:37:14",
|
||||
"updated_at_beijing": "2026-10-17 11:03:41"
|
||||
}
|
||||
],
|
||||
"staff_current": [
|
||||
{
|
||||
"id": 12,
|
||||
"name": "霍桢毅",
|
||||
"roles": "医生"
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"name": "赵俊霞",
|
||||
"roles": "医生"
|
||||
},
|
||||
{
|
||||
"id": 116,
|
||||
"name": "药房1",
|
||||
"roles": "排班、下单"
|
||||
},
|
||||
{
|
||||
"id": 119,
|
||||
"name": "药房",
|
||||
"roles": "下单"
|
||||
},
|
||||
{
|
||||
"id": 203,
|
||||
"name": "张卫霞",
|
||||
"roles": "药房"
|
||||
},
|
||||
{
|
||||
"id": 204,
|
||||
"name": "徐云云",
|
||||
"roles": "药房"
|
||||
},
|
||||
{
|
||||
"id": 279,
|
||||
"name": "董肖妍",
|
||||
"roles": "医助"
|
||||
},
|
||||
{
|
||||
"id": 284,
|
||||
"name": "晁婷婷",
|
||||
"roles": "医助"
|
||||
}
|
||||
],
|
||||
"operation_log_coverage": {
|
||||
"total": 179,
|
||||
"earliest_time": 1781149993,
|
||||
"latest_time": 1791674406,
|
||||
"earliest_time_beijing": "2026-06-11 11:53:13",
|
||||
"latest_time_beijing": "2026-10-11 07:20:06"
|
||||
},
|
||||
"source_freshness_indicator": {
|
||||
"latest_order_create_time": 1794884824,
|
||||
"latest_order_create_time_beijing": "2026-11-17 11:07:04"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
三个处方业务订单:开方记录与药房操作日志
|
||||
导出时间:2026-11-18T16:50:09+08:00
|
||||
|
||||
来源:项目 server/.env 指向的本机 MySQL 数据库 zyt(127.0.0.1:3306)。未核实与生产库同步情况;本报告仅证明当前查询库中保存的记录。
|
||||
所有展示时间均为北京时间 UTC+08:00;JSON 同时保留 Unix 原始时间戳。查询使用只读事务,未修改业务数据。
|
||||
开方栏取自处方主记录 doctor_name、creator_id、create_time;它是当前处方记录,并非独立的开方保存、修改操作流水。
|
||||
审方日志原始 admin_name 三笔均为“药房”。本报告另列同一账号 ID 对应的处方 audit_by_name,以及同单相邻操作日志署名,保留来源差异。
|
||||
账号 116 当前名为“药房1”,账号 119 当前名为“药房”;当前角色为下单等。焦珂、李思佳为审核字段/历史日志署名,不据此认定实名登录人或执业资质。
|
||||
当前代码 server/app/adminapi/event.php 的 HttpEnd 监听器为空,关闭了通用后台操作日志写入;这不能证明历史所有时段均关闭。
|
||||
药房回调的日志时间为本系统落库时间;如载荷提供 occurred_at,则在回传明细中另列原值。
|
||||
未检索到关联这三个订单/处方的通用后台请求日志,不能提供完整的逐次开方、修改请求历史。
|
||||
|
||||
当前库订单表最新创建时间:2026-11-17 11:07:04(仅供判断数据范围,不代表同步时间)
|
||||
订单操作日志共 54 条;匹配后台请求日志 0 条;AI 触发记录 2 条;洛阳药房原始回传 1 条。
|
||||
|
||||
========================================================================================
|
||||
PO20261024092136816172
|
||||
患者:雷柏生;诊单 ID:12167;业务订单 ID:4583
|
||||
处方:RX202610233553(ID 11945);类型:浓缩水丸;名称:系统代开
|
||||
处方记录医生:霍桢毅(creator_id=12);创建时间:2026-10-23 17:37:58;处方日期:2026-10-23
|
||||
业务订单创建人:晁婷婷(ID 284);创建时间:2026-10-24 09:21:36
|
||||
金额:1800.00;已付:1800.00;状态:已完成
|
||||
处方审核字段:李思佳(账号 ID 119);2026-10-26 10:04:14;audit_status=1;业务订单处方审核通过
|
||||
发货方式:direct;甘草订单:无;洛阳药房订单:EJ202610261004182FA855
|
||||
|
||||
审方/撤审/人工补记日志(1 条)
|
||||
2026-10-26 10:04:14 | 日志 64976 | 原始署名 药房 / 账号 119 | audit_rx_approve | 处方审核通过
|
||||
|
||||
完整订单操作流水(10 条,按时间、日志 ID 升序)
|
||||
2026-10-24 09:21:36 | 日志 64682 | 晁婷婷 / 账号 284 | create | 创建业务订单
|
||||
2026-10-26 09:32:57 | 日志 64957 | 李思佳 / 账号 119 | set_ship_mode | 发货类型:甘草药房 → 洛阳药房
|
||||
2026-10-26 10:02:04 | 日志 64975 | 李思佳 / 账号 119 | edit | 编辑了业务订单及相关信息
|
||||
2026-10-26 10:04:14 | 日志 64976 | 药房 / 账号 119 | audit_rx_approve | 处方审核通过
|
||||
2026-10-26 10:04:16 | 日志 64978 | 李思佳 / 账号 119 | audit_pay_approve | 支付单审核通过
|
||||
2026-10-26 10:04:18 | 日志 64979 | 李思佳 / 账号 119 | ej_pharmacy_submit | 上传洛阳药房成功 EJ202610261004182FA855
|
||||
2026-10-26 10:06:01 | 日志 64981 | 洛阳药房ERP / 账号 0 | ej_pharmacy_callback | 洛阳药房回传:订单已创建;远端状态:待审核;履约状态:待发货/发货与履约 → 待发货/发货与履约;(版本已处理,保留回传日志)
|
||||
2026-10-26 10:51:35 | 日志 65003 | 张卫霞 / 账号 203 | ship | 确认发货(药房直发),运单:JDVE19405836801(auto)
|
||||
2026-10-28 12:30:07 | 日志 65616 | 系统 / 账号 0 | auto_sign | 物流签收(运单:JDVE19405836801),订单状态自动更新为「已签收」
|
||||
2026-10-31 16:20:06 | 日志 66872 | 李思佳 / 账号 119 | complete | 订单完成,状态变更为「已完成」,实付金额更新为 ¥1800
|
||||
|
||||
========================================================================================
|
||||
PO20260924112640923356
|
||||
患者:雷柏生;诊单 ID:12167;业务订单 ID:4087
|
||||
处方:RX202609238774(ID 10615);类型:浓缩水丸;名称:系统代开
|
||||
处方记录医生:赵俊霞(creator_id=28);创建时间:2026-09-23 17:37:35;处方日期:2026-09-23
|
||||
业务订单创建人:晁婷婷(ID 284);创建时间:2026-09-24 11:26:40
|
||||
金额:1800.00;已付:0.00;状态:已完成
|
||||
处方审核字段:焦珂(账号 ID 116);2026-09-24 16:17:19;audit_status=1;业务订单处方审核通过
|
||||
发货方式:gancao;甘草订单:G17902378442302734;洛阳药房订单:无
|
||||
|
||||
审方/撤审/人工补记日志(1 条)
|
||||
2026-09-24 16:17:19 | 日志 57801 | 原始署名 药房 / 账号 116 | audit_rx_approve | 处方审核通过
|
||||
|
||||
完整订单操作流水(36 条,按时间、日志 ID 升序)
|
||||
2026-09-24 11:26:40 | 日志 57681 | 晁婷婷 / 账号 284 | create | 创建业务订单
|
||||
2026-09-24 16:14:48 | 日志 57792 | 焦珂 / 账号 116 | set_ship_mode | 发货类型:甘草药房 → 洛阳药房
|
||||
2026-09-24 16:14:54 | 日志 57793 | 焦珂 / 账号 116 | set_ship_mode | 发货类型:洛阳药房 → 甘草药房
|
||||
2026-09-24 16:16:51 | 日志 57798 | 焦珂 / 账号 116 | edit | 编辑了业务订单及相关信息
|
||||
2026-09-24 16:16:55 | 日志 57799 | 焦珂 / 账号 116 | edit | 编辑了业务订单及相关信息
|
||||
2026-09-24 16:17:19 | 日志 57801 | 药房 / 账号 116 | audit_rx_approve | 处方审核通过
|
||||
2026-09-24 16:17:21 | 日志 57802 | 焦珂 / 账号 116 | audit_pay_approve | 支付单审核通过
|
||||
2026-09-24 16:17:24 | 日志 57803 | 焦珂 / 账号 116 | gancao_submit | 上传甘草药房成功 G17902378442302734
|
||||
2026-09-24 16:29:18 | 日志 57817 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:系统审核通过
|
||||
2026-09-24 16:29:18 | 日志 57818 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:派单 | 药房:G郑州调配中心
|
||||
2026-09-24 16:49:17 | 日志 57829 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:打印快递 | 药房:G郑州调配中心
|
||||
2026-09-24 16:49:17 | 日志 57830 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:审方 | 药房:G郑州调配中心
|
||||
2026-09-24 16:49:17 | 日志 57831 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:系统审核通过
|
||||
2026-09-24 16:56:50 | 日志 57841 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:煎药调配 | 药房:G郑州调配中心
|
||||
2026-09-24 16:59:29 | 日志 57850 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:打粉调配 | 药房:G郑州调配中心
|
||||
2026-09-24 17:00:05 | 日志 57852 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:煎药复核 | 药房:G郑州调配中心
|
||||
2026-09-24 17:01:10 | 日志 57855 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:打粉复核 | 药房:G郑州调配中心
|
||||
2026-09-24 17:09:56 | 日志 57872 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:粗碎 | 药房:G郑州调配中心
|
||||
2026-09-24 17:40:54 | 日志 57956 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:浸泡 | 药房:G郑州调配中心
|
||||
2026-09-24 18:09:07 | 日志 57977 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:煎药开始 | 药房:G郑州调配中心
|
||||
2026-09-24 19:09:23 | 日志 57995 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:煎药结束 | 药房:G郑州调配中心
|
||||
2026-09-25 08:34:41 | 日志 58016 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:浓缩开始 | 药房:G郑州调配中心
|
||||
2026-09-25 08:34:45 | 日志 58017 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:浓缩结束 | 药房:G郑州调配中心
|
||||
2026-09-25 09:46:44 | 日志 58024 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:打粉 | 药房:G郑州调配中心
|
||||
2026-09-25 10:26:02 | 日志 58030 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:拌粉开始 | 药房:G郑州调配中心
|
||||
2026-09-25 10:36:29 | 日志 58034 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:拌粉 | 药房:G郑州调配中心
|
||||
2026-09-25 10:36:50 | 日志 58035 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:制丸 | 药房:G郑州调配中心
|
||||
2026-09-25 10:46:55 | 日志 58037 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:抛光 | 药房:G郑州调配中心
|
||||
2026-09-25 16:57:20 | 日志 58074 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:烘干完成并过筛 | 药房:G郑州调配中心
|
||||
2026-09-25 17:30:40 | 日志 58076 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:发货 | 药房:G郑州调配中心
|
||||
2026-09-25 17:30:40 | 日志 58077 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:发货 | 药房:G郑州调配中心
|
||||
2026-09-25 20:00:14 | 日志 58084 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889
|
||||
2026-09-25 20:10:04 | 日志 58085 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889
|
||||
2026-09-25 20:10:04 | 日志 58086 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:物流中 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889
|
||||
2026-09-25 20:10:04 | 日志 58087 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:订单药房流转制作中 | 流程:寄出 | 药房:G郑州调配中心
|
||||
2026-09-27 08:28:23 | 日志 58182 | 甘草系统 / 账号 0 | gancao_callback | 甘草回调:完成 | 药房:G郑州调配中心 | 物流:shunfeng | 单号:SF5155771371889
|
||||
|
||||
========================================================================================
|
||||
PO20260908142548426588
|
||||
患者:雷柏生;诊单 ID:12167;业务订单 ID:3751
|
||||
处方:RX202609078921(ID 9787);类型:浓缩水丸;名称:系统代开
|
||||
处方记录医生:赵俊霞(creator_id=28);创建时间:2026-09-07 17:42:46;处方日期:2026-09-07
|
||||
业务订单创建人:董肖妍(ID 279);创建时间:2026-09-08 14:25:48
|
||||
金额:1400.00;已付:1400.00;状态:已完成
|
||||
处方审核字段:焦珂(账号 ID 116);2026-09-09 11:48:48;audit_status=1;业务订单处方审核通过
|
||||
发货方式:direct;甘草订单:无;洛阳药房订单:无
|
||||
|
||||
审方/撤审/人工补记日志(1 条)
|
||||
2026-09-09 11:48:48 | 日志 53014 | 原始署名 药房 / 账号 116 | audit_rx_approve | 处方审核通过
|
||||
|
||||
完整订单操作流水(8 条,按时间、日志 ID 升序)
|
||||
2026-09-08 14:25:48 | 日志 52702 | 董肖妍 / 账号 279 | create | 创建业务订单
|
||||
2026-09-09 10:58:36 | 日志 52953 | 焦珂 / 账号 116 | set_ship_mode | 发货类型:甘草药房 → 洛阳药房
|
||||
2026-09-09 11:46:56 | 日志 53013 | 焦珂 / 账号 116 | edit | 编辑了业务订单及相关信息
|
||||
2026-09-09 11:48:48 | 日志 53014 | 药房 / 账号 116 | audit_rx_approve | 处方审核通过
|
||||
2026-09-09 11:48:51 | 日志 53015 | 焦珂 / 账号 116 | audit_pay_approve | 支付单审核通过
|
||||
2026-09-10 10:02:10 | 日志 53255 | 徐云云 / 账号 204 | ship | 确认发货(药房直发),运单:JDVE18948527288(auto)
|
||||
2026-09-12 11:30:14 | 日志 54095 | 系统 / 账号 0 | auto_sign | 物流签收(运单:JDVE18948527288),订单状态自动更新为「已签收」
|
||||
2026-09-27 15:02:08 | 日志 58339 | 焦珂 / 账号 116 | complete | 订单完成,状态变更为「已完成」,实付金额更新为 ¥1400
|
||||
|
||||
========================================================================================
|
||||
洛阳药房回传明细
|
||||
[
|
||||
{
|
||||
"id": 913,
|
||||
"event_id": "170ed91e-3c32-4fef-841d-ad85ff39f59f",
|
||||
"pharmacy_order_no": "EJ202610261004182FA855",
|
||||
"source_order_no": "PO20261024092136816172",
|
||||
"event_type": "ORDER_CREATED",
|
||||
"status_version": 1,
|
||||
"process_status": "PROCESSED",
|
||||
"processed_time": 1792980361,
|
||||
"error_message": "",
|
||||
"create_time": 1792980361,
|
||||
"update_time": 1792980361,
|
||||
"processed_time_beijing": "2026-10-26 10:06:01",
|
||||
"create_time_beijing": "2026-10-26 10:06:01",
|
||||
"update_time_beijing": "2026-10-26 10:06:01",
|
||||
"payload_selected_fields": {
|
||||
"status": "PENDING_REVIEW",
|
||||
"event_id": "170ed91e-3c32-4fef-841d-ad85ff39f59f",
|
||||
"event_type": "ORDER_CREATED",
|
||||
"occurred_at": "2026-10-26T10:04:18+08:00",
|
||||
"review_status": "PENDING",
|
||||
"source_system": "zyt",
|
||||
"status_version": 1,
|
||||
"express_company": "",
|
||||
"source_order_no": "PO20261024092136816172",
|
||||
"source_revision": 1,
|
||||
"tracking_number": "",
|
||||
"pharmacy_order_no": "EJ202610261004182FA855"
|
||||
}
|
||||
}
|
||||
]
|
||||
关联开方/修改后台请求日志
|
||||
[]
|
||||
关联 AI 分析触发元数据(不等同开方日志)
|
||||
[
|
||||
{
|
||||
"id": 2952,
|
||||
"prescription_id": 10615,
|
||||
"prescription_revision": 1,
|
||||
"doctor_id": 28,
|
||||
"actor_id": 28,
|
||||
"trigger_type": "source_update",
|
||||
"reason": "患者资料或问诊转写已更新",
|
||||
"status": "partial",
|
||||
"validity": "source_updated",
|
||||
"created_at": 1792028463,
|
||||
"updated_at": 1792115017,
|
||||
"created_at_beijing": "2026-10-15 09:41:03",
|
||||
"updated_at_beijing": "2026-10-16 09:43:37"
|
||||
},
|
||||
{
|
||||
"id": 3265,
|
||||
"prescription_id": 10615,
|
||||
"prescription_revision": 1,
|
||||
"doctor_id": 28,
|
||||
"actor_id": 28,
|
||||
"trigger_type": "source_update",
|
||||
"reason": "患者资料或问诊转写已更新",
|
||||
"status": "partial",
|
||||
"validity": "current",
|
||||
"created_at": 1792204634,
|
||||
"updated_at": 1792206221,
|
||||
"created_at_beijing": "2026-10-17 10:37:14",
|
||||
"updated_at_beijing": "2026-10-17 11:03:41"
|
||||
}
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user