先上图:
Web API 【销售订单】保存完整示例分享。
Save 新增修改
View 查看
Submit 提交
Audit 审核
UnAudit 反审核
StatusConvert 状态转换
核心调用代码类:
[code]import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.json.JSONArray;
import org.json.JSONObject;
public class InvokeHelper {
// K3 Cloud WebSite URL Example "http://192.168.19.113/K3Cloud/"
public static String POST_K3CloudURL = "http://192.168.19.113/K3Cloud/";
// Cookie 值
private static String CookieVal = null;
private static Map map = new HashMap();
static {
map.put("Save",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc");
map.put("View",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc");
map.put("Submit",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc");
map.put("Audit",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc");
map.put("UnAudit",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.UnAudit.common.kdsvc");
map.put("StatusConvert",
"Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.StatusConvert.common.kdsvc");
}
// HttpURLConnection
private static HttpURLConnection initUrlConn(String url, JSONArray paras)
throws Exception {
URL postUrl = new URL(POST_K3CloudURL.concat(url));
HttpURLConnection connection = (HttpURLConnection) postUrl
.openConnection();
if (CookieVal != nu