#调用接口例子
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
JSONObject json=new JSONObject();
json.set("instanceId", instanceId);
json.set("type", type);
json.set("reason", reason);
json.set("code", code);
json.set("tcode", tcode);
String url = workflow + "/workflow/deleteProcessById";
HttpResponse resp=HttpRequest.post(url).header("Content-Type", "application/json")
.body(json.toString()).execute();
if(resp.getStatus()==200){
json=JSONUtil.parseObj(resp.body());
String instanceId=json.getStr("instanceId");
HashMap param=new HashMap();
param.put("id",id);
param.put("instanceId",instanceId);
}else{
log.error(resp.body());
throw new EmosException("请假工作流删除失败");
}
java调用接口例子
最新推荐文章于 2024-07-23 22:52:34 发布