{
  "openapi": "3.0.3",
  "info": {"title": "国信PC端补贴钱包流水查询", "version": "1.0.0", "description": "guoxin_develop专用，只读业务表；异步导出沿用export_log和ExportMealOrder(type103)。不修改资金业务。"},
  "tags": [{"name": "PC端/账户管理/流水查询"}],
  "security": [{"token": []}],
  "paths": {
    "/p/walletFlow/list": {"post": {"tags": ["PC端/账户管理/流水查询"], "summary": "补贴逐笔流水、同条件合计", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/Filters"}}}}, "responses": {"200": {"description": "code=0时data含data数组、total、current_page、per_page、summary(total_inflow,total_outflow,net_change)，金额为两位小数字符串；code=1为登录/权限/参数错误。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}}}}}}},
    "/p/walletFlow/departments": {"post": {"tags": ["PC端/账户管理/流水查询"], "summary": "实时权限内当前部门树", "responses": {"200": {"description": "code=0,data为uuid/puuid/name/children树；无部门权限空数组。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}}}}}}},
    "/p/walletFlow/export": {"post": {"tags": ["PC端/账户管理/流水查询"], "summary": "提交补贴流水异步XLSX", "description": "条件同列表，忽略分页。冻结最大流水ID及服务端权限范围；执行时复验当前账号/菜单/部门，范围只可收窄。相同条件任务按现有hash_key去重。", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/Filters"}}}}, "responses": {"200": {"description": "code=0已提交，后续从导出日志下载；code=1参数或权限失败。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}}}}}}},
    "/p/walletFlow/exportLogs": {"post": {"tags": ["PC端/账户管理/流水查询"], "summary": "仅本人补贴流水导出日志", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"type": "object", "properties": {"page": {"type": "integer", "minimum": 1, "default": 1}, "page_size": {"type": "integer", "minimum": 1, "maximum": 100, "default": 10}}}}}}, "responses": {"200": {"description": "code=0,data为分页；行包含id/operator/operate_time/file_name/status/status_text/url。status:0排队,4处理,1完成,5失败。所有新端点实时校验账号启用、有效期和菜单。", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Envelope"}}}}}}}
  },
  "components": {
    "securitySchemes": {"token": {"type": "apiKey", "in": "header", "name": "token"}},
    "schemas": {
      "Filters": {"type": "object", "additionalProperties": false, "properties": {
        "start_date": {"type": "string", "description": "YYYY-MM-DD，与end_date同时填写/清空；流水发生日期"},
        "end_date": {"type": "string", "description": "含当日全天"},
        "department_uuid": {"type": "string", "description": "真实当前部门UUID逗号分隔；含子部门，与账号权限相交；空表示权限内全部"},
        "direction": {"type": "string", "enum": ["", "in", "out"]},
        "change_type": {"type": "string", "enum": ["", "grant", "deduct", "adjust", "consume", "refund", "expire"]},
        "source_channel": {"type": "string", "enum": ["", "manual", "import", "rule", "bind", "machine", "online", "third", "dining", "store", "gate", "terminal", "refund", "expire", "unknown"]},
        "recharge_method": {"type": "string", "enum": ["", "0", "1", "2"], "description": "0历史未标注/1现金/2单位补贴，仅补贴批次标记；消费退款未归属，不混为历史未标注"},
        "keyword": {"type": "string", "maxLength": 100, "description": "姓名、业务单号、流水号任一字段包含匹配"},
        "page": {"type": "integer", "minimum": 1, "default": 1},
        "page_size": {"type": "integer", "minimum": 1, "maximum": 100, "default": 15}
      }},
      "Flow": {"type": "object", "properties": {
        "flow_no": {"type": "string"}, "occur_time": {"type": "string"}, "name": {"type": "string"}, "current_department": {"type": "string"},
        "change_type": {"type": "string"}, "direction": {"type": "string"}, "change_amount": {"type": "string"},
        "balance_after": {"type": "string", "description": "系统记录值或--；无balance_before，不反推"},
        "business_no": {"type": "string"}, "source_channel": {"type": "string"}, "recharge_method_text": {"type": "string"},
        "operator_name": {"type": "string"}, "remark": {"type": "string"}
      }},
      "Envelope": {"type": "object", "properties": {"code": {"type": "integer", "enum": [0, 1]}, "message": {"type": "string"}, "data": {"description": "按端点返回分页、树或空数组"}}}
    }
  }
}
