{"id":28729746,"url":"https://github.com/didi/ddes-openapi-sdk-java","last_synced_at":"2026-01-23T06:01:48.364Z","repository":{"id":298655156,"uuid":"996030704","full_name":"didi/ddes-openapi-sdk-java","owner":"didi","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-08T03:46:40.000Z","size":433,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-08T03:47:01.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/didi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-04T11:03:06.000Z","updated_at":"2025-08-08T03:46:43.000Z","dependencies_parsed_at":"2025-06-12T07:32:12.741Z","dependency_job_id":"34ea759a-e611-4b55-9e0e-634c15dbcd48","html_url":"https://github.com/didi/ddes-openapi-sdk-java","commit_stats":null,"previous_names":["didi/ddes-openapi-sdk-java"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/didi/ddes-openapi-sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2Fddes-openapi-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2Fddes-openapi-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2Fddes-openapi-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2Fddes-openapi-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/didi","download_url":"https://codeload.github.com/didi/ddes-openapi-sdk-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2Fddes-openapi-sdk-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-15T17:10:49.940Z","updated_at":"2026-01-23T06:01:48.340Z","avatar_url":"https://github.com/didi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 滴滴企业级开放接口SDK[`Java版本`]\n\n## 概述\n\n---\n\n- 滴滴企业级开发接口SDK，便捷调用开放平台API,目前包括以下服务：\n    - 接口认证[auth]\n    - 审批 [行前(approval)、行后(afterapproval)、外部(outapproval)]\n    - 账单 [bill]\n    - 成本中心 [budgetcenter]\n    - 城市信息 [city]\n    - 扩展信息 [extend]\n    - 公司主体 [legalentity]\n    - 单点登录 [login]\n    - 用户信息 [member]\n    - 订单 [order]\n    - 职级 [rank]\n    - 制度 [regulation]\n    - 角色 [role]\n    - 外部人员 [traveler]\n    - 工作地点 [workplace]\n      具体可以访问 [管理API对接文档（2024版）](https://opendocs.xiaojukeji.com/version2024) 查看。\n\n## 运行环境\n\n---\n\n- JDK 1.8\n\n## 安装方法\n\n---\n\n### 1、Maven 仓库\n\n```xml\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.xiaoju.sdk\u003c/groupId\u003e\n  \u003cartifactId\u003eddes-open-sdk\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n  \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### 2、手动下载\n\n- 1、下载最新的源码\n- 2、使用Maven命令打包：`mvn clean install`\n- 3、将生成的jar包引入到项目中\n\n---\n\n## 快速使用\n\n### 流程概述\n\n调用API的流程如下：\n\n1. 创建应用\n2. 获取访问凭证\n3. 设置IP白名单 [前3步参考：[接入前必读](https://opendocs.xiaojukeji.com/version2024/10957)]\n4. 调用API\n\n---\n\n### SDK配置参数说明(`com.xiaoju.open.sdk.didies.core.Config`)\n\n| 配置项                         | 配置方式                                   | 描述                                                       |\n|-----------------------------|----------------------------------------|----------------------------------------------------------|\n| `clientId`                  | 必填                                     | 客户端 ID，用于身份认证。                                           |\n| `clientSecret`              | 必填                                     | 客户端密钥，用于身份认证。                                            |\n| `signKey`                   | 必填                                     | 签名密钥，用于请求签名。                                             |\n| `baseUrl`                   | 可选，默认值：`https://api.es.xiaojukeji.com` | 接口请求的基础 URL。                                             |\n| `grantType`                 | 可选，默认值：`client_credentials`            | OAuth 认证的授权类型，默认使用客户端凭证模式。                               |\n| `unauthorizedRetryTimes`    | 可选，默认值：`2`                             | 因 Token 失效导致接口请求失败时的重试次数。                                |\n| `unauthorizedRetryInterval` | 可选，默认值：`1000`（毫秒）                      | Token 失效重试的时间间隔，默认1秒。                                    |\n| `httpTransport`             | 可选，默认自动创建 `RestHttpTransport` 实例       | 自定义 HTTP 请求实现类，需实现 `IHttpTransport` 接口。未设置时使用默认实现。       |\n| `signMethod`                | 可选，默认值：`MD5`                           | 签名方法，可选枚举值（如 `MD5`、`SHA256`，默认MD5）。                      |\n| `enableHoldToken`           | 可选，默认值：`true`                          | 是否开启自动获取并持有 Token（如未开启，需用自己管理token在每个接口中设置，推荐开启）。        |\n| `enableRequestLog`          | 可选                                     | 是否开启请求日志打印。需配合 `logLevel` 使用。                            |\n| `logLevel`                  | 可选                                     | 请求日志的打印级别（需开启 `enableRequestLog`），可选枚举如 `DEBUG`、`INFO` 。 |\n| `enableAES`                 | 可选，默认值：`false`                         | 是否启用 AES 加密（此加密为整体加密，开启整体加密时人员信息不需要额外加密）。                |\n| `aesKey`                    | 条件必填（当 `enableAES` 为 `true` 时需设置）      | AES 加密使用的密钥。                                             |\n| `encryptType`               | 可选，默认值：`NORMAL`                        | 加密类型。默认不加密（`NORMAL`），启用 AES 时可选择 `AES128` 或 `AES256` 。   |\n| `connectTimeout`            | 可选，默认值：`3000`（毫秒）                      | 网络连接超时时间（单位由 `timeoutUnit` 决定）。                          |\n| `callTimeOut`               | 可选，默认值：`3000`（毫秒）                      | 接口调用超时时间（单位由 `timeoutUnit` 决定）。                          |\n| `timeoutUnit`               | 可选，默认值：`MILLISECONDS`                  | 超时时间单位（如 `MILLISECONDS`、`SECONDS` 等）。                    |\n\n--- \n说明：\n\n1. 必填项：`clientId`、`clientSecret`、`signKey` 必须通过代码手动设置（如 `setClientId(\"your-id\")`）。\n2. 条件必填：`aesKey` 仅在启用 AES 加密（`enableAES=true`）时需设置。\n3. 默认行为：  \n   • `httpTransport` 未设置时，自动使用 `RestHttpTransport` 实现类。\n\n   • 接口整体加密默认关闭（`enableAES=false`），签名方法默认使用 `MD5`。\n\n4. 超时配置：`connectTimeout` 和 `callTimeOut` 的单位由 `timeoutUnit` 统一控制，默认毫秒。\n5. 依赖关系：  \n   • `logLevel` 仅在 `enableRequestLog=true` 时生效。\n\n   • `encryptType` 的具体值需根据 `EncryptTypeEnum` 枚举定义选择（如 `NORMAL` 表示不加密）。\n\n--- \n\n### 使用示例\n\n1、以查询公司主体为例,更多示例请参考：`sample`module\n\n```java\n\npublic class Test {\n\n  public static void main(String[] args) {\n    Config config = Config.builder()\n        .clientId(\"your_client_id\")\n        .clientSecret(\"your_client_secret\")\n        .signKey(\"your_sign_key\")\n        .signMethod(SignMethodEnum.MD5) // 默认使用MD5签名，可选SHA256签名，具体和对接人确认\n        .build();\n\n    ApiClient client = new ApiClient(config);\n    getLegalEntityTest(client);\n  }\n\n  /**\n   * 公司主体查询\n   * \u003cp\u003e\n   * 说明： * 查询公司在滴滴侧的具体信息; * 通过获取的信息用于确认相关的配置信息，可以用于同步滴滴ES后台的信息; * 只返回有效的公司信息。不包含禁用和过期的公司主体信息。需要返回全部的，是不是需要重新封接口。\n   */\n  public static void getLegalEntityTest(ApiClient client) throws Exception {\n    GetLegalEntityRequest request = GetLegalEntityRequest.builder()\n        .companyId(\"替换成自己的companyId\")\n        .legalEntityId(\"xxx\")\n        .build();\n\n    GetLegalEntityApiReply response = client.legalentity().v1().getLegalEntity(request);\n    if (response != null) {\n      System.out.println(JacksonUtils.toJson(response));\n    }\n    System.out.println(\"getAdjustBillDataResultTest end\");\n  }\n}\n```\n\n2、使用整体加密\n\n```java\n\npublic class EncryptTest {\n\n  public static void main(String[] args) {\n    Config config = Config.builder()\n        .clientId(\"your_client_id\")\n        .clientSecret(\"your_client_secret\")\n        .signKey(\"your_sign_key\")\n        .enableAES(true) // 启用整体加密[默认为false]\n        .aesKey(\"your_aes_key\") // 设置AES密钥[enableAES为false的时候，该值无效]\n        .encryptType(EncryptTypeEnum.AES128) // 设置加密方式[enableAES为false的时候，该值无效]\n        .build();\n\n    ApiClient client = new ApiClient(config);\n    // 接口的调用不需要任何额外的操作，SDK会自动处理加密和解密\n    getLegalEntityTest(client);\n  }\n\n  /**\n   * 公司主体查询\n   * \u003cp\u003e\n   * 说明： * 查询公司在滴滴侧的具体信息; * 通过获取的信息用于确认相关的配置信息，可以用于同步滴滴ES后台的信息; * 只返回有效的公司信息。不包含禁用和过期的公司主体信息。需要返回全部的，是不是需要重新封接口。\n   */\n  public static void getLegalEntityTest(ApiClient client) throws Exception {\n    GetLegalEntityRequest request = GetLegalEntityRequest.builder()\n        .companyId(\"替换成自己的companyId\")\n        .legalEntityId(\"xxx\")\n        .build();\n\n    GetLegalEntityApiReply response = client.legalentity().v1().getLegalEntity(request);\n    if (response != null) {\n      System.out.println(JacksonUtils.toJson(response));\n    }\n    System.out.println(\"getAdjustBillDataResultTest end\");\n  }\n}\n```\n\n3、更多示例\n\n| 示例模块   | 示例代码路径                          | 包含接口                 | 接口地址                                          |\n|--------|---------------------------------|----------------------|-----------------------------------------------|\n| 接口认证   | sample/AuthSample.java          | 接口认证(获取access_token) | /river/Auth/authorize                         |\n| 行后授权   | sample/AfterapprovalSample.java | 行后审批结果同步             | /river/AfterApproval/createPersonalReceipt    |\n|        |                                 | 行后审批完订单查询个人付款单       | /river/AfterApproval/getPersonalReceiptOrder  |\n| 审批对接   | sample/ApprovalSample.java      | 创建申请单(已按业务拆分)        | /river/Approval/create                        |\n|        |                                 | 修改申请单(已按业务拆分)        | /river/Approval/update                        |\n|        |                                 | 取消申请单                | /river/Approval/cancel                        |\n|        |                                 | 查询审批单列表              | /river/Approval/getOrder                      |\n|        |                                 | 查询申请单详情              | /open-apis/v1/approval/detail                 |\n|        |                                 | 外部审批处理               | /river/Approval/pass                          |\n| 外部审批处理 | sample/OutapprovalSample.java   | 外部通知审批单状态变更          | /river/OutApproval/Status                     |\n| 财税信息   | sample/BillSample.java          | 账单列表                 | /river/Bill/get                               |\n|        |                                 | 已出账单(已按业务类型拆分)       | /river/Bill/detail                            |\n|        |                                 | 未出账单(已按业务类型拆分)       | /river/Bill/getNotGeneratedBillDetail         |\n|        |                                 | 网约车，出租车交易明细          | /river/Bill/transactionDetail                 |\n|        |                                 | 账单汇总查询-商旅、网约车、出租车    | /river/Bill/summary                           |\n|        |                                 | 网约车、商旅账单树查询          | /river/Bill/getBillStructure                  |\n|        |                                 | 商旅、网约车账单确认           | /river/Bill/confirm                           |\n|        |                                 | 调账提交                 | /river/Bill/adjustBillData                    |\n|        |                                 | 调账结果查询               | /river/Bill/queryAdjustBillDataResult         |\n| 部门或项目  | sample/BudgetcenterSample.java  | 部门或项目查询              | /river/BudgetCenter/get                       |\n|        |                                 | 部门或项目新增              | /river/BudgetCenter/add                       |\n|        |                                 | 部门或项目修改              | /river/BudgetCenter/edit                      |\n|        |                                 | 部门或项目停用              | /river/BudgetCenter/del                       |\n| 城市     | sample/CitySample.java          | 国家查询(全量获取国际ID)       | /river/DemeterAres/Country/index              |\n|        |                                 | 全量开城城市列表查询           | /open-apis/v1/city/list                       |\n| 地点     | sample/WorkspaceSample.java     | 地点新增                 | /open-apis/v1/workplace/create                |\n|        |                                 | 地点删除                 | /open-apis/v1/workplace/del                   |\n|        |                                 | 地点修改                 | /open-apis/v1/workplace/update                |\n| 外部出行人  | sample/TravelerSample.java      | 外部出行人新增              | /open-apis/v1/traveler/create                 |\n|        |                                 | 外部出行人修改              | /open-apis/v1/traveler/update                 |\n|        |                                 | 外部出行人删除              | /open-apis/v1/traveler/del                    |\n| 角色     | sample/RoleSample.java          | 角色查询                 | /river/Role/get                               |\n| 制度     | sample/RegulationSample.java    | 制度列表                 | /river/Regulation/get                         |\n|        |                                 | 制度详情                 | /river/Regulation/detail                      |\n| 职级     | sample/RankSample.java          | 职级新增                 | /open-apis/v1/rank/create                     |\n|        |                                 | 职级更新                 | /open-apis/v1/rank/update                     |\n|        |                                 | 职级删除                 | /open-apis/v1/rank/del                        |\n|        |                                 | 职级查询                 | /river/Rank/getRanks                          |\n| 订单     | sample/OrderSample.java         | 订单号列表查询              | /open-apis/v1/order/list                      |\n|        |                                 | 机票订单详情查询             | /api-gateway/g/flight/orderDetail             |\n|        |                                 | 酒店订单详情查询             | /api-gateway/g/hotel/orderDetail              |\n|        |                                 | 火车票订单详情查询            | /api-gateway/g/train/orderDetail              |\n|        |                                 | 用车订单详情查询             | /river/Order/detail                           |\n|        |                                 | 用车列表                 | /river/Order/get                              |\n|        |                                 | 机票预估价获取              | /api-gateway/g/flight/info/estimatePrice      |\n|        |                                 | 火车票直达列表              | /api-gateway/train/queryLeftTicket            |\n|        |                                 | 火车票中转车次列表            | /api-gateway/g/train/transfer/queryLeftTicket |\n| 用户     | sample/MemberSample.java        | 用户查询~员工列表（批量查询）      | /river/Member/get                             |\n|        |                                 | 用户查询~员工明细            | /river/Member/detail                          |\n|        |                                 | 员工限额查询               | /river/Member/getQuota                        |\n|        |                                 | 用户新增                 | /river/Member/single                          |\n|        |                                 | 用户修改                 | /river/Member/edit                            |\n|        |                                 | 用户删除                 | /river/Member/del                             |\n| 单点页面   | sample/LoginSample.java         | 单点请求                 | /river/Login/getLoginEncryptStr               |\n| 公司主体   | sample/LegalentitySample.java   | 公司主体查询               | /river/LegalEntity/get                        |\n|        |                                 | 公司主体新增               | /river/LegalEntity/add                        |\n|        |                                 | 公司主体修改               | /river/LegalEntity/edit                       |\n|        |                                 | 公司主体停用               | /river/LegalEntity/del                        |\n| 拓展     | sample/ExtendSample.java        | 拓展信息批量创建             | /river/ExtendInfo/BatchSync                   |\n|        |                                 | 档案状态处理               | /river/ExtendInfo/Status                      |\n|        |                                 | 拓展信息查询               | /river/ExtendInfo/Get                         |\n\n---\n`📢注意`： 请替换代码中的`clientId`、`clientSecret`和`signKey`为实际的值，以及替换实际入参中的`companyId`\n\n---\n\n## 特殊说明\n\n1、接口中以obj结尾的字段均为SDK特有字段，在文档中无Obj结尾，文档中为字段类型为json-string，SDK中可直接使用对象，SDK自动完成对象转为json-string的过程。\n\n如（仅保留了特殊处理的Obj字段及源字段信息）：\n\n```java\npublic class CreateApprovalRequest extends BaseReq {\n  /**\n   * 扩展信息，扩展信息，自定义字段；最长不大于 500 字符；(必须为json字符串)；默认为空字符\n   */\n  @JsonProperty(\"extra_info\")\n  private String extraInfo;\n  /**\n   * 扩展信息。转成json赋值给extra_info字段\n   */\n  @JsonProperty(\"extra_info__obj__\")\n  private Map\u003cString, String\u003e extraInfoObj;\n  /**\n   * 扩展信息list，自定义字段，最长不大于 500 字符，将extend_field_list转为 json 字符串，三个字段仅作为备注性字段。详见extend_field_list\n   */\n  @JsonProperty(\"extend_field_list\")\n  private String extendFieldList;\n  /**\n   * extendFieldListObj\n   */\n  @JsonProperty(\"extend_field_list__obj__\")\n  private ExtendFieldList extendFieldListObj;\n\n  /**\n   * 差旅单行程信息，差旅单行程信息，将travel_detail的值转为 json 字符串，approval_type \u0026#x3D; 1 时必传。\n   */\n  @JsonProperty(\"travel_detail\")\n  private String travelDetail;\n  /**\n   * travelDetailObj\n   */\n  @JsonProperty(\"travel_detail__obj__\")\n  private TravelDetail travelDetailObj;\n  /**\n   * 差旅预算总额，差旅预算控制，一个申请单对应一个总预算纬度，一次只能全部或者选择部分品类。\n   */\n  @JsonProperty(\"travel_budget\")\n  private String travelBudget;\n  /**\n   * travelBudgetObj\n   */\n  @JsonProperty(\"travel_budget__obj__\")\n  private TravelBudget travelBudgetObj;\n  /**\n   * 差旅管控，差旅管控，目前仅支持市内用车每日限额设置（为json字符串类型，具体看请求示例）\n   */\n  @JsonProperty(\"travel_management\")\n  private String travelManagement;\n  /**\n   * travelManagementObj\n   */\n  @JsonProperty(\"travel_management__obj__\")\n  private TravelManagement travelManagementObj;\n  /**\n   * 出行人信息，出行人信息，不传时默认出行人为申请人，将passenger_list 转为 json 数组字符串。详见passenger_list\n   */\n  @JsonProperty(\"passenger_list\")\n  private String passengerList;\n  /**\n   * 出行人信息,可使用脚本将其转换为json后赋值给 passenger_list 字段\n   */\n  @JsonProperty(\"passenger_list__obj__\")\n  private List\u003cTripPassenger\u003e passengerListObj;\n  /**\n   * 多成本中心(array)，序号1对应远成本中心字段，依然支持滴滴内部主键ID。使用部门CODE主键，和项目时名称和code作为主键。\n   */\n  @JsonProperty(\"budget_center_list\")\n  private String budgetCenterList;\n  /**\n   * 差旅预算总额,可使用脚本将其转换为json后赋值给 budget_center_list 字段\n   */\n  @JsonProperty(\"budget_center_list__obj__\")\n  private List\u003cBudgetCenterListItem\u003e budgetCenterListObj;\n}\n\n```\n\n\u003e 上述实体在使用时，可直接通过已Obj结尾的属性赋值，实际传调用接口时，SDK会自动将Obj结尾的属性转为json字符串，赋值给原属性传递给滴滴企业级。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidi%2Fddes-openapi-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidi%2Fddes-openapi-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidi%2Fddes-openapi-sdk-java/lists"}