feat(osi): 某人全部体检查询 JKTJ00002(T-306)
- osi.QueryHealthChecks(/auto/jktj/query,返回全部体检数组) - contract.HealthCheckRecordSummary:驼峰 idCard(≠最近一次小写 idcard)、checkId 可空 - HTTP 端点 GET /api/health-check/all - 单测含 null checkId 场景;实测端点已部署 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,27 @@ func (h *HealthCheckHandler) Last(w http.ResponseWriter, r *http.Request) {
|
||||
writeRawOrError(w, result, err)
|
||||
}
|
||||
|
||||
// All 处理 GET /api/health-check/all?idCard=..|phrid=..|empiId=..
|
||||
// 返回某人全部体检(JKTJ00002 数组)的平台完整响应;历史记录 checkId 可能为空。
|
||||
func (h *HealthCheckHandler) All(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
writeJSONError(w, http.StatusMethodNotAllowed, "only GET is supported")
|
||||
return
|
||||
}
|
||||
q := r.URL.Query()
|
||||
query := osi.FindHealthCheckQuery{
|
||||
IDCard: q.Get("idCard"),
|
||||
PHRID: q.Get("phrid"),
|
||||
EMPIID: q.Get("empiId"),
|
||||
}
|
||||
if query.IDCard == "" && query.PHRID == "" && query.EMPIID == "" {
|
||||
writeJSONError(w, http.StatusBadRequest, "provide one of: idCard, phrid, empiId")
|
||||
return
|
||||
}
|
||||
_, result, err := h.client.QueryHealthChecks(r.Context(), query)
|
||||
writeRawOrError(w, result, err)
|
||||
}
|
||||
|
||||
// List 处理 GET /api/health-check/list?checkYear=..&idCard=..&checkType=..&page=..&rows=..
|
||||
// 返回某年度已检/未检人员名单的平台完整响应(名单,非体检明细,见 docs/04 §11.4)。
|
||||
func (h *HealthCheckHandler) List(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user