cloudroam
2025-01-09 9628b3362c1624dd373c1ab1d7a55e72104b972e
src/main/java/com/mzl/flower/service/payment/WxDeliveryGoodService.java
@@ -20,7 +20,7 @@
public class WxDeliveryGoodService {
    public JSONObject wxDeliveryGood(String orderId, String openid, String transactionId,
                                  String itemDesc, String merchantId,String accessToken, Long partnerID,String deliveryNo) throws Exception {
                                  String itemDesc, String merchantId,String accessToken, Long partnerID,String deliveryNo,String logisticsCompanyCode, String maskedNumber) throws Exception {
        String requestPath = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token="+accessToken;
        Map<String, Object> headers = new HashMap<>();
        headers.put("Accept", MediaType.APPLICATION_JSON.getValue());
@@ -48,6 +48,11 @@
        itemMap.put("item_desc",itemDesc);//商品描述
        if (StringUtils.isEmpty(partnerID) && !StringUtils.isEmpty(deliveryNo)) {
            itemMap.put("tracking_no", deliveryNo);//物流单号,物流快递发货时必填,示例值: 323244567777 字符字节限制: [1, 128]
            itemMap.put("express_company", logisticsCompanyCode);//物流公司编码,快递公司ID,参见「查询物流公司编码列表」,物流快递发货时必填, 示例值: DHL 字符字节限制: [1, 128]
            //联系方式,当发货的物流公司为顺丰时,联系方式为必填,收件人或寄件人联系方式二选一
            Map<String,Object> contact = new HashMap<>();
            orderKey.put("receiver_contact",maskedNumber);//收件人联系方式,收件人联系方式为,采用掩码传输,最后4位数字不能打掩码 示例值: `189****1234, 021-****1234, ****1234, 0**2-***1234, 0**2-******23-10, ****123-8008` 值限制: 0 ≤ value ≤ 1024
            itemMap.put("contact", contact);
        }
        shippingList.add(itemMap);
        body.put("shipping_list",shippingList);