PHP | <?php
require_once("../WdtClient.php");
$c = new WdtClient;
$c->sid = '';
$c->appkey = '';
$c->appsecret = '';
$c->gatewayUrl = 'http://sandbox.wangdian.cn/openapi2/purchase_order_end.php';
//采购单取消,停止等待type=1或type=0使用$purchase_no_list
$purchase_no_list = array(
array(
'purchase_no'=>""
)
);
//采购单明细停止等待type=2使用$purchase_no_list1
$purchase_no_list1 = array(
array(
'purchase_no'=>"",
'spec_no'=>array(
"",
"",
"",
"",
)
)
);
$c->putApiParam('type', 0);
$c->putApiParam('is_reject_review', 0);
$c->putApiParam('purchase_no_list', json_encode($purchase_no_list1));
$json = $c->wdtOpenApi();
echo $json;
?> |
JAVA | package com.wangdian.api.purchase;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import com.alibaba.fastjson.JSON;
import com.wangdian.api.WdtClient;
public class PurchaseOrderEnd {
public static void main(String[] args) {
// TODO Auto-generated method stub
WdtClient client = new WdtClient("传入sid", "传入appkey", "传入appsecret", "传入url");
//测试环境sid、appkey、密钥请到旺店通开放平台-自助对接-申请测试环境内查看,测试环境url=https://sandbox.wangdian.cn/openapi2/
//调用正式环境时请将sid、appkey、appsecret切换为实际参数,参数在旺店通开放平台-自助对接-应用管理内应用状态为已上线的应用中查看,调用正式环境注意切换正式环境url=https://api.wangdian.cn/openapi2/
Map<String, String> params = new HashMap<String, String>();
//采购单取消,停止等待type=1或type=0使用arrayList
ArrayList<HashMap<String, String>> arrayList = new ArrayList<>();
arrayList.add(new HashMap<String, String>(){{put("purchase_no","");}});
arrayList.add(new HashMap<String, String>(){{put("purchase_no","");}});
arrayList.add(new HashMap<String, String>(){{put("purchase_no","");}});
//采购单明细停止等待type=2使用arrayLis1
ArrayList<HashMap<String, Object>> arrayList1 = new ArrayList<>();
arrayList1.add(new HashMap<String, Object>(){{
put("purchase_no","");
put("spec_no",new ArrayList<String>(){{
add("");
add("");
add("");
}});
}});
params.put("type", "0");
params.put("is_reject_review", "1");
params.put("purchase_no_list", JSON.toJSONString(arrayList));
try {
String response = client.execute("purchase_order_end.php", params);
System.out.println(response);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WdtSdk;
namespace PurchaseOrderEnd
{
class PurchaseOrderEnd
{
static void Main(string[] args)
{
WdtClient client = new WdtClient();
client.sid = "";
client.appkey = "";
client.appsecret = "";
client.gatewayUrl = "http://sandbox.wangdian.cn/openapi2/purchase_order_end.php";
var purchase_no_list =new []
{
purchase_no="CG20230405001",
} ;
client.putParams("type", 1);
client.putParams("purchase_no_list",json);
string result = client.wdtOpenapi();
Console.WriteLine(result);
Console.ReadKey();
}
}
} |