From 686d4243b171162fc1e7dab3dec317ef82dd1248 Mon Sep 17 00:00:00 2001 From: ChenJiaXin520 <30996653+ChenJiaXin520@users.noreply.github.com> Date: Tue, 21 May 2024 18:16:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=97=B6Content-Type=E6=B2=A1=E6=9C=89boundary=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/MaterialUploadApacheHttpRequestExecutor.java | 4 ---- .../media/MediaImgUploadApacheHttpRequestExecutor.java | 1 - .../voice/VoiceUploadApacheHttpRequestExecutor.java | 1 - 3 files changed, 6 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialUploadApacheHttpRequestExecutor.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialUploadApacheHttpRequestExecutor.java index 2d48341489..6a31484420 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialUploadApacheHttpRequestExecutor.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialUploadApacheHttpRequestExecutor.java @@ -58,11 +58,7 @@ public WxMpMaterialUploadResult execute(String uri, WxMpMaterial material, WxTyp multipartEntityBuilder.addPart("description", new StringBody(WxGsonBuilder.create().toJson(form), ContentType.create("text/plain", Consts.UTF_8))); } - httpPost.setEntity(multipartEntityBuilder.build()); - //手动设置的Content-Type请求头没有boundary,是一个非标准的文件上传请求头,虽然微信提供了对这类非标准请求的支持,但如果请求需要先经过我们的tomcat server,那么都会报错:the request was rejected because no multipart boundary was found - //不设置Content-Type请求头,httpclient将会自动设置,值为entity的getContentType方法返回值。MultipartEntityBuilder的getContentType方法将会返回boundary - //httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString()); try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) { String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/media/MediaImgUploadApacheHttpRequestExecutor.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/media/MediaImgUploadApacheHttpRequestExecutor.java index b570a1c43b..7c4ba18598 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/media/MediaImgUploadApacheHttpRequestExecutor.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/media/MediaImgUploadApacheHttpRequestExecutor.java @@ -47,7 +47,6 @@ public WxMediaImgUploadResult execute(String uri, File data, WxType wxType) thro .setMode(HttpMultipartMode.RFC6532) .build(); httpPost.setEntity(entity); - httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString()); try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) { String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/voice/VoiceUploadApacheHttpRequestExecutor.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/voice/VoiceUploadApacheHttpRequestExecutor.java index 07af44b340..06aa1fcda1 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/voice/VoiceUploadApacheHttpRequestExecutor.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/voice/VoiceUploadApacheHttpRequestExecutor.java @@ -48,7 +48,6 @@ public Boolean execute(String uri, File data, WxType wxType) throws WxErrorExcep .setMode(HttpMultipartMode.RFC6532) .build(); httpPost.setEntity(entity); - httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString()); try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) { String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response); From 8f796eba875306f4b0ed0c3395951b67cc594581 Mon Sep 17 00:00:00 2001 From: liuhuibin Date: Wed, 22 May 2024 17:30:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E3=80=91=E5=BE=AE=E4=BF=A1=E7=89=A9=E6=B5=81=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?-=E6=B6=88=E6=81=AF=E7=BB=84=E4=BB=B6=EF=BC=9A4.1=E3=80=81?= =?UTF-8?q?=E4=BC=A0=E8=BF=90=E5=8D=95=E6=8E=A5=E5=8F=A3=20follow=5Fwaybil?= =?UTF-8?q?l=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0=20delivery=5Fid=20?= =?UTF-8?q?=E8=BF=90=E5=8A=9Bid=EF=BC=88=E8=BF=90=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E8=BF=90=E5=8A=9B=E5=85=AC=E5=8F=B8id?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wx/miniapp/bean/delivery/FollowWaybillRequest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java index 92add53aa2..5bb796e0b2 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java @@ -60,6 +60,16 @@ public class FollowWaybillRequest implements Serializable { @SerializedName("receiver_phone") private String receiverPhone; + /** + * 运力id(运单号所属运力公司id),该字段从 get_delivery_list 获取。 + *
+   * 是否必填: 否
+   * 描述:该参数用于提高运单号识别的准确度;特别是对非主流快递公司,建议传入该参数,确保查询正确率。
+   * 
+ */ + @SerializedName("delivery_id") + private String deliveryId; + /** * 运单ID *

From 7750555731befbc583f6387562dd3ea96d98c258 Mon Sep 17 00:00:00 2001
From: willowhb 
Date: Fri, 14 Jun 2024 11:18:16 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E6=9F=A5=E8=BF=90=E5=8D=95=E6=8E=A5?=
 =?UTF-8?q?=E5=8F=A3query=5Ftrace/query=5Ffollow=5Ftrace=E6=8E=A5=E5=8F=A3?=
 =?UTF-8?q?=E5=93=8D=E5=BA=94=E4=B8=AD=E8=BF=90=E5=8D=95=E4=BF=A1=E6=81=AF?=
 =?UTF-8?q?=E5=8F=98=E6=9B=B4=EF=BC=9Awaybill=5Ftoken=20--=E3=80=8Bwaybill?=
 =?UTF-8?q?=5Fid?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../wx/miniapp/bean/delivery/FollowWaybillRequest.java      | 4 ++--
 .../wx/miniapp/bean/delivery/QueryFollowTraceResponse.java  | 6 +++---
 .../wx/miniapp/bean/delivery/QueryWaybillTraceResponse.java | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java
index 5bb796e0b2..78122bf26b 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/FollowWaybillRequest.java
@@ -12,7 +12,7 @@
 
 /**
  * 
- * 传运单接口 follow_waybil
+ * 传运单接口 follow_waybill
  *
  * 商户使用此接口向微信提供某交易单号对应的运单号。微信后台会跟踪运单的状态变化,在关键物流节点给下单用户推送消息通知。
  * 
@@ -53,7 +53,7 @@ public class FollowWaybillRequest implements Serializable { /** * 收件人手机号 *
-   * 是否必填: 否
+   * 是否必填: 是
    * 描述:部分运力需要用户手机号作为查单依据
    * 
*/ diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryFollowTraceResponse.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryFollowTraceResponse.java index a6e698d0df..740ea2999e 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryFollowTraceResponse.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryFollowTraceResponse.java @@ -73,10 +73,10 @@ public static class WaybillInfo implements Serializable { private Integer status; /** - * 查询id. + * 运单号. */ - @SerializedName("waybill_token") - private String waybillToken; + @SerializedName("waybill_id") + private String waybillId; } /** diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryWaybillTraceResponse.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryWaybillTraceResponse.java index 726705cf8d..5cba13a5cc 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryWaybillTraceResponse.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/delivery/QueryWaybillTraceResponse.java @@ -73,10 +73,10 @@ public static class WaybillInfo implements Serializable { private Integer status; /** - * 查询id. + * 运单号. */ - @SerializedName("waybill_token") - private String waybillToken; + @SerializedName("waybill_id") + private String waybillId; } /**